|
BioLegato 0.7.3 Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biolegato.core.main.BLMain
public final class BLMain
The main program and generic function class.
This class is used to generate the main window, do all startup processing, and run the program. This class also contains most of the utility functions.
| Nested Class Summary | |
|---|---|
static class |
BLMain.ARCH
|
static class |
BLMain.OS
|
| Field Summary | |
|---|---|
static javax.swing.JMenuItem |
ABOUT_MENUITEM
The menu item for BioLegato's "About..." |
static BLMain.ARCH |
CURRENT_ARCH
Stores the current machine architecture |
static java.lang.String |
CURRENT_DIR
This constant is set to the path of where biolegato was run The value of this constant determined at runtime. |
static BLMain.OS |
CURRENT_OS
Stores the current operating system |
static boolean |
debug
Stores information regarding the usage of the debug command NOTE: This should always be accessed using BLMain.debug |
static java.awt.Font |
DEFAULT_FONT
The default font for BioLegato |
static int |
DOUBLE_CLICK_TIME
The amount of time between clicks to be considered a double click. |
static javax.swing.JMenuItem |
EXIT_MENUITEM
The menu item for BioLegato's "Exit..." |
static java.lang.String |
HOME_DIR
Stores the user's home directory |
static java.lang.String |
NAME
This constant stores the program's name |
static java.lang.String |
PROGRAM_DIR
This constant is set to the path of BioLegato.jar The value of this constant determined at runtime. |
static long |
serialVersionUID
This constant is used for Serialization |
static java.lang.String |
VERSION
This constant is used to keep track of version changes. |
| Constructor Summary | |
|---|---|
BLMain()
|
|
| Method Summary | |
|---|---|
static void |
aboutPopup()
Displays an about popup for BioLegato. |
static javax.swing.JMenu |
addMenuHeading(int order,
java.lang.String name)
Adds a menu heading (JMenu) to our menu (BLMenu). |
static javax.swing.JMenu |
addMenuHeading(java.lang.String name)
Adds a menu heading (JMenu) to our menu (BLMenu). |
static void |
addMenuItem(int location,
java.lang.String headingName,
javax.swing.JMenuItem menuItem)
Adds a menu item (JMenuItem) to a menu heading (JMenu) within the window (ProgramWindow) |
static void |
addMenuItem(java.lang.String headingName,
javax.swing.JMenuItem menuItem)
Adds a menu item (JMenuItem) to a menu heading (JMenu) within the window (ProgramWindow) |
static void |
addPropertiesListener(java.lang.String key,
PropertiesListener listener)
Adds a properties listener to the properties object. |
static java.lang.String |
envreplace(java.lang.String change)
Replaces $VARIABLE name with environment variables. |
static void |
error(java.lang.String message)
Sends an error message to BioLegato's standard err. |
static void |
error(java.lang.String message,
java.lang.String location)
Sends an error message to BioLegato's standard err. |
static DataCanvas |
getCanvas()
Returns the current/selected data in the canvas. |
static java.io.File |
getCurrentPWD()
Gets the present working directory "PWD" for BioLegato (this does NOT change CURRENT_DIR!) This value can be used to cache which directory file dialog boxes should use as their "current working directory" |
static javax.swing.JFrame |
getJFrame()
Provides access for other classes to the main program window JFrame object. |
static java.util.Collection<PluginWrapper> |
getPlugins(java.lang.Class<?> type)
Returns a list with all of the plugins loaded by BioLegato that are instances of the class type indicated. |
static BLProperties |
getProperties()
Returns the properties object associated with this instance of BioLegato |
static java.lang.String |
getProperty(java.lang.String property)
Retrieves individual settings for BioLegato. |
static boolean |
isDigit(char test)
Tests if a character is a digit or not. |
static void |
main(java.lang.String[] args)
Starts up BioLegato. |
static void |
message(java.lang.String message)
Sends a message to BioLegato's standard out. |
static void |
message(java.lang.String message,
java.lang.String location)
Sends a message to BioLegato's standard out. |
static boolean |
notDigit(char test)
Tests if a character is a digit or not. |
static java.lang.String |
readStream(java.io.BufferedReader reader)
Reads the complete contents of a BufferedReader into a string. |
static java.lang.Process |
safeExecute(java.lang.String cmd)
Ensures that the command will be executed properly as a shell command |
static void |
setCurrentPWD(java.io.File newPWD)
Sets the present working directory "PWD" for BioLegato (this does NOT change CURRENT_DIR!) This value can be used to cache which directory file dialog boxes should use as their "current working directory" |
static void |
setProperty(java.lang.String key,
java.lang.String value)
Changes properties for BioLegato. |
static void |
shellCommand(java.lang.String cmd,
java.lang.String data)
Runs simple shell commands. |
static boolean |
testNumber(char[] test)
Checks if a character array is all digits. |
static void |
warning(java.lang.String message)
Sends an warning message to BioLegato's standard err. |
static void |
warning(java.lang.String message,
java.lang.String location)
Sends an warning message to BioLegato's standard err. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String NAME
public static final java.lang.String PROGRAM_DIR
public static final java.lang.String CURRENT_DIR
public static final java.lang.String VERSION
public static final java.awt.Font DEFAULT_FONT
public static final java.lang.String HOME_DIR
public static final int DOUBLE_CLICK_TIME
public static final BLMain.OS CURRENT_OS
public static final BLMain.ARCH CURRENT_ARCH
public static final long serialVersionUID
public static final javax.swing.JMenuItem ABOUT_MENUITEM
public static final javax.swing.JMenuItem EXIT_MENUITEM
public static boolean debug
| Constructor Detail |
|---|
public BLMain()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - the command line arguments for BioLegato.
public static void setProperty(java.lang.String key,
java.lang.String value)
key - the property to change.value - the new value for the property.public static java.lang.String getProperty(java.lang.String property)
property - the property key to retrieve the value for
public static DataCanvas getCanvas()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException - any exceiptions related to obtaining the datapublic static javax.swing.JFrame getJFrame()
public static BLProperties getProperties()
public static javax.swing.JMenu addMenuHeading(java.lang.String name)
name - the name of the menu heading
public static javax.swing.JMenu addMenuHeading(int order,
java.lang.String name)
order - the position to place the menu tagname - the name of the menu heading
public static void addMenuItem(int location,
java.lang.String headingName,
javax.swing.JMenuItem menuItem)
If the heading which was entered does not exist, this function will create it; hence why addMenuHeading returns the heading corresponding to the name entered if a menu heading with that name already exists.
location - is the location in the menu to insert the item atheadingName - is the name of the menu heading to add the menu item to.menuItem - is the menu item to add to the heading.
public static void addMenuItem(java.lang.String headingName,
javax.swing.JMenuItem menuItem)
If the heading which was entered does not exist, this function will create it; hence why addMenuHeading returns the heading corresponding to the name entered if a menu heading with that name already exists.
headingName - is the name of the menu heading to add the menu item to.menuItem - is the menu item to add to the heading.public static void aboutPopup()
public static void addPropertiesListener(java.lang.String key,
PropertiesListener listener)
key - the key of the properties to listen to.listener - the listener to add to the object.public static java.lang.Process safeExecute(java.lang.String cmd)
This function generates a command list for execution. The command list will contain the appropriate shell for the current operating system, followed by the "execution-argument", (whatever flag is required to tell the shell that the rest of the commandline should be executed by the shell), followed by the command to execute (the variable cmd)
Operating system values obtained from http://lopica.sourceforge.net/os.html
cmd - the command string to execute
public static void shellCommand(java.lang.String cmd,
java.lang.String data)
cmd - the command string to rundata - the data to use as standard input (System.in)public static void error(java.lang.String message)
message - the error message to send.
public static void error(java.lang.String message,
java.lang.String location)
message - the error message to send.location - the location the error occurred.public static void warning(java.lang.String message)
message - the warning message to send.
public static void warning(java.lang.String message,
java.lang.String location)
message - the warning message to send.location - the location the error occurred.public static void message(java.lang.String message)
message - the message to send.
public static void message(java.lang.String message,
java.lang.String location)
message - the message to send.location - the location the message was sent from.
public static java.lang.String readStream(java.io.BufferedReader reader)
throws java.io.IOException
reader - the BufferedReader to read.
java.io.IOException - throws any exceptions from the read operation.public static boolean testNumber(char[] test)
test - the character array to test.
public static java.lang.String envreplace(java.lang.String change)
change - the string to modify.
public static final boolean notDigit(char test)
test - the character to test.
public static final boolean isDigit(char test)
test - the character to test.
public static java.io.File getCurrentPWD()
public static void setCurrentPWD(java.io.File newPWD)
newPWD - the new directory to use as the "PWD"public static java.util.Collection<PluginWrapper> getPlugins(java.lang.Class<?> type)
type - the plugin type to find
|
BioLegato 0.7.3 Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||