Package kiyut.sketsa.canvas.tool
Class DirectSelectionTool
- java.lang.Object
-
- kiyut.sketsa.canvas.tool.AbstractTool
-
- kiyut.sketsa.canvas.tool.AbstractSelectionTool
-
- kiyut.sketsa.canvas.tool.DefaultSelectionTool
-
- kiyut.sketsa.canvas.tool.DirectSelectionTool
-
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,EventListener,MouseInputListener,SelectionTool,Tool
public class DirectSelectionTool extends DefaultSelectionTool
Implementation of Direct Selection Tool- Author:
- Kiyut
-
-
Field Summary
-
Fields inherited from class kiyut.sketsa.canvas.tool.DefaultSelectionTool
bounds, canvas, newX, newY, rect, startX, startY
-
Fields inherited from class kiyut.sketsa.canvas.tool.AbstractSelectionTool
cursor, moveTool, resizeTool
-
-
Constructor Summary
Constructors Constructor Description DirectSelectionTool()Creates a new instance of DirectSelectionTool
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmouseDragged(MouseEvent evt)voidmousePressed(MouseEvent evt)voidmouseReleased(MouseEvent evt)voidpaint(Graphics2D g2d)Invoked by canvas to draw tool.voidsetVectorCanvas(VectorCanvas canvas)set the canvas for the toolvoidstartTool()Invoked when the tool is started-
Methods inherited from class kiyut.sketsa.canvas.tool.AbstractSelectionTool
getCursor, getMoveTool, getResizeTool
-
Methods inherited from class kiyut.sketsa.canvas.tool.AbstractTool
addMessageListener, endTool, fireMessageReceived, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, removeMessageListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
-
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited
-
Methods inherited from interface java.awt.event.MouseMotionListener
mouseMoved
-
Methods inherited from interface kiyut.sketsa.canvas.tool.Tool
addMessageListener, endTool, removeMessageListener
-
-
-
-
Method Detail
-
paint
public void paint(Graphics2D g2d)
Description copied from interface:ToolInvoked by canvas to draw tool.- Specified by:
paintin interfaceTool- Overrides:
paintin classDefaultSelectionTool- Parameters:
g2d- the Graphics2D context in which to paint
-
setVectorCanvas
public void setVectorCanvas(VectorCanvas canvas)
Description copied from interface:Toolset the canvas for the tool- Specified by:
setVectorCanvasin interfaceTool- Overrides:
setVectorCanvasin classDefaultSelectionTool- Parameters:
canvas- VectorCanvas
-
startTool
public void startTool()
Description copied from interface:ToolInvoked when the tool is started- Specified by:
startToolin interfaceTool- Overrides:
startToolin classDefaultSelectionTool
-
mousePressed
public void mousePressed(MouseEvent evt)
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classDefaultSelectionTool
-
mouseReleased
public void mouseReleased(MouseEvent evt)
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classDefaultSelectionTool
-
mouseDragged
public void mouseDragged(MouseEvent evt)
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classDefaultSelectionTool
-
-