Package ucar.visad.display
Class CrossSectionSelector
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.CompositeDisplayable
ucar.visad.display.SelectorDisplayable
ucar.visad.display.CrossSectionSelector
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
FieldsModifier and TypeFieldDescriptionstatic final int
end point idstatic final int
mid point idstatic final int
start point idstatic final String
position propertystatic final String
position propertystatic final String
position propertyFields 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
ConstructorsConstructorDescriptionConstruct a CrossSectionSelector with default.Construct a CrossSectionSelector from another instanceCrossSectionSelector
(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
Modifier and TypeMethodDescriptionvoid
Adds a listener for data changes.void
Adds a listener for data changes.void
Adds a listener for data changes.Returns a clone of this instance suitable for another VisAD display.void
Remove the end pointvoid
Remove the mid pointvoid
Remove the start pointGet the position of the ending point of the line.get the selector pointget the selector pointGet the position of the middle point of the line.Get the position of the ending point of the line.Get the position of the starting point of the lineget the selector pointprotected void
Called when the position has changedvoid
Removes a listener for data changes.void
Removes a listener for data changes.void
Removes a listener for data changes.void
setAutoSize
(boolean yesorno) Set whether the marker should automatically resize as the display is zoomed.void
Set the color of the selector points.void
setConstantPosition
(double value, DisplayRealType type) Override base class methodvoid
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=yesvoid
setEndPointVisible
(boolean value) Set whether the end point is visible; true=yesvoid
setInterpolateLinePoints
(boolean value) SHould we interpolate the line pointsvoid
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=yesvoid
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=yesvoid
setStartPointVisible
(boolean value) Set whether the start point is visible; true=yesvoid
setStartPtFixed
(boolean value) set whether the start point can be moved or not by user; true=yes deprecated Should use setStartPointFixedvoid
setZValue
(double zValue) Set the location along the Z Axis that you want to have the line and points displayedMethods 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
-
Field Details
-
PROPERTY_STARTPOINT
position property- See Also:
-
PROPERTY_ENDPOINT
position property- See Also:
-
PROPERTY_MIDPOINT
position property- See Also:
-
POINT_START
public static final int POINT_STARTstart point id- See Also:
-
POINT_END
public static final int POINT_ENDend point id- See Also:
-
POINT_MID
public static final int POINT_MIDmid point id- See Also:
-
-
Constructor Details
-
CrossSectionSelector
Construct a CrossSectionSelector with default. Line will run from (-1, 0) to (1,0) in (X,Y) space.- Throws:
VisADException
- VisAD errorRemoteException
- 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 pointendPoint
- XY position of ending point- Throws:
VisADException
- VisAD errorRemoteException
- 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 pointendPoint
- XY position of ending pointcolor
- color for all components of this composite- Throws:
VisADException
- VisAD errorRemoteException
- remote error
-
CrossSectionSelector
Construct a CrossSectionSelector from another instance- Parameters:
that
- other instance- Throws:
VisADException
- VisAD errorRemoteException
- remote error
-
-
Method Details
-
getStartSelectorPoint
get the selector point- Returns:
- the selector point
-
getEndSelectorPoint
get the selector point- Returns:
- the selector point
-
getMiddleSelectorPoint
get the selector point- Returns:
- the selector point
-
dontShowStartPoint
Remove the start point- Throws:
RemoteException
- On badnessVisADException
- On badness
-
dontShowMiddlePoint
Remove the mid point- Throws:
RemoteException
- On badnessVisADException
- On badness
-
dontShowEndPoint
Remove the end point- Throws:
RemoteException
- On badnessVisADException
- On badness
-
setPointSize
Set the size of the selector points. The middle point is always just a little bigger than the end points- Overrides:
setPointSize
in classSelectorDisplayable
- Parameters:
size
- point size in pixels- Throws:
VisADException
- VisAD errorRemoteException
- remote error
-
setColor
Set the color of the selector points. The middle point is always just a little darker than the end points- Overrides:
setColor
in classCompositeDisplayable
- Parameters:
newColor
- color for components- Throws:
VisADException
- VisAD errorRemoteException
- remote error
-
setAutoSize
Set whether the marker should automatically resize as the display is zoomed.- Overrides:
setAutoSize
in classSelectorDisplayable
- Parameters:
yesorno
- true to automatically resize the marker.- Throws:
RemoteException
VisADException
-
setZValue
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 errorRemoteException
- remote error
-
setConstantPosition
public void setConstantPosition(double value, DisplayRealType type) throws VisADException, RemoteException Override base class method- Overrides:
setConstantPosition
in classCompositeDisplayable
- Parameters:
value
- Valuetype
- Type- Throws:
RemoteException
- On badnessVisADException
- On badness
-
setStartPtFixed
set whether the start point can be moved or not by user; true=yes deprecated Should use setStartPointFixed- Parameters:
value
- true to be fixed- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
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 errorVisADException
- problem creating VisAD object
-
setEndPointFixed
set whether the end point can be moved or not by user; true=yes- Parameters:
value
- true to be fixed- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setStartPointVisible
Set whether the start point is visible; true=yes- Parameters:
value
- true to be fixed- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setEndPointVisible
Set whether the end point is visible; true=yes- Parameters:
value
- true for visible- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setMidPointVisible
Set whether the mid point is visible; true=yes- Parameters:
value
- true for visible- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setStartPoint
Set the position of the starting point of the line.- Parameters:
point
- XY position as a RealTuple- Throws:
VisADException
- bad pointRemoteException
- Java RMI error
-
getStartPoint
Get the position of the starting point of the line- Returns:
- XY position as a RealTuple
-
setMidPoint
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 pointRemoteException
- Java RMI error
-
getMidPoint
Get the position of the middle point of the line.- Returns:
- XY position as a RealTuple
-
setEndPoint
Set the position of the ending point of the line.- Parameters:
point
- XY position as a RealTuple- Throws:
VisADException
- bad pointRemoteException
- Java RMI error
-
getEndPoint
Get the position of the ending point of the line.- Returns:
- XY position as a RealTuple
-
setPoint
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_ENDpoint
- point position- Throws:
RemoteException
- Java RMI errorVisADException
- bad point
-
setPosition
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 errorVisADException
- bad point
-
getPosition
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 errorVisADException
- 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 lineendPosition
- ending position for the selector line- Throws:
RemoteException
- Java RMI errorVisADException
- bad point
-
positionHasChanged
Called when the position has changed- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
cloneForDisplay
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.- Overrides:
cloneForDisplay
in classCompositeDisplayable
- Returns:
- A semi-deep clone of this instance.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
addStartPropertyChangeListener
Adds a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.
-
removeStartPropertyChangeListener
Removes a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.
-
addEndPropertyChangeListener
Adds a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.
-
removeEndPropertyChangeListener
Removes a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.
-
addMidPropertyChangeListener
Adds a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.
-
removeMidPropertyChangeListener
Removes a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.
-
setInterpolateLinePoints
SHould we interpolate the line points- Parameters:
value
- interpolate- Throws:
RemoteException
- on badnessVisADException
- on badness
-