Search this API

y.view
Class LocalViewCreator.EdgeGroup

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

public static class LocalViewCreator.EdgeGroup
extends LocalViewCreator.AbstractLocalViewCreator

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.

 

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
static byte GROUP_BY_SOURCE
          Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if the corresponding source data matches.
static byte GROUP_BY_SOURCE_AND_TARGET
          Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if both source data and target data match.
static byte GROUP_BY_SOURCE_OR_TARGET
          Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if source data or target data matches.
static byte GROUP_BY_TARGET
          Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if the corresponding target data matches.
 
Fields inherited from class y.view.LocalViewCreator.AbstractLocalViewCreator
ELEMENT_TYPE_EDGE, ELEMENT_TYPE_NODE
 
Constructor Summary
LocalViewCreator.EdgeGroup(Graph2D model)
          Creates a new EdgeGroup instance for the specified model graph.
LocalViewCreator.EdgeGroup(Graph2D model, GraphCopier.CopyFactory factory)
          Creates a new EdgeGroup instance for the specified model graph and copy factory.
LocalViewCreator.EdgeGroup(Graph2D model, GraphCopier.CopyFactory factory, Graph2D view)
          Creates a new EdgeGroup 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.
 byte getGroupByPolicy()
          Returns the policy used for identifying edge groups.
 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.
 java.lang.Object getSourceGroupidKey()
          Returns the data provider key used to retrieve a DataProvider that contains source group IDs from the creator's model graph.
 java.lang.Object getTargetGroupidKey()
          Returns the data provider key used to retrieve a DataProvider that contains target group IDs from the creator's model graph.
 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 isGroupByIdEnabled()
          Returns true if edge groups are identified using IDs that are stored in DataProviders bound to the creator's model graph using the keys returned by getSourceGroupidKey and getTargetGroupidKey and false if edge groups are defined by shared source and/or target nodes.
 void setGroupByIdEnabled(boolean enabled)
          Specifies whether edge groups are identified using IDs that are stored in DataProviders bound to the creator's model graph using the keys returned by getSourceGroupidKey and getTargetGroupidKey or by shared source and/or target nodes.
 void setGroupByPolicy(byte policy)
          Specifies the policy used for identifying edge groups.
 void setSourceGroupidKey(java.lang.Object sourceGroupidKey)
          Specifies the data provider key used to retrieve a DataProvider that contains source group IDs from the creator's model graph.
 void setTargetGroupidKey(java.lang.Object targetGroupidKey)
          Specifies the data provider key used to retrieve a DataProvider that contains target group IDs from the creator's model graph.
 
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
createDefaultLayouter, getLayouter, layoutViewGraph, publishViewGraph, setLayouter, updateViewGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_BY_SOURCE

public static final byte GROUP_BY_SOURCE
Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if the corresponding source data matches. The data that is used to determine matches depends on the creator's groupByIdEnabled, sourceGroupidKey, and targetGroupidKey properties.

See Also:
Constant Field Values

GROUP_BY_TARGET

public static final byte GROUP_BY_TARGET
Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if the corresponding target data matches. The data that is used to determine matches depends on the creator's groupByIdEnabled, sourceGroupidKey, and targetGroupidKey properties.

See Also:
Constant Field Values

GROUP_BY_SOURCE_OR_TARGET

public static final byte GROUP_BY_SOURCE_OR_TARGET
Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if source data or target data matches. The data that is used to determine matches depends on the creator's groupByIdEnabled, sourceGroupidKey, and targetGroupidKey properties.

See Also:
Constant Field Values

GROUP_BY_SOURCE_AND_TARGET

public static final byte GROUP_BY_SOURCE_AND_TARGET
Grouping policy that specifies that an edge belongs to the same edge group as one of the focus edges if both source data and target data match. The data that is used to determine matches depends on the creator's groupByIdEnabled, sourceGroupidKey, and targetGroupidKey properties.

See Also:
Constant Field Values
Constructor Detail

