Package adams.gui.goe

Class BaseMeasureCollectionEditor

  • All Implemented Interfaces:
    adams.core.HelpProvider, adams.gui.goe.CustomStringRepresentationHandler, adams.gui.goe.MultiSelectionEditor, PropertyEditor

    public class BaseMeasureCollectionEditor
    extends adams.gui.goe.AbstractPropertyEditorSupport
    implements adams.gui.goe.CustomStringRepresentationHandler, adams.gui.goe.MultiSelectionEditor
    A PropertyEditor for BaseMeasureCollection objects.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_ComboBoxValue

        protected adams.gui.core.BaseComboBox<String> m_ComboBoxValue
        The combobox with the values.
    • Constructor Detail

      • BaseMeasureCollectionEditor

        public BaseMeasureCollectionEditor()
    • Method Detail

      • toString

        public static String toString​(adams.core.option.AbstractOption option,
                                      Object object)
        Returns the BaseMeasureCollection as string.
        Parameters:
        option - the current option
        object - the BaseBoolean object to convert
        Returns:
        the generated string
      • valueOf

        public static Object valueOf​(adams.core.option.AbstractOption option,
                                     String str)
        Returns a BaseMeasureCollection generated from the string.
        Parameters:
        option - the current option
        str - the string to convert to a BaseBoolean
        Returns:
        the generated BaseBoolean
      • toCustomStringRepresentation

        public String toCustomStringRepresentation​(Object obj)
        Returns a custom string representation of the object.
        Specified by:
        toCustomStringRepresentation in interface adams.gui.goe.CustomStringRepresentationHandler
        Parameters:
        obj - the object to turn into a string
        Returns:
        the string representation
      • fromCustomStringRepresentation

        public Object fromCustomStringRepresentation​(String str)
        Returns an object created from the custom string representation.
        Specified by:
        fromCustomStringRepresentation in interface adams.gui.goe.CustomStringRepresentationHandler
        Parameters:
        str - the string to turn into an object
        Returns:
        the object
      • parse

        protected BaseMeasureCollection parse​(String s)
        Parses the given string and returns the generated object. The string has to be a valid one, i.e., the isValid(String) check has been performed already and succeeded.
        Parameters:
        s - the string to parse
        Returns:
        the generated object, or null in case of an error
      • createCustomEditor

        protected JComponent createCustomEditor()
        Gets the custom editor component.
        Specified by:
        createCustomEditor in class adams.gui.goe.AbstractPropertyEditorSupport
        Returns:
        always null
      • isValid

        protected boolean isValid​(String s)
        Checks whether the string is valid.
        Parameters:
        s - the string to check
        Returns:
        true if the string is valid
      • isUnchanged

        protected boolean isUnchanged​(String s)
        Checks whether the string is the same as the currently used one.
        Parameters:
        s - the string to check
        Returns:
        true if the strings are the same
      • acceptInput

        protected void acceptInput()
        Accepts the input and closes the dialog.
      • discardInput

        protected void discardInput()
        Discards the input and closes the dialog.
      • initForDisplay

        protected void initForDisplay()
        Initializes the display of the value.
        Overrides:
        initForDisplay in class adams.gui.goe.AbstractPropertyEditorSupport
      • getSelectedObjects

        public Object[] getSelectedObjects​(Container parent)
        Returns the selected objects.
        Specified by:
        getSelectedObjects in interface adams.gui.goe.MultiSelectionEditor
        Parameters:
        parent - the parent container
        Returns:
        the objects