com.jgraph.graph
Class GraphView.GraphViewEdit

java.lang.Object
  extended byjavax.swing.undo.AbstractUndoableEdit
      extended byjavax.swing.undo.CompoundEdit
          extended bycom.jgraph.graph.GraphView.GraphViewEdit
All Implemented Interfaces:
GraphModelEvent.GraphViewChange, java.io.Serializable, javax.swing.undo.UndoableEdit
Enclosing class:
GraphView

public class GraphView.GraphViewEdit
extends javax.swing.undo.CompoundEdit
implements GraphModelEvent.GraphViewChange

An implementation of GraphViewChange.

See Also:
Serialized Form

Field Summary
protected  java.util.Map attributeMap
           
protected  java.lang.Object[] cells
           
protected  CellView[] context
           
 
Fields inherited from class javax.swing.undo.CompoundEdit
edits
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
GraphView.GraphViewEdit(java.util.Map viewAttributeMap)
          Constructs a GraphViewEdit.
 
Method Summary
 void execute()
          Execute this edit such that the next invocation to this method will invert the last execution.
 java.util.Map getAttributeMap()
          Returns a map of (cell view, attribute) pairs.
 java.lang.Object[] getChanged()
          Returns the views that have changed.
 java.lang.Object[] getContext()
          Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.
 java.lang.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
 
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

cells

protected java.lang.Object[] cells

context

protected CellView[] context

attributeMap

protected java.util.Map attributeMap
Constructor Detail

GraphView.GraphViewEdit

public GraphView.GraphViewEdit(java.util.Map viewAttributeMap)
Constructs a GraphViewEdit. This modifies the attributes of the specified views and may be used to notify UndoListeners.

Method Detail

isSignificant

public boolean isSignificant()
Specified by:
isSignificant in interface javax.swing.undo.UndoableEdit

getSource

public java.lang.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 java.lang.Object[] getChanged()
Returns the views that have changed.

Specified by:
getChanged in interface GraphModelEvent.GraphViewChange

getContext

public java.lang.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

getAttributeMap

public java.util.Map getAttributeMap()
Returns a map of (cell view, attribute) pairs.

Specified by:
getAttributeMap in interface GraphModelEvent.GraphViewChange

redo

public void redo()
          throws javax.swing.undo.CannotRedoException
Redoes a change.

Specified by:
redo in interface javax.swing.undo.UndoableEdit
Throws:
javax.swing.undo.CannotRedoException - if the change cannot be redone

undo

public void undo()
          throws javax.swing.undo.CannotUndoException
Undoes a change.

Specified by:
undo in interface javax.swing.undo.UndoableEdit
Throws:
javax.swing.undo.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.