LocalViewCreator.EdgeGroup

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

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

LocalViewCreator.EdgeGroup

public LocalViewCreator.EdgeGroup(Graph2D model,
                                  GraphCopier.CopyFactory factory)
Creates a new EdgeGroup instance for the specified model graph and copy factory. Invoking this constructor is equivalent to:
new EdgeGroup(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.EdgeGroup

public LocalViewCreator.EdgeGroup(Graph2D model,
                                  GraphCopier.CopyFactory factory,
                                  Graph2D view)
Creates a new EdgeGroup 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

isGroupByIdEnabled

public boolean isGroupByIdEnabled()
Returns true if edge groups are identified using IDs that are stored in DataProviders bound to the creator's model graph using the keys returned by getSourceGroupidKey and getTargetGroupidKey and false if edge groups are defined by shared source and/or target nodes.

By default, this property is set to false.

Returns:
true if edge groups are identified using IDs and false if edge groups are defined by shared source and/or target nodes.
See Also:
setGroupByIdEnabled(boolean)

setGroupByIdEnabled

public void setGroupByIdEnabled(boolean enabled)
Specifies whether edge groups are identified using IDs that are stored in DataProviders bound to the creator's model graph using the keys returned by getSourceGroupidKey and getTargetGroupidKey or by shared source and/or target nodes.

By default, this property is set to false.

Parameters:
enabled - if true edge groups are identified using IDs and false if edge groups are defined by shared source and/or target nodes.
See Also:
isGroupByIdEnabled()

getGroupByPolicy

public byte getGroupByPolicy()
Returns the policy used for identifying edge groups. One of

Returns:
the policy used for identifying edge groups.
See Also:
getGroupByPolicy()

setGroupByPolicy

public void setGroupByPolicy(byte policy)
Specifies the policy used for identifying edge groups.

Parameters:
policy - the policy used for identifying edge groups. One of
Throws:
java.lang.IllegalArgumentException - if the specified policy is not one of the listed constants.
See Also:
getGroupByPolicy()

getSourceGroupidKey

public java.lang.Object getSourceGroupidKey()
Returns the data provider key used to retrieve a DataProvider that contains source group IDs from the creator's model graph. Said DataProvider is only used if groupByIdEnabled is set to true.

Defaults to PortConstraintKeys.SOURCE_GROUPID_KEY.

Returns:
the data provider key used to retrieve a DataProvider that contains source group IDs.
See Also:
setSourceGroupidKey(Object)

setSourceGroupidKey

public void setSourceGroupidKey(java.lang.Object sourceGroupidKey)
Specifies the data provider key used to retrieve a DataProvider that contains source group IDs from the creator's model graph. Said DataProvider is only used if groupByIdEnabled is set to true.

Defaults to PortConstraintKeys.SOURCE_GROUPID_KEY.

Parameters:
sourceGroupidKey - the data provider key used to retrieve source group IDs from the creator's model graph.
See Also:
getSourceGroupidKey()

getTargetGroupidKey

public java.lang.Object getTargetGroupidKey()
Returns the data provider key used to retrieve a DataProvider that contains target group IDs from the creator's model graph. Said DataProvider is only used if groupByIdEnabled is set to true.

Defaults to PortConstraintKeys.TARGET_GROUPID_KEY.

Returns:
the data provider key used to retrieve a DataProvider that contains target group IDs.
See Also:
setTargetGroupidKey(Object)

setTargetGroupidKey

public void setTargetGroupidKey(java.lang.Object targetGroupidKey)
Specifies the data provider key used to retrieve a DataProvider that contains target group IDs from the creator's model graph. Said DataProvider is only used if groupByIdEnabled is set to true.

Defaults to PortConstraintKeys.TARGET_GROUPID_KEY.

Parameters:
targetGroupidKey - the data provider key used to retrieve target group IDs from the creator's model graph.
See Also:
getTargetGroupidKey()

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.