Package moa.gui

Class 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 file moa/gui/GUI.props.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • PROPERTIES

        protected static Properties PROPERTIES
        Properties associated with the GUI options.
    • Constructor Detail

      • GUIDefaults

        public GUIDefaults()
    • 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 for
        defaultValue - 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 for
        defaultValue - 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 for
        defaultValue - the default object spec string
        cls - 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