kiyut.citra 3.7

kiyut.citra.canvas.tool
Class SelectionResizeTool

java.lang.Object
  extended by kiyut.citra.canvas.tool.AbstractTool
      extended by kiyut.citra.canvas.tool.AbstractSelectionTool
          extended by kiyut.citra.canvas.tool.SelectionResizeTool
All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, EventListener, MouseInputListener, FXTool

public class SelectionResizeTool
extends AbstractSelectionTool

Implementation of Resize Selection Tool

Author:
Kiyut

Field Summary
protected  AffineTransform canvasAt
           
protected  boolean constraint
           
protected  int direction
           
protected  Shape resizedShape
           
protected  Shape shape
           
 
Fields inherited from class kiyut.citra.canvas.tool.AbstractSelectionTool
cursor, prevCursor
 
Fields inherited from class kiyut.citra.canvas.tool.AbstractTool
canvas, enabled, listenerList
 
Constructor Summary
SelectionResizeTool()
          Creates a new instance of SelectionRectangleTool
 
Method Summary
protected  AffineTransform createTransform()
          Return resize transform
 void endTool()
           Overidden to unregister input listener.
protected  int hitTest(int pX, int pY)
          Determine direction.
 void mouseDragged(MouseEvent evt)
           
 void mouseMoved(MouseEvent evt)
           
 void mousePressed(MouseEvent evt)
           
 void mouseReleased(MouseEvent evt)
           
 void paint(Graphics2D g2d)
          this methods do nothing
 void reset()
           
 void startTool(FXCanvas canvas)
           Overidden to register input listener.
 
Methods inherited from class kiyut.citra.canvas.tool.AbstractTool
addToolListener, fireStateChanged, isEnabled, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, registerInputListener, removeToolListener, setEnabled, unregisterInputListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected Shape shape

resizedShape

protected Shape resizedShape

direction

protected int direction

canvasAt

protected AffineTransform canvasAt

constraint

protected boolean constraint
Constructor Detail

SelectionResizeTool

public SelectionResizeTool()
Creates a new instance of SelectionRectangleTool

Method Detail

paint

public void paint(Graphics2D g2d)
Description copied from class: AbstractTool
this methods do nothing

Specified by:
paint in interface FXTool
Overrides:
paint in class AbstractTool
Parameters:
g2d - Graphics2D

startTool

public void startTool(FXCanvas canvas)
Description copied from class: AbstractSelectionTool
Overidden to register input listener. Inherited tool please do not forget to call super Overriden to set cursor

Specified by:
startTool in interface FXTool
Overrides:
startTool in class AbstractSelectionTool

endTool

public void endTool()
Description copied from class: AbstractSelectionTool
Overidden to unregister input listener. Inherited tool please do not forget to call super Overriden to unset cursor

Specified by:
endTool in interface FXTool
Overrides:
endTool in class AbstractSelectionTool

reset

public void reset()

mouseMoved

public void mouseMoved(MouseEvent evt)
Specified by:
mouseMoved in interface MouseMotionListener
Overrides:
mouseMoved in class AbstractTool

mousePressed

public void mousePressed(MouseEvent evt)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class AbstractTool

mouseDragged

public void mouseDragged(MouseEvent evt)
Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class AbstractTool

mouseReleased

public void mouseReleased(MouseEvent evt)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class AbstractTool

hitTest

protected int hitTest(int pX,
                      int pY)
Determine direction. The direction is in phone keypad format.
 1 2 4
 4 5 6
 7 8 9
 
Note: there is no direction 5

Returns:
direction or -1

createTransform

protected AffineTransform createTransform()
Return resize transform

Returns:
resize transform

kiyut.citra 3.7