java.lang.Object
java.awt.event.KeyAdapter
jpicedt.graphic.toolkit.MouseTool
jpicedt.graphic.toolkit.ScaleTool
- All Implemented Interfaces:
- java.util.EventListener, java.awt.event.KeyListener, jpicedt.graphic.event.PEMouseInputListener
- public class ScaleTool
- extends MouseTool
A MouseTool used to scale a target Element using a source and a destination vector.
Sequence of mouse operations :
- mousePressed -> set first corner of source rectangle
- mouseDragged -> drag second corner source rectangle
- mouseReleased -> switch to destination rectangle
- mouseMoved -> set second corner of destination rectangle, and rescale target element accordingly
- mousePressed -> complete operation, then reset.
- Since:
- jPicEdt 1.3.2
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
kit
private EditorKit kit
vecSrc
private java.awt.geom.Line2D.Double vecSrc
vecDst
private java.awt.geom.Line2D.Double vecDst
ptOrg
private jpicedt.graphic.PicPoint ptOrg
cursorFactory
private CursorFactory cursorFactory
target
private jpicedt.graphic.model.Element target
lastDragPoint
private jpicedt.graphic.PicPoint lastDragPoint
currentTask
private int currentTask
SET_SRC_RECT
private static final int SET_SRC_RECT
- See Also:
- Constant Field Values
SET_DST_RECT
private static final int SET_DST_RECT
- See Also:
- Constant Field Values
COMPLETED
private static final int COMPLETED
- See Also:
- Constant Field Values
ScaleTool
public ScaleTool(EditorKit kit,
jpicedt.graphic.model.Element target)
mousePressed
public void mousePressed(jpicedt.graphic.event.PEMouseEvent e)
- set the source rect, then the destination rect
- Specified by:
mousePressed
in interface jpicedt.graphic.event.PEMouseInputListener
- Overrides:
mousePressed
in class MouseTool
mouseReleased
public void mouseReleased(jpicedt.graphic.event.PEMouseEvent e)
- Description copied from class:
MouseTool
- does nothing
- Specified by:
mouseReleased
in interface jpicedt.graphic.event.PEMouseInputListener
- Overrides:
mouseReleased
in class MouseTool
mouseMoved
public void mouseMoved(jpicedt.graphic.event.PEMouseEvent e)
- Description copied from class:
MouseTool
- does nothing
- Specified by:
mouseMoved
in interface jpicedt.graphic.event.PEMouseInputListener
- Overrides:
mouseMoved
in class MouseTool
mouseDragged
public void mouseDragged(jpicedt.graphic.event.PEMouseEvent e)
- Description copied from class:
MouseTool
- does nothing
- Specified by:
mouseDragged
in interface jpicedt.graphic.event.PEMouseInputListener
- Overrides:
mouseDragged
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(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D allocation,
double scale)
- Allow the tool to paint shapes that are specific to this tool.
- Overrides:
paint
in class MouseTool