Package jpicedt.graphic.toolkit
Class ScaleTool
- java.lang.Object
-
- java.awt.event.KeyAdapter
-
- jpicedt.graphic.toolkit.MouseTool
-
- jpicedt.graphic.toolkit.ScaleTool
-
- All Implemented Interfaces:
java.awt.event.KeyListener,java.util.EventListener,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
- Version:
- $Id: ScaleTool.java,v 1.7.2.1 2007/09/02 11:56:29 reynal Exp $
- Author:
- Sylvain Reynal
-
-
Field Summary
-
Fields inherited from class jpicedt.graphic.toolkit.MouseTool
lastMouseEvent, mouseOutside
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()Called when this tool is being replaced by another tool in the hosting kitvoidmouseDragged(PEMouseEvent e)this default implementation simply stores the given mouse-event in lastMouseEvent fieldvoidmouseMoved(PEMouseEvent e)this default implementation simply stores the given mouse-event in lastMouseEvent fieldvoidmousePressed(PEMouseEvent e)set the source rect, then the destination rectvoidmouseReleased(PEMouseEvent e)this default implementation simply stores the given mouse-event in lastMouseEvent fieldvoidpaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)Allow the tool to paint shapes that are specific to this tool.-
Methods inherited from class jpicedt.graphic.toolkit.MouseTool
getLastMouseEvent, init, keyPressed, keyReleased, mouseClicked, mouseEntered, mouseExited, processKeyEvent
-
-
-
-
Method Detail
-
mousePressed
public void mousePressed(PEMouseEvent e)
set the source rect, then the destination rect- Specified by:
mousePressedin interfacePEMouseInputListener- Overrides:
mousePressedin classMouseTool
-
mouseReleased
public void mouseReleased(PEMouseEvent e)
Description copied from class:MouseToolthis default implementation simply stores the given mouse-event in lastMouseEvent field- Specified by:
mouseReleasedin interfacePEMouseInputListener- Overrides:
mouseReleasedin classMouseTool
-
mouseMoved
public void mouseMoved(PEMouseEvent e)
Description copied from class:MouseToolthis default implementation simply stores the given mouse-event in lastMouseEvent field- Specified by:
mouseMovedin interfacePEMouseInputListener- Overrides:
mouseMovedin classMouseTool
-
mouseDragged
public void mouseDragged(PEMouseEvent e)
Description copied from class:MouseToolthis default implementation simply stores the given mouse-event in lastMouseEvent field- Specified by:
mouseDraggedin interfacePEMouseInputListener- Overrides:
mouseDraggedin classMouseTool
-
flush
public void flush()
Called when this tool is being replaced by another tool in the hosting kit
-
-