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 Details

    • targetShape

      public Shape3DInt targetShape
    • targetPanel

      public InterfaceGraphic3D targetPanel
    • toolPhase

      public int toolPhase
    • name

      public java.lang.String name
    • isImmediate

      public boolean isImmediate
    • listeners

      protected java.util.ArrayList<ToolListener> listeners
    • previous_tool

      protected Tool3D 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.
      Specified by:
      activate in interface Tool
    • 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 interface Tool
    • getPreviousTool

      public Tool getPreviousTool()
      Description copied from interface: Tool
      Returns the tool that was set previous to this one, if one exists
      Specified by:
      getPreviousTool in interface Tool
      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 interface Tool
      Returns:
    • addListener

      public void addListener​(ToolListener tl)
      Specified by:
      addListener in interface Tool
    • removeListener

      public void removeListener​(ToolListener tl)
      Specified by:
      removeListener in interface Tool
    • setTargetShape

      public void setTargetShape​(Shape3DInt thisShape)
    • setTargetPanel

      public void setTargetPanel​(InterfacePanel thisPanel)
      Specified by:
      setTargetPanel in interface Tool
    • handleToolEvent

      public void handleToolEvent​(ToolInputEvent e)
      Description copied from interface: ToolInputListener
      Handle this tool event
      Specified by:
      handleToolEvent in interface ToolInputListener
    • 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 interface Tool
      Returns:
    • getName

      public java.lang.String getName()
      Specified by:
      getName in interface Tool
    • clone

      public java.lang.Object clone()
      Specified by:
      clone in interface Tool
      Overrides:
      clone in class java.lang.Object
    • fireListeners

      protected void fireListeners()
    • fireDeactivated

      protected void fireDeactivated()
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from interface: IconObject
      Returns the Icon associated with this object.
      Specified by:
      getObjectIcon in interface IconObject
      Returns:
    • setIcon

      protected void setIcon()
    • getPopupMenu

      public InterfacePopupMenu getPopupMenu()
      Description copied from interface: PopupMenuObject
      Produces and returns a popup menu for this object.
      Specified by:
      getPopupMenu in interface PopupMenuObject
      Returns:
    • getPopupMenu

      public InterfacePopupMenu getPopupMenu​(java.util.List<java.lang.Object> selected)
      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 interface PopupMenuObject
      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 interface PopupMenuObject
    • showPopupMenu

      public void showPopupMenu​(java.awt.event.MouseEvent e)
      Description copied from interface: PopupMenuObject
      Shows a popup menu at the point of the given MouseEvent.
      Specified by:
      showPopupMenu in interface PopupMenuObject