Class MouseRotateExt

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

    public class MouseRotateExt
    extends com.sun.j3d.utils.behaviors.mouse.MouseRotate
    MouseRotateExt extends the MouseRotate class by providing public access to certain states of the MouseBehavior that are stored as protected values with no other public accesss.

    Also overrides the mouseReleased routine so that the callback can be notified one more time of the updated transform, this time with the buttonPress flag being set to false.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback callback
      Mouse behavior callback reference.
      • Fields inherited from class com.sun.j3d.utils.behaviors.mouse.MouseBehavior

        buttonPress, currXform, enable, flags, invert, INVERT_INPUT, MANUAL_WAKEUP, mouseCriterion, mouseEvents, mouseq, reset, transformGroup, transformX, transformY, wakeUp, x, x_last, y, y_last
      • Fields inherited from class javax.media.j3d.Node

        ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
    • Constructor Summary

      Constructors 
      Constructor Description
      MouseRotateExt()
      Creates a default mouse rotate behavior.
      MouseRotateExt​(int flags)
      Creates a rotate behavior.
      MouseRotateExt​(java.awt.Component c)
      Creates a rotate behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent.
      MouseRotateExt​(java.awt.Component c, int flags)
      Creates a rotate behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent.
      MouseRotateExt​(java.awt.Component c, javax.media.j3d.TransformGroup transformGroup)
      Creates a rotate behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent.
      MouseRotateExt​(javax.media.j3d.TransformGroup transformGroup)
      Creates a rotate behavior given the transform group.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isButtonPressed()
      Return whether the button press state is set which can be used as an indication of whether or not the associated TransformGroup instance is being interactively updated.
      boolean isEnabled()
      Return indication of whether or not this behavior is enabled.
      void mouseReleased​(java.awt.event.MouseEvent e)
      Override mouse release so that we can force another update of the current transform to the callback.
      void setupCallback​(com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback callback)
      The transformChanged method in the callback class will be called every time the transform is updated.
      • Methods inherited from class com.sun.j3d.utils.behaviors.mouse.MouseRotate

        getXFactor, getYFactor, initialize, processStimulus, setFactor, setFactor, transformChanged
      • Methods inherited from class com.sun.j3d.utils.behaviors.mouse.MouseBehavior

        addListener, getTransformGroup, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseWheelMoved, processMouseEvent, setEnable, setTransformGroup, wakeup
      • Methods inherited from class javax.media.j3d.Behavior

        getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
      • Methods inherited from class javax.media.j3d.Node

        cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
      • Methods inherited from class javax.media.j3d.SceneGraphObject

        clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • callback

        protected com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback callback
        Mouse behavior callback reference.
    • Constructor Detail

      • MouseRotateExt

        public MouseRotateExt()
        Creates a default mouse rotate behavior.
      • MouseRotateExt

        public MouseRotateExt​(javax.media.j3d.TransformGroup transformGroup)
        Creates a rotate behavior given the transform group.
        Parameters:
        transformGroup - The transformGroup to operate on.
      • MouseRotateExt

        public MouseRotateExt​(int flags)
        Creates a rotate behavior. Note that this behavior still needs a transform group to work on (use setTransformGroup(tg)) and the transform group must add this behavior.
        Parameters:
        flags - interesting flags (wakeup conditions).
      • MouseRotateExt

        public MouseRotateExt​(java.awt.Component c)
        Creates a rotate behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent. The behavior is added to the specified Component. A null component can be passed to specify the behavior should use listeners. Components can then be added to the behavior with the addListener(Component c) method.
        Parameters:
        c - The Component to add the MouseListener and MouseMotionListener to.
        Since:
        Java 3D 1.2.1
      • MouseRotateExt

        public MouseRotateExt​(java.awt.Component c,
                              javax.media.j3d.TransformGroup transformGroup)
        Creates a rotate behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent. The behaviors is added to the specified Component and works on the given TransformGroup. A null component can be passed to specify the behavior should use listeners. Components can then be added to the behavior with the addListener(Component c) method.
        Parameters:
        c - The Component to add the MouseListener and MouseMotionListener to.
        transformGroup - The TransformGroup to operate on.
        Since:
        Java 3D 1.2.1
      • MouseRotateExt

        public MouseRotateExt​(java.awt.Component c,
                              int flags)
        Creates a rotate behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent. The behavior is added to the specified Component. A null component can be passed to specify the behavior should use listeners. Components can then be added to the behavior with the addListener(Component c) method. Note that this behavior still needs a transform group to work on (use setTransformGroup(tg)) and the transform group must add this behavior.
        Parameters:
        c - The Component to add the MouseListener and MouseMotionListener to.
        flags - interesting flags (wakeup conditions).
        Since:
        Java 3D 1.2.1
    • Method Detail

      • isButtonPressed

        public boolean isButtonPressed()
        Return whether the button press state is set which can be used as an indication of whether or not the associated TransformGroup instance is being interactively updated.
        Returns:
        boolean True if the button press state is true.
      • isEnabled

        public boolean isEnabled()
        Return indication of whether or not this behavior is enabled.
        Returns:
        boolean True if this behavior is enabled.
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Override mouse release so that we can force another update of the current transform to the callback.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class com.sun.j3d.utils.behaviors.mouse.MouseBehavior
        Parameters:
        e - MouseEvent
      • setupCallback

        public void setupCallback​(com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback callback)
        The transformChanged method in the callback class will be called every time the transform is updated.
        Overrides:
        setupCallback in class com.sun.j3d.utils.behaviors.mouse.MouseRotate
        Parameters:
        callback - mouse call back reference.