org.jgraph.event

Interface GraphLayoutCacheEvent.GraphLayoutCacheChange

public static interface GraphLayoutCacheEvent.GraphLayoutCacheChange

Defines the interface for objects that may be used to represent a change to the graph layout cache.
Method Summary
MapgetAttributes()
Returns a map that contains (object, map) pairs which holds the new attributes for each changed cell.
Object[]getChanged()
Returns the cells that have changed.
Object[]getContext()
Returns the objects that have not changed explicitly, but implicitly because one of their dependent cells has changed.
Rectangle2DgetDirtyRegion()
Returns the dirty region for the original position of the changed cells before the change happened.
Object[]getInserted()
Returns the cells that have been inserted.
MapgetPreviousAttributes()
Returns a map that contains (object, map) pairs which holds the previous attributes for the changed cells.
Object[]getRemoved()
Returns the cells that have been removed.
ObjectgetSource()
Returns the source of this change.
voidsetDirtyRegion(Rectangle2D dirty)
In some cases the class firing this event will not have access to the dirty region prior to the change.

Method Detail

getAttributes

public Map getAttributes()
Returns a map that contains (object, map) pairs which holds the new attributes for each changed cell. Note: This returns a map of (cell, map) pairs for an insert on a model that is not an attribute store. Use getPreviousAttributes to access the attributes that have been stored in the model.

getChanged

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

Returns: the cell changed

getContext

public Object[] getContext()
Returns the objects that have not changed explicitly, but implicitly because one of their dependent cells has changed. This is typically used to return the edges that are attached to vertices, which in turn have been resized or moved.

Returns: array of contextual cells

getDirtyRegion

public Rectangle2D getDirtyRegion()
Returns the dirty region for the original position of the changed cells before the change happened.

Returns: the dirty region prior to the event

getInserted

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

Returns: the cells that were inserted by the change

getPreviousAttributes

public Map getPreviousAttributes()
Returns a map that contains (object, map) pairs which holds the previous attributes for the changed cells.

Returns: map of attributes before the change

getRemoved

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

Returns: the cells that were removed by the change

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. Note: This is not necessarily the same as the source of the event and is used separately in the graphundomanager.

Returns: the source fo this change

setDirtyRegion

public void setDirtyRegion(Rectangle2D dirty)
In some cases the class firing this event will not have access to the dirty region prior to the change. It is then up to the receiving class to set it once.

Parameters: dirty

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