JGraph | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
CompoundEdit
org.jgraph.graph.DefaultGraphModel.GraphModelEdit
public class DefaultGraphModel.GraphModelEdit
extends CompoundEdit
implements GraphModelEvent.GraphModelChange
Field Summary | |
protected Map | |
protected Map | |
protected Object[] | |
protected ConnectionSet | |
protected Object[] | |
protected Rectangle2D |
|
protected Object[] | |
protected Object[] | |
protected ParentMap | |
protected Map | |
protected ConnectionSet | |
protected ParentMap | |
protected Object[] | |
protected Object[] |
Constructor Summary | |
|
Method Summary | |
protected void |
|
void |
|
Object[] |
|
Map |
|
Object[] |
|
ConnectionSet |
|
Object[] |
|
Rectangle2D | |
Object[] |
|
ParentMap |
|
Map |
|
ConnectionSet | |
ParentMap | |
Object[] |
|
Object |
|
CellView[] |
|
protected void |
|
boolean | |
void |
|
void |
|
void |
|
String |
|
void |
|
protected Map attributes
protected Map cellViews
protected Object[] changed
protected Object[] context
protected Rectangle2D dirtyRegion
The dirty region of the change prior to it happening
protected Object[] insert
protected Object[] inserted
protected Map previousAttributes
protected Object[] remove
protected Object[] removed
public GraphModelEdit(Object[] inserted, Object[] removed, Map attributes, ConnectionSet connectionSet, ParentMap parentMap)
Constructs an edit record.
- Parameters:
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 parents
protected void changeChildCount(Map childCount, Object parent, int change)
public void execute()
Execute this edit such that the next invocation to this method will invert the last execution.
public Object[] filterParents(Map childCount, int children)
public Map getAttributes()
Returns a map of (object, view attributes). The objects are model objects which need to be mapped to views.
- Specified by:
- getAttributes in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public Object[] getChanged()
Returns the cells that have changed. This includes the cells that have been changed through a call to getAttributes and the edges that have been changed with the ConnectionSet.
- Specified by:
- getChanged in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public ConnectionSet getConnectionSet()
Returns the connectionSet.
- Specified by:
- getConnectionSet in interface GraphModelEvent.GraphModelChange
- Returns:
- ConnectionSet
public Object[] getContext()
Returns the objects that have not changed explicitly, but implicitly because one of their dependent cells has changed.
- Specified by:
- getContext in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public Rectangle2D getDirtyRegion()
- Specified by:
- getDirtyRegion in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public Object[] getInserted()
Returns the cells that were inserted.
- Specified by:
- getInserted in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public ParentMap getParentMap()
Returns the parentMap.
- Specified by:
- getParentMap in interface GraphModelEvent.GraphModelChange
- Returns:
- ParentMap
public Map getPreviousAttributes()
Returns a map that contains (object, map) pairs of the attributes that have been stored in the model.
- Specified by:
- getPreviousAttributes in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public ConnectionSet getPreviousConnectionSet()
- Specified by:
- getPreviousConnectionSet in interface GraphModelEvent.GraphModelChange
public ParentMap getPreviousParentMap()
- Specified by:
- getPreviousParentMap in interface GraphModelEvent.GraphModelChange
public Object[] getRemoved()
Returns the cells that were inserted.
- Specified by:
- getRemoved in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public Object getSource()
Returns the source of this change. This can either be a view or a model, if this change is a GraphModelChange.
- Specified by:
- getSource in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public CellView[] getViews(GraphLayoutCache view)
- Specified by:
- getViews in interface GraphModelEvent.GraphModelChange
protected void handleEmptyGroups(Object[] groups)
Adds the groups that become empty to the cells that will be removed. (Auto remove empty cells.) Removed cells will be re-inserted on undo, and the parent- child relations will be restored.
public boolean isSignificant()
public void putViews(GraphLayoutCache view, CellView[] views)
- Specified by:
- putViews in interface GraphModelEvent.GraphModelChange
public void redo() throws CannotRedoException
Redoes a change.
public void setDirtyRegion(Rectangle2D dirty)
- Specified by:
- setDirtyRegion in interface GraphLayoutCacheEvent.GraphLayoutCacheChange
public String toString()
public void undo() throws CannotUndoException
Undoes a change.