Module imp

Class ToolRoot

All Implemented Interfaces:
Manageable, PersistenceCapable, Shareable, UserFields, XObject, Disposable, Map, Serializable
Direct Known Subclasses:
ToolRoot2D, ToolRoot3D

public abstract class ToolRoot extends Node implements Disposable
Instances of this class are used as root nodes of tool graphs for the interactive manipulation of objects in two- or three-dimensional views.
Author:
Ole Kniemeyer
See Also:
  • Field Details

    • tool

      protected Tool tool
      The tool to which this tool node is associated.
    • $TYPE

      public static final Node.NType $TYPE
  • Constructor Details

    • ToolRoot

      public ToolRoot()
  • Method Details

    • initialize

      protected boolean initialize(Tool tool)
      Initializes this tool root. This method initializes the field tool with the given tool.
      Parameters:
      tool - the tool to which this tool root is associated
      Returns:
      true if this tool root actually shall be used for the tool, false if it shall not be used (e.g., if the actual tool target cannot be manipulated by the tool graph of this tool root).
    • getToolTarget

      public Object getToolTarget()
      Returns the target object of the tool.
      Returns:
      the target object of the tool
      See Also:
    • isTargetNode

      public boolean isTargetNode()
      Returns true iff the target object of the tool is a node.
      Returns:
      is the target object a node?
      See Also:
    • executeWithWriteLock

      public void executeWithWriteLock(Command command, EditEvent event)
      Executes the given command in the main thread of the workbench and with a write-lock on the graph. The context-argument of the command's run-method will be the given event, the arg-argument will be this.
      Parameters:
      command - a command to be executed
      event - the event, it is used as Context
    • attributeChanged

      protected abstract void attributeChanged(Attribute[] b)
      This method is invoked to notify the tool root about modifications of attributes of the tool target.
      Parameters:
      b - an array of attributes which have changed