Package adams.gui.goe

Class GPSEditor

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

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

      • m_TextCoordinates

        protected JTextComponent m_TextCoordinates
        The text field with the coordinates.
    • Constructor Detail

      • GPSEditor

        public GPSEditor()
    • Method Detail

      • 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
      • acceptInput

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

        protected void discardInput()
        Discards the input and closes the dialog.
      • 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
      • createCustomEditor

        protected JComponent createCustomEditor()
        Gets the custom editor component.
        Specified by:
        createCustomEditor in class adams.gui.goe.AbstractPropertyEditorSupport
        Returns:
        a value of type 'Component'
      • 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
      • isInlineEditingAvailable

        public boolean isInlineEditingAvailable()
        Checks whether inline editing is available.
        Specified by:
        isInlineEditingAvailable in interface adams.gui.goe.InlineEditorSupport
        Returns:
        true if editing available
      • setInlineValue

        public void setInlineValue​(String value)
        Sets the value to use.
        Specified by:
        setInlineValue in interface adams.gui.goe.InlineEditorSupport
        Parameters:
        value - the value to use
      • getInlineValue

        public String getInlineValue()
        Returns the current value.
        Specified by:
        getInlineValue in interface adams.gui.goe.InlineEditorSupport
        Returns:
        the current value
      • isInlineValueValid

        public boolean isInlineValueValid​(String value)
        Checks whether the value id valid.
        Specified by:
        isInlineValueValid in interface adams.gui.goe.InlineEditorSupport
        Parameters:
        value - the value to check
        Returns:
        true if valid