Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpicedt.graphic.toolkit
Class ScaleTool  view ScaleTool download ScaleTool.java

java.lang.Object
  extended byjava.awt.event.KeyAdapter
      extended byjpicedt.graphic.toolkit.MouseTool
          extended byjpicedt.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 :

Since:
jPicEdt 1.3.2

Field Summary
private static int COMPLETED
           
private  int currentTask
           
private  CursorFactory cursorFactory
           
private  EditorKit kit
           
private  jpicedt.graphic.PicPoint lastDragPoint
           
private  jpicedt.graphic.PicPoint ptOrg
           
private static int SET_DST_RECT
           
private static int SET_SRC_RECT
           
private  jpicedt.graphic.model.Element target
           
private  java.awt.geom.Line2D.Double vecDst
           
private  java.awt.geom.Line2D.Double vecSrc
           
 
Fields inherited from class jpicedt.graphic.toolkit.MouseTool
mouseOutside
 
Constructor Summary
ScaleTool(EditorKit kit, jpicedt.graphic.model.Element target)
           
 
Method Summary
 void flush()
          Called when this tool is being replaced by another tool in the hosting kit
 void mouseDragged(jpicedt.graphic.event.PEMouseEvent e)
          does nothing
 void mouseMoved(jpicedt.graphic.event.PEMouseEvent e)
          does nothing
 void mousePressed(jpicedt.graphic.event.PEMouseEvent e)
          set the source rect, then the destination rect
 void mouseReleased(jpicedt.graphic.event.PEMouseEvent e)
          does nothing
 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.
 
Methods inherited from class jpicedt.graphic.toolkit.MouseTool
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.awt.event.KeyAdapter
keyPressed, keyReleased, keyTyped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ScaleTool

public ScaleTool(EditorKit kit,
                 jpicedt.graphic.model.Element target)
Method Detail

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