de.grogra.imp.edit
public final class Tool extends java.lang.Object implements Disposable, AttributeChangeListener, ChangeBoundaryListener
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.
ATTRIBUTE_PRIORITY, TOPOLOGY_PRIORITY, UPDATE_PRIORITY| Constructor and Description |
|---|
Tool(java.lang.Object object,
boolean asNode,
ToolRoot[] roots)
Creates a new
Tool. |
| Modifier and Type | Method and Description |
|---|---|
void |
attributeChanged(AttributeChangeEvent e) |
void |
beginChange(GraphState gs) |
static DisposableEventListener |
createToolListener(View view,
UIProperty tool) |
void |
dispose() |
void |
endChange(GraphState gs) |
AttributeAccessor |
getAccessorOfObject(Attribute a) |
boolean |
getBooleanOfObject(BooleanAttribute a,
boolean defaultValue) |
byte |
getByteOfObject(ByteAttribute a,
byte defaultValue) |
char |
getCharOfObject(CharAttribute a,
char defaultValue) |
double |
getDoubleOfObject(DoubleAttribute a,
double defaultValue) |
float |
getFloatOfObject(FloatAttribute a,
float defaultValue) |
GraphState |
getGraphState()
Returns the
GraphState of the workbench. |
int |
getIntOfObject(IntAttribute a,
int defaultValue) |
long |
getLongOfObject(LongAttribute a,
long defaultValue) |
java.lang.Object |
getObject()
Returns this tool's target.
|
java.lang.Object |
getObjectOfObject(ObjectAttribute a,
java.lang.Object defaultValue) |
int |
getPriority() |
ToolRoot |
getRoot(int index)
Returns the tool root at position
index in the
list of tool roots. |
short |
getShortOfObject(ShortAttribute a,
short defaultValue) |
int |
getToolCount()
Returns the number of tool roots.
|
View |
getView()
Returns the view in which this tool is displayed.
|
void |
initialize(View view) |
boolean |
isNode()
Determines whether the tool target is a node or an edge.
|
boolean |
isWritable(Attribute a) |
void |
setBooleanOfObject(BooleanAttribute a,
boolean value) |
void |
setByteOfObject(ByteAttribute a,
byte value) |
void |
setCharOfObject(CharAttribute a,
char value) |
void |
setDoubleOfObject(DoubleAttribute a,
double value) |
void |
setFloatOfObject(FloatAttribute a,
float value) |
void |
setIntOfObject(IntAttribute a,
int value) |
void |
setLongOfObject(LongAttribute a,
long value) |
void |
setObjectOfObject(ObjectAttribute a,
java.lang.Object value) |
void |
setShortOfObject(ShortAttribute a,
short value) |
void |
setSubfield(ObjectAttribute a,
FieldChain field,
int[] indices,
java.lang.Object value) |
java.lang.String |
toString() |
public void attributeChanged(AttributeChangeEvent e)
attributeChanged in interface AttributeChangeListenerpublic void beginChange(GraphState gs)
beginChange in interface ChangeBoundaryListenerpublic static DisposableEventListener createToolListener(View view, UIProperty tool)
public void dispose()
dispose in interface Disposablepublic void endChange(GraphState gs)
endChange in interface ChangeBoundaryListenerpublic AttributeAccessor getAccessorOfObject(Attribute a)
public boolean getBooleanOfObject(BooleanAttribute a, boolean defaultValue)
public byte getByteOfObject(ByteAttribute a, byte defaultValue)
public char getCharOfObject(CharAttribute a, char defaultValue)
public double getDoubleOfObject(DoubleAttribute a, double defaultValue)
public float getFloatOfObject(FloatAttribute a, float defaultValue)
public GraphState getGraphState()
GraphState of the workbench.public int getIntOfObject(IntAttribute a, int defaultValue)
public long getLongOfObject(LongAttribute a, long defaultValue)
public java.lang.Object getObject()
public java.lang.Object getObjectOfObject(ObjectAttribute a, java.lang.Object defaultValue)
public int getPriority()
getPriority in interface ChangeBoundaryListenerpublic ToolRoot getRoot(int index)
index in the
list of tool roots.index - the index into the list of tool rootsindexpublic short getShortOfObject(ShortAttribute a, short defaultValue)
public int getToolCount()
Tool,
depending on the result of the initializations of each tool root.public View getView()
public void initialize(View view)
public boolean isNode()
true iff the tool target is a nodepublic boolean isWritable(Attribute a)
public void setBooleanOfObject(BooleanAttribute a, boolean value)
public void setByteOfObject(ByteAttribute a, byte value)
public void setCharOfObject(CharAttribute a, char value)
public void setDoubleOfObject(DoubleAttribute a, double value)
public void setFloatOfObject(FloatAttribute a, float value)
public void setIntOfObject(IntAttribute a, int value)
public void setLongOfObject(LongAttribute a, long value)
public void setObjectOfObject(ObjectAttribute a, java.lang.Object value)
public void setShortOfObject(ShortAttribute a, short value)
public void setSubfield(ObjectAttribute a, FieldChain field, int[] indices, java.lang.Object value)
public java.lang.String toString()
toString in class java.lang.Object