ucar.visad.display
Class CrossSectionSelector

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.CompositeDisplayable
          extended by ucar.visad.display.SelectorDisplayable
              extended by ucar.visad.display.CrossSectionSelector

public class CrossSectionSelector
extends SelectorDisplayable

CrossSectionSelector is a composite of two endpoints that can be moved independently, a line connecting the two points, and a middle point that can be used to move orthoganally to the line.

Version:
$Revision: 1.28 $
Author:
Don Murray

Field Summary
static int POINT_END
          end point id
static int POINT_MID
          mid point id
static int POINT_START
          start point id
static String PROPERTY_ENDPOINT
          position property
static String PROPERTY_MIDPOINT
          position property
static String PROPERTY_STARTPOINT
          position property
 
Fields inherited from class ucar.visad.display.SelectorDisplayable
PROPERTY_POSITION
 
Fields inherited from class ucar.visad.display.CompositeDisplayable
cnt, label
 
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
 
Constructor Summary
CrossSectionSelector()
          Construct a CrossSectionSelector with default.
CrossSectionSelector(CrossSectionSelector that)
          Construct a CrossSectionSelector from another instance
CrossSectionSelector(RealTuple startPoint, RealTuple endPoint)
          Construct a CrossSectionSelector along the points specified.
CrossSectionSelector(RealTuple startPoint, RealTuple endPoint, Color color)
          Construct a CrossSectionSelector along the points specified in the Color specified.
 
Method Summary
 void addEndPropertyChangeListener(PropertyChangeListener action)
          Adds a listener for data changes.
 void addMidPropertyChangeListener(PropertyChangeListener action)
          Adds a listener for data changes.
 void addStartPropertyChangeListener(PropertyChangeListener action)
          Adds a listener for data changes.
 Displayable cloneForDisplay()
          Returns a clone of this instance suitable for another VisAD display.
 void dontShowEndPoint()
          Remove the end point
 void dontShowMiddlePoint()
          Remove the mid point
 void dontShowStartPoint()
          Remove the start point
 RealTuple getEndPoint()
          Get the position of the ending point of the line.
 SelectorPoint getEndSelectorPoint()
          get the selector point
 SelectorPoint getMiddleSelectorPoint()
          get the selector point
 RealTuple getMidPoint()
          Get the position of the middle point of the line.
 RealTuple[] getPosition()
          Get the position of the ending point of the line.
 RealTuple getStartPoint()
          Get the position of the starting point of the line
 SelectorPoint getStartSelectorPoint()
          get the selector point
protected  void positionHasChanged()
          Called when the position has changed
 void removeEndPropertyChangeListener(PropertyChangeListener action)
          Removes a listener for data changes.
 void removeMidPropertyChangeListener(PropertyChangeListener action)
          Removes a listener for data changes.
 void removeStartPropertyChangeListener(PropertyChangeListener action)
          Removes a listener for data changes.
 void setAutoSize(boolean yesorno)
          Set whether the marker should automatically resize as the display is zoomed.
 void setColor(Color newColor)
          Set the color of the selector points.
 void setConstantPosition(double value, DisplayRealType type)
          Override base class method
 void setEndPoint(RealTuple point)
          Set the position of the ending point of the line.
 void setEndPointFixed(boolean value)
          set whether the end point can be moved or not by user; true=yes
 void setEndPointVisible(boolean value)
          Set whether the end point is visible; true=yes
 void setInterpolateLinePoints(boolean value)
          SHould we interpolate the line points
 void setMidPoint(RealTuple point)
          Set the position of the ending point of the line; using current start and end points (ie "does nothing" -for persistence)
 void setMidPointVisible(boolean value)
          Set whether the mid point is visible; true=yes
 void setPoint(int which, RealTuple point)
          Set the position of one end point of the line.
 void setPointSize(float size)
          Set the size of the selector points.
 void setPosition(RealTuple[] position)
          Set the position of the ending point of the line.
 void setPosition(RealTuple startPosition, RealTuple endPosition)
          Set the position of the ending point of the line.
 void setStartPoint(RealTuple point)
          Set the position of the starting point of the line.
 void setStartPointFixed(boolean value)
          set whether the start point can be moved or not by user; true=yes
 void setStartPointVisible(boolean value)
          Set whether the start point is visible; true=yes
 void setStartPtFixed(boolean value)
          Deprecated. Should use setStartPointFixed
 void setZValue(double zValue)
          Set the location along the Z Axis that you want to have the line and points displayed
 
Methods inherited from class ucar.visad.display.SelectorDisplayable
addPropertyChangeListener, getAutoSize, getFiringEvent, getOkToFireEvents, getPointSize, notifyListenersOfMove, removePropertyChangeListener, setOkToFireEvents
 
