Package kiyut.sketsa.canvas.tool
Class DropperTool
- java.lang.Object
-
- kiyut.sketsa.canvas.tool.AbstractTool
-
- kiyut.sketsa.canvas.tool.DropperTool
-
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,EventListener,MouseInputListener,Tool
public class DropperTool extends AbstractTool
Implementation of Dropper Tool aka Color Picker- Author:
- Kiyut
-
-
Field Summary
Fields Modifier and Type Field Description protected VectorCanvascanvasprotected Colorcolorstatic StringCOLOR_PROPERTYprotected Cursorcursorprotected EventListenerListlistenerListprotected GeneralPathpath
-
Constructor Summary
Constructors Constructor Description DropperTool()Creates a new instance of LassoTool
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)voidendTool()Invoked when the tool is endedprotected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)ColorgetColor()Return the Dropper acquiredColorvoidmouseReleased(MouseEvent evt)voidremovePropertyChangeListener(PropertyChangeListener listener)voidsetVectorCanvas(VectorCanvas canvas)set the canvas for the toolvoidstartTool()Invoked when the tool is started-
Methods inherited from class kiyut.sketsa.canvas.tool.AbstractTool
addMessageListener, fireMessageReceived, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, paint, removeMessageListener
-
-
-
-
Field Detail
-
COLOR_PROPERTY
public static final String COLOR_PROPERTY
- See Also:
- Constant Field Values
-
canvas
protected VectorCanvas canvas
-
path
protected GeneralPath path
-
cursor
protected Cursor cursor
-
color
protected Color color
-
listenerList
protected EventListenerList listenerList
-
-
Method Detail
-
setVectorCanvas
public void setVectorCanvas(VectorCanvas canvas)
Description copied from interface:Toolset the canvas for the tool- Specified by:
setVectorCanvasin interfaceTool- Overrides:
setVectorCanvasin classAbstractTool- Parameters:
canvas- VectorCanvas
-
startTool
public void startTool()
Description copied from interface:ToolInvoked when the tool is started- Specified by:
startToolin interfaceTool- Overrides:
startToolin classAbstractTool
-
endTool
public void endTool()
Description copied from interface:ToolInvoked when the tool is ended- Specified by:
endToolin interfaceTool- Overrides:
endToolin classAbstractTool
-
getColor
public Color getColor()
Return the Dropper acquiredColor- Returns:
Coloror null
-
mouseReleased
public void mouseReleased(MouseEvent evt)
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classAbstractTool
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
-
-