Package kiyut.citra.canvas.tool
Class ShapeMoveTool
- java.lang.Object
-
- kiyut.citra.canvas.tool.AbstractTool
-
- kiyut.citra.canvas.tool.ShapeMoveTool
-
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,EventListener,MouseInputListener,FXTool
public class ShapeMoveTool extends AbstractTool
Implementation of Shape Move Interactor Tool- Author:
- Kiyut
-
-
Field Summary
Fields Modifier and Type Field Description protected CursorcursorCursorprotected ShapemovedShapeprotected booleanmovingprotected CursorprevCursorPrevious Cursorprotected Shapeshapeprotected intstartXprotected intstartYprotected Strokestrokeprotected inttxprotected intty-
Fields inherited from class kiyut.citra.canvas.tool.AbstractTool
canvas, enabled, listenerList
-
-
Constructor Summary
Constructors Constructor Description ShapeMoveTool()Creates a new instance of ShapeMoveTool
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendTool()Overidden to unregister input listener.ShapegetShape()voidmouseDragged(MouseEvent evt)voidmouseMoved(MouseEvent evt)voidmousePressed(MouseEvent evt)voidmouseReleased(MouseEvent evt)voidpaint(Graphics2D g2d)this methods do nothingprotected voidreset()reset all the variablevoidsetShape(Shape shape)-
Methods inherited from class kiyut.citra.canvas.tool.AbstractTool
addToolListener, fireStateChanged, isEnabled, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, registerInputListener, removeToolListener, setEnabled, startTool, unregisterInputListener
-
-
-
-
Field Detail
-
cursor
protected Cursor cursor
Cursor
-
prevCursor
protected Cursor prevCursor
Previous Cursor
-
moving
protected boolean moving
-
startX
protected int startX
-
startY
protected int startY
-
tx
protected int tx
-
ty
protected int ty
-
shape
protected Shape shape
-
movedShape
protected Shape movedShape
-
stroke
protected Stroke stroke
-
-
Method Detail
-
endTool
public void endTool()
Overidden to unregister input listener. Inherited tool please do not forget to call super Overidden to unsetting cursor- Specified by:
endToolin interfaceFXTool- Overrides:
endToolin classAbstractTool
-
reset
protected void reset()
reset all the variable
-
setShape
public void setShape(Shape shape)
-
getShape
public Shape getShape()
-
paint
public void paint(Graphics2D g2d)
Description copied from class:AbstractToolthis methods do nothing- Specified by:
paintin interfaceFXTool- Overrides:
paintin classAbstractTool- Parameters:
g2d- Graphics2D
-
mouseMoved
public void mouseMoved(MouseEvent evt)
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classAbstractTool
-
mousePressed
public void mousePressed(MouseEvent evt)
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classAbstractTool
-
mouseDragged
public void mouseDragged(MouseEvent evt)
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classAbstractTool
-
mouseReleased
public void mouseReleased(MouseEvent evt)
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classAbstractTool
-
-