com.jgraph.graph
Class GraphView.GraphViewLayerEdit

java.lang.Object
  extended byjavax.swing.undo.AbstractUndoableEdit
      extended bycom.jgraph.graph.GraphView.GraphViewLayerEdit
All Implemented Interfaces:
GraphModelEvent.GraphViewChange, java.io.Serializable, javax.swing.undo.UndoableEdit
Direct Known Subclasses:
DefaultGraphModel.GraphModelLayerEdit
Enclosing class:
GraphView

public static class GraphView.GraphViewLayerEdit
extends javax.swing.undo.AbstractUndoableEdit
implements GraphModelEvent.GraphViewChange

An implementation of GraphViewChange.

See Also:
Serialized Form

Field Summary
static int BACK
           
protected  java.lang.Object[] cells
           
protected  java.lang.Object changeSource
           
static int FRONT
           
protected  int layer
           
protected  int[] next
           
protected  int[] prev
           
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
GraphView.GraphViewLayerEdit(java.lang.Object source, java.lang.Object[] cells, int layer)
          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 cells 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.
protected  java.util.List getParentList(java.lang.Object cell)
          Returns the list that exclusively contains view.
 java.lang.Object getSource()
          Returns the source of this change.
 void redo()
          Redoes a change.
 void undo()
          Undoes a change.
protected  void updateListeners()
           
protected  void updateNext()
           
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FRONT

public static final int FRONT
See Also:
Constant Field Values

BACK

public static final int BACK
See Also:
Constant Field Values

changeSource

protected java.lang.Object changeSource

cells

protected transient java.lang.Object[] cells

next

protected transient int[] next

prev

protected transient int[] prev

layer

protected int layer
Constructor Detail

GraphView.GraphViewLayerEdit

public GraphView.GraphViewLayerEdit(java.lang.Object source,
                                    java.lang.Object[] cells,
                                    int layer)
Constructs a GraphViewEdit. This modifies the view attributes of the specified cells and may be used to notify UndoListeners.

Parameters:
source - the source of the change (the view)
Method Detail

updateNext

protected void updateNext()

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 cells 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.


updateListeners

protected void updateListeners()

getParentList

protected java.util.List getParentList(java.lang.Object cell)
Returns the list that exclusively contains view.