Package org.jgraph.graph
Class ParentMap
java.lang.Object
org.jgraph.graph.ParentMap
- All Implemented Interfaces:
Serializable
An object that describes relations between childs and parents.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Object that represents the relation between a child an a parent. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntries
(Object[] children, Object parent) Adds all child parent pairs using addEntry.void
Add a new entry for this child, parent pair to the parent map.Creates a new parent map based on this parent map, where the child and parents are mapped usingmap
.static ParentMap
create
(GraphModel m, Object[] c, boolean remove, boolean onlyUsePassedInCells) Returns a parent map that represents the insertion or removal ofcells
inmodel
based onremove
.entries()
Returns anIterator
for the entries in the map.Returns aSet
for the nodes, childs and parents, in this parent map.int
size()
Returns the number of entries.toString()
-
Field Details
-
entries
Contents of the parent map. -
changedNodes
Set of changed changedNodes for the parent map. Includes childs and parents. -
childCount
Maps parents to integers with the future number of childs.
-
-
Constructor Details
-
ParentMap
public ParentMap()Constructs aParentMap
object. -
ParentMap
Constructs aParentMap
object.
-
-
Method Details
-
create
public static ParentMap create(GraphModel m, Object[] c, boolean remove, boolean onlyUsePassedInCells) Returns a parent map that represents the insertion or removal ofcells
inmodel
based onremove
. Unselected childs of selected nodes are moved to the first unselected parent of that node.Note: Consequently, cells "move up" one level when their parent is removed. Note: onlyUsePassedInCells can be used to indicate if only cells from the passed-in cell array are allowed parents. This is only used if remove is not true.
-
addEntry
Add a new entry for this child, parent pair to the parent map. The child and parent are added to the set of changed nodes. Note: The previous parent is changed on execution of this parent map and must be added by the GraphModel and reflected by the GraphChange.getChanged method. TODO: In general, the GraphModel should be in charge of computing the set of changed cells. -
addEntries
Adds all child parent pairs using addEntry. -
size
public int size()Returns the number of entries. -
entries
Returns anIterator
for the entries in the map. -
getChangedNodes
Returns aSet
for the nodes, childs and parents, in this parent map. -
clone
Creates a new parent map based on this parent map, where the child and parents are mapped usingmap
. If one the cells is not inmap
, then the original cell is used instead. -
toString
-