Package noaa.coastwatch.gui.visual
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
The
AbstractVisualObject
class implements default versions
of the following interface methods:
ComponentProducer.refreshComponent()
(no operation)VisualObject.addPropertyChangeListener(java.beans.PropertyChangeListener)
VisualObject.firePropertyChange()
VisualObject.showChooser()
(no operation)VisualObject.hasChooser()
(returns false)VisualObject.setRestrictions(java.lang.Object)
(no operation)
- Since:
- 3.1.7
- Author:
- Peter Hollemans
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new abstract visual object and initializes the property change support. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener to receive property change events for when this object's value changes.void
Fires a property change event for this object's value.void
firePropertyChange
(Object oldValue, Object newValue) Fires a property change event for this object's value using the specified old and new values.boolean
Gets the chooser flag.void
Refreshes the component display to show the contents of the current object.void
setRestrictions
(Object restrict) Sets restrictions on the allowed object values.void
Shows the chooser dialog used to manipulate the object's properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface noaa.coastwatch.gui.visual.ComponentProducer
getComponent
Methods inherited from interface noaa.coastwatch.gui.visual.VisualObject
getValue
-
Field Details
-
VALUE_PROPERTY
The value property.- See Also:
-
-
Constructor Details
-
AbstractVisualObject
protected AbstractVisualObject()Creates a new abstract visual object and initializes the property change support.
-
-
Method Details
-
addPropertyChangeListener
Description copied from interface:VisualObject
Adds a listener to receive property change events for when this object's value changes.- Specified by:
addPropertyChangeListener
in interfaceVisualObject
- 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 byVisualObject.getValue()
.- Specified by:
firePropertyChange
in interfaceVisualObject
-
firePropertyChange
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 caseVisualObject.hasChooser()
returns false and this method has no effect.- Specified by:
showChooser
in interfaceVisualObject
-
hasChooser
public boolean hasChooser()Description copied from interface:VisualObject
Gets the chooser flag.- Specified by:
hasChooser
in interfaceVisualObject
- Returns:
- true if this object has a chooser, or false if not.
-
setRestrictions
Description copied from interface:VisualObject
Sets restrictions on the allowed object values.- Specified by:
setRestrictions
in interfaceVisualObject
- 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 interfaceComponentProducer
-