Package moa.gui
Class GUIDefaults
- java.lang.Object
-
- moa.gui.GUIDefaults
-
- All Implemented Interfaces:
Serializable
public class GUIDefaults extends Object implements Serializable
This class offers get methods for the default GUI settings in the props filemoa/gui/GUI.props
.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Properties
PROPERTIES
Properties associated with the GUI options.static String
PROPERTY_FILE
The name of the properties file.
-
Constructor Summary
Constructors Constructor Description GUIDefaults()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
get(String property, String defaultValue)
returns the value for the specified property, if non-existent then the default value.static String[]
getDefaultTabs()
returns an array with the classnames of all default tabs to display as tabs in the GUI.static int
getFileChooserHeight()
Returns the height for the file chooser.static int
getFileChooserWidth()
Returns the width for the file chooser.static int
getFrameHeight()
Returns the height for the frame.static int
getFrameWidth()
Returns the width for the frame.static String
getInitialDirectory()
Returns the initial directory for the file chooser used for opening datasets.static int
getMaxTabUndo()
Returns the maximum of undos for closing pages/tabs.protected static Object
getObject(String property, String defaultValue)
Tries to instantiate the class stored for this property, optional options will be set as well.protected static Object
getObject(String property, String defaultValue, Class cls)
Tries to instantiate the class stored for this property, optional options will be set as well.static Properties
getProperties()
returns the associated properties file.static String[]
getTabs()
returns an array with the classnames of all the additional panels to display as tabs in the GUI.static void
main(String[] args)
only for testing - prints the content of the props file.
-
-
-
Field Detail
-
PROPERTY_FILE
public static final String PROPERTY_FILE
The name of the properties file.- See Also:
- Constant Field Values
-
PROPERTIES
protected static Properties PROPERTIES
Properties associated with the GUI options.
-
-
Method Detail
-
get
public static String get(String property, String defaultValue)
returns the value for the specified property, if non-existent then the default value.- Parameters:
property
- the property to retrieve the value fordefaultValue
- the default value for the property- Returns:
- the value of the specified property
-
getProperties
public static final Properties getProperties()
returns the associated properties file.- Returns:
- the props file
-
getObject
protected static Object getObject(String property, String defaultValue)
Tries to instantiate the class stored for this property, optional options will be set as well. Returns null if unsuccessful.- Parameters:
property
- the property to get the object fordefaultValue
- the default object spec string- Returns:
- if successful the fully configured object, null otherwise
-
getObject
protected static Object getObject(String property, String defaultValue, Class cls)
Tries to instantiate the class stored for this property, optional options will be set as well. Returns null if unsuccessful.- Parameters:
property
- the property to get the object fordefaultValue
- the default object spec stringcls
- the class the object must be derived from- Returns:
- if successful the fully configured object, null otherwise
-
getTabs
public static String[] getTabs()
returns an array with the classnames of all the additional panels to display as tabs in the GUI.- Returns:
- the classnames
-
getDefaultTabs
public static String[] getDefaultTabs()
returns an array with the classnames of all default tabs to display as tabs in the GUI.- Returns:
- the classnames
-
getMaxTabUndo
public static int getMaxTabUndo()
Returns the maximum of undos for closing pages/tabs.- Returns:
- the maximum
-
getInitialDirectory
public static String getInitialDirectory()
Returns the initial directory for the file chooser used for opening datasets. The following placeholders are recognized:%t - the temp directory %h - the user's home directory %c - the current directory %% - gets replaced by a single percentage sign
- Returns:
- the default directory
-
getFrameWidth
public static int getFrameWidth()
Returns the width for the frame.- Returns:
- the width in pixel
-
getFrameHeight
public static int getFrameHeight()
Returns the height for the frame.- Returns:
- the height in pixel
-
getFileChooserWidth
public static int getFileChooserWidth()
Returns the width for the file chooser.- Returns:
- the width in pixel
-
getFileChooserHeight
public static int getFileChooserHeight()
Returns the height for the file chooser.- Returns:
- the height in pixel
-
main
public static void main(String[] args)
only for testing - prints the content of the props file.- Parameters:
args
- commandline parameters - ignored
-
-