org.jgraph.graph
Class ParentMap
- java.lang.Object
-
- org.jgraph.graph.ParentMap
-
- All Implemented Interfaces:
- java.io.Serializable
public class ParentMap extends java.lang.Object implements java.io.SerializableAn object that describes relations between childs and parents.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classParentMap.EntryObject that represents the relation between a child an a parent.
-
Constructor Summary
Constructors Constructor and Description ParentMap()Constructs aParentMapobject.ParentMap(java.lang.Object[] children, java.lang.Object parent)Constructs aParentMapobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddEntries(java.lang.Object[] children, java.lang.Object parent)Adds all child parent pairs using addEntry.voidaddEntry(java.lang.Object child, java.lang.Object parent)Add a new entry for this child, parent pair to the parent map.ParentMapclone(java.util.Map map)Creates a new parent map based on this parent map, where the child and parents are mapped usingmap.static ParentMapcreate(GraphModel m, java.lang.Object[] c, boolean remove, boolean onlyUsePassedInCells)Returns a parent map that represents the insertion or removal ofcellsinmodelbased onremove.java.util.Iteratorentries()Returns anIteratorfor the entries in the map.java.util.SetgetChangedNodes()Returns aSetfor the nodes, childs and parents, in this parent map.intsize()Returns the number of entries.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ParentMap
public ParentMap()
Constructs aParentMapobject.
-
ParentMap
public ParentMap(java.lang.Object[] children, java.lang.Object parent)Constructs aParentMapobject.
-
-
Method Detail
-
create
public static ParentMap create(GraphModel m, java.lang.Object[] c, boolean remove, boolean onlyUsePassedInCells)
Returns a parent map that represents the insertion or removal ofcellsinmodelbased 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
public void addEntry(java.lang.Object child, java.lang.Object parent)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
public void addEntries(java.lang.Object[] children, java.lang.Object parent)Adds all child parent pairs using addEntry.
-
size
public int size()
Returns the number of entries.
-
entries
public java.util.Iterator entries()
Returns anIteratorfor the entries in the map.
-
getChangedNodes
public java.util.Set getChangedNodes()
Returns aSetfor the nodes, childs and parents, in this parent map.
-
clone
public ParentMap clone(java.util.Map map)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG