org.jgraph.graph

Class DefaultGraphModel.GraphModelLayerEdit

public class DefaultGraphModel.GraphModelLayerEdit extends AbstractUndoableEdit implements GraphModelEvent.GraphModelChange

An implementation of GraphViewChange.
Field Summary
static intBACK
protected Object[]cells
protected Object[]changed
protected ObjectchangeSource
static intFRONT
protected intlayer
protected int[]next
protected int[]prev
Constructor Summary
GraphModelLayerEdit(Object[] cells, int layer)
Constructs a GraphModelEdit.
Method Summary
voidaddImplicitEdit(UndoableEdit edit)
Allows a GraphLayoutCache to add and execute and UndoableEdit in this change.
voidexecute()
Execute this edit such that the next invocation to this method will invert the last execution.
MapgetAttributes()
Returns null.
Object[]getChanged()
Returns the cells that have changed.
ConnectionSetgetConnectionSet()
Object[]getContext()
Returns null.
Rectangle2DgetDirtyRegion()
Object[]getInserted()
Returns the cells that have changed.
protected ListgetParentList(Object cell)
Returns the list that exclusively contains view.
ParentMapgetParentMap()
Returns null.
MapgetPreviousAttributes()
Returns null.
ConnectionSetgetPreviousConnectionSet()
ParentMapgetPreviousParentMap()
Object[]getRemoved()
Returns the cells that have changed.
ObjectgetSource()
Returns the source of this change.
CellView[]getViews(GraphLayoutCache view)
Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.
voidputViews(GraphLayoutCache view, CellView[] cellViews)
Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.
voidredo()
Redoes a change.
voidsetDirtyRegion(Rectangle2D dirty)
voidundo()
Undoes a change.
protected voidupdateListeners()
protected voidupdateNext()

Field Detail

BACK

public static final int BACK

cells

protected transient Object[] cells

changed

protected Object[] changed

changeSource

protected Object changeSource

FRONT

public static final int FRONT

layer

protected int layer

protected transient int[] next

protected transient int[] prev

Constructor Detail

GraphModelLayerEdit

public GraphModelLayerEdit(Object[] cells, int layer)
Constructs a GraphModelEdit. This modifies the order of the cells in the model.

Method Detail

addImplicitEdit

public void addImplicitEdit(UndoableEdit edit)
Allows a GraphLayoutCache to add and execute and UndoableEdit in this change. This does also work if the parent edit has already been executed, in which case the to be added edit will be executed immediately, after addition. This is used to handle changes to the view that are triggered by certain changes of the model. Such implicit edits may be associated with the view so that they may be undone and redone correctly, and are stored in the model's global history together with the parent event as one unit.

execute

public void execute()
Execute this edit such that the next invocation to this method will invert the last execution.

getAttributes

public Map getAttributes()
Returns null.

getChanged

public Object[] getChanged()
Returns the cells that have changed.

getConnectionSet

public ConnectionSet getConnectionSet()

getContext

public Object[] getContext()
Returns null.

getDirtyRegion

public Rectangle2D getDirtyRegion()

getInserted

public Object[] getInserted()
Returns the cells that have changed.

getParentList

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

getParentMap

public ParentMap getParentMap()
Returns null.

getPreviousAttributes

public Map getPreviousAttributes()
Returns null.

getPreviousConnectionSet

public ConnectionSet getPreviousConnectionSet()

getPreviousParentMap

public ParentMap getPreviousParentMap()

getRemoved

public Object[] getRemoved()
Returns the cells that have changed.

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.

getViews

public CellView[] getViews(GraphLayoutCache view)
Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.

putViews

public void putViews(GraphLayoutCache view, CellView[] cellViews)
Returns the views that have not changed explicitly, but implicitly because one of their dependent cells has changed.

redo

public void redo()
Redoes a change.

Throws: CannotRedoException if the change cannot be redone

setDirtyRegion

public void setDirtyRegion(Rectangle2D dirty)

undo

public void undo()
Undoes a change.

Throws: CannotUndoException if the change cannot be undone

updateListeners

protected void updateListeners()

updateNext

protected void updateNext()
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.