Methods inherited from class ucar.visad.display.CompositeDisplayable
addConstantMap, addDisplayable, addListDataListener, clearDisplayables, debug, destroy, destroyAll, displayableCount, fireListDataContentsChanged, fireListDataIntervalAdded, fireListDataIntervalRemoved, getAnimationSet, getDisplayable, indexOf, iterator, lastDisplayable, myAddDataReferences, myRemoveDataReferences, removeDisplayable, removeDisplayable, removeListDataListener, setAdjustFlow, setColorPalette, setColorUnit, setDisplay, setDisplayable, setDisplayMaster, setDisplayUnit, setLineWidth, setManipulable, setPointMode, setSelectedRange, setUseFastRendering, setUseTimesInAnimation, setVisible, setVisible, setVisible, toFront, toString
 
Methods inherited from class ucar.visad.display.Displayable
addConstantMaps, addDataReferences, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getData, getDestroyed, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, hasDataObject, isActive, isUnitCompatible, isVisible, logException, myAddConstantMaps, removeConstantMap, removeDataReferences, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setColorPalette, setContourInfo, setDisplayActive, setDisplayInactive, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_STARTPOINT

public static final String PROPERTY_STARTPOINT
position property

See Also:
Constant Field Values

PROPERTY_ENDPOINT

public static final String PROPERTY_ENDPOINT
position property

See Also:
Constant Field Values

PROPERTY_MIDPOINT

public static final String PROPERTY_MIDPOINT
position property

See Also:
Constant Field Values

POINT_START

public static final int POINT_START
start point id

See Also:
Constant Field Values

POINT_END

public static final int POINT_END
end point id

See Also:
Constant Field Values

POINT_MID

public static final int POINT_MID
mid point id

See Also:
Constant Field Values
Constructor Detail

CrossSectionSelector

public CrossSectionSelector()
                     throws VisADException,
                            RemoteException
Construct a CrossSectionSelector with default. Line will run from (-1, 0) to (1,0) in (X,Y) space.

Throws:
VisADException - VisAD error
RemoteException - remote error

CrossSectionSelector

public CrossSectionSelector(RealTuple startPoint,
                            RealTuple endPoint)
                     throws VisADException,
                            RemoteException
Construct a CrossSectionSelector along the points specified.

Parameters:
startPoint - XY position of starting point
endPoint - XY position of ending point
Throws:
VisADException - VisAD error
RemoteException - remote error

CrossSectionSelector

public CrossSectionSelector(RealTuple startPoint,
                            RealTuple endPoint,
                            Color color)
                     throws VisADException,
                            RemoteException
Construct a CrossSectionSelector along the points specified in the Color specified.

Parameters:
startPoint - XY position of starting point
endPoint - XY position of ending point
color - color for all components of this composite
Throws:
VisADException - VisAD error
RemoteException - remote error

CrossSectionSelector

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

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

getStartSelectorPoint

public SelectorPoint getStartSelectorPoint()
get the selector point

Returns:
the selector point

getEndSelectorPoint

public SelectorPoint getEndSelectorPoint()
get the selector point

Returns:
the selector point

getMiddleSelectorPoint

public SelectorPoint getMiddleSelectorPoint()
get the selector point

Returns:
the selector point

dontShowStartPoint

public void dontShowStartPoint()
                        throws VisADException,
                               RemoteException
Remove the start point

Throws:
RemoteException - On badness
VisADException - On badness

dontShowMiddlePoint

public void dontShowMiddlePoint()
                         throws VisADException,
                                RemoteException
Remove the mid point

Throws:
RemoteException - On badness
VisADException - On badness

dontShowEndPoint

public void dontShowEndPoint()
                      throws VisADException,
                             RemoteException
Remove the end point

Throws:
RemoteException - On badness
VisADException - On badness

setPointSize

public void setPointSize(float size)
                  throws VisADException,
                         RemoteException
Set the size of the selector points. The middle point is always just a little bigger than the end points

Overrides:
setPointSize in class SelectorDisplayable
Parameters:
size - point size in pixels
Throws:
VisADException - VisAD error
RemoteException - remote error

setColor

public void setColor(Color newColor)
              throws VisADException,
                     RemoteException
Set the color of the selector points. The middle point is always just a little darker than the end points

Overrides:
setColor in class CompositeDisplayable
Parameters:
newColor - color for components
Throws:
VisADException - VisAD error
RemoteException - remote error

setAutoSize

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

Overrides:
setAutoSize in class SelectorDisplayable
Parameters:
yesorno - true to automatically resize the marker.
Throws:
RemoteException
VisADException

setZValue

public void setZValue(double zValue)
               throws VisADException,
                      RemoteException
Set the location along the Z Axis that you want to have the line and points displayed

Parameters:
zValue - position along Z axis where components should be located
Throws:
VisADException - VisAD error
RemoteException - remote error

setConstantPosition

public void setConstantPosition(double value,
                                DisplayRealType type)
                         throws VisADException,
                                RemoteException
Override base class method

Overrides:
setConstantPosition in class CompositeDisplayable
Parameters:
value - Value
type - Type
Throws:
RemoteException - On badness
VisADException - On badness

setStartPtFixed

public void setStartPtFixed(boolean value)
                     throws VisADException,
                            RemoteException
Deprecated. Should use setStartPointFixed

