visad.bom
Class CurveManipulationRendererJ2D

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

public class CurveManipulationRendererJ2D
extends DirectManipulationRendererJ2D

CurveManipulationRendererJ2D is the VisAD class for direct manipulation rendering of curves under Java2D, where curves are represented by UnionSets of Gridded2DSets with manifold dimension = 2


Field Summary
 
Fields inherited from class visad.DataRenderer
enabled, pickCrawlToCursor
 
Constructor Summary
CurveManipulationRendererJ2D()
          Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to (XAxis, YAxis);
CurveManipulationRendererJ2D(int mmm, int mmv)
          Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to (XAxis, YAxis).
CurveManipulationRendererJ2D(int mmm, int mmv, boolean oo)
          Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to (XAxis, YAxis).
 
Method Summary
 void addPoint(float[] x)
          Add a point to the data.
 float checkClose(double[] origin, double[] direction)
          Find minimum distance from ray to spatialValues
 void checkDirect()
          Check whether direct manipulation is possible for this Renderer.
 Object clone()
          Clone this renderer.
 void drag_direct(VisADRay ray, boolean first, int mouseModifiers)
          This method is called when direct manipulation is occuring.
 String getWhyNotDirect()
          Get the error messages on why direct manipulation is not possible.
static void main(String[] args)
          test CurveManipulationRendererJ2D
 ShadowType makeShadowSetType(SetType type, DataDisplayLink link, ShadowType parent)
          Create a ShadowType based on the SetType
 void release_direct()
          Mouse button released, ending direct manipulation.
 void setSpatialValues(float[][] spatial_values)
          Set spatialValues from ShadowType.doTransform
 void stop_direct()
          Stop direct manipulation.
 
Methods inherited from class visad.java2d.DirectManipulationRendererJ2D
doTransform, getExtraBranch, isLegalTextureMap, setLinks
 
Methods inherited from class visad.java2d.RendererJ2D
clearBranch, clearScene, doAction, makeShadowFunctionType, makeShadowRealTupleType, makeShadowRealType, 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, getDisplayCoordinateSystem, getDisplayRenderer, getEarthDimension, getEarthUnits, getEnabled, getExceptionVector, getIsDirectManipulation, getLastMouseModifiers, getLatLonIndices, getLatLonRange, getLink, getLinks, getPickCrawlToCursor, getRanges, getRealVectorTypes, isTransformControl, prepareAction, realCheckDirect, removeLink, set_all_feasible, setDisplay, setDisplayRenderer, setEarthSpatialData, setEarthSpatialDisplay, setIsDirectManipulation, setLastMouseModifiers, setLatLonIndices, setLinks, setPickCrawlToCursor, spatialToEarth, spatialToEarth, suppressExceptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurveManipulationRendererJ2D

public CurveManipulationRendererJ2D()
Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to (XAxis, YAxis);


CurveManipulationRendererJ2D

public CurveManipulationRendererJ2D(int mmm,
                                    int mmv)
Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to (XAxis, YAxis). 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
mmv - mouse mask to check.

CurveManipulationRendererJ2D

public CurveManipulationRendererJ2D(int mmm,
                                    int mmv,
                                    boolean oo)
Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to (XAxis, YAxis). 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
mmv - mouse mask to check.
oo - if true, only one curve should exist at any one time.
Method Detail

makeShadowSetType

public ShadowType makeShadowSetType(SetType type,
                                    DataDisplayLink link,
                                    ShadowType parent)
                             throws VisADException,
                                    RemoteException
Create a ShadowType based on the SetType

Overrides:
makeShadowSetType in class RendererJ2D
Parameters:
type - SetType of UnionSet.
link - DataDisplayLink for DataReference
parent - Parent ShadowType
Returns:
constructed ShadowType
Throws:
VisADException - problem creating a VisAD object
RemoteException - problem creating a remote object

checkDirect

public void checkDirect()
                 throws VisADException,
                        RemoteException
Check whether direct manipulation is possible for this Renderer. Set appropriate error conditions if not possible.

Overrides:
checkDirect in class DirectManipulationRendererJ2D
Throws:
VisADException - problem accessing information
RemoteException - problem accessing information for remote objects

getWhyNotDirect

public String getWhyNotDirect()
Get the error messages on why direct manipulation is not possible.

Overrides:
getWhyNotDirect in class DataRenderer
Returns:
error messages.

addPoint

public void addPoint(float[] x)
              throws VisADException
Add a point to the data. Not used, but may be needed for performance.

Overrides:
addPoint in class DirectManipulationRendererJ2D
Parameters:
x - point to add.
Throws:
VisADException - error occured.

setSpatialValues

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

Overrides:
setSpatialValues in class DataRenderer
Parameters:
spatial_values - spatial values.

checkClose

public float checkClose(double[] origin,
                        double[] direction)
Find minimum distance from ray to spatialValues

Overrides:
checkClose in class DataRenderer
Parameters:
origin - origin of ray
direction - direction of the ray
Returns:
miniumum distance from ray to spatial values

release_direct

public void release_direct()
Mouse button released, ending direct manipulation. Does nothing now, may need to do this for performance.

Overrides:
release_direct in class DataRenderer

stop_direct

public void stop_direct()
Stop direct manipulation.

Overrides:
stop_direct in class DataRenderer

drag_direct

public void drag_direct(VisADRay ray,
                        boolean first,
                        int mouseModifiers)
This method is called when direct manipulation is occuring. This adds points to the Gridded2DSet that comprises the current line being drawn.

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

clone

public Object clone()
Clone this renderer.

Overrides:
clone in class DirectManipulationRendererJ2D
Returns:
new Renderer with same parameters.

main

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

Throws:
VisADException
RemoteException