http://www.jpicedt.org

jpicedt.graphic.toolkit
Class RotateTool

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by jpicedt.graphic.toolkit.MouseTool
          extended by jpicedt.graphic.toolkit.RotateTool
All Implemented Interfaces:
KeyListener, EventListener, PEMouseInputListener

public class RotateTool
extends MouseTool

A MouseTool used to rotate a target Element using a origin point and a mobile point used to compute the rotation angle.

Sequence of mouse operations:

Since:
jPicEdt 1.4
Version:
$Id: RotateTool.java,v 1.15 2013/03/27 06:56:31 vincentb1 Exp $
Author:
Sylvain Reynal

Nested Class Summary
 
Nested classes/interfaces inherited from class jpicedt.graphic.toolkit.MouseTool
MouseTool.MouseToolType
 
Field Summary
 
Fields inherited from class jpicedt.graphic.toolkit.MouseTool
lastMouseEvent, mouseOutside
 
Constructor Summary
RotateTool(EditorKit kit, Element target)
           
 
Method Summary
 void flush()
          Called when this tool is being replaced by another tool in the hosting kit
 void init()
          initialisation process
 void mouseDragged(PEMouseEvent e)
          this default implementation simply stores the given mouse-event in lastMouseEvent field
 void mouseMoved(PEMouseEvent e)
          this default implementation simply stores the given mouse-event in lastMouseEvent field
 void mousePressed(PEMouseEvent e)
          set the source rect, then the destination rect
 void mouseReleased(PEMouseEvent e)
          this default implementation simply stores the given mouse-event in lastMouseEvent field
 void paint(Graphics2D g, Rectangle2D allocation, double scale)
          Allow the tool to paint shapes that are specific to this tool.
 void rotateTarget(double angle, PECanvas canvas)
          Rotation à partir du GridZoomToolBar.
 void setRotationCenter(PicPoint pt)
          Définit le centre de rotation.
 
Methods inherited from class jpicedt.graphic.toolkit.MouseTool
getLastMouseEvent, keyPressed, keyReleased, mouseClicked, mouseEntered, mouseExited, processKeyEvent
 
Methods inherited from class java.awt.event.KeyAdapter
keyTyped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotateTool

public RotateTool(EditorKit kit,
                  Element target)
Parameters:
kit - the EditorKit this mouse-tool is to registered with.
Method Detail

setRotationCenter

public void setRotationCenter(PicPoint pt)
Définit le centre de rotation.

Parameters:
pt - le PicPoint centre de rotation.

mousePressed

public void mousePressed(PEMouseEvent e)
set the source rect, then the destination rect

Specified by:
mousePressed in interface PEMouseInputListener
Overrides:
mousePressed in class MouseTool

mouseDragged

public void mouseDragged(PEMouseEvent e)
Description copied from class: MouseTool
this default implementation simply stores the given mouse-event in lastMouseEvent field

Specified by:
mouseDragged in interface PEMouseInputListener
Overrides:
mouseDragged in class MouseTool

mouseReleased

public void mouseReleased(PEMouseEvent e)
Description copied from class: MouseTool
this default implementation simply stores the given mouse-event in lastMouseEvent field

Specified by:
mouseReleased in interface PEMouseInputListener
Overrides:
mouseReleased in class MouseTool

mouseMoved

public void mouseMoved(PEMouseEvent e)
Description copied from class: MouseTool
this default implementation simply stores the given mouse-event in lastMouseEvent field

Specified by:
mouseMoved in interface PEMouseInputListener
Overrides:
mouseMoved in class MouseTool

flush

public void flush()
Called when this tool is being replaced by another tool in the hosting kit

Overrides:
flush in class MouseTool

paint

public void paint(Graphics2D g,
                  Rectangle2D allocation,
                  double scale)
Allow the tool to paint shapes that are specific to this tool.

Overrides:
paint in class MouseTool

init

public void init()
initialisation process

Overrides:
init in class MouseTool

rotateTarget

public void rotateTarget(double angle,
                         PECanvas canvas)
Rotation à partir du GridZoomToolBar.

Parameters:
angle - Angle de rotation à partir de la position initiale
See Also:
PEDrawingBoard.GridZoomToolBar

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org