Documentation of 'visad.java2d.MouseBehaviorJ2D' Java class
MouseBehaviorJ2D
visad.java2d

Class MouseBehaviorJ2D

  • All Implemented Interfaces:
    MouseBehavior


    public class MouseBehaviorJ2D
    extends java.lang.Object
    implements MouseBehavior
    MouseBehaviorJ2D is the VisAD class for mouse behaviors for Java2D
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      VisADRay cursorRay(double[] cursor)
      Return the VisAD ray corresponding to the VisAD cursor coordinates.
      VisADRay findRay(int screen_x, int screen_y)
      Return the VisAD ray corresponding to the component coordinates.
      MouseHelper getMouseHelper()
      Get the helper class used by this MouseBehavior.
      int[] getScreenCoords(double[] position)
      Return the screen coordinates corresponding to the VisAD coordinates.
      void instance_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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 use
        mhClass - MouseHelper subclass to use
    • Method Detail

      • getMouseHelper

        public MouseHelper getMouseHelper()
        Get the helper class used by this MouseBehavior. The MouseHelper defines the actions taken based on MouseEvents.
        Specified by:
        getMouseHelper in interface MouseBehavior
        Returns:
        MouseHelper being used.
      • findRay

        public VisADRay findRay(int screen_x,
                                int screen_y)
        Return the VisAD ray corresponding to the component coordinates.
        Specified by:
        findRay in interface MouseBehavior
        Parameters:
        screen_x - x coordinate of the component
        screen_y - y coordinate of the component
        Returns:
        corresponding VisADRay
        See Also:
        VisADRay, LocalDisplay.getComponent()
      • getScreenCoords

        public int[] getScreenCoords(double[] position)
        Return the screen coordinates corresponding to the VisAD coordinates.
        Specified by:
        getScreenCoords in interface MouseBehavior
        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_translate in interface MouseBehavior
        Parameters:
        transx - x translation amount
        transy - y translation amount
        transz - 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_translate in interface MouseBehavior
        Parameters:
        transx - x translation amount
        transy - 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_matrix in interface MouseBehavior
        Parameters:
        a - first matrix
        b - 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_matrix in interface MouseBehavior
        Parameters:
        rotx - x rotation
        roty - y rotation
        rotz - z rotation
        scale - scaling factor
        transx - x translation
        transy - y translation
        transz - 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_matrix in interface MouseBehavior
        Parameters:
        rotx - x rotation
        roty - y rotation
        rotz - z rotation
        scalex - x scaling factor
        scaley - y scaling factor
        scalez - z scaling factor
        transx - x translation
        transy - y translation
        transz - 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_matrix in interface MouseBehavior
        Parameters:
        rot - array to hold x,y,z rotation values
        scale - array to hold scale value
        trans - array to hold x,y,z translation values

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.