visad.bom
Class PickManipulationRendererJ2D

java.lang.Object
  extended by visad.DataRenderer
      extended by visad.java2d.RendererJ2D
          extended by visad.java2d.DirectManipulationRendererJ2D
              extended by visad.bom.PickManipulationRendererJ2D
All Implemented Interfaces:
Cloneable

public class PickManipulationRendererJ2D
extends DirectManipulationRendererJ2D

PickManipulationRendererJ2D is the VisAD class for picking data in 2D.


Field Summary
 
Fields inherited from class visad.DataRenderer
enabled, pickCrawlToCursor
 
Constructor Summary
PickManipulationRendererJ2D()
          Default constructor
PickManipulationRendererJ2D(int mmm, int mmv)
          Construct a new PickManipulationRenderer using the mouseModifiers supplied.
 
Method Summary
 void addPoint(float[] x)
          Add a point.
 float checkClose(double[] origin, double[] direction)
          Check if ray intersects sub-manifold.
 void checkDirect()
          Check if direct manipulation is possible.
 void drag_direct(VisADRay ray, boolean first, int mouseModifiers)
          Actual workhorse method of manipulation renderer.
 int getCloseIndex()
          Return the index of the closes point.
 CoordinateSystem getDisplayCoordinateSystem()
          Get the CoordinateSystem for the display side.
 String getWhyNotDirect()
          If direct manipulation is not possible, get the error message explaining why.
static void main(String[] args)
          test PickManipulationRendererJ2D
 void setSpatialValues(float[][] spatial_values)
          Set spatialValues from ShadowType.doTransform
 
Methods inherited from class visad.java2d.DirectManipulationRendererJ2D
clone, doTransform, getExtraBranch, isLegalTextureMap, setLinks
 
Methods inherited from class visad.java2d.RendererJ2D
clearBranch, clearScene, doAction, makeShadowFunctionType, makeShadowRealTupleType, makeShadowRealType, makeShadowSetType, makeShadowTextType, makeShadowTupleType, toggle
 
Methods inherited from class visad.DataRenderer
addException, checkAction, clearAVControls, clearExceptions, computeRanges, constrainDragPoint, earthToSpatial, earthToSpatial, findRayManifoldIntersection, get_all_feasible, get_any_changed, get_any_transform_control, getBadScale, getDisplay, getDisplayRenderer, getEarthDimension, getEarthUnits, getEnabled, getExceptionVector, getIsDirectManipulation, getLastMouseModifiers, getLatLonIndices, getLatLonRange, getLink, getLinks, getPickCrawlToCursor, getRanges, getRealVectorTypes, isTransformControl, prepareAction, realCheckDirect, release_direct, removeLink, set_all_feasible, setDisplay, setDisplayRenderer, setEarthSpatialData, setEarthSpatialDisplay, setIsDirectManipulation, setLastMouseModifiers, setLatLonIndices, setLinks, setPickCrawlToCursor, spatialToEarth, spatialToEarth, stop_direct, suppressExceptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PickManipulationRendererJ2D

public PickManipulationRendererJ2D()
Default constructor


PickManipulationRendererJ2D

public PickManipulationRendererJ2D(int mmm,
                                   int mmv)
Construct a new PickManipulationRenderer using the mouseModifiers supplied. mmm and mmv determine whehter SHIFT or CTRL keys are required - This is needed since this is a greedy DirectManipulationRenderer that will grab any right mouse click (that intersects its 2-D sub-manifold).

Parameters:
mmm - mouse modifiers mask.
mmv - mouse modifiers value.
Method Detail

checkDirect

public void checkDirect()
                 throws VisADException,
                        RemoteException
Check if direct manipulation is possible.

Overrides:
checkDirect in class DirectManipulationRendererJ2D
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

getWhyNotDirect

public String getWhyNotDirect()
If direct manipulation is not possible, get the error message explaining why.

Overrides:
getWhyNotDirect in class DataRenderer
Returns:
error message. Will be null if no errors.

addPoint

public void addPoint(float[] x)
              throws VisADException
Add a point. a no-op at this point.

Overrides:
addPoint in class DirectManipulationRendererJ2D
Parameters:
x - point value.
Throws:
VisADException - a VisAD error occurred

getDisplayCoordinateSystem

public CoordinateSystem getDisplayCoordinateSystem()
Get the CoordinateSystem for the display side.

Overrides:
getDisplayCoordinateSystem in class DataRenderer
Returns:
null for this DataRenderer

setSpatialValues

public void setSpatialValues(float[][] spatial_values)
Set spatialValues from ShadowType.doTransform

Overrides:
setSpatialValues in class DataRenderer
Parameters:
spatial_values - X, Y, Z values

checkClose

public float checkClose(double[] origin,
                        double[] direction)
Check if ray intersects sub-manifold.

Overrides:
checkClose in class DataRenderer
Parameters:
origin - x,y,z values of the ray
direction - x,y,z values of the ray?
Returns:
distance from the spatial values.

getCloseIndex

public int getCloseIndex()
Return the index of the closes point.

Returns:
index of closest point

drag_direct

public void drag_direct(VisADRay ray,
                        boolean first,
                        int mouseModifiers)
Actual workhorse method of manipulation renderer. It's what gets called when the click is done.

Overrides:
drag_direct in class DataRenderer
Parameters:
ray - ray of point where click is.
first - if this is the first time.
mouseModifiers - modifiers used with the mouse.

main

public static void main(String[] args)
                 throws VisADException,
                        RemoteException
test PickManipulationRendererJ2D

Throws:
VisADException
RemoteException