|
JGraph |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
org.jgraph.graph.DefaultGraphModel.GraphModelEdit
public class DefaultGraphModel.GraphModelEdit
An implementation of GraphModelChange that can be added to the model event.
Field Summary | |
---|---|
protected java.util.Map |
attributes
|
protected java.util.Map |
cellViews
|
protected java.lang.Object[] |
changed
|
protected ConnectionSet |
connectionSet
|
protected java.lang.Object[] |
context
|
protected java.lang.Object[] |
insert
|
protected java.lang.Object[] |
inserted
|
protected ParentMap |
parentMap
|
protected java.util.Map |
previousAttributes
|
protected ConnectionSet |
previousConnectionSet
|
protected ParentMap |
previousParentMap
|
protected java.lang.Object[] |
remove
|
protected java.lang.Object[] |
removed
|
Fields inherited from class javax.swing.undo.CompoundEdit |
---|
edits |
Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
RedoName, UndoName |
Constructor Summary | |
---|---|
DefaultGraphModel.GraphModelEdit(java.lang.Object[] inserted,
java.lang.Object[] removed,
java.util.Map attributes,
ConnectionSet connectionSet,
ParentMap parentMap)
Constructs an edit record. |
Method Summary | |
---|---|
protected void |
changeChildCount(java.util.Map childCount,
java.lang.Object parent,
int change)
|
void |
execute()
Execute this edit such that the next invocation to this method will invert the last execution. |
java.lang.Object[] |
filterParents(java.util.Map childCount,
int children)
|
java.util.Map |
getAttributes()
Returns a map of (object, view attributes). |
java.lang.Object[] |
getChanged()
Returns the cells that have changed. |
ConnectionSet |
getConnectionSet()
Returns the connectionSet. |
java.lang.Object[] |
getContext()
Returns the objects that have not changed explicitly, but implicitly because one of their dependent cells has changed. |
java.lang.Object[] |
getInserted()
Returns the cells that were inserted. |
ParentMap |
getParentMap()
Returns the parentMap. |
java.util.Map |
getPreviousAttributes()
Returns a map that contains (object, map) pairs of the attributes that have been stored in the model. |
ConnectionSet |
getPreviousConnectionSet()
Returns a connection set representing the graph structure before the change was applied ( an "undo" of the change). |
ParentMap |
getPreviousParentMap()
Returns a parent map representing the group structure before the change was applied ( an "undo" of the change ) |
java.lang.Object[] |
getRemoved()
Returns the cells that were inserted. |
java.lang.Object |
getSource()
Returns the source of this change. |
CellView[] |
getViews(GraphLayoutCache view)
Allows a GraphLayoutCache to retrieve an array of
CellViews that was previously stored with
putViews(GraphLayoutCache, CellView[]) . |
protected void |
handleEmptyGroups(java.lang.Object[] groups)
Adds the groups that become empty to the cells that will be removed. |
boolean |
isSignificant()
|
void |
putViews(GraphLayoutCache view,
CellView[] views)
Allows a GraphLayoutCache to store cell views for
cells that have been removed. |
void |
redo()
Redoes a change. |
java.lang.String |
toString()
|
void |
undo()
Undoes a change. |
Methods inherited from class javax.swing.undo.CompoundEdit |
---|
addEdit, canRedo, canUndo, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, lastEdit |
Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
replaceEdit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object[] insert
protected java.lang.Object[] changed
protected java.lang.Object[] remove
protected java.lang.Object[] context
protected java.lang.Object[] inserted
protected java.lang.Object[] removed
protected java.util.Map attributes
protected java.util.Map previousAttributes
protected ParentMap parentMap
protected ParentMap previousParentMap
protected ConnectionSet connectionSet
protected ConnectionSet previousConnectionSet
protected java.util.Map cellViews
Constructor Detail |
---|
public DefaultGraphModel.GraphModelEdit(java.lang.Object[] inserted, java.lang.Object[] removed, java.util.Map attributes, ConnectionSet connectionSet, ParentMap parentMap)
inserted
- a set of roots that were insertedremoved
- a set of elements that were removedattributes
- the attribute changes made by the editconnectionSet
- the set of changed connectionsparentMap
- the map of changed parentsMethod Detail |
---|
public java.lang.Object[] filterParents(java.util.Map childCount, int children)
protected void changeChildCount(java.util.Map childCount, java.lang.Object parent, int change)
protected void handleEmptyGroups(java.lang.Object[] groups)
public boolean isSignificant()
isSignificant
in interface javax.swing.undo.UndoableEdit
isSignificant
in class javax.swing.undo.CompoundEdit
public java.lang.Object getSource()
getSource
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public java.lang.Object[] getChanged()
getChanged
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public java.lang.Object[] getContext()
getContext
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public java.lang.Object[] getInserted()
getInserted
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public java.lang.Object[] getRemoved()
getRemoved
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public java.util.Map getPreviousAttributes()
getPreviousAttributes
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public java.util.Map getAttributes()
getAttributes
in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public ConnectionSet getConnectionSet()
getConnectionSet
in interface GraphModelEvent.GraphModelChange
public ConnectionSet getPreviousConnectionSet()
GraphModelEvent.GraphModelChange
getPreviousConnectionSet
in interface GraphModelEvent.GraphModelChange
public ParentMap getParentMap()
getParentMap
in interface GraphModelEvent.GraphModelChange
public ParentMap getPreviousParentMap()
GraphModelEvent.GraphModelChange
getPreviousParentMap
in interface GraphModelEvent.GraphModelChange
public void redo() throws javax.swing.undo.CannotRedoException
redo
in interface javax.swing.undo.UndoableEdit
redo
in class javax.swing.undo.CompoundEdit
javax.swing.undo.CannotRedoException
- if the change cannot be redonepublic void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
undo
in class javax.swing.undo.CompoundEdit
javax.swing.undo.CannotUndoException
- if the change cannot be undonepublic void execute()
public void putViews(GraphLayoutCache view, CellView[] views)
GraphModelEvent.GraphModelChange
GraphLayoutCache
to store cell views for
cells that have been removed. Such cell views are used for
re-insertion and restoring the visual attributes.
putViews
in interface GraphModelEvent.GraphModelChange
view
- the GraphLayoutCache
to store the removed
cellsviews
- the cell views to be storedpublic CellView[] getViews(GraphLayoutCache view)
GraphModelEvent.GraphModelChange
GraphLayoutCache
to retrieve an array of
CellViews
that was previously stored with
putViews(GraphLayoutCache, CellView[])
.
getViews
in interface GraphModelEvent.GraphModelChange
view
- the GraphLayoutCache
whose stored cells are
to be retrievedpublic java.lang.String toString()
toString
in class javax.swing.undo.CompoundEdit
|
JGraph |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |