|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.LocalViewCreator
public abstract class LocalViewCreator
Abstract base class for all local view creator implementations that both defines the contract for such classes as well as provides convenience implementation for laying out and publishing newly created local views. In this context, a local view describes a graph structure that is created from information provided in a model graph according to a arbitrary but specific criteria such as contents of folder nodes or neighborhood of selected nodes.
Nested Class Summary | |
---|---|
static class |
LocalViewCreator.AbstractLocalViewCreator
Abstract base class for local view creator implementations that create local views based upon a subset of either nodes or edges of the model graph. |
static class |
LocalViewCreator.AncestorGroups
Local view creator that creates local views that display all ancestor group nodes of the creator's focus nodes. |
static class |
LocalViewCreator.CommonParentGroup
Local view creator that creates local views that display all nodes that share the same parent group node as at least one of the creator's focus nodes and all edges that connect any two of the displayed nodes. |
static class |
LocalViewCreator.EdgeGroup
Local view creator that tries to identify groups of edges according to shared source and/or target nodes or using ids provided that are bound to the model graph. |
static class |
LocalViewCreator.FolderContents
Local view creator that creates local views that display the content of all folder nodes in the creator's collection of focus nodes. |
static class |
LocalViewCreator.Neighborhood
Local view creator that creates local views based upon the neighborhood of its focused nodes. |
static class |
LocalViewCreator.SourceAndTarget
Local view creator that creates local views by simply displaying its collection of focused edges (and their target and source nodes). |
Constructor Summary | |
---|---|
protected |
LocalViewCreator()
|
Method Summary | |
---|---|
protected abstract void |
buildViewGraph()
Creates graph elements in the creator's view graph. |
protected Layouter |
createDefaultLayouter()
Creates a preconfigured instance of a layout algorithm that is used by default to lay out the contents of a newly created local view. |
Layouter |
getLayouter()
Returns the layout algorithm used to lay out the contents of a newly created local view or null if the contents of said view should
not be laid out at all. |
abstract Graph2D |
getModel()
Returns the model graph for which the creator may create local views. |
abstract Edge |
getModelEdge(Edge view)
Returns a edge in the creator's model graph that corresponds to the specified edge in the creator's view graph or null if
there is no corresponding edge. |
abstract Node |
getModelNode(Node view)
Returns a node in the creator's model graph that corresponds to the specified node in the creator's view graph or null if there
is no corresponding node. |
abstract Edge |
getViewEdge(Edge model)
Returns a edge in the creator's view graph that corresponds to the specified edge in the creator's model graph or null if
there is no corresponding edge. |
abstract Graph2D |
getViewGraph()
Returns the view graph that is modified by the creator's updateViewGraph method. |
abstract Node |
getViewNode(Node model)
Returns a node in the creator's view graph that corresponds to the specified node in the creator's model graph or null if
there is no corresponding node. |
protected void |
layoutViewGraph()
Lays out the contents of the creator's view graph using the layout algorithm returned by getLayouter() which is additionally wrapped
using MinNodeSizeStage . |
protected void |
publishViewGraph()
Notifies all View implementations registered for the
creator's view graph that the graph may have changed (due to
updateViewGraph ). |
void |
setLayouter(Layouter layouter)
Specifies the layout algorithm to lay out the contents of a newly created local view. |
void |
updateViewGraph()
Creates the local view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LocalViewCreator()
Method Detail |
---|
public Layouter getLayouter()
null
if the contents of said view should
not be laid out at all.
null
if the contents of said view should
not be laid out at all.setLayouter(y.layout.Layouter)
public void setLayouter(Layouter layouter)
layouter
- the layout algorithm to lay out the contents of a newly
created local view or null
if the contents of said view should
not be laid out at all.getLayouter()
protected Layouter createDefaultLayouter()
null
to indicate, that the contents
of newly created local views should not be laid out at all.
The default implementation creates a new instance of
IncrementalHierarchicLayouter
that is
configured to consider node labels and use integrated edge labeling as well
as to route edges in an orthogonal fashion.
Note: This factory method is called from the creator's constructor.
IncrementalHierarchicLayouter.setConsiderNodeLabelsEnabled(boolean)
,
IncrementalHierarchicLayouter.setIntegratedEdgeLabelingEnabled(boolean)
,
IncrementalHierarchicLayouter.setOrthogonallyRouted(boolean)
public void updateViewGraph()
buildViewGraph();
layoutViewGraph();
publishViewGraph();
buildViewGraph()
,
layoutViewGraph()
,
publishViewGraph()
protected void layoutViewGraph()
getLayouter()
which is additionally wrapped
using MinNodeSizeStage
.
The default implementation uses Graph2DLayoutExecutor
with port intersection calculation enabled to execute the aforementioned
layout algorithm.
updateViewGraph()
protected void publishViewGraph()
View
implementations registered for the
creator's view graph that the graph may have changed (due to
updateViewGraph
).
The default implementation calls updateView
for each registered view. If a registered view is of type
Graph2DView
, fitContent
is
called right before updateView
.
updateViewGraph()
,
View.updateView()
,
Graph2DView.fitContent()
public abstract Graph2D getModel()
public abstract Graph2D getViewGraph()
updateViewGraph
method.
updateViewGraph
method.updateViewGraph()
protected abstract void buildViewGraph()
updateViewGraph()
public abstract Node getModelNode(Node view)
null
if there
is no corresponding node.
view
- a node in the creator's view graph.
null
if there
is no corresponding node.public abstract Node getViewNode(Node model)
null
if
there is no corresponding node.
model
- a node in the creator's model graph.
null
if
there is no corresponding node.public abstract Edge getModelEdge(Edge view)
null
if
there is no corresponding edge.
view
- a edge in the creator's view graph.
null
if
there is no corresponding edge.public abstract Edge getViewEdge(Edge model)
null
if
there is no corresponding edge.
model
- a edge in the creator's model graph.
null
if
there is no corresponding edge.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |