Class AbstractVisualObject

java.lang.Object
noaa.coastwatch.gui.visual.AbstractVisualObject
All Implemented Interfaces:
ComponentProducer, VisualObject
Direct Known Subclasses:
VisualArray, VisualBoolean, VisualChoice, VisualColor, VisualFont, VisualInteger, VisualOverlay, VisualString, VisualStroke, VisualSymbol

public abstract class AbstractVisualObject extends Object implements VisualObject
The AbstractVisualObject class implements default versions of the following interface methods: Child classes must implement: and override any default behaviours needed for the methods provided here.
Since:
3.1.7
Author:
Peter Hollemans
  • Field Details

  • Constructor Details

    • AbstractVisualObject

      protected AbstractVisualObject()
      Creates a new abstract visual object and initializes the property change support.
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Description copied from interface: VisualObject
      Adds a listener to receive property change events for when this object's value changes.
      Specified by:
      addPropertyChangeListener in interface VisualObject
      Parameters:
      listener - the listener to add.
    • firePropertyChange

      public void firePropertyChange()
      Fires a property change event for this object's value. The old property value is set to null, and the new value is set to the value returned by VisualObject.getValue().
      Specified by:
      firePropertyChange in interface VisualObject
    • firePropertyChange

      public void firePropertyChange(Object oldValue, Object newValue)
      Fires a property change event for this object's value using the specified old and new values.
      Parameters:
      oldValue - the old value for the property change event.
      newValue - the new value for the property change event.
    • showChooser

      public void showChooser()
      Description copied from interface: VisualObject
      Shows the chooser dialog used to manipulate the object's properties. In some cases, a visual object may not have a chooser, in which case VisualObject.hasChooser() returns false and this method has no effect.
      Specified by:
      showChooser in interface VisualObject
    • hasChooser

      public boolean hasChooser()
      Description copied from interface: VisualObject
      Gets the chooser flag.
      Specified by:
      hasChooser in interface VisualObject
      Returns:
      true if this object has a chooser, or false if not.
    • setRestrictions

      public void setRestrictions(Object restrict)
      Description copied from interface: VisualObject
      Sets restrictions on the allowed object values.
      Specified by:
      setRestrictions in interface VisualObject
      Parameters:
      restrict - the restictions, a custom object that is known to the child class.
    • refreshComponent

      public void refreshComponent()
      Refreshes the component display to show the contents of the current object. This method does nothing unless overridden in the child class.
      Specified by:
      refreshComponent in interface ComponentProducer