Search this API

y.view
Class LocalViewCreator.CommonParentGroup

java.lang.Object
  extended by y.view.LocalViewCreator
      extended by y.view.LocalViewCreator.AbstractLocalViewCreator
          extended by y.view.LocalViewCreator.CommonParentGroup
Enclosing class:
LocalViewCreator

public static class LocalViewCreator.CommonParentGroup
extends LocalViewCreator.AbstractLocalViewCreator

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.

 

Nested Class Summary
 
Nested classes/interfaces inherited from class y.view.LocalViewCreator
LocalViewCreator.AbstractLocalViewCreator, LocalViewCreator.AncestorGroups, LocalViewCreator.CommonParentGroup, LocalViewCreator.EdgeGroup, LocalViewCreator.FolderContents, LocalViewCreator.Neighborhood, LocalViewCreator.SourceAndTarget
 
Field Summary
 
Fields inherited from class y.view.LocalViewCreator.AbstractLocalViewCreator
ELEMENT_TYPE_EDGE, ELEMENT_TYPE_NODE
 
Constructor Summary
LocalViewCreator.CommonParentGroup(Graph2D model)
          Creates a new CommonParentGroup instance for the specified model graph.
LocalViewCreator.CommonParentGroup(Graph2D model, GraphCopier.CopyFactory factory)
          Creates a new CommonParentGroup instance for the specified model graph and copy factory.
LocalViewCreator.CommonParentGroup(Graph2D model, GraphCopier.CopyFactory factory, Graph2D view)
          Creates a new CommonParentGroup instance for the specified model graph, copy factory, and view graph.
 
Method Summary
protected  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.
 Graph2D getModel()
          Returns the model graph for which the creator may create local views.
 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.
 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.
 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.
 Graph2D getViewGraph()
          Returns the view graph that is modified by the creator's updateViewGraph method.
 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.
 boolean isIncludeDescendants()
          Determines whether the contents of group nodes should be included in the created local view as well.
 void setIncludeDescendants(boolean includeDescendants)
          Specifies whether the contents of group nodes should be included in the created local view as well.
 
Methods inherited from class y.view.LocalViewCreator.AbstractLocalViewCreator
addFocusEdge, addFocusNode, addSelectionTrigger, clearFocusEdges, clearFocusNodes, createHoverTrigger, createSelectionTrigger, focusEdges, focusNodes, getElementType, getTriggerDelay, isFocusEdge, isFocusNode, isSingleFocus, removeFocusEdge, removeFocusNode, removeSelectionTrigger, setSingleFocus, setTriggerDelay
 
Methods inherited from class y.view.LocalViewCreator
getLayouter, layoutViewGraph, publishViewGraph, setLayouter, updateViewGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalViewCreator.CommonParentGroup

public LocalViewCreator.CommonParentGroup(Graph2D model)
Creates a new CommonParentGroup instance for the specified model graph. Invoking this constructor is equivalent to:
new CommonParentGroup(model, model.getGraphCopyFactory(), (Graph2D) model.getGraphCopyFactory().createGraph());

Parameters:
model - the graph for which local views are to be created.

LocalViewCreator.CommonParentGroup

public LocalViewCreator.CommonParentGroup(Graph2D model,
                                          GraphCopier.CopyFactory factory)
Creates a new CommonParentGroup instance for the specified model graph and copy factory. Invoking this constructor is equivalent to:
new CommonParentGroup(model, factory, (Graph2D) factory.createGraph());

Note: The graph instances created by the specified factory have to be of type Graph2D or subclasses thereof. Moreover, the factory.

Parameters:
model - the graph for which local views are to be created.
factory - that CopyFactory that will be used to create graph elements in the creator's view graph.

LocalViewCreator.CommonParentGroup

public LocalViewCreator.CommonParentGroup(Graph2D model,
                                          GraphCopier.CopyFactory factory,
                                          Graph2D view)
Creates a new CommonParentGroup instance for the specified model graph, copy factory, and view graph.

Note: The specified factory has to be able to create graph elements in the specified view graph.

Parameters:
model - the graph for which local views are to be created.
factory - that CopyFactory that will be used to create graph elements in the creator's view graph.
view - the graph that will be modified by the creator.
Method Detail

isIncludeDescendants

public boolean isIncludeDescendants()
Determines whether the contents of group nodes should be included in the created local view as well.

By default, this property is set to false.

Returns:
true if the contents of group nodes should be included in the created local view as well and false otherwise.
See Also:
setIncludeDescendants(boolean)

setIncludeDescendants

public void setIncludeDescendants(boolean includeDescendants)
Specifies whether the contents of group nodes should be included in the created local view as well.

By default, this property is set to false.

Parameters:
includeDescendants - true if the contents of group nodes should be included in the created local view as well and false otherwise.
See Also:
isIncludeDescendants()

createDefaultLayouter

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. This implementation returns null to keep the original graph layout in the created local view.

Overrides:
createDefaultLayouter in class LocalViewCreator
Returns:
null.
See Also:
IncrementalHierarchicLayouter.setConsiderNodeLabelsEnabled(boolean), IncrementalHierarchicLayouter.setIntegratedEdgeLabelingEnabled(boolean), IncrementalHierarchicLayouter.setOrthogonallyRouted(boolean)

buildViewGraph

protected void buildViewGraph()
Description copied from class: LocalViewCreator
Creates graph elements in the creator's view graph. This method is also responsible for creating mappings between graph elements in the creator's model graph and the creator's view graph.

Specified by:
buildViewGraph in class LocalViewCreator
See Also:
LocalViewCreator.updateViewGraph()

getModel

public Graph2D getModel()
Description copied from class: LocalViewCreator
Returns the model graph for which the creator may create local views.

Specified by:
getModel in class LocalViewCreator
Returns:
the model graph for which the creator may create local views.

getViewGraph

public Graph2D getViewGraph()
Description copied from class: LocalViewCreator
Returns the view graph that is modified by the creator's updateViewGraph method.

Specified by:
getViewGraph in class LocalViewCreator
Returns:
the view graph that is modified by the creator's updateViewGraph method.
See Also:
LocalViewCreator.updateViewGraph()

getModelNode

public Node getModelNode(Node view)
Description copied from class: LocalViewCreator
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.

Specified by:
getModelNode in class LocalViewCreator
Parameters:
view - a node in the creator's view graph.
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.

getViewNode

public Node getViewNode(Node model)
Description copied from class: LocalViewCreator
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.

Specified by:
getViewNode in class LocalViewCreator
Parameters:
model - a node in the creator's model graph.
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.

getModelEdge

public Edge getModelEdge(Edge view)
Description copied from class: LocalViewCreator
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.

Specified by:
getModelEdge in class LocalViewCreator
Parameters:
view - a edge in the creator's view graph.
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.

getViewEdge

public Edge getViewEdge(Edge model)
Description copied from class: LocalViewCreator
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.

Specified by:
getViewEdge in class LocalViewCreator
Parameters:
model - a edge in the creator's model graph.
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.

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.