visad.java2d
Class MouseBehaviorJ2D
- java.lang.Object
-
- visad.java2d.MouseBehaviorJ2D
-
- All Implemented Interfaces:
- MouseBehavior
public class MouseBehaviorJ2D extends java.lang.Object implements MouseBehavior
MouseBehaviorJ2D is the VisAD class for mouse behaviors for Java2D
-
-
Constructor Summary
Constructors Constructor and Description MouseBehaviorJ2D(DisplayRendererJ2D r)Construct a MouseBehavior for the DisplayRenderer specifiedMouseBehaviorJ2D(DisplayRendererJ2D r, java.lang.Class mhClass)Construct a MouseBehavior for the DisplayRenderer specified
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description VisADRaycursorRay(double[] cursor)Return the VisAD ray corresponding to the VisAD cursor coordinates.VisADRayfindRay(int screen_x, int screen_y)Return the VisAD ray corresponding to the component coordinates.MouseHelpergetMouseHelper()Get the helper class used by this MouseBehavior.int[]getScreenCoords(double[] position)Return the screen coordinates corresponding to the VisAD coordinates.voidinstance_unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)Get the rotation, scale and translation parameters for the specified matrix.double[]make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation.double[]make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation.double[]make_translate(double transx, double transy)Create a translation matrix.double[]make_translate(double transx, double transy, double transz)Create a translation matrix.double[]multiply_matrix(double[] a, double[] b)Multiply the two matrices together.
-
-
-
Constructor Detail
-
MouseBehaviorJ2D
public MouseBehaviorJ2D(DisplayRendererJ2D r)
Construct a MouseBehavior for the DisplayRenderer specified- Parameters:
r- DisplayRenderer to use
-
MouseBehaviorJ2D
public MouseBehaviorJ2D(DisplayRendererJ2D r, java.lang.Class mhClass)
Construct a MouseBehavior for the DisplayRenderer specified- Parameters:
r- DisplayRenderer to usemhClass- MouseHelper subclass to use
-
-
Method Detail
-
getMouseHelper
public MouseHelper getMouseHelper()
Get the helper class used by this MouseBehavior. TheMouseHelperdefines the actions taken based onMouseEvents.- Specified by:
getMouseHelperin interfaceMouseBehavior- Returns:
MouseHelperbeing used.
-
findRay
public VisADRay findRay(int screen_x, int screen_y)
Return the VisAD ray corresponding to the component coordinates.- Specified by:
findRayin interfaceMouseBehavior- Parameters:
screen_x- x coordinate of the componentscreen_y- y coordinate of the component- Returns:
- corresponding VisADRay
- See Also:
VisADRay,LocalDisplay.getComponent()
-
cursorRay
public VisADRay cursorRay(double[] cursor)
Return the VisAD ray corresponding to the VisAD cursor coordinates.- Specified by:
cursorRayin interfaceMouseBehavior- Parameters:
cursor- array (x,y) of cursor location- Returns:
- corresponding VisADRay
- See Also:
VisADRay,DisplayRenderer.getCursor()
-
getScreenCoords
public int[] getScreenCoords(double[] position)
Return the screen coordinates corresponding to the VisAD coordinates.- Specified by:
getScreenCoordsin interfaceMouseBehavior- Parameters:
position- array of VisAD coordinates- Returns:
- corresponding (x, y) screen coordinates
-
make_translate
public double[] make_translate(double transx, double transy, double transz)Create a translation matrix.- Specified by:
make_translatein interfaceMouseBehavior- Parameters:
transx- x translation amounttransy- y translation amounttransz- z translation amount- Returns:
- new translation matrix. This can be used to translate the current matrix
- See Also:
multiply_matrix(double[] a, double[] b)
-
make_translate
public double[] make_translate(double transx, double transy)Create a translation matrix.- Specified by:
make_translatein interfaceMouseBehavior- Parameters:
transx- x translation amounttransy- y translation amount- Returns:
- new translation matrix. This can be used to translate the current matrix
- See Also:
multiply_matrix(double[] a, double[] b)
-
multiply_matrix
public double[] multiply_matrix(double[] a, double[] b)Multiply the two matrices together.- Specified by:
multiply_matrixin interfaceMouseBehavior- Parameters:
a- first matrixb- second matrix- Returns:
- new resulting matrix
-
make_matrix
public double[] make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation. This function uses the fast matrix post-concatenation techniques from Graphics Gems.- Specified by:
make_matrixin interfaceMouseBehavior- Parameters:
rotx- x rotationroty- y rotationrotz- z rotationscale- scaling factortransx- x translationtransy- y translationtransz- z translation- Returns:
- new matrix
-
make_matrix
public double[] make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation. This function uses the fast matrix post-concatenation techniques from Graphics Gems.- Specified by:
make_matrixin interfaceMouseBehavior- Parameters:
rotx- x rotationroty- y rotationrotz- z rotationscalex- x scaling factorscaley- y scaling factorscalez- z scaling factortransx- x translationtransy- y translationtransz- z translation- Returns:
- new matrix
-
instance_unmake_matrix
public void instance_unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)Get the rotation, scale and translation parameters for the specified matrix. Results are not valid for non-uniform aspect (scale).- Specified by:
instance_unmake_matrixin interfaceMouseBehavior- Parameters:
rot- array to hold x,y,z rotation valuesscale- array to hold scale valuetrans- array to hold x,y,z translation values
-
-
DMelt 3.0 © DataMelt by jWork.ORG