Class AbstractRotateInteractor

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

    public class AbstractRotateInteractor
    extends InteractorAdapter
    This class represents a rotate interactor. To use it, just redefine the InteractorAdapter.startInteraction(java.awt.event.InputEvent) method.
    Version:
    $Id: AbstractRotateInteractor.java 1808975 2017-09-20 08:59:36Z ssteiner $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean finished
      Whether the interactor has finished.
      protected double initialRotation
      The initial rotation angle.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean endInteraction()
      Tells whether the interactor has finished.
      void mouseDragged​(java.awt.event.MouseEvent e)
      Invoked when a mouse button is pressed on a component and then dragged.
      void mouseExited​(java.awt.event.MouseEvent e)
      Invoked when the mouse exits a component.
      void mousePressed​(java.awt.event.MouseEvent e)
      Invoked when a mouse button has been pressed on a component.
      void mouseReleased​(java.awt.event.MouseEvent e)
      Invoked when a mouse button has been released on a component.
      protected java.awt.geom.AffineTransform rotateTransform​(java.awt.Dimension d, int x, int y)
      Returns the rotate transform.
      • Methods inherited from class java.lang.Object

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

      • finished

        protected boolean finished
        Whether the interactor has finished.
      • initialRotation

        protected double initialRotation
        The initial rotation angle.
    • Constructor Detail

      • AbstractRotateInteractor

        public AbstractRotateInteractor()
    • Method Detail

      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Invoked when a mouse button has been pressed on a component.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class InteractorAdapter
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Invoked when a mouse button has been released on a component.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class InteractorAdapter
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent e)
        Invoked when the mouse exits a component.
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        Overrides:
        mouseExited in class InteractorAdapter
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class InteractorAdapter
      • rotateTransform

        protected java.awt.geom.AffineTransform rotateTransform​(java.awt.Dimension d,
                                                                int x,
                                                                int y)
        Returns the rotate transform.