Package mgui.interfaces.tools.shapes
Class ToolRuler2D
java.lang.Object
mgui.interfaces.tools.graphics.Tool2D
mgui.interfaces.tools.shapes.ToolCreatePolygon2D
mgui.interfaces.tools.shapes.ToolRuler2D
- All Implemented Interfaces:
java.lang.Cloneable,PopupMenuObject,Tool,ToolInputListener,IconObject
public class ToolRuler2D extends ToolCreatePolygon2D
Allows the user to measure distance on a 2D window, along a path with N nodes. Opens a non-modal
dialog box containing a table which displays the distance of each segment of the path, along with
the cumulative distance at each vertex.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.interfaces.tools.shapes.ToolCreatePolygon2D
close, lastPt, nextPt, screenStartPt, startPt, thisPolyFields inherited from class mgui.interfaces.tools.graphics.Tool2D
icon, is_active, isImmediate, last_tool, listeners, name, targetPanel, targetShape, toolPhase -
Constructor Summary
Constructors Constructor Description ToolRuler2D()ToolRuler2D(Tool2D last_tool) -
Method Summary
Modifier and Type Method Description voidactivate()Should be called once a tool is activated within a particular InterfaceDisplayPanel.java.lang.Objectclone()voiddeactivate()Should be called once a tool is deactivated; instances of Tool should perform clean-up activities here.voidhandleToolEvent(ToolInputEvent e)Handle this tool eventprotected voidsetIcon()Methods inherited from class mgui.interfaces.tools.graphics.Tool2D
addListener, fireListeners, fireListeners, getName, getObjectIcon, getPopupMenu, getPopupMenu, getPreviousTool, handlePopupEvent, isExclusive, isImmediate, removeListener, setTargetPanel, setTargetShape, showPopupMenuMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ToolRuler2D
public ToolRuler2D() -
ToolRuler2D
-
-
Method Details
-
activate
public void activate()Description copied from interface:ToolShould be called once a tool is activated within a particular InterfaceDisplayPanel. -
deactivate
public void deactivate()Description copied from interface:ToolShould be called once a tool is deactivated; instances of Tool should perform clean-up activities here.- Specified by:
deactivatein interfaceTool- Overrides:
deactivatein classTool2D
-
handleToolEvent
Description copied from interface:ToolInputListenerHandle this tool event- Specified by:
handleToolEventin interfaceToolInputListener- Overrides:
handleToolEventin classToolCreatePolygon2D
-
clone
public java.lang.Object clone()- Specified by:
clonein interfaceTool- Overrides:
clonein classToolCreatePolygon2D
-
setIcon
protected void setIcon()- Overrides:
setIconin classToolCreatePolygon2D
-