de.grogra.imp.edit
Class ToolRoot

java.lang.Object
  extended by de.grogra.graph.impl.Edge
      extended by de.grogra.graph.impl.Node
          extended by de.grogra.imp.edit.ToolRoot
All Implemented Interfaces:
Manageable, PersistenceCapable, Shareable, UserFields, XObject, Disposable, Map, java.io.Serializable
Direct Known Subclasses:
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:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType
 
Nested classes/interfaces inherited from interface de.grogra.util.Map
Map.Chain
 
Field Summary
static Node.NType $TYPE
           
protected  Tool tool
          The tool to which this tool node is associated.
 
Fields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MIME_TYPE, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD, USED_BITS
 
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
 
Constructor Summary
ToolRoot()
           
 
Method Summary
protected abstract  void attributeChanged(Attribute[] b)
          This method is invoked to notify the tool root about modifications of attributes of the tool target.
 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.
 java.lang.Object getToolTarget()
          Returns the target object of the tool.
protected  boolean initialize(Tool tool)
          Initializes this tool root.
 boolean isTargetNode()
          Returns true iff the target object of the tool is a node.
 
Methods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getNTypeImpl, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getShort, getSource, getStamp, getSuccessor, getSymbol, getSymbolColor, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, newInstance, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setLayer, setMark, setName, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplace
 
Methods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBits
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.util.Disposable
dispose
 
Methods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
 

Field Detail

$TYPE

public static final Node.NType $TYPE

tool

protected Tool tool
The tool to which this tool node is associated.

Constructor Detail

ToolRoot

public ToolRoot()
Method Detail

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

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

getToolTarget

public java.lang.Object getToolTarget()
Returns the target object of the tool.

Returns:
the target object of the tool
See Also:
Tool.getObject()

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).

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:
Tool.isNode()