Package mgui.interfaces.tools.graphics
Class Tool3D
java.lang.Object
mgui.interfaces.tools.graphics.Tool3D
- All Implemented Interfaces:
java.lang.Cloneable
,PopupMenuObject
,Tool
,ToolInputListener
,IconObject
- Direct Known Subclasses:
ToolMouseOrbit3D
,ToolQueryShape3D
,ToolSelectMeshBoundaryNodes
,ToolSelectNodesWithPolygon
,ToolSelectRegionBoundaryNodes
,ToolSelectShape3D
public abstract class Tool3D extends java.lang.Object implements Tool
Abstract class for a tool to be used on an InterfaceGraphic3D window.
TODO: implement default ESC behaviour
- Since:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.Icon
icon
boolean
isImmediate
protected java.util.ArrayList<ToolListener>
listeners
java.lang.String
name
protected Tool3D
previous_tool
InterfaceGraphic3D
targetPanel
Shape3DInt
targetShape
int
toolPhase
-
Constructor Summary
Constructors Constructor Description Tool3D()
-
Method Summary
Modifier and Type Method Description void
activate()
Should be called once a tool is activated within a particular InterfaceDisplayPanel.void
addListener(ToolListener tl)
java.lang.Object
clone()
void
deactivate()
Should be called once a tool is deactivated; instances of Tool should perform clean-up activities here.protected void
fireDeactivated()
protected void
fireListeners()
java.lang.String
getName()
javax.swing.Icon
getObjectIcon()
Returns theIcon
associated with this object.InterfacePopupMenu
getPopupMenu()
Produces and returns a popup menu for this object.InterfacePopupMenu
getPopupMenu(java.util.List<java.lang.Object> selected)
Produces and returns a popup menu for this object.Tool
getPreviousTool()
Returns the tool that was set previous to this one, if one existsvoid
handlePopupEvent(java.awt.event.ActionEvent e)
Handles an event on this object's popup menu.void
handleToolEvent(ToolInputEvent e)
Handle this tool eventboolean
isExclusive()
Specifies whether this tool requires exclusively; otherwise it will run in parallel with the default tool, if one exists.boolean
isImmediate()
Specifies whether this tool is immediate; this indicates that it should be run immediately upon calling and stop, rather than wait for AWT events.void
removeListener(ToolListener tl)
protected void
setIcon()
void
setTargetPanel(InterfacePanel thisPanel)
void
setTargetShape(Shape3DInt thisShape)
void
showPopupMenu(java.awt.event.MouseEvent e)
Shows a popup menu at the point of the givenMouseEvent
.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
targetShape
-
targetPanel
-
toolPhase
public int toolPhase -
name
public java.lang.String name -
isImmediate
public boolean isImmediate -
listeners
-
previous_tool
-
icon
protected javax.swing.Icon icon
-
-
Constructor Details
-
Tool3D
public Tool3D()
-
-
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
-
getPreviousTool
Description copied from interface:Tool
Returns the tool that was set previous to this one, if one exists- Specified by:
getPreviousTool
in interfaceTool
- Returns:
-
isExclusive
public boolean isExclusive()Description copied from interface:Tool
Specifies whether this tool requires exclusively; otherwise it will run in parallel with the default tool, if one exists.- Specified by:
isExclusive
in interfaceTool
- Returns:
-
addListener
- Specified by:
addListener
in interfaceTool
-
removeListener
- Specified by:
removeListener
in interfaceTool
-
setTargetShape
-
setTargetPanel
- Specified by:
setTargetPanel
in interfaceTool
-
handleToolEvent
Description copied from interface:ToolInputListener
Handle this tool event- Specified by:
handleToolEvent
in interfaceToolInputListener
-
isImmediate
public boolean isImmediate()Description copied from interface:Tool
Specifies whether this tool is immediate; this indicates that it should be run immediately upon calling and stop, rather than wait for AWT events.- Specified by:
isImmediate
in interfaceTool
- Returns:
-
getName
public java.lang.String getName() -
clone
public java.lang.Object clone() -
fireListeners
protected void fireListeners() -
fireDeactivated
protected void fireDeactivated() -
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Returns:
-
setIcon
protected void setIcon() -
getPopupMenu
Description copied from interface:PopupMenuObject
Produces and returns a popup menu for this object.- Specified by:
getPopupMenu
in interfacePopupMenuObject
- Returns:
-
getPopupMenu
Description copied from interface:PopupMenuObject
Produces and returns a popup menu for this object. Allows an associated list of objects to be passed as an argument.- Specified by:
getPopupMenu
in interfacePopupMenuObject
- Returns:
-
handlePopupEvent
public void handlePopupEvent(java.awt.event.ActionEvent e)Description copied from interface:PopupMenuObject
Handles an event on this object's popup menu.- Specified by:
handlePopupEvent
in interfacePopupMenuObject
-
showPopupMenu
public void showPopupMenu(java.awt.event.MouseEvent e)Description copied from interface:PopupMenuObject
Shows a popup menu at the point of the givenMouseEvent
.- Specified by:
showPopupMenu
in interfacePopupMenuObject
-