org.jgraph.graph
Class GraphLayoutCache.GraphViewEdit
java.lang.Object
|
+--javax.swing.undo.AbstractUndoableEdit
|
+--javax.swing.undo.CompoundEdit
|
+--org.jgraph.graph.GraphLayoutCache.GraphViewEdit
- All Implemented Interfaces:
- GraphModelEvent.ExecutableGraphChange, GraphModelEvent.GraphViewChange, Serializable, UndoableEdit
- Enclosing class:
- GraphLayoutCache
- public class GraphLayoutCache.GraphViewEdit
- extends CompoundEdit
- implements GraphModelEvent.GraphViewChange, GraphModelEvent.ExecutableGraphChange
An implementation of GraphViewChange.
- See Also:
- Serialized Form
Method Summary |
void |
execute()
Execute this edit such that the next invocation to this method will
invert the last execution. |
Map |
getAttributes()
Returns a map of (cell view, attribute) pairs. |
Object[] |
getChanged()
Returns the views that have changed. |
Object[] |
getContext()
Returns the views that have not changed explicitly, but implicitly
because one of their dependent cells has changed. |
Object |
getSource()
Returns the source of this change. |
boolean |
isSignificant()
|
void |
redo()
Redoes a change. |
void |
undo()
Undoes a change. |
Methods inherited from class javax.swing.undo.CompoundEdit |
addEdit, canRedo, canUndo, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, lastEdit, toString |
cells
protected Object[] cells
context
protected CellView[] context
hidden
protected CellView[] hidden
attributes
protected Map attributes
visible
protected Object[] visible
invisible
protected Object[] invisible
GraphLayoutCache.GraphViewEdit
public GraphLayoutCache.GraphViewEdit(Map nested)
- Constructs a GraphViewEdit. This modifies the attributes of the
specified views and may be used to notify UndoListeners.
- Parameters:
viewAttributes
- the map that defines the new attributes
GraphLayoutCache.GraphViewEdit
public GraphLayoutCache.GraphViewEdit(Map attributes,
Object[] visible,
Object[] invisible)
- Constructs a GraphViewEdit. This modifies the attributes of the
specified views and may be used to notify UndoListeners. This should
also take an array of removed cell views, but it is not possible to
add further UndoableEdits to an already executed CompoundEdit, such
as a GraphModel change. Thus, to handle implicit changes -- rather
than piggybacking on the model's event -- the CompoundEdit's addEdit
method should be extended to accept and instantly execute sub-
sequent edits (implicit changes to the view, such as removing a
mapping, hiding a view or the like).
- Parameters:
viewAttributes
- the map that defines the new attributes
isSignificant
public boolean isSignificant()
- Overrides:
isSignificant
in class CompoundEdit
getSource
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 GraphModelEvent.GraphViewChange
getChanged
public Object[] getChanged()
- Returns the views that have changed.
- Specified by:
getChanged
in interface GraphModelEvent.GraphViewChange
getContext
public Object[] getContext()
- Returns the views that have not changed explicitly, but implicitly
because one of their dependent cells has changed.
- Specified by:
getContext
in interface GraphModelEvent.GraphViewChange
getAttributes
public Map getAttributes()
- Returns a map of (cell view, attribute) pairs.
- Specified by:
getAttributes
in interface GraphModelEvent.GraphViewChange
redo
public void redo()
throws CannotRedoException
- Redoes a change.
- Overrides:
redo
in class CompoundEdit
- Throws:
CannotRedoException
- if the change cannot be redone
undo
public void undo()
throws CannotUndoException
- Undoes a change.
- Overrides:
undo
in class CompoundEdit
- Throws:
CannotUndoException
- if the change cannot be undone
execute
public void execute()
- Execute this edit such that the next invocation to this method will
invert the last execution.
- Specified by:
execute
in interface GraphModelEvent.ExecutableGraphChange
Copyright (C) 2001-2004 JGraph.org. All rights reserved.