Class BaseFrame

    • Field Detail

      • m_Logger

        protected transient Logger m_Logger
        for logging.
      • m_UseMaximizationFix

        protected static Boolean m_UseMaximizationFix
        whether to use the fix.
      • m_UISettingsPrefix

        protected String m_UISettingsPrefix
        the UI settings prefix to use.
      • m_UISettingsStored

        protected boolean m_UISettingsStored
        whether the UI settings got stored.
      • m_UISettingsApplied

        protected boolean m_UISettingsApplied
        whether UI settings were applied.
    • Constructor Detail

      • BaseFrame

        public BaseFrame()
        Initializes the frame with no title.
      • BaseFrame

        public BaseFrame​(String title)
        Initializes the frame with the given title.
        Parameters:
        title - the title of the frame
      • BaseFrame

        public BaseFrame​(GraphicsConfiguration gc)
        Initializes the frame with no title.
        Parameters:
        gc - the graphics configuration to use
      • BaseFrame

        public BaseFrame​(String title,
                         GraphicsConfiguration gc)
        Initializes the frame with the specified title.
        Parameters:
        title - the title of the frame
        gc - the graphics configuration to use
    • Method Detail

      • performInitialization

        protected void performInitialization()
        Contains all the initialization steps to perform.
      • initialize

        protected void initialize()
        For initializing members.
      • initGUI

        protected void initGUI()
        For initializing the GUI.
      • setBounds

        public void setBounds​(int x,
                              int y,
                              int width,
                              int height)
        Updates the bounds of the window.
        Overrides:
        setBounds in class Window
        Parameters:
        x - the new x of the frame
        y - the new y of the frame
        width - the new width of the frame
        height - the new height of the frame
      • finishInit

        protected void finishInit()
        finishes the initialization, by setting size/location.
      • initializeLogger

        protected void initializeLogger()
        Initializes the logger.

        Default implementation uses the class name.
      • setUISettingsPrefix

        public void setUISettingsPrefix​(Class cls)
        Sets the prefix for the UI settings (eg stores width/height).
        Parameters:
        cls - the class to use as prefix, ignored if null or empty
      • setUISettingsPrefix

        public void setUISettingsPrefix​(String value)
        Sets the prefix for the UI settings (eg stores width/height).
        Parameters:
        value - the prefix, ignored if null or empty
      • getUISettingsPrefix

        public String getUISettingsPrefix()
        Returns the prefix for the UI settings.
        Returns:
        the prefix, empty if ignored
      • getUISettingsApplied

        public boolean getUISettingsApplied()
        Returns whether UI settings were applied. E.g., to determine whether still necessary to set default dimensions/location.
        Returns:
        true if applied
      • applyUISettings

        public void applyUISettings()
        Applies any UI settings if present.
      • storeUISettings

        public void storeUISettings()
        Stores the UI settings.
      • beforeShow

        protected void beforeShow()
        Hook method just before the dialog is made visible.
      • afterShow

        protected void afterShow()
        Hook method just after the dialog was made visible.
      • beforeHide

        protected void beforeHide()
        Hook method just before the dialog is hidden.
      • afterHide

        protected void afterHide()
        Hook method just after the dialog was hidden.
      • setVisible

        public void setVisible​(boolean value)
        closes/shows the dialog.
        Overrides:
        setVisible in class Window
        Parameters:
        value - if true then display the dialog, otherwise close it
      • setLocationRelativeTo

        public void setLocationRelativeTo​(Component c)
        Sets the location relative to this component, but adjust window size and position if necessary.
        Overrides:
        setLocationRelativeTo in class Window
        Parameters:
        c - the component to position the window relative to
      • forName

        public static BaseFrame forName​(String classname)
        Instantiates the frame.
        Parameters:
        classname - the classname of the frame to instantiate
        Returns:
        the instantiated frame or null if an error occurred
      • runFrame

        public static BaseFrame runFrame​(Class env,
                                         Class app)
        Runs the frame from the commandline.
        Parameters:
        env - the environment class to use
        app - the frame class
        Returns:
        the instantiated frame