Search this API

y.view
Class LocalViewCreator.FolderContents

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

public static class LocalViewCreator.FolderContents
extends LocalViewCreator.AbstractLocalViewCreator

Local view creator that creates local views that display the content of all folder nodes in the creator's collection of focus 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
static byte FOLDER_POLICY_ALWAYS
          Folder inclusion policy specifier to always include a folder node representative in the created local views.
static byte FOLDER_POLICY_AS_NEEDED
          Folder inclusion policy specifier to include folder node representatives whenever the local view displays the contents of more than one folder node.
static byte FOLDER_POLICY_NEVER
          Folder inclusion policy specifier to never include folder node representatives in the created local views.
 
Fields inherited from class y.view.LocalViewCreator.AbstractLocalViewCreator
ELEMENT_TYPE_EDGE, ELEMENT_TYPE_NODE
 
Constructor Summary
LocalViewCreator.FolderContents(Graph2D model)
          Creates a new FolderContents instance for the specified model graph.
LocalViewCreator.FolderContents(Graph2D model, GraphCopier.CopyFactory factory)
          Creates a new FolderContents instance for the specified model graph and copy factory.
LocalViewCreator.FolderContents(Graph2D model, GraphCopier.CopyFactory factory, Graph2D view)
          Creates a new FolderContents 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.
protected  NodeRealizer createViewRealizer(Node model, Node view)
          Creates and/or configures the realizer used to display folder node representatives in the creator's view graph.
 byte getFolderPolicy()
          Returns the policy specifier that determines whether or not folder nodes should be included in the 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 isInnerGraphBindingAllowed()
          Determines if bindings between view nodes/edges and nodes/edges that do not lie in the model graph but are part of its graph hierarchy are allowed.
protected  void layoutViewGraph()
          Lays out the contents of the creator's view graph using the layout algorithm returned by LocalViewCreator.getLayouter().
 void setFolderPolicy(byte policy)
          Specifies the policy specifier that determines whether or not folder nodes should be included in the local view.
 void setInnerGraphBindingAllowed(boolean innerGraphBindingAllowed)
          Enables/disables binding between nodes/edges in the view graph that do not lie in the model graph but are part of its graph hierarchy.
 
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, publishViewGraph, setLayouter, updateViewGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOLDER_POLICY_ALWAYS

public static final byte FOLDER_POLICY_ALWAYS
Folder inclusion policy specifier to always include a folder node representative in the created local views.

See Also:
getFolderPolicy(), setFolderPolicy(byte), Constant Field Values

FOLDER_POLICY_AS_NEEDED

public static final byte FOLDER_POLICY_AS_NEEDED
Folder inclusion policy specifier to include folder node representatives whenever the local view displays the contents of more than one folder node.

See Also:
getFolderPolicy(), setFolderPolicy(byte), Constant Field Values

FOLDER_POLICY_NEVER

public static final byte FOLDER_POLICY_NEVER
Folder inclusion policy specifier to never include folder node representatives in the created local views.

See Also:
getFolderPolicy(), setFolderPolicy(byte), Constant Field Values
Constructor Detail

LocalViewCreator.FolderContents

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

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

LocalViewCreator.FolderContents

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

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

getFolderPolicy

public byte getFolderPolicy()
Returns the policy specifier that determines whether or not folder nodes should be included in the local view. One of

Defaults to FOLDER_POLICY_AS_NEEDED.

Returns:
the policy specifier that determines whether or not folder nodes should be included in the local view.
See Also:
setFolderPolicy(byte)

setFolderPolicy

public void setFolderPolicy(byte policy)
Specifies the policy specifier that determines whether or not folder nodes should be included in the local view.

Defaults to FOLDER_POLICY_AS_NEEDED.

Parameters:
policy - one of
Throws:
java.lang.IllegalArgumentException - if the specified policy is not one of the listed constants.
See Also:
getFolderPolicy()

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 a new instance of ComponentLayouter to keep the original layout of each displayed folder's contents.

Overrides:
createDefaultLayouter in class LocalViewCreator
Returns:
a new instance of ComponentLayouter.
See Also:
IncrementalHierarchicLayouter.setConsiderNodeLabelsEnabled(boolean), IncrementalHierarchicLayouter.setIntegratedEdgeLabelingEnabled(boolean), IncrementalHierarchicLayouter.setOrthogonallyRouted(boolean)

layoutViewGraph

protected void layoutViewGraph()
Lays out the contents of the creator's view graph using the layout algorithm returned by LocalViewCreator.getLayouter(). This implementation is specifically tailored to be used with ComponentLayouter to ensure that the contents of each folder node constitute one graph component.

Overrides:
layoutViewGraph in class LocalViewCreator
See Also:
LocalViewCreator.updateViewGraph()

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()

createViewRealizer

protected NodeRealizer createViewRealizer(Node model,
                                          Node view)
Creates and/or configures the realizer used to display folder node representatives in the creator's view graph. The default implementation either adjusts the node label text of the realizer that has been created by default for the specified view node to match the text set for the model node's default label or removes all labels from the view node's realizer if the model node has no associated labels.

Note: As the view graph displays a folder node's contents, representatives of folder nodes are group nodes in the creator's view graph.

Parameters:
model - a folder node in creator's model graph.
view - a group node in the creator's view graph that is the representative of the specified model node and for which a realizer should be created and/or configured.
Returns:
the view node's realizer with adjusted node labels.

isInnerGraphBindingAllowed

public boolean isInnerGraphBindingAllowed()
Determines if bindings between view nodes/edges and nodes/edges that do not lie in the model graph but are part of its graph hierarchy are allowed. (The model graph does not contain the nodes/edges of the folder content.)

By default, this property is set to false.

Returns:
true if inner graph binding is allowed, false otherwise.
See Also:
setInnerGraphBindingAllowed(boolean)

setInnerGraphBindingAllowed

public void setInnerGraphBindingAllowed(boolean innerGraphBindingAllowed)
Enables/disables binding between nodes/edges in the view graph that do not lie in the model graph but are part of its graph hierarchy. (The model graph does not contain the nodes/edges of the folder content.)

By default, this property is set to false.

Parameters:
innerGraphBindingAllowed - determines if inner graph binding is allowed.
See Also:
isInnerGraphBindingAllowed()

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.