|
Jazz API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.umd.cs.jazz.util.ZSceneGraphEditor
ZSceneGraphEditor provides a convenience mechanism used to locate and create instances of the following types of group nodes:
For example, you can use a graph editor to obtain a ZTransformGroup for a leaf node. The first time you do this, a new ZTransformGroup is inserted above the leaf. Subsequently, that ZTransformGroup is reused. e.g.
ZTransformGroup t = node.editor().getTransformGroup();
t.translate(1, 0);
will translate node by 1, 0. Repeatedly executing
this code will cause the node to move horizontally across the
screen.If multiple group types are created for a given node in the scene graph, they are ordered as shown in the list above - so custom groups will be inserted at the top (closest to the root), whereas fade groups will be inserted at the bottom (closest to the node being edited.)
Group nodes inserted into the scene graph by ZSceneGraphEditor have their hasOneChild flag set to true - such group nodes are referred to as "edit groups", and can only act on the single node immediately beneath them in the scene graph. This guarantees that translations or scalings applied to a ZTransformGroup node created by ZSceneGraphEditor effect only the node being edited. ZSceneGraphEditor uses the hasOneChild flag to identify edit groups that it has created in the scene graph, to avoid creating the same group nodes twice.
ZNode.editor(), Serialized Form| Field Summary | |
protected static int |
ANCHOR
A bit representing an anchor node type (ZAnchorGroup) and order. |
protected static int |
CUSTOM
A bit representing an application-defined custom node type and order. |
protected static int |
FADE
A bit representing a fade node type (ZFadeGroup) and order. |
protected static int |
INVISIBLE
A bit representing an invisible node type (ZInvisibleGroup) and order. |
protected static int |
LAYOUT
A bit representing a layout node type (ZLayoutGroup) and order. |
protected static int |
SELECTION
A bit representing a selection node type (ZSelectionGroup) and order. |
protected static int |
STICKY
A bit representing a sticky node type (ZStickyGroup) and order. |
protected static int |
TRANSFORM
A bit representing a transform node type (ZTransformGroup) and order. |
protected static int |
UNKNOWN
A value representing an unknown node type. |
| Constructor Summary | |
ZSceneGraphEditor(ZNode node)
Given a node, constructs an "editor" for the node. |
|
| Method Summary | |
protected static int |
editGroupType(ZNode node)
Returns the type number for a given instance. |
ZAnchorGroup |
getAnchorGroup()
Returns a ZAnchorGroup to use for a node, or inserts one above the node if none exists. |
protected ZGroup |
getEditGroup(int type)
Returns the specified edit group type for this editor, if there is one, or null otherwise. |
ZFadeGroup |
getFadeGroup()
Returns a ZFadeGroup to use for a node, or inserts one above the node if none exists. |
java.util.ArrayList |
getGroups()
Returns an array representing the list of "edit" groups above the node - groups above the node whose hasOneChild flag is set to true. |
ZInvisibleGroup |
getInvisibleGroup()
Returns a ZInvisibleGroup to use for a node, or inserts one above the node if none exists. |
ZLayoutGroup |
getLayoutGroup()
Returns a ZLayoutGroup to use for a node, or inserts one above the node if none exists. |
ZNode |
getNode()
Returns the node being edited. |
ZSelectionGroup |
getSelectionGroup()
Returns a ZSelectionGroup to use for a node, or inserts one above the node if none exists. |
ZStickyGroup |
getStickyGroup()
Returns a ZStickyGroup to use for a node, or inserts one above the node if none exists. |
ZNode |
getTop()
If ZSceneGraphEditor has inserted groups above a node, this returns the topmost of those groups (the group nearest the root of the scene graph). |
ZTransformGroup |
getTransformGroup()
Returns a ZTransformGroup to use for a node, insertsing one above the edited node if none exists. |
boolean |
hasAnchorGroup()
Returns true if this node has a ZAnchorGroup above it as an edit group, false otherwise. |
protected boolean |
hasEditGroup(int type)
Determines if this editor has an edit group of the specified type. |
boolean |
hasFadeGroup()
Returns true if this node has a ZFadeGroup above it as an edit group, false otherwise. |
boolean |
hasInvisibleGroup()
Returns true if this node has a ZInvisibleGroup above it as an edit group, false otherwise. |
boolean |
hasLayoutGroup()
Returns true if this node has a ZLayoutGroup above it as an edit group, false otherwise. |
boolean |
hasSelectionGroup()
Returns true if this node has a ZSelectionGroup above it as an edit group, false otherwise. |
boolean |
hasStickyGroup()
Returns true if this node has a ZStickyGroup above it as an edit group, false otherwise. |
boolean |
hasTransformGroup()
Returns true if this node has a ZTransformGroup above it as an edit group, false otherwise. |
protected static boolean |
isEditGroup(ZNode node)
|
boolean |
removeAnchorGroup()
Removes a ZAnchorGroup edit group for above a node. |
protected boolean |
removeEditGroup(int type)
Removes the specified edit group from this editor if there is one, or does nothing otherwise. |
boolean |
removeFadeGroup()
Removes a ZFadeGroup edit group for above a node. |
boolean |
removeInvisibleGroup()
Removes a ZInvisibleGroup edit group for above a node. |
boolean |
removeLayoutGroup()
Removes a ZLayoutGroup edit group for above a node. |
boolean |
removeSelectionGroup()
Removes a ZSelectionGroup edit group for above a node. |
boolean |
removeStickyGroup()
Removes a ZStickyGroup edit group for above a node. |
boolean |
removeTransformGroup()
Removes a TransformGroup edit group from above a node. |
protected void |
setEditGroup(int type,
ZGroup editGroup)
Adds a ZGroup as an "editGroup", preserving the order listed by the numbering for the various editGroup types. |
java.lang.String |
toString()
Generate a string that represents this object for debugging. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected static final int CUSTOM
protected static final int INVISIBLE
protected static final int LAYOUT
protected static final int ANCHOR
protected static final int TRANSFORM
protected static final int STICKY
protected static final int SELECTION
protected static final int FADE
protected static final int UNKNOWN
| Constructor Detail |
public ZSceneGraphEditor(ZNode node)
| Method Detail |
protected static int editGroupType(ZNode node)
node - The node being checkedprotected static boolean isEditGroup(ZNode node)
protected void setEditGroup(int type,
ZGroup editGroup)
type - The type of the new groupeditGroup - The new groupprotected boolean hasEditGroup(int type)
protected ZGroup getEditGroup(int type)
type - The type of edit group to returnprotected boolean removeEditGroup(int type)
type - The type of edit group to returnpublic ZNode getTop()
public ZNode getNode()
public java.util.ArrayList getGroups()
public ZTransformGroup getTransformGroup()
public boolean hasTransformGroup()
public boolean removeTransformGroup()
public ZFadeGroup getFadeGroup()
public boolean hasFadeGroup()
public boolean removeFadeGroup()
public ZStickyGroup getStickyGroup()
public boolean hasStickyGroup()
public boolean removeStickyGroup()
public ZSelectionGroup getSelectionGroup()
public boolean hasSelectionGroup()
public boolean removeSelectionGroup()
public ZAnchorGroup getAnchorGroup()
public boolean hasAnchorGroup()
public boolean removeAnchorGroup()
public ZLayoutGroup getLayoutGroup()
public boolean hasLayoutGroup()
public boolean removeLayoutGroup()
public ZInvisibleGroup getInvisibleGroup()
public boolean hasInvisibleGroup()
public boolean removeInvisibleGroup()
public java.lang.String toString()
|
Jazz API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||