ucar.visad.display
Class RubberBandBox

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.RubberBandBox

public class RubberBandBox
extends LineDrawing

Provides support for a Displayable that comprises a rubber band box. The box can be drawn in spherical and other non-Cartesian coordinate systems by selecting the appropriate X and Y RealTypes.

Sample usage:

  RubberBandBox rbBox =
      new RubberBandBox(RealType.Latitude, RealType.Longitude);
  rbBox.addAction(new ActionImpl() {
      public void doAction()
          throws VisADException, RemoteException
      {
          Gridded2DSet bounds = rbBox.getBounds();
          (do something useful with the box)
      }
  });
 

Version:
$Revision: 1.10 $
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
  RubberBandBox(RealType xType, RealType yType)
          Construct a RubberBandBox using xType as the X coordinate and yType as the Y coordinate of the box.
  RubberBandBox(RealType xType, RealType yType, int mask)
          Construct a RubberBandBox using xType as the X coordinate and yType as the Y coordinate of the box.
protected RubberBandBox(RubberBandBox that)
          Constructor for creating a RubberBandBox from another instance
 
Method Summary
 Displayable cloneForDisplay()
          Returns a clone of this instance suitable for another VisAD display.
protected  void dataChange()
          Invoked when box mouse is released.
 Gridded2DSet getBounds()
          Return the bounds of the RubberBandBox.
protected  DataRenderer getDataRenderer()
          Get the DataRenderer used for this displayable.
 
Methods inherited from class ucar.visad.display.LineDrawing
getColor, getLineStyle, getLineWidth, getPointSize, setColor, setHSV, setHSV, setLineStyle, setLineWidth, setPointSize, setRGB, setRGB, setRGBA, setRGBA
 
Methods inherited from class ucar.visad.display.DisplayableData
addAction, destroy, getActive, getAnimationSet, getData, 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

RubberBandBox

public RubberBandBox(RealType xType,
                     RealType yType)
              throws VisADException,
                     RemoteException
Construct a RubberBandBox using xType as the X coordinate and yType as the Y coordinate of the box.

Parameters:
xType - RealType of the X coordinate of the box
yType - RealType of the Y coordinate of the box
Throws:
VisADException - VisAD error
RemoteException - Remote error

RubberBandBox

public RubberBandBox(RealType xType,
                     RealType yType,
                     int mask)
              throws VisADException,
                     RemoteException
Construct a RubberBandBox using xType as the X coordinate and yType as the Y coordinate of the box.

Parameters:
xType - RealType of the X coordinate of the box
yType - RealType of the Y coordinate of the box
mask - key mask to use for rubberbanding
Throws:
VisADException - VisAD error
RemoteException - Remote error

RubberBandBox

protected RubberBandBox(RubberBandBox that)
                 throws VisADException,
                        RemoteException
Constructor for creating a RubberBandBox from another instance

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

dataChange

protected void dataChange()
                   throws VisADException,
                          RemoteException
Invoked when box mouse is released. Subclasses should invoke super.dataChange() to ensure the the bounds are set.

Overrides:
dataChange in class DisplayableData
Throws:
RemoteException
VisADException

getBounds

public Gridded2DSet getBounds()
Return the bounds of the RubberBandBox. The Gridded2DSet that is returned contains the opposite (starting and ending) corners of the box.

Returns:
set containing the opposite corners of the box.

getDataRenderer

protected DataRenderer getDataRenderer()
Get the DataRenderer used for this displayable.

Overrides:
getDataRenderer in class DisplayableData
Returns:
RubberBandBoxRendererJ3D associated with this displayable

cloneForDisplay

public Displayable cloneForDisplay()
                            throws RemoteException,
                                   VisADException
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.