java.lang.Object
de.grogra.imp.edit.Tool
- All Implemented Interfaces:
AttributeChangeListener,ChangeBoundaryListener,Disposable
public class Tool
extends Object
implements Disposable, AttributeChangeListener, ChangeBoundaryListener
A
Tool represents a tool for interactive manipulation
of objects in a 2D- or 3D-view. A tool is composed of a set of
tool graphs, each represented by its root node of (a subclass of) class
ToolRoot. Each tool graph is drawn as
part of the 2D- or 3D-view.
A Tool operates on a single object, the tool target.
- Author:
- Ole Kniemeyer
-
Field Summary
Fields inherited from interface de.grogra.graph.ChangeBoundaryListener
ATTRIBUTE_PRIORITY, TOPOLOGY_PRIORITY, UPDATE_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidstatic DisposableEventListenercreateToolListener(View view, UIProperty tool) voiddispose()voidendChange(GraphState gs) booleangetBooleanOfObject(BooleanAttribute a, boolean defaultValue) bytegetByteOfObject(ByteAttribute a, byte defaultValue) chargetCharOfObject(CharAttribute a, char defaultValue) doublegetDoubleOfObject(DoubleAttribute a, double defaultValue) floatgetFloatOfObject(FloatAttribute a, float defaultValue) Returns theGraphStateof the workbench.intgetIntOfObject(IntAttribute a, int defaultValue) longgetLongOfObject(LongAttribute a, long defaultValue) Returns this tool's target.getObjectOfObject(ObjectAttribute a, Object defaultValue) intgetRoot(int index) Returns the tool root at positionindexin the list of tool roots.shortgetShortOfObject(ShortAttribute a, short defaultValue) intReturns the number of tool roots.getView()Returns the view in which this tool is displayed.voidinitialize(View view) booleanisNode()Determines whether the tool target is a node or an edge.booleanvoidsetBooleanOfObject(BooleanAttribute a, boolean value) voidsetByteOfObject(ByteAttribute a, byte value) voidsetCharOfObject(CharAttribute a, char value) voidsetDoubleOfObject(DoubleAttribute a, double value) voidsetFloatOfObject(FloatAttribute a, float value) voidsetIntOfObject(IntAttribute a, int value) voidsetLongOfObject(LongAttribute a, long value) voidsetObjectOfObject(ObjectAttribute a, Object value) voidsetShortOfObject(ShortAttribute a, short value) voidsetSubfield(ObjectAttribute a, FieldChain field, int[] indices, Object value) toString()
-
Constructor Details
-
Tool
Creates a newTool.- Parameters:
object- the tool targetasNode-trueiffobjectis a noderoots- the set of tool roots- See Also:
-
-
Method Details
-
initialize
-
getView
Returns the view in which this tool is displayed.- Returns:
- the view
-
getObject
Returns this tool's target.- Returns:
- the tool target
-
isNode
public boolean isNode()Determines whether the tool target is a node or an edge.- Returns:
trueiff the tool target is a node
-
getGraphState
Returns theGraphStateof the workbench.- Returns:
- the graph state of the workbench
-
getToolCount
public int getToolCount()Returns the number of tool roots. This number may be less than the length of the array used in the contructor ofTool, depending on the result of the initializations of each tool root.- Returns:
- the number of tool roots
-
getRoot
Returns the tool root at positionindexin the list of tool roots.- Parameters:
index- the index into the list of tool roots- Returns:
- the tool root number
index
-
dispose
public void dispose()- Specified by:
disposein interfaceDisposable
-
toString
-
beginChange
- Specified by:
beginChangein interfaceChangeBoundaryListener
-
endChange
- Specified by:
endChangein interfaceChangeBoundaryListener
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceChangeBoundaryListener
-
attributeChanged
- Specified by:
attributeChangedin interfaceAttributeChangeListener
-
createToolListener
-
getAccessorOfObject
-
isWritable
-
setBooleanOfObject
-
getBooleanOfObject
-
setByteOfObject
-
getByteOfObject
-
setShortOfObject
-
getShortOfObject
-
setCharOfObject
-
getCharOfObject
-
setIntOfObject
-
getIntOfObject
-
setLongOfObject
-
getLongOfObject
-
setFloatOfObject
-
getFloatOfObject
-
setDoubleOfObject
-
getDoubleOfObject
-
setObjectOfObject
-
getObjectOfObject
-
setSubfield
-