org.jgraph.graph
public class GraphLayoutCache extends Object implements CellMapper, Serializable
Nested Class Summary | |
---|---|
class | GraphLayoutCache.GraphLayoutCacheEdit
An implementation of GraphLayoutCacheChange. |
Field Summary | |
---|---|
protected boolean | allAttributesLocal
Controls if all attributes are local. |
protected boolean | autoSizeOnValueChange
True if the cells should be auto-sized when their values change. |
protected double | collapseXScale
Specified the initial x- and y-scaling factor for initial collapsed group
bounds. |
protected double | collapseYScale
Specified the initial x- and y-scaling factor for initial collapsed group
bounds. |
protected CellViewFactory | factory
Factory to create the views. |
protected GraphModel | graphModel
Reference to the graphModel |
protected Map | hiddenMapping
Maps cells to views. |
protected boolean | hidesDanglingConnections
Boolean indicating whether existing connections should be hidden if their
source or target port is removed from the model. |
protected boolean | hidesExistingConnections
Boolean indicating whether existing connections should be hidden if their
source or target and no parent of the ports is visible, either by hiding
the cell or by changing the source or target of the edge to a hidden
cell. |
protected EventListenerList | listenerList
The list of listeners that listen to the GraphLayoutCache. |
protected Set | localAttributes
A set containing all attribute keys that are stored in the cell views, in
other words, the view-local attributes. |
protected Map | mapping
Maps cells to views. |
protected boolean | movesChildrenOnExpand
Boolean indicating whether children should be moved to the parent group's
origin on expand. |
protected boolean | movesParentsOnCollapse
Boolean indicating whether parents should be moved to the child area
origin on collapse. |
protected boolean | partial
Only portions of the model are visible. |
protected PortView[] | ports
Cached array of all ports for the view. |
protected boolean | reconnectsEdgesToVisibleParent
Boolean indicating whether edges should be reconneted to visible parents
on collapse/expand. |
protected boolean | remembersCellViews
Boolean indicating whether cellviews should be remembered once visible in
this GraphLayoutCache. |
protected boolean | resizesParentsOnCollapse
Boolean indicating whether parents should always be resized to the child
area on collapse. |
protected List | roots
Ordered list of roots for the view. |
protected boolean | selectsAllInsertedCells
Boolean indicating whether inserted cells should automatically be
selected. |
protected boolean | selectsLocalInsertedCells
Boolean indicating whether cells that are inserted using the local insert
method should automatically be selected. |
protected boolean | showsChangedConnections
Boolean indicating whether connections should be made visible when
reconnected and their source and target port is visible. |
protected boolean | showsExistingConnections
Boolean indicating whether existing connections should me made visible if
their sources or targets are made visible, given the opposite end of the
edge is already visible or made visible, too. |
protected boolean | showsInsertedCells
Boolean indicating whether inserted should be made visible if they are
inserted via
(Object[], Map, ConnectionSet, ParentMap, UndoableEdit[]) .
|
protected boolean | showsInsertedConnections
Boolean indicating whether inserted edges should me made visible if their
sources or targets are already visible. |
protected boolean | showsInvisibleEditedCells
Boolean indicating whether edited cells should be made visible if they
are changed via
(Map, ConnectionSet, ParentMap, UndoableEdit[]) . |
protected Set | visibleSet
The set of visible cells. |
Constructor Summary | |
---|---|
GraphLayoutCache()
Constructs a graph layout cache. | |
GraphLayoutCache(GraphModel model, CellViewFactory factory)
Constructs a view for the specified model that uses factory
to create its views.
| |
GraphLayoutCache(GraphModel model, CellViewFactory factory, boolean partial)
Constructs a view for the specified model that uses factory
to create its views.
| |
GraphLayoutCache(GraphModel model, CellViewFactory factory, CellView[] cellViews, CellView[] hiddenCellViews, boolean partial)
Constructs a view for the specified model that uses factory
to create its views.
|
Method Summary | |
---|---|
void | addGraphLayoutCacheListener(GraphLayoutCacheListener l)
Adds a listener for the GraphLayoutCacheEvent posted after the graph
layout cache changes.
|
protected Object[] | addVisibleDependencies(Object[] cells, boolean visible) |
protected UndoableEdit[] | augment(UndoableEdit[] e, UndoableEdit edit) |
protected void | augmentNestedMapForValueChange(Map nested, Object cell, Object newValue)
Hook for subclassers to add more stuff for value changes. |
protected void | cellExpanded(Object cell)
Called when a child has been made visible by expanding its parent. |
void | cellViewsChanged(CellView[] cellViews)
Invoke this method after you've changed how the cells are to be
represented in the graph. |
protected void | cellWillCollapse(Object cell) |
void | collapse(Object[] groups)
Collapses all groups by hiding all their descendants.
|
protected GraphLayoutCache.GraphLayoutCacheEdit | createLocalEdit(Object[] inserted, Map nested, Object[] visible, Object[] invisible)
Creates a local edit for the specified change. |
Map | createNestedMap()
Returns a nested map of (cell, map) pairs that represent all attributes
of all cell views in this view.
|
void | edit(Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e)
Applies the propertyMap and the connection changes to the
model. |
void | edit(Map attributes)
A shortcut method that takes a nested map and passes it to the edit
method. |
void | edit(Object[] cells, Map attributes)
Applies the attributes to all cells by
creating a map that contains the attributes for each cell and passing it
to edit on this layout cache. |
void | editCell(Object cell, Map attributes)
Applies the attributes to a single cell by
creating a map that contains the attributes for this cell and passing it
to edit on this layout cache. |
void | expand(Object[] cells)
Expands all groups by showing all children. |
protected void | fireGraphLayoutCacheChanged(Object source, GraphLayoutCacheEvent.GraphLayoutCacheChange edit) |
CellView[] | getAllDescendants(CellView[] views)
Returns all views, including descendants that have a parent in
views , especially the PortViews. |
CellView[] | getAllViews()
Returns all views, shortcut to getAllDescendants(getRoots()) |
static Rectangle2D | getBounds(CellView[] views)
Returns the bounding box for the specified cell views. |
Object[] | getCells(boolean groups, boolean vertices, boolean ports, boolean edges)
A helper method to return various arrays of cells that are visible in
this cache. |
Object[] | getCells(CellView[] views)
Takes an array of views and returns the array of the corresponding cells
by using getCell for each view. |
CellView[] | getCellViews() |
protected Object | getChildPort(Object edge, boolean source)
Hook for subclassers to return the port to be used for edges that have
been connected to the group. |
double | getCollapseXScale() |
double | getCollapseYScale() |
protected Object[] | getContext(GraphModelEvent.GraphModelChange change)
Hook for subclassers to augment the context for a graphChange. |
protected List | getEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops, boolean incoming)
Returns the incoming or outgoing edges for cell. |
CellViewFactory | getFactory()
Returns the factory that was passed to the constructor. |
GraphLayoutCacheListener[] | getGraphLayoutCacheListeners()
Return an array of all GraphLayoutCacheListener that were added to this
model. |
CellView[] | getHiddenCellViews() |
Map | getHiddenMapping()
Returns the hiddenMapping.
|
List | getIncomingEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops)
Returns the incoming edges for cell. |
Set | getLocalAttributes() |
CellView | getMapping(Object cell, boolean create)
Returns the view for the specified cell. |
CellView[] | getMapping(Object[] cells)
Returns the views for the specified array of cells without creating these
views on the fly. |
CellView[] | getMapping(Object[] cells, boolean create)
Returns the views for the specified array of cells. |
GraphModel | getModel()
Returns the current model. |
List | getNeighbours(Object cell, Set exclude, boolean directed, boolean visibleCells)
Returns a collection of cells that are connected to the specified cell by
edges. |
List | getOutgoingEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops)
Returns the outgoing edges for cell. |
protected Object | getParentPort(Object edge, boolean source)
Hook for subclassers to return the first or last visible port to replace
the current source or target port of the edge. |
protected Collection | getParentPorts(Object cell) |
boolean | getPartial()
Required for XML persistence
|
PortView[] | getPorts()
Returns the ports of the view. |
protected Collection | getPorts(Object cell) |
CellView[] | getRoots()
Returns the roots of the view. |
CellView[] | getRoots(Rectangle2D clip)
Return all root cells that intersect the given rectangle. |
Object[] | getVisibleCells(Object[] cells)
Returns a an array with the visible cells in cells . |
Set | getVisibleSet()
Returns the set of visible sets in this view. |
void | graphChanged(GraphModelEvent.GraphModelChange change)
Called from BasicGraphUI.ModelHandler to update the view based on the
specified GraphModelEvent. |
protected Map | handleAttributes(Map attributes)
Attention: Undo will not work for routing-change if ROUTING and POINTS
are stored in different locations. |
protected boolean | hasVisibleParent(Object cell, Set invisible)
Checks if the port or one of its parents is visible. |
void | hideCells(Object[] cells, boolean descandants)
Hides the specified cells with all children if descandants
is true.
|
protected void | hideCellsForChange(GraphModelEvent.GraphModelChange change) |
void | insert(Object[] roots, Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e)
Inserts the cells and connections into the model, and
absorbs the local attributes. |
void | insert(Object cell)
Inserts the specified vertex into the graph model. |
void | insert(Object[] cells)
Inserts the specified cells into the graph model. |
void | insert(Object[] cells, Map nested, ConnectionSet cs, ParentMap pm)
Variant of the insert method that allows to pass a default connection set
and parent map and nested map. |
Object[] | insertClones(Object[] cells, Map clones, Map nested, ConnectionSet cs, ParentMap pm, double dx, double dy)
Inserts the cloned cells from the clone map and clones the passed-in
arguments according to the clone map before insertion and returns the
clones in order of the cells. |
void | insertEdge(Object edge, Object source, Object target)
Inserts the specified edge into the graph model. |
void | insertGroup(Object group, Object[] children)
Inserts the specified cell as a parent of children. |
void | insertViews(CellView[] views)
Adds the specified model root cells to the view. |
boolean | isAllAttributesLocal() |
boolean | isAutoSizeOnValueChange()
Returns true if cells should be auto-sized when their values change
|
protected boolean | isControlAttribute(Object cell, Object key, Object value)
Returns true if key is a control attribute |
boolean | isHidesDanglingConnections()
Returns the hidesDanglingConnections.
|
boolean | isHidesExistingConnections()
Returns the hidesExistingConnections.
|
protected boolean | isLocalAttribute(Object cell, Object key, Object value)
Returns true if the set of local attributes contains key |
boolean | isMovesChildrenOnExpand() |
boolean | isMovesParentsOnCollapse() |
boolean | isPartial() |
boolean | isReconnectsEdgesToVisibleParent() |
boolean | isRemembersCellViews()
Returns the remembersCellViews.
|
boolean | isResizesParentsOnCollapse() |
boolean | isSelectsAllInsertedCells() |
boolean | isSelectsLocalInsertedCells() |
boolean | isShowsChangedConnections() |
boolean | isShowsExistingConnections()
Returns the showsExistingConnections.
|
boolean | isShowsInsertedConnections()
Returns the showsInsertedConnections.
|
boolean | isShowsInvisibleEditedCells() |
boolean | isVisible(Object cell)
Whether or not the specified cell is visible.
|
void | putMapping(Object cell, CellView view)
Associates the specified model cell with the specified view. |
void | refresh(CellView[] views, boolean create) |
void | refresh(CellView view, boolean create) |
void | reload()
Remaps all existing views using the CellViewFactory
and replaces the respective root views. |
protected void | reloadRoots()
Completely reloads all roots from the model in the order returned by
DefaultGraphModel.getAll. |
void | remove(Object[] cells)
Removes cells from the model. |
void | remove(Object[] cells, boolean descendants, boolean edges)
Removes cells from the model, including all children and connected edges
if children or edges is true, respectively.
|
CellView[] | removeCells(Object[] cells)
Removes the specified model root cells from the view by removing the
mapping between the cell and its view and makes the cells invisible. |
void | removeGraphLayoutCacheListener(GraphLayoutCacheListener l)
Removes a listener previously added with addGraphLayoutCacheListener()
.
|
CellView | removeMapping(Object cell)
Removes the association for the specified model cell and returns the view
that was previously associated with the cell. |
boolean | removeViewLocalAttribute(Object key, boolean addToModel, boolean override)
Handles the removal of view local attributes. |
void | setAllAttributesLocal(boolean allAttributesLocal) |
void | setAutoSizeOnValueChange(boolean flag)
Determines whether cells should be auto-sized when their values change.
|
void | setCollapsedState(Object[] collapse, Object[] expand)
Collapses and/or expands the specified cell(s)
NOTE: Your GraphLayoutCache must be partial (set
partial to true in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
|
void | setCollapseXScale(double collapseXScale) |
void | setCollapseYScale(double collapseYScale) |
void | setFactory(CellViewFactory factory)
Sets the factory that creates the cell views. |
void | setHiddenSet(Map hiddenSet)
Sets the hiddenSet.
|
void | setHidesDanglingConnections(boolean hidesDanglingConnections)
Sets the hidesDanglingConnections
|
void | setHidesExistingConnections(boolean hidesExistingConnections)
Sets the hidesExistingConnections
|
void | setLocalAttributes(Set localAttributes) |
void | setModel(GraphModel model)
Sets the current model. |
void | setMovesChildrenOnExpand(boolean moveChildrenOnExpand) |
void | setMovesParentsOnCollapse(boolean movesParentsOnCollapse) |
void | setReconnectsEdgesToVisibleParent(boolean reconnectsEdgesToVisibleParent) |
void | setRemembersCellViews(boolean rememberCellViews)
Sets the rememberCellViews.
|
void | setResizesParentsOnCollapse(boolean resizesParentsOnCollapse) |
void | setSelectsAllInsertedCells(boolean selectsAllInsertedCells) |
void | setSelectsLocalInsertedCells(boolean selectsLocalInsertedCells) |
void | setShowsChangedConnections(boolean showsChangedConnections) |
void | setShowsExistingConnections(boolean showsExistingConnections)
Sets the showsExistingConnections
|
void | setShowsInsertedConnections(boolean showsInsertedConnections)
Sets the showsInsertedConnections
|
void | setShowsInvisibleEditedCells(boolean showsInvisibleEditedCells) |
void | setVisible(Object cell, boolean visible)
Makes the specified cell visible or invisible depending on the flag
passed in. |
void | setVisible(Object[] cells, boolean visible)
Makes the specified cells visible or invisible depending on the flag
passed in. |
void | setVisible(Object[] visible, Object[] invisible)
Changes the visibility state of the cells passed in. |
void | setVisible(Object[] visible, Object[] invisible, ConnectionSet cs)
Changes the visibility state of the cells passed in. |
void | setVisible(Object[] visible, Object[] invisible, Map attributes, ConnectionSet cs)
Changes the visibility state of the cells passed in. |
boolean | setVisibleImpl(Object[] cells, boolean visible)
The actual implementation of changing cells' visibility state. |
void | setVisibleSet(Set visible)
Applies the specified set of cells as being those visible |
void | showCells(Object[] cells, boolean descandants)
Shows the specified cells with all children if descandants
is true.
|
protected void | showCellsForChange(GraphModelEvent.GraphModelChange change) |
void | toBack(Object[] cells)
Sends cells to back. |
void | toFront(Object[] cells)
Brings cells to front. |
void | toggleCollapsedState(Object[] cells, boolean collapseOnly, boolean expandOnly)
Toggles the collapsed state of the specified cells.
|
static void | translateViews(CellView[] views, double dx, double dy)
Translates the specified views by the given amount.
|
Object[] | ungroup(Object[] cells)
Ungroups all groups in cells and returns the children that are not ports.
|
void | update()
Sets the current model. |
void | update(CellView[] views) |
void | update(CellView view) |
protected void | updatePorts()
Updates the cached array of ports. |
void | valueForCellChanged(Object cell, Object newValue)
Messaged when the user has altered the value for the item identified by
cell to newValue. |
Deprecated: edges are moved to parent view and back automatically
Boolean indicating whether edges should be reconneted to visible parents on collapse/expand. Default is false.(Object[], Map, ConnectionSet, ParentMap, UndoableEdit[])
.
Default is true.(Map, ConnectionSet, ParentMap, UndoableEdit[])
. Default is
false.factory
to create its views.
Parameters: model the model that constitues the data source
factory
to create its views.
Parameters: model the model that constitues the data source
factory
to create its views.
Parameters: model the model that constitues the data source
Parameters: l the listener to add
See Also: GraphLayoutCache
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: groups
See Also: GraphLayoutCache
propertyMap
and the connection changes to the
model. The initial edits
that triggered the call are
considered to be part of this transaction. Notifies the model- and undo
listeners of the change. Note: The passed in attributes may contain
PortViews.attributes
to all cells
by
creating a map that contains the attributes for each cell and passing it
to edit on this layout cache. Example:
Map attrs = new java.util.Hashtable(); GraphConstants.setBackground(attrs, Color.RED); graph.getGraphLayoutCache().edit(graph.getSelectionCells(), attrs);
attributes
to a single cell
by
creating a map that contains the attributes for this cell and passing it
to edit on this layout cache. Example:
Map attrs = new java.util.Hashtable(); GraphConstants.setBackground(attrs, Color.RED); graph.getGraphLayoutCache().editCell(graph.getSelectionCell(), attrs);
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.views
, especially the PortViews. Note: Iterative
Implementation using model.getChild and getMapping on this cell mapper.graph.getSelectionCells(graph.getGraphLayoutCache().getCells(false, true,
false, false));
getCell
for each view.Returns: Returns an unordered array of all visible cellviews.
source
.Returns: Returns the collapseXScale.
Returns: Returns the collapseYScale.
Parameters: cell
The cell from which the edges will be determined exclude
The set of edges to ignore when searching visibleCells
whether or not only visible cells should be processed selfLoops
whether or not to include self loops in the returned list incoming
true
if incoming edges are to be obtained,
false
if outgoing edges are to be obtained
Returns: Returns the list of incoming or outgoing edges for
cell
Returns: Returns an unordered array of all hidden cellviews.
Returns: Map
Parameters: cell The cell from which the incoming edges will be determined exclude The set of edges to ignore when searching visibleCells whether or not only visible cells should be processed selfLoops whether or not to include self loops in the returned list
Returns: Returns the list of incoming edges for cell
Returns: Returns the localAttributes.
create
is false
.Parameters: cell The cell from which the neighbours will be determined exclude The set of cells to ignore when searching directed whether or not direction of edges should be taken into account visibleCells whether or not to only consider visible cells
Returns: Returns the list of neighbours for cell
Parameters: cell The cell from which the outgoing edges will be determined exclude The set of edges to ignore when searching visibleCells whether or not only visible cells should be processed selfLoops whether or not to include self loops in the returned list
Returns: Returns the list of outgoing edges for cell
Returns: whether or not the cache is partial
cells
.Returns: the set of visible sets in this view.
descandants
is true.
NOTE: Your GraphLayoutCache must be partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.cells
and connections into the model, and
absorbs the local attributes. This implementation sets the inserted cells
visible and selects the new roots depending on graph.selectNewCells.DefaultGraphCell vertex = new DefaultGraphCell("Hello, world!"); Map attrs = vertex.getAttributes(); GraphConstants.setOpaque(attrs, false); GraphConstants.setBorderColor(attrs, Color.black); DefaultPort port = new DefaultPort(); vertex.add(port); port.setParent(vertex); graph.getGraphLayoutCache().insert(vertex);
Parameters: cell inserts the specified cell in the cache
Object source = graph.getDefaultPortForCell(sourceVertex).getCell(); Object target = graph.getDefaultPortForCell(targetVertex).getCell(); DefaultEdge edge = new DefaultEdge("Hello, world!"); edge.setSource(source); edge.setTarget(target); Map attrs = edge.getAttributes(); GraphConstants.setLineEnd(attrs, GraphConstants.ARROW_TECHNICAL); graph.getGraphLayoutCache().insert(edge);
Object[] cells = graph.getDescendants(graph.order(graph.getSelectionCells())); ConnectionSet cs = ConnectionSet.create(graphModel, cells, false); ParentMap pm = ParentMap.create(graphModel, cells, false, true); cells = graphLayoutCache.insertClones(cells, graph.cloneCells(cells), attributes, cs, pm, 0, 0);
Parameters: edge the edge to be inserted source the source port this edge is connected to target the target port this edge is connected to
DefaultGraphCell group = new DefaultGraphCell("Hello, world!"); Object[] cells = DefaultGraphModel.order(graph.getModel(), graph .getSelectionCells()); Rectangle2D bounds = graph.getCellBounds(cells); if (bounds != null) { bounds = new Rectangle2D.Double(bounds.getX() + bounds.getWidth() / 4, bounds.getY() + bounds.getHeight() / 4, bounds.getWidth() / 2, bounds.getHeight() / 2); GraphConstants.setBounds(group.getAttributes(), bounds); } graph.getGraphLayoutCache().insertGroup(group, cells);
Returns: Returns the askLocalAttribute.
Returns: true if cells should be auto-sized when their values change
key
is a control attributeReturns: boolean
Returns: boolean
key
Returns: Returns the moveChildrenOnExpand.
Returns: Returns the movesParentsOnCollapse.
Deprecated: edges are moved to parent view and back automatically
Returns: Returns the reconnectsEdgesToVisibleParent.
Returns: boolean
Returns: Returns the resizesParentsOnCollapse.
Returns: Returns the selectsAllInsertedCells.
Returns: Returns the selectsLocalInsertedCells.
Returns: Returns the showsChangedConnections.
Returns: boolean
Returns: boolean
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
null is always visible
Parameters: cell the whose visibility to determine
Returns: whether or not the cell is visible
cells
from the model.children
or edges
is true, respectively.
Parameters: cells The cells to remove. descendants Whether to remove all descendants as well. edges Whether to remove all connected edges as well.
Parameters: l the listener to remove
See Also: GraphLayoutCache
Parameters: key the key of the view local attribute addToModel whether or not to move the attribute values to the graph model override whether or not to override the key's value in the model cell's attribute map if it exists
Returns: whether or not the operation completed sucessfully
Parameters: allAttributesLocal The allAttributesLocal to set.
Parameters: flag a boolean value, true if cells should be auto-sized when their values change
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: collapse the cells to be collapsed expand the cells to be expanded
Parameters: collapseXScale The collapseXScale to set.
Parameters: collapseYScale The collapseYScale to set.
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: hiddenSet The hiddenSet to set
Parameters: hidesDanglingConnections
Parameters: hidesExistingConnections
Parameters: localAttributes The localAttributes to set.
Parameters: moveChildrenOnExpand The moveChildrenOnExpand to set.
Parameters: movesParentsOnCollapse The movesParentsOnCollapse to set.
Deprecated: edges are moved to parent view and back automatically
Parameters: reconnectsEdgesToVisibleParent The reconnectsEdgesToVisibleParent to set.
Parameters: rememberCellViews The rememberCellViews to set
Parameters: resizesParentsOnCollapse The resizesParentsOnCollapse to set.
Parameters: selectsAllInsertedCells The selectsAllInsertedCells to set.
Parameters: selectsLocalInsertedCells The selectsLocalInsertedCells to set.
Parameters: showsChangedConnections The showsChangedConnections to set.
Parameters: showsExistingConnections
Parameters: showsInsertedConnections
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: cell
the cell whose visibility is to be changed visible
true
if cell is to be made visible
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: cells
the cells whose visibility is to be changed visible
true
if the cells are to be made visible
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: visible cells to be made visible invisible cells to be made invisible
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: visible
cells to be made visible invisible
cells to be made invisible cs
a ConnectionSet
describing the new state of
edge connections in the graph
partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: visible
cells to be made visible invisible
cells to be made invisible attributes
a nested attribute map of cells/attribute maps cs
a ConnectionSet
describing the new state of
edge connections in the graph
setVisible
methods in this
class are intended to be the main public way to change visiblilty.
However, if you do not require the undo to be formed, this method is much
quicker, just note that you must call updatePorts
if this
method returns true.
NOTE: Your GraphLayoutCache must be partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: cells visible
Returns: whether or not the ports needed updating in the calling method
Parameters: visible the set of visible cells
descandants
is true.
NOTE: Your GraphLayoutCache must be partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.cells
to back. Note: This expects an array of cells!cells
to front. Note: This expects an array of
cells!partial
(set
partial
to true
in the constructor)
in order to use the visibility functionality of expand/collapse,
setVisible, etc.
Parameters: cells The cells to toggle the collapsed state for. collapseOnly Whether cells should only be collapsed. expandOnly Whether cells should only be expanded.
Parameters: views an array of cell view to each be translated dx the amount to translate the views in the x-axis dy the amount to translate the views in the x-axis