|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fhg.igd.earth.model.graph.ProjectorObject
de.fhg.igd.earth.model.graph.ModelGraphObject
de.fhg.igd.earth.model.graph.Node
de.fhg.igd.earth.model.graph.Group
This class represents a group. A group can have children. The number of children can be limited. All children are stored in the children_ Vector. If one child will be removed from this vector it will be added to the erasedChildren list. Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG
Field Summary | |
private Vector |
children_
A vector with the childen nodes |
private Vector |
erasedChildren_
A vector with the erased children nodes |
protected int |
maxNumChildren_
maximum number of children. |
Fields inherited from class de.fhg.igd.earth.model.graph.Node |
boundless_, collidable_, icon_, parent_, pickable_ |
Fields inherited from class de.fhg.igd.earth.model.graph.ProjectorObject |
projectorObject_ |
Constructor Summary | |
Group()
Constructs and initializes a default group. |
Method Summary | |
boolean |
addChild(Node n)
Adds the given node to this group. |
protected boolean |
allowChildAddEvent(Node n)
This method is called BEFORE the given node is added to this group. |
void |
calcBoundingBox(cBoundingBox boundingBox)
Calculates the bounding box of this node. |
protected void |
childAddedEvent(int index)
This method is called AFTER a new child was added to this group. |
protected void |
childRemovedEvent(int index)
This method is called AFTER a child was removed. |
Object |
clone()
Clones this group |
protected void |
createLeafList(Vector list)
Inserts all sub leafs to a given Vector. |
protected void |
createSubGroupList(Vector list)
Inserts all sub groups to a given Vector. |
protected void |
createSubNodeList(Vector list)
Inserts all subnodes to a given Vector. |
protected void |
detach()
This method sets the CHANGED_DELETED flag of this node and all sub nodes. |
protected void |
detachedEvent()
This method is called AFTER a node was detached. |
Enumeration |
getAllChildren()
Returns an Enumeration of all children. |
protected Node |
getChild(int index)
Returns the node at the given index. |
Enumeration |
getErasedChildren()
Returns an enumeration of all erased children. |
int |
getSubType()
Returns SUBTYPE_Group. |
int |
getType()
Returns TYPE_Group. |
int |
numChildren()
Returns the number of children |
boolean |
removeAllChildren()
Removes all children in this group (blocked by mutable). |
protected boolean |
removeChild(int index)
Removes a child at a spezial index (blocked by mutable). |
boolean |
removeChild(Node o)
Removes a given child from the child vector (blocked by mutable). |
protected void |
resetChanges()
Resets all changes in this group and clear the erasedChildren vector. |
Enumeration |
searchDown(int type)
Search method which walks down the tree and searches by type. |
Node |
searchDown(int type,
int subType)
Search method which walks down the tree and searches by type and subtype. |
Enumeration |
searchDown(String group)
Search method which walks down the tree and searches by group. |
Node |
searchDown(String group,
String name)
Search method which walks down the tree and searches by group and name. |
protected void |
searchDownInserter(int type,
Vector result)
This method inserts all nodes with the given type into the result Vector. |
protected void |
searchDownInserter(String group,
Vector result)
This method inserts all nodes with the given group name into the result Vector. |
protected void |
setChildAt(Node c,
int index)
Set child at index. |
boolean |
setColor(Color c)
Sets the color of all leafs. |
boolean |
setHighLight(boolean on)
Sets the HighLight flag of all leafs. |
protected void |
setMutable(boolean m)
Sets the mutable flag for this group and all sub nodes. |
void |
setVisible(boolean v)
Sets the visibility of this node and all subnodes. |
Methods inherited from class de.fhg.igd.earth.model.graph.Node |
broadcastCreation, broadcastResetChanges, createParentGroupList, delete, delete, getBoundingBox, getBoundless, getBranchGroup, getCollidable, getGroup, getIcon, getLeafList, getModelGraph, getParent, getParentGroupList, getPickable, getSubGroupList, getSubNodeList, isFocused, move, move, moveTo, publishChanges, resetProjectorObject, searchUp, searchUp, searchUp, searchUp, setBoundless, setCollidable, setIcon, setParent, setPickable |
Methods inherited from class de.fhg.igd.earth.model.graph.ModelGraphObject |
anyChanges, anySubChanges, getChanges, getChanges, getInfoTable, getInfoTableElements, getInfoTableKeys, getInfoTableSize, getInfoTableValues, getMutable, getName, getSubChanges, getSubChanges, getSubTypeName, getTimeStamp, getTrace, getTraceable, putInfo, setChanges, setInfoTable, setName, setSubChanges, setTrace, VectorClone |
Methods inherited from class de.fhg.igd.earth.model.graph.ProjectorObject |
getProjectorObject, setProjectorObject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Vector children_
private Vector erasedChildren_
protected int maxNumChildren_
Constructor Detail |
public Group()
Method Detail |
public int getType()
getType
in class ModelGraphObject
public int getSubType()
getSubType
in class ModelGraphObject
protected void resetChanges()
resetChanges
in class ModelGraphObject
public Node searchDown(String group, String name)
searchDown
in class Node
group
- The searched groupname
- The searched name
public Enumeration searchDown(String group)
searchDown
in class Node
group
- The searched group
protected void searchDownInserter(String group, Vector result)
searchDownInserter
in class Node
group
- The searched groupresult
- The Vector to insert intopublic Node searchDown(int type, int subType)
searchDown
in class Node
type
- The searched type
public Enumeration searchDown(int type)
searchDown
in class Node
protected void searchDownInserter(int type, Vector result)
searchDownInserter
in class Node
type
- The searched typeresult
- The Vector to insert intopublic void calcBoundingBox(cBoundingBox boundingBox)
calcBoundingBox
in class Node
boundingBox
- which will be combined withpublic void setVisible(boolean v)
setVisible
in class Node
v
- visibilitypublic boolean setColor(Color c)
setColor
in class Node
c
- Color
true
on successpublic boolean setHighLight(boolean on)
setHighLight
in class Node
on
- The new HighLight flag
true
on successprotected void setMutable(boolean m)
setMutable
in class ModelGraphObject
m
- new mutable flag (true=is mutable)public boolean addChild(Node n)
n
- Node to add
true
on success.protected boolean allowChildAddEvent(Node n)
n
- Node to check
true
if it's allowed to add this nodeprotected void childAddedEvent(int index)
index
- Index of the new nodeprotected Node getChild(int index)
protected void setChildAt(Node c, int index)
c
- Childindex
- Indexpublic Enumeration getAllChildren()
public int numChildren()
public boolean removeAllChildren()
true
on successpublic boolean removeChild(Node o)
o
- Child to remove
true
on successprotected boolean removeChild(int index)
index
- Index of the child to remove
true
on successprotected void childRemovedEvent(int index)
public Enumeration getErasedChildren()
protected void detach()
detach
in class Node
protected void detachedEvent()
protected void createSubNodeList(Vector list)
createSubNodeList
in class Node
list
- Vector to add intoprotected void createSubGroupList(Vector list)
createSubGroupList
in class Node
list
- Vector to add intoprotected void createLeafList(Vector list)
createLeafList
in class Node
list
- Vector to add intopublic Object clone()
clone
in class Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |