at.tuwien.ifs.somtoolbox.apps
Class SOMToolboxMain

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.SOMToolboxMain

public class SOMToolboxMain
extends Object

Searches the classpath for classes implementing the SOMToolboxApp interface.

Version:
$Id: SOMToolboxMain.java 3985 2011-01-10 13:50:20Z frank $
Author:
Jakob Frank

Constructor Summary
SOMToolboxMain()
           
 
Method Summary
private static boolean invokeMainClass(ArrayList<Class<? extends SOMToolboxApp>> runnables, String runable, String[] cleanArgs, boolean useGUI)
           
static void main(String[] args)
          Central Main for SOMToolbox.
private static void printAvailableRunnables(int screenWidth, ArrayList<Class<? extends SOMToolboxApp>> runnables)
           
private static void printHelp()
           
static void printVersion(String executable)
           
private static void showAvailableRunnables(ArrayList<Class<? extends SOMToolboxApp>> runnables, String[] args)
           
private static boolean tryInvokeMain(Class<?> cls, String[] args, boolean useGUI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SOMToolboxMain

public SOMToolboxMain()
Method Detail

main

public static void main(String[] args)
Central Main for SOMToolbox.

Parameters:
args - the command line args

showAvailableRunnables

private static void showAvailableRunnables(ArrayList<Class<? extends SOMToolboxApp>> runnables,
                                           String[] args)
Parameters:
runnables - ArrayList of available runnables.
args - command line arguments.

invokeMainClass

private static boolean invokeMainClass(ArrayList<Class<? extends SOMToolboxApp>> runnables,
                                       String runable,
                                       String[] cleanArgs,
                                       boolean useGUI)
Parameters:
runnables - ArrayList of available main-classes
runable - The main class specified on command line
cleanArgs - the arguments for the main class.
useGUI - true if the GenericGUI should be used.
Returns:
true if invocation was successful, false otherwise.

tryInvokeMain

private static boolean tryInvokeMain(Class<?> cls,
                                     String[] args,
                                     boolean useGUI)
Parameters:
cls - the class to search the main in.
args - command line args for the main class invoked.
useGUI - true if the GenericGUI should be launched.
Returns:
true if the class contains a static main(String[]) that was invoked, false otherwise.
See Also:
GenericGUI

printHelp

private static void printHelp()

printAvailableRunnables

private static void printAvailableRunnables(int screenWidth,
                                            ArrayList<Class<? extends SOMToolboxApp>> runnables)
Parameters:
screenWidth - the with of the screen
runnables - ArrayList of available runnables.

printVersion

public static void printVersion(String executable)