CH.ifa.draw.standard
Class AbstractTool
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractTool
-
- All Implemented Interfaces:
- Tool
- Direct Known Subclasses:
- ActionTool, ConnectionTool, CreationTool, DragTracker, HandleTracker, PolygonTool, ScribbleTool, SelectAreaTracker, SelectionTool, URLTool
public class AbstractTool extends java.lang.Object implements Tool
Default implementation support for Tools.- See Also:
DrawingView,Tool
-
-
Constructor Summary
Constructors Constructor and Description AbstractTool(DrawingView itsView)Constructs a tool for the given view.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactivate()Activates the tool for the given view.voiddeactivate()Deactivates the tool.Drawingdrawing()Gets the tool's drawing.DrawingEditoreditor()Gets the tool's editor.voidkeyDown(java.awt.event.KeyEvent evt, int key)Handles key down events in the drawing view.voidmouseDown(java.awt.event.MouseEvent e, int x, int y)Handles mouse down events in the drawing view.voidmouseDrag(java.awt.event.MouseEvent e, int x, int y)Handles mouse drag events in the drawing view.voidmouseMove(java.awt.event.MouseEvent evt, int x, int y)Handles mouse moves (if the mouse button is up).voidmouseUp(java.awt.event.MouseEvent e, int x, int y)Handles mouse up in the drawing view.DrawingViewview()Gets the tool's view.
-
-
-
Constructor Detail
-
AbstractTool
public AbstractTool(DrawingView itsView)
Constructs a tool for the given view.
-
-
Method Detail
-
activate
public void activate()
Activates the tool for the given view. This method is called whenever the user switches to this tool. Use this method to reinitialize a tool.
-
deactivate
public void deactivate()
Deactivates the tool. This method is called whenever the user switches to another tool. Use this method to do some clean-up when the tool is switched. Subclassers should always call super.deactivate.- Specified by:
deactivatein interfaceTool
-
mouseDown
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)Handles mouse down events in the drawing view.
-
mouseDrag
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)Handles mouse drag events in the drawing view.
-
mouseUp
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)Handles mouse up in the drawing view.
-
mouseMove
public void mouseMove(java.awt.event.MouseEvent evt, int x, int y)Handles mouse moves (if the mouse button is up).
-
keyDown
public void keyDown(java.awt.event.KeyEvent evt, int key)Handles key down events in the drawing view.
-
drawing
public Drawing drawing()
Gets the tool's drawing.
-
editor
public DrawingEditor editor()
Gets the tool's editor.
-
view
public DrawingView view()
Gets the tool's view.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG