Class BaseDialog

    • Field Detail

      • m_DisposeCalled

        protected boolean m_DisposeCalled
        whether the dispose method has been called already manually.
      • 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.
      • m_BeforeShowActions

        protected Set<Runnable> m_BeforeShowActions
        the actions to execute before the dialog is made visible.
      • m_BeforeHideActions

        protected Set<Runnable> m_BeforeHideActions
        the actions to execute before the dialog is hidden.
      • m_AfterShowActions

        protected Set<Runnable> m_AfterShowActions
        the actions to execute after the dialog has been made visible.
      • m_AfterHideActions

        protected Set<Runnable> m_AfterHideActions
        the actions to execute after the dialog has been hidden.
    • Constructor Detail

      • BaseDialog

        public BaseDialog()
        Creates a modeless dialog without a title and without a specified Frame owner.
      • BaseDialog

        public BaseDialog​(Dialog owner)
        Creates a modeless dialog without a title with the specified Dialog as its owner.
        Parameters:
        owner - the owning dialog
      • BaseDialog

        public BaseDialog​(Dialog owner,
                          Dialog.ModalityType modality)
        Creates a dialog with the specified owner Dialog and modality.
        Parameters:
        owner - the owning dialog
        modality - the type of modality
      • BaseDialog

        public BaseDialog​(Dialog owner,
                          String title)
        Creates a modeless dialog with the specified title and with the specified owner dialog.
        Parameters:
        owner - the owning dialog
        title - the title of the dialog
      • BaseDialog

        public BaseDialog​(Dialog owner,
                          String title,
                          Dialog.ModalityType modality)
        Creates a dialog with the specified title, modality and the specified owner Dialog.
        Parameters:
        owner - the owning dialog
        title - the title of the dialog
        modality - the type of modality
      • BaseDialog

        public BaseDialog​(Frame owner)
        Creates a modeless dialog without a title with the specified Frame as its owner.
        Parameters:
        owner - the owning frame
      • BaseDialog

        public BaseDialog​(Frame owner,
                          boolean modal)
        Creates a dialog with the specified owner Frame, modality and an empty title.
        Parameters:
        owner - the owning frame
        modal - whether the dialog is modal or not
      • BaseDialog

        public BaseDialog​(Frame owner,
                          String title)
        Creates a modeless dialog with the specified title and with the specified owner frame.
        Parameters:
        owner - the owning frame
        title - the title of the dialog
      • BaseDialog

        public BaseDialog​(Frame owner,
                          String title,
                          boolean modal)
        Creates a dialog with the specified owner Frame, modality and title.
        Parameters:
        owner - the owning frame
        title - the title of the dialog
        modal - whether the dialog is modal or not
    • Method Detail

      • initialize

        protected void initialize()
        For initializing members.
      • initGUI

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

        protected void finishInit()
        finishes the initialization, by setting size/location.
      • 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 Dialog
        Parameters:
        value - if true then display the dialog, otherwise close it
      • dispose

        public void dispose()
        de-registers the child frame with the parent first.
        Overrides:
        dispose in class Window
      • 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
      • pack

        public void pack​(Dimension min,
                         Dimension max)
        Packs the dialog with optional min/max dimensions.
        Parameters:
        min - the minimum dimensions, ignored if null
        max - the maximum dimensions, ignored if null
      • addAfterShowAction

        public void addAfterShowAction​(Runnable r)
        Adds the specified action to the list of actions to execute after showing the dialog.
        Parameters:
        r - the action to run
      • removeAfterShowAction

        public void removeAfterShowAction​(Runnable r)
        Removes the specified action to the list of actions to execute after showing the dialog.
        Parameters:
        r - the action to run
      • executeAfterShowActions

        protected void executeAfterShowActions()
        Places the after show actions on the swing queue.
      • addAfterHideAction

        public void addAfterHideAction​(Runnable r)
        Adds the specified action to the list of actions to execute after hiding the dialog.
        Parameters:
        r - the action to run
      • removeAfterHideAction

        public void removeAfterHideAction​(Runnable r)
        Removes the specified action to the list of actions to execute after hiding the dialog.
        Parameters:
        r - the action to run
      • executeAfterHideActions

        protected void executeAfterHideActions()
        Places the after hide actions on the swing queue.
      • addBeforeShowAction

        public void addBeforeShowAction​(Runnable r)
        Adds the specified action to the list of actions to execute before showing the dialog.
        Parameters:
        r - the action to run
      • removeBeforeShowAction

        public void removeBeforeShowAction​(Runnable r)
        Removes the specified action to the list of actions to execute before showing the dialog.
        Parameters:
        r - the action to run
      • executeBeforeShowActions

        protected void executeBeforeShowActions()
        Places the before show actions on the swing queue.
      • addBeforeHideAction

        public void addBeforeHideAction​(Runnable r)
        Adds the specified action to the list of actions to execute before hiding the dialog.
        Parameters:
        r - the action to run
      • removeBeforeHideAction

        public void removeBeforeHideAction​(Runnable r)
        Removes the specified action to the list of actions to execute before hiding the dialog.
        Parameters:
        r - the action to run
      • executeBeforeHideActions

        protected void executeBeforeHideActions()
        Places the before hide actions on the swing queue.