|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.graph.GraphLayoutCache
com.jgraph.layout.JGraphExampleLayoutCache
public class JGraphExampleLayoutCache
A class that encapsulates autolayout functionality for manual changes. This
layout cache overrides the edit method to add layout results for the given
change which are then passed to the superclass' edit method. This way a
manual change and layout result is merged into one call on the model, thus
resulting in correct undo and redo in the command history.
To morph into the new geometry this cache needs a reference to the hosting
graph, which it calls to perform the animation. After morphing, which is
asynchronous in order to not block the UI dispatcher thread, the graph
invokes edit on the cache again. The autolayout
-switch is used
avoid infinite recursion for this second call.
Nested Class Summary | |
---|---|
class |
JGraphExampleLayoutCache.JGraphMoveSelectionFacade
An example of how to override the graph facade to control the cells that are moveable by graph layouts. |
Nested classes/interfaces inherited from class org.jgraph.graph.GraphLayoutCache |
---|
org.jgraph.graph.GraphLayoutCache.GraphLayoutCacheEdit |
Constructor Summary | |
---|---|
JGraphExampleLayoutCache()
|
|
JGraphExampleLayoutCache(org.jgraph.graph.GraphModel model,
org.jgraph.graph.CellViewFactory factory,
org.jgraph.graph.CellView[] cellViews,
org.jgraph.graph.CellView[] hiddenCellViews,
boolean partial)
Required for XML persistence |
|
JGraphExampleLayoutCache(JGraphExampleGraph graph)
Constructs a new example layout cache for the specified example graph. |
Method Summary | |
---|---|
void |
configureLayout()
Displays the properties of the current layout in dialog. |
void |
edit(java.util.Map attributes,
org.jgraph.graph.ConnectionSet cs,
org.jgraph.graph.ParentMap pm,
javax.swing.undo.UndoableEdit[] e)
Overrides the superclass' method to invoke autolayout. |
java.awt.geom.Rectangle2D |
getBounds(java.lang.Object cell,
java.util.Map nested)
|
boolean |
getPartial()
Required for XML persistence |
void |
layout(java.util.Map nestedMap)
Layouts the graph using the current layout . |
void |
setGraph(JGraphExampleGraph graph)
Setting the graph after loading from file. |
Methods inherited from class org.jgraph.graph.GraphLayoutCache |
---|
addGraphLayoutCacheListener, cellViewsChanged, collapse, createNestedMap, edit, edit, editCell, expand, getAllDescendants, getAllViews, getBounds, getCells, getCells, getCellViews, getCollapseXScale, getCollapseYScale, getFactory, getGraphLayoutCacheListeners, getHiddenCellViews, getHiddenMapping, getIncomingEdges, getLocalAttributes, getMapping, getMapping, getMapping, getModel, getNeighbours, getOutgoingEdges, getPorts, getRoots, getRoots, getVisibleCells, getVisibleSet, graphChanged, hideCells, insert, insert, insert, insert, insertClones, insertEdge, insertGroup, insertViews, isAllAttributesLocal, isAutoSizeOnValueChange, isHidesDanglingConnections, isHidesExistingConnections, isMovesChildrenOnExpand, isMovesParentsOnCollapse, isPartial, isReconnectsEdgesToVisibleParent, isRemembersCellViews, isResizesParentsOnCollapse, isSelectsAllInsertedCells, isSelectsLocalInsertedCells, isShowsChangedConnections, isShowsExistingConnections, isShowsInsertedConnections, isShowsInvisibleEditedCells, isVisible, putMapping, refresh, refresh, reload, remove, remove, removeCells, removeGraphLayoutCacheListener, removeMapping, removeViewLocalAttribute, setAllAttributesLocal, setAutoSizeOnValueChange, setCollapsedState, setCollapseXScale, setCollapseYScale, setFactory, setHiddenSet, setHidesDanglingConnections, setHidesExistingConnections, setLocalAttributes, setModel, setMovesChildrenOnExpand, setMovesParentsOnCollapse, setReconnectsEdgesToVisibleParent, setRemembersCellViews, setResizesParentsOnCollapse, setSelectsAllInsertedCells, setSelectsLocalInsertedCells, setShowsChangedConnections, setShowsExistingConnections, setShowsInsertedConnections, setShowsInvisibleEditedCells, setVisible, setVisible, setVisible, setVisible, setVisible, setVisibleImpl, setVisibleSet, showCells, toBack, toFront, toggleCollapsedState, translateViews, ungroup, update, update, update, valueForCellChanged |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JGraphExampleLayoutCache()
public JGraphExampleLayoutCache(JGraphExampleGraph graph)
graph
- the graph this layout cache is to associated withpublic JGraphExampleLayoutCache(org.jgraph.graph.GraphModel model, org.jgraph.graph.CellViewFactory factory, org.jgraph.graph.CellView[] cellViews, org.jgraph.graph.CellView[] hiddenCellViews, boolean partial)
model
- the model that constitues the data sourceMethod Detail |
---|
public void setGraph(JGraphExampleGraph graph)
public void edit(java.util.Map attributes, org.jgraph.graph.ConnectionSet cs, org.jgraph.graph.ParentMap pm, javax.swing.undo.UndoableEdit[] e)
edit
in class org.jgraph.graph.GraphLayoutCache
public void layout(java.util.Map nestedMap)
layout
. The specified map
constitutes a previous (manual) change that should be reflected by the
facade. The result of the layout is subsequently merged with the map and
passed to the morpher only if the layout provided additional cell
locations.
This may run asynchronously, eg. the method may return when the layout is still running. The graph will remain disabled until the layout terminates or it stopped by the user, but the user interface will not be blocked while the layout is running. Instead, a progress dialog will inform the user of the current progress.
nestedMap
- the nested map constituting a manual changepublic java.awt.geom.Rectangle2D getBounds(java.lang.Object cell, java.util.Map nested)
public boolean getPartial()
getPartial
in class org.jgraph.graph.GraphLayoutCache
public void configureLayout()
layout
in dialog.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |