http://www.jpicedt.org

jpicedt.graphic.toolkit
Class MoveTool

java.lang.Object
  extended byjava.awt.event.KeyAdapter
      extended byjpicedt.graphic.toolkit.MouseTool
          extended byjpicedt.graphic.toolkit.MoveTool
All Implemented Interfaces:
EventListener, KeyListener, PEMouseInputListener

public class MoveTool
extends MouseTool

A MouseTool used to translate a target Element by a given vector.

Since:
jPicEdt 1.3
Version:
$Id: MoveTool.java,v 1.8.2.1 2007/09/02 11:56:28 reynal Exp $
Author:
Sylvain Reynal

Field Summary
 
Fields inherited from class jpicedt.graphic.toolkit.MouseTool
lastMouseEvent, mouseOutside
 
Constructor Summary
MoveTool(EditorKit kit, Element target)
           
 
Method Summary
 void mouseDragged(PEMouseEvent e)
          set the 2nd pt of the translation vector and translate the target
 void mouseMoved(PEMouseEvent e)
          set the cursor
 void mousePressed(PEMouseEvent e)
          set the first point of the translation vector
 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.
 
Methods inherited from class jpicedt.graphic.toolkit.MouseTool
flush, getLastMouseEvent, init, 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

MoveTool

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

mousePressed

public void mousePressed(PEMouseEvent e)
set the first point of the translation vector

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

mouseDragged

public void mouseDragged(PEMouseEvent e)
set the 2nd pt of the translation vector and translate the target

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)
set the cursor

Specified by:
mouseMoved in interface PEMouseInputListener
Overrides:
mouseMoved 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

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org