set whether the start point can be moved or not by user; true=yes

Parameters:
value - true to be fixed
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setStartPointFixed

public void setStartPointFixed(boolean value)
                        throws VisADException,
                               RemoteException
set whether the start point can be moved or not by user; true=yes

Parameters:
value - true to be fixed
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setEndPointFixed

public void setEndPointFixed(boolean value)
                      throws VisADException,
                             RemoteException
set whether the end point can be moved or not by user; true=yes

Parameters:
value - true to be fixed
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setStartPointVisible

public void setStartPointVisible(boolean value)
                          throws VisADException,
                                 RemoteException
Set whether the start point is visible; true=yes

Parameters:
value - true to be fixed
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setEndPointVisible

public void setEndPointVisible(boolean value)
                        throws VisADException,
                               RemoteException
Set whether the end point is visible; true=yes

Parameters:
value - true for visible
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setMidPointVisible

public void setMidPointVisible(boolean value)
                        throws VisADException,
                               RemoteException
Set whether the mid point is visible; true=yes

Parameters:
value - true for visible
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setStartPoint

public void setStartPoint(RealTuple point)
                   throws VisADException,
                          RemoteException
Set the position of the starting point of the line.

Parameters:
point - XY position as a RealTuple
Throws:
VisADException - bad point
RemoteException - Java RMI error

getStartPoint

public RealTuple getStartPoint()
Get the position of the starting point of the line

Returns:
XY position as a RealTuple

setMidPoint

public void setMidPoint(RealTuple point)
                 throws VisADException,
                        RemoteException
Set the position of the ending point of the line; using current start and end points (ie "does nothing" -for persistence)

Parameters:
point - XY position as a RealTuple
Throws:
VisADException - bad point
RemoteException - Java RMI error

getMidPoint

public RealTuple getMidPoint()
Get the position of the middle point of the line.

Returns:
XY position as a RealTuple

setEndPoint

public void setEndPoint(RealTuple point)
                 throws VisADException,
                        RemoteException
Set the position of the ending point of the line.

Parameters:
point - XY position as a RealTuple
Throws:
VisADException - bad point
RemoteException - Java RMI error

getEndPoint

public RealTuple getEndPoint()
Get the position of the ending point of the line.

Returns:
XY position as a RealTuple

setPoint

public void setPoint(int which,
                     RealTuple point)
              throws VisADException,
                     RemoteException
Set the position of one end point of the line. The mid point is automatically fit between them.

Parameters:
which - either CrossSectionSelector.POINT_START or POINT_END
point - point position
Throws:
RemoteException - Java RMI error
VisADException - bad point

setPosition

public void setPosition(RealTuple[] position)
                 throws VisADException,
                        RemoteException
Set the position of the ending point of the line.

Parameters:
position - an array of size 2 that holds the start and end points
Throws:
RemoteException - Java RMI error
VisADException - bad point

getPosition

public RealTuple[] getPosition()
                        throws VisADException,
                               RemoteException
Get the position of the ending point of the line.

Returns:
an array of size 2 that holds the start and end points
Throws:
RemoteException - Java RMI error
VisADException - bad point

setPosition

public void setPosition(RealTuple startPosition,
                        RealTuple endPosition)
                 throws VisADException,
                        RemoteException
Set the position of the ending point of the line.

Parameters:
startPosition - starting position for the selector line
endPosition - ending position for the selector line
Throws:
RemoteException - Java RMI error
VisADException - bad point

positionHasChanged

protected void positionHasChanged()
                           throws VisADException,
                                  RemoteException
Called when the position has changed

Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

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 CompositeDisplayable
Returns:
A semi-deep clone of this instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

addStartPropertyChangeListener

public void addStartPropertyChangeListener(PropertyChangeListener action)
Adds a listener for data changes.

Parameters:
action - The listener for changes to the underlying data.

removeStartPropertyChangeListener

public void removeStartPropertyChangeListener(PropertyChangeListener action)
Removes a listener for data changes.

Parameters:
action - The listener for changes to the underlying data.

addEndPropertyChangeListener

public void addEndPropertyChangeListener(PropertyChangeListener action)
Adds a listener for data changes.

Parameters:
action - The listener for changes to the underlying data.

removeEndPropertyChangeListener

public void removeEndPropertyChangeListener(PropertyChangeListener action)
Removes a listener for data changes.

Parameters:
action - The listener for changes to the underlying data.

addMidPropertyChangeListener

public void addMidPropertyChangeListener(PropertyChangeListener action)
Adds a listener for data changes.

Parameters:
action - The listener for changes to the underlying data.

removeMidPropertyChangeListener

public void removeMidPropertyChangeListener(PropertyChangeListener action)
Removes a listener for data changes.

Parameters:
action - The listener for changes to the underlying data.

setInterpolateLinePoints

public void setInterpolateLinePoints(boolean value)
                              throws VisADException,
                                     RemoteException
SHould we interpolate the line points

Parameters:
value - interpolate
Throws:
RemoteException - on badness
VisADException - on badness