ucar.visad.display
Class SelectorPoint

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableData
          extended by ucar.visad.display.LineDrawing
              extended by ucar.visad.display.SelectorPoint

public class SelectorPoint
extends LineDrawing

Displayable to encompass a manipulable point that can be moved around the display. If you want to limit the movement to one axis, then construct the RealTuple with one element whose RealType corresponds to that axis.

Version:
$Revision: 1.26 $
Author:
Don Murray

Field Summary
 
Fields inherited from class ucar.visad.display.LineDrawing
COLOR, LINE_STYLE, LINE_WIDTH, POINT_SIZE
 
Fields inherited from class ucar.visad.display.DisplayableData
MANIPULABLE, VISIBLE
 
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
 
Constructor Summary
SelectorPoint(SelectorPoint that)
          Construct a SelectorPoint from another instance
SelectorPoint(String name, RealTuple initialValue)
          Construct a SelectorPoint for the pointType specified with the specified intial value.
SelectorPoint(String name, RealTupleType pointType)
          Construct a SelectorPoint for the pointType specified.
SelectorPoint(String name, String markerText, RealTuple initialValue)
          Construct a SelectorPoint.
SelectorPoint(String name, VisADGeometryArray marker, RealTuple initialValue)
          Construct a SelectorPoint for the pointType specified with the
 
Method Summary
 Displayable cloneForDisplay()
          Returns a clone of this instance suitable for another VisAD display.
protected  void dataChange()
          Called when the data changes.
 Set getAnimationSet(RealType aniType)
          Returns the set of values for the given aniType if the contained Data object adapted by this DisplayableData have any data of that type.
 boolean getAutoSize()
          Get whether the marker is automatically resized as the display is zoomed.
 VisADGeometryArray getMarker()
          Get the marker for this selector point
 RealTuple getPoint()
          Get the current point.
 float getScale()
          Get the scale of the ShapeControl.
static VisADGeometryArray reduce(VisADGeometryArray marker)
          Reduce the size of the marker
 void setAutoSize(boolean yesorno)
          Set whether the marker should automatically resize as the display is zoomed.
 void setFixed(boolean x, boolean y, boolean z)
          Set if any of the axis movements are fixed
 void setMarker(String markerText)
          Set the marker text for this selector point
 void setMarker(VisADGeometryArray marker)
          Set the marker for this selector point
 void setPoint(RealTuple value)
          Set the point.
 void setPointSize(float newSize)
          Set the size (scale) of the ShapeControl.
 void setPointWithTime(RealTuple value, List times)
           
 
Methods inherited from class ucar.visad.display.LineDrawing
getColor, getLineStyle, getLineWidth, getPointSize, setColor, setHSV, setHSV, setLineStyle, setLineWidth, setRGB, setRGB, setRGBA, setRGBA
 
Methods inherited from class ucar.visad.display.DisplayableData
addAction, destroy, getActive, getData, getDataRenderer, getName, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setManipulable, setPickable, setPointMode, setUseFastRendering, setVisible, toString
 
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectorPoint

public SelectorPoint(String name,
                     RealTupleType pointType)
              throws VisADException,
                     RemoteException
Construct a SelectorPoint for the pointType specified. Initial value is set to 0.

Parameters:
name - name of this SelectorPoint
pointType - RealType that the point should map to
Throws:
VisADException - VisAD error
RemoteException - remote error

SelectorPoint

public SelectorPoint(String name,
                     RealTuple initialValue)
              throws VisADException,
                     RemoteException
Construct a SelectorPoint for the pointType specified with the specified intial value.

Parameters:
name - name of this SelectorPoint
initialValue - RealTuple position for point
Throws:
VisADException - VisAD error
RemoteException - remote error

SelectorPoint

public SelectorPoint(String name,
                     String markerText,
                     RealTuple initialValue)
              throws VisADException,
                     RemoteException
Construct a SelectorPoint.

Parameters:
name - name of this SelectorPoint
markerText - text for the marker
initialValue - RealTuple position for point
Throws:
VisADException - VisAD error
RemoteException - remote error

SelectorPoint

public SelectorPoint(String name,
                     VisADGeometryArray marker,
                     RealTuple initialValue)
              throws VisADException,
                     RemoteException
Construct a SelectorPoint for the pointType specified with the

Parameters:
name - name of this SelectorPoint
marker - Shape to use for maker
initialValue - RealTuple position for point
Throws:
VisADException - VisAD error
RemoteException - remote error

SelectorPoint

public SelectorPoint(SelectorPoint that)
              throws VisADException,
                     RemoteException
Construct a SelectorPoint from another instance

Parameters:
that - other instance
Throws:
VisADException - VisAD error
RemoteException - remote error
Method Detail

getAnimationSet

public Set getAnimationSet(RealType aniType)
                    throws VisADException,
                           RemoteException
Description copied from class: DisplayableData

Returns the set of values for the given aniType if the contained Data object adapted by this DisplayableData have any data of that type. null will be returned if this instance adapts such an object but the object is unset, or if this instance does not support this type.

Overrides:
getAnimationSet in class DisplayableData
Parameters:
aniType - The type used for animation
Returns:
The set of times from all data May be null.
Throws:
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
See Also:
DisplayableData.hasDataObject()

setFixed

public void setFixed(boolean x,
                     boolean y,
                     boolean z)
Set if any of the axis movements are fixed

Parameters:
x - x fixed
y - y fixed
z - z fixed

setPoint

public void setPoint(RealTuple value)
              throws VisADException,
                     RemoteException
Set the point.

Parameters:
value - new value for this point
Throws:
VisADException - VisAD error
RemoteException - remote error

setPointWithTime

public void setPointWithTime(RealTuple value,
                             List times)
                      throws VisADException,
                             RemoteException
Throws:
VisADException
RemoteException

cloneForDisplay

public Displayable cloneForDisplay()
                            throws VisADException,
                                   RemoteException
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.

Overrides:
cloneForDisplay in class DisplayableData
Returns:
A semi-deep clone of this instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getPoint

public RealTuple getPoint()
Get the current point.

Returns:
the current value for this point

setMarker

public void setMarker(String markerText)
               throws VisADException,
                      RemoteException
Set the marker text for this selector point

Parameters:
markerText - VisADGeometryArray for marker
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setMarker

public void setMarker(VisADGeometryArray marker)
               throws VisADException,
                      RemoteException
Set the marker for this selector point

Parameters:
marker - VisADGeometryArray for marker
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setPointSize

public void setPointSize(float newSize)
                  throws VisADException,
                         RemoteException
Set the size (scale) of the ShapeControl. Usually done to set the initial size.

Overrides:
setPointSize in class LineDrawing
Parameters:
newSize - size to use.
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

getScale

public float getScale()
Get the scale of the ShapeControl.

Returns:
current scale;

getMarker

public VisADGeometryArray getMarker()
Get the marker for this selector point

Returns:
VisADGeometryArray for marker

setAutoSize

public void setAutoSize(boolean yesorno)
                 throws VisADException,
                        RemoteException
Set whether the marker should automatically resize as the display is zoomed.

Parameters:
yesorno - true to automatically resize the marker.
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

getAutoSize

public boolean getAutoSize()
Get whether the marker is automatically resized as the display is zoomed.

Returns:
true if marker is automatically resized.

dataChange

protected void dataChange()
                   throws VisADException,
                          RemoteException
Called when the data changes.

Overrides:
dataChange in class DisplayableData
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

reduce

public static VisADGeometryArray reduce(VisADGeometryArray marker)
Reduce the size of the marker

Parameters:
marker - marker to reduce
Returns:
reduced marker