Package adams.gui.goe

Class GenericObjectEditor.GOEPanel

    • Field Detail

      • m_SplitPane

        protected BaseSplitPane m_SplitPane
        the split pane.
      • m_PanelLeft

        protected JPanel m_PanelLeft
        the left panel.
      • m_PanelRight

        protected JPanel m_PanelRight
        the right panel.
      • m_Tree

        protected ClassTree m_Tree
        the tree to use.
      • m_PropertySheetChild

        protected PropertySheetPanel m_PropertySheetChild
        The component that performs object customization.
      • m_ComboBoxClassname

        protected BaseComboBox<String> m_ComboBoxClassname
        The names of the proposed classes.
      • m_LabelClassname

        protected JLabel m_LabelClassname
        The name of the current class.
      • m_ButtonOpen

        protected BaseButton m_ButtonOpen
        Open object from disk.
      • m_ButtonSave

        protected BaseButton m_ButtonSave
        Save object to disk.
      • m_ButtonOK

        protected BaseButton m_ButtonOK
        ok button.
      • m_ButtonCancel

        protected BaseButton m_ButtonCancel
        cancel button.
      • m_ButtonRevert

        protected BaseButton m_ButtonRevert
        revert button.
      • m_FileChooser

        protected transient ObjectFileChooser m_FileChooser
        The filechooser for opening and saving object files.
      • m_ButtonCopyPaste

        protected BaseButton m_ButtonCopyPaste
        the button for copy/paste menu.
      • m_TopPanel

        protected JPanel m_TopPanel
        the top panel with the classname and choose button.
      • m_PanelLogAndButtons

        protected JPanel m_PanelLogAndButtons
        the panel for the log and buttons.
      • m_PanelLog

        protected JPanel m_PanelLog
        the panel for the log messages.
      • m_ButtonLogClear

        protected BaseButton m_ButtonLogClear
        the button for clearing the log message.
      • m_ButtonLogCopy

        protected BaseButton m_ButtonLogCopy
        the button for copying the log message.
      • m_PanelButtons

        protected JPanel m_PanelButtons
        the panel with the buttons.
      • m_IgnoreChanges

        protected boolean m_IgnoreChanges
        whether to ignore selection changes to the combobox.
      • m_UpdateSize

        protected boolean m_UpdateSize
        whether to update the dialog size.
      • m_FirstUpdate

        protected boolean m_FirstUpdate
        whether its the first update.
    • Constructor Detail

      • GOEPanel

        public GOEPanel()
        Creates the GUI editor component.
    • Method Detail

      • setUpdateSize

        public void setUpdateSize​(boolean value)
        Sets whether to update the preferred size.
        Parameters:
        value - true if to update
      • getUpdateSize

        public boolean getUpdateSize()
        Returns whether to update the preferred size.
        Returns:
        true if to update
      • setButtonsVisible

        public void setButtonsVisible​(boolean value)
        Sets whether to display the buttons.
        Parameters:
        value - true if to display
      • getButtonsVisible

        public boolean getButtonsVisible()
        Returns whether the buttons are visible.
        Returns:
        true if displayed
      • close

        protected void close()
        Disposes the window the GOE belongs to, if possible.
      • setCancelButton

        protected void setCancelButton​(boolean flag)
        Enables/disables the cancel button.
        Parameters:
        flag - true to enable cancel button, false to disable it
      • openObject

        protected Object openObject()
        Opens an object from a file selected by the user.
        Returns:
        the loaded object, or null if the operation was cancelled or failed to load object or incompatible type
      • saveObject

        protected void saveObject​(Object object)
        Saves an object to a file selected by the user.
        Parameters:
        object - the object to save
      • getFileChooser

        protected ObjectFileChooser getFileChooser()
        Creates the file chooser the user will use to save/load files with.
      • copyObject

        protected Object copyObject​(Object source)
        Makes a copy of an object using OptionUtils#shallowCopy(Object), CloneHandler#getClone() or serialization.
        Parameters:
        source - the object to copy
        Returns:
        a copy of the source object
      • setOkButtonText

        public void setOkButtonText​(String newLabel)
        Allows customization of the action label on the dialog.
        Parameters:
        newLabel - the new string for the ok button
      • addOkListener

        public void addOkListener​(ActionListener a)
        This is used to hook an action listener to the ok button.
        Parameters:
        a - The action listener.
      • addCancelListener

        public void addCancelListener​(ActionListener a)
        This is used to hook an action listener to the cancel button.
        Parameters:
        a - The action listener.
      • removeOkListener

        public void removeOkListener​(ActionListener a)
        This is used to remove an action listener from the ok button.
        Parameters:
        a - The action listener
      • removeCancelListener

        public void removeCancelListener​(ActionListener a)
        This is used to remove an action listener from the cancel button.
        Parameters:
        a - The action listener
      • updateChildPropertySheet

        public void updateChildPropertySheet()
        Updates the child property sheet, and creates if needed.
      • setCanChangeClassInDialog

        public void setCanChangeClassInDialog​(boolean value)
        Sets whether the user can change the class in the dialog.
        Parameters:
        value - if true then the user can change the class
      • getCanChangeClassInDialog

        public boolean getCanChangeClassInDialog()
        Returns whether the user can change the class in the dialog.
        Returns:
        true if the user can change the class
      • setReadOnly

        public void setReadOnly​(boolean value)
        Sets whether the dialog is read-only or not.
        Parameters:
        value - if true then the dialog is read-only
      • isReadOnly

        public boolean isReadOnly()
        Returns whether the dialog is read-only or not.
        Returns:
        true if the dialog is read-only
      • log

        public void log​(Level level,
                        String msg)
        For logging messages.
        Parameters:
        level - the logging level
        msg - the message
      • log

        public void log​(Level level,
                        String msg,
                        Throwable t)
        For logging messages.
        Parameters:
        level - the logging level
        msg - the message
        t - the optional exception (if one occurred), can be null
      • clearLogMessage

        public void clearLogMessage()
        Removes the message and hides the panel.
      • copyLogMessage

        public void copyLogMessage()
        Copies the message to the clipboard.
      • hasLogMessage

        public boolean hasLogMessage()
        Returns whether a message is currently being displayed.
        Returns:
        true if message displayed
      • getLogMessage

        public String getLogMessage()
        Returns the current log message.
        Returns:
        the log message, null if none displayed