Package adams.gui.goe

Class PropertySheetPanel

    • Field Detail

      • SHOW_VARIABLE_POPUP_BUTTON

        protected static Boolean SHOW_VARIABLE_POPUP_BUTTON
        whether to show an extra button for variable popup menu.
      • m_Target

        protected Object m_Target
        The target object being edited.
      • m_Options

        protected List<AbstractOption> m_Options
        Holds the options of this object, if it implements OptionHandler.
      • m_Properties

        protected PropertyDescriptor[] m_Properties
        Holds properties of the target.
      • m_Methods

        protected MethodDescriptor[] m_Methods
        Holds the methods of the target.
      • m_Editors

        protected PropertyEditor[] m_Editors
        Holds property editors of the object.
      • m_Values

        protected Object[] m_Values
        Holds current object values for each property.
      • m_TabbedPane

        protected BaseTabbedPane m_TabbedPane
        the tabbed pane.
      • m_SplitPaneContent

        protected BaseSplitPane m_SplitPaneContent
        the panel with the content.
      • m_ParameterPanel

        protected ParameterPanel m_ParameterPanel
        the panel for the parameters.
      • m_Views

        protected JComponent[] m_Views
        Stores GUI components containing each editing component.
      • m_VarButtons

        protected BaseFlatButton[] m_VarButtons
        the buttons for the variable popup menu.
      • m_TipTexts

        protected String[] m_TipTexts
        The tool tip text for each property.
      • m_GlobalInfo

        protected String m_GlobalInfo
        the text from the globalInfo method, if any.
      • m_PanelAbout

        protected BaseTextAreaWithButtons m_PanelAbout
        The panel holding global info and help, if provided by the object being editied.
      • m_Support

        protected PropertyChangeSupport m_Support
        A support object for handling property change listeners.
      • m_ShowAboutBox

        protected boolean m_ShowAboutBox
        whether to show/suppress the about box.
      • m_UserMode

        protected UserMode m_UserMode
        the user mode to use.
    • Constructor Detail

      • PropertySheetPanel

        public PropertySheetPanel​(UserMode userMode)
        Default constructor.
    • Method Detail

      • initialize

        protected void initialize()
        For initializing members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • setShowAboutBox

        public void setShowAboutBox​(boolean value)
        Sets whether to show the about box or not. Must happen before calling setTarget(Object).
        Parameters:
        value - true if to show
      • getShowAboutBox

        public boolean getShowAboutBox()
        Returns whether the about box is displayed.
        Returns:
        true if shown
      • getAboutPanel

        public JPanel getAboutPanel()
        Return the panel containing global info and help for the object being edited. May return null if the edited object provides no global info or tip text.
        Returns:
        the about panel.
      • getPropertyChangeSupport

        public PropertyChangeSupport getPropertyChangeSupport()
        Returns the underlying PropertyChangeSupport object.
        Returns:
        the support object
      • propertyChange

        public void propertyChange​(PropertyChangeEvent evt)
        Updates the property sheet panel with a changed property and also passed the event along.
        Specified by:
        propertyChange in interface PropertyChangeListener
        Parameters:
        evt - a value of type 'PropertyChangeEvent'
      • extractFirstSentence

        protected String extractFirstSentence​(String text,
                                              boolean indicator)
        Extracts the first sentence from the given text.
        Parameters:
        text - the text to process
        indicator - whether to add an indicator that more text is available
        Returns:
        the first sentence
      • initSheet

        protected void initSheet()
        Initializes the options/methods to display.
        See Also:
        m_Options, m_Methods
      • initHelp

        protected void initHelp()
        Initializes the help text for the object.
        See Also:
        m_GlobalInfo, m_TipTexts
      • setTarget

        public void setTarget​(Object targ)
        Sets a new target object for customisation.
        Parameters:
        targ - a value of type 'Object'
      • getTarget

        public Object getTarget()
        Returns the current target object.
        Returns:
        the target
      • setUserMode

        public void setUserMode​(UserMode value)
        Sets the user mode to use for displaying the properties.
        Specified by:
        setUserMode in interface UserModeSupporter
        Parameters:
        value - the mode
      • getUserMode

        public UserMode getUserMode()
        Returns the user mode to use for displaying the properties.
        Specified by:
        getUserMode in interface UserModeSupporter
        Returns:
        the mode
      • updateHelpPanel

        protected void updateHelpPanel()
        Updates the content in the help panel.
      • editableProperties

        public int editableProperties()
        Gets the number of editable properties for the current target.
        Returns:
        the number of editable properties.
      • findEditor

        protected int findEditor​(PropertyEditor editor)
        Determines the index of the editor in this sheet panel.
        Parameters:
        editor - the editor to look for
        Returns:
        the index, or -1 if not found
      • findOption

        public AbstractOption findOption​(PropertyEditor editor)
        Tries to find the option for the specified editor.
        Parameters:
        editor - the editor to find the option for
        Returns:
        the option, or null if none found
      • findView

        public JComponent findView​(PropertyEditor editor)
        Tries to find the JComponent for the specified editor.
        Parameters:
        editor - the editor to find the option for
        Returns:
        the GUI component, or null if none found
      • findLabel

        public JLabel findLabel​(PropertyEditor editor)
        Tries to find the label for the specified editor.
        Parameters:
        editor - the editor to find the option for
        Returns:
        the label, or null if none found
      • getShowVariablePopupButton

        public static boolean getShowVariablePopupButton()
        Returns whether variable popup button should be displayed.
        Returns:
        true if button displayed
      • findVarButton

        public BaseFlatButton findVarButton​(PropertyEditor editor)
        Tries to find the variable button for the specified editor.
        Parameters:
        editor - the editor to find the option for
        Returns:
        the button, or null if none found