Package adams.gui.goe

Class AbstractBasicTypePropertyEditor

    • Constructor Detail

      • AbstractBasicTypePropertyEditor

        public AbstractBasicTypePropertyEditor()
    • Method Detail

      • paintValue

        public void paintValue​(Graphics gfx,
                               Rectangle box)
        Paint a representation of the value into a given area of screen real estate. Note that the propertyEditor is responsible for doing its own clipping so that it fits into the given rectangle.

        If the PropertyEditor doesn't honor paint requests (see isPaintable) this method should be a silent noop.

        The given Graphics object will have the default font, color, etc of the parent container. The PropertyEditor may change graphics attributes such as font and color and doesn't need to restore the old values.

        Specified by:
        paintValue in interface PropertyEditor
        Overrides:
        paintValue in class PropertyEditorSupport
        Parameters:
        gfx - Graphics object to paint into.
        box - Rectangle within graphics object into which we should paint.
      • getAsText

        public String getAsText()
        Gets the property value as text.
        Specified by:
        getAsText in interface PropertyEditor
        Overrides:
        getAsText in class PropertyEditorSupport
        Returns:
        The property value as a human editable string.

        Returns null if the value can't be expressed as an editable string.

        If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().

      • toString

        protected String toString​(Object obj)
        Turns the object into a string representation.

        Default implementation just uses the Object's toString() method.
        Parameters:
        obj - the object to convert
        Returns:
        the string representation