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, thisPoly
Fields 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 void
activate()
Should be called once a tool is activated within a particular InterfaceDisplayPanel.java.lang.Object
clone()
void
deactivate()
Should be called once a tool is deactivated; instances of Tool should perform clean-up activities here.void
handleToolEvent(ToolInputEvent e)
Handle this tool eventprotected void
setIcon()
Methods inherited from class mgui.interfaces.tools.graphics.Tool2D
addListener, fireListeners, fireListeners, getName, getObjectIcon, getPopupMenu, getPopupMenu, getPreviousTool, handlePopupEvent, isExclusive, isImmediate, removeListener, setTargetPanel, setTargetShape, showPopupMenu
Methods 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:Tool
Should be called once a tool is activated within a particular InterfaceDisplayPanel. -
deactivate
public void deactivate()Description copied from interface:Tool
Should be called once a tool is deactivated; instances of Tool should perform clean-up activities here.- Specified by:
deactivate
in interfaceTool
- Overrides:
deactivate
in classTool2D
-
handleToolEvent
Description copied from interface:ToolInputListener
Handle this tool event- Specified by:
handleToolEvent
in interfaceToolInputListener
- Overrides:
handleToolEvent
in classToolCreatePolygon2D
-
clone
public java.lang.Object clone()- Specified by:
clone
in interfaceTool
- Overrides:
clone
in classToolCreatePolygon2D
-
setIcon
protected void setIcon()- Overrides:
setIcon
in classToolCreatePolygon2D
-