Search this API

y.view
Class LocalViewCreator.AbstractLocalViewCreator

java.lang.Object
  extended by y.view.LocalViewCreator
      extended by y.view.LocalViewCreator.AbstractLocalViewCreator
Direct Known Subclasses:
LocalViewCreator.AncestorGroups, LocalViewCreator.CommonParentGroup, LocalViewCreator.EdgeGroup, LocalViewCreator.FolderContents, LocalViewCreator.Neighborhood, LocalViewCreator.SourceAndTarget
Enclosing class:
LocalViewCreator

public abstract static class LocalViewCreator.AbstractLocalViewCreator
extends LocalViewCreator

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.

 

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 ELEMENT_TYPE_EDGE
          Element type specifier for edges.
static byte ELEMENT_TYPE_NODE
          Element type specifier for nodes.
 
Constructor Summary
protected LocalViewCreator.AbstractLocalViewCreator(byte elementType)
          Creates a AbstractLocalViewCreator for the specified element type.
 
Method Summary
 void addFocusEdge(Edge edge)
          Adds the specified edge to the collection of input edges the creator uses to create local views.
 void addFocusNode(Node node)
          Adds the specified node to the collection of input nodes the creator uses to create local views.
 void addSelectionTrigger()
          Adds a Graph2DSelectionListener to the creator's model graph that creates a local view on selection changes.
 void clearFocusEdges()
          Removes all edges which the creator currently stores as input data for creating local views.
 void clearFocusNodes()
          Removes all nodes which the creator currently stores as input data for creating local views.
 ViewMode createHoverTrigger()
          Creates a ViewMode that triggers local view creation after the mouse has been hovering over a graph element for a short period of time (the trigger delay).
protected  Graph2DSelectionListener createSelectionTrigger()
          Creates a Graph2DSelectionListener that creates local view upon selection changes.
 java.util.Iterator focusEdges()
          Returns and Iterator over all edges that the creator currently stores as input data for creating local views.
 java.util.Iterator focusNodes()
          Returns and Iterator over all nodes that the creator currently stores as input data for creating local views.
 byte getElementType()
          Returns ELEMENT_TYPE_NODE if the creator uses nodes of the model graph as input data and ELEMENT_TYPE_EDGE otherwise.
 int getTriggerDelay()
          Returns the delay in milliseconds after which trigger events for local view creation are processed.
 boolean isFocusEdge(Edge edge)
          Returns true if the specified edge is one of the edges the creator currently stores as input data for creating local views; false otherwise.
 boolean isFocusNode(Node node)
          Returns true if the specified node is one of the nodes the creator currently stores as input data for creating local views; false otherwise.
 boolean isSingleFocus()
          Returns true if the creator will only accept/use a single graph element as input to create a local view and false otherwise.
 void removeFocusEdge(Edge edge)
          Removes the specified edge from the collection of input edges the creator uses to create local views.
 void removeFocusNode(Node node)
          Removes the specified node from the collection of input nodes the creator uses to create local views.
 void removeSelectionTrigger()
          Removes the Graph2DSelectionListener, that was added using addSelectionTrigger() from the creator's model graph.
 void setSingleFocus(boolean singleFocus)
          Specifies whether the creator should accept/use either one graph element only or multiple graph elements as input to create a local view.
 void setTriggerDelay(int triggerDelay)
          Specifies the delay in milliseconds after which trigger events for local view creation are processed.
 
Methods inherited from class y.view.LocalViewCreator
buildViewGraph, createDefaultLayouter, getLayouter, getModel, getModelEdge, getModelNode, getViewEdge, getViewGraph, getViewNode, layoutViewGraph, publishViewGraph, setLayouter, updateViewGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_TYPE_NODE

public static final byte ELEMENT_TYPE_NODE
Element type specifier for nodes.

See Also:
LocalViewCreator.AbstractLocalViewCreator(byte), getElementType(), Constant Field Values

ELEMENT_TYPE_EDGE

public static final byte ELEMENT_TYPE_EDGE
Element type specifier for edges.

See Also:
LocalViewCreator.AbstractLocalViewCreator(byte), getElementType(), Constant Field Values
Constructor Detail

LocalViewCreator.AbstractLocalViewCreator

protected LocalViewCreator.AbstractLocalViewCreator(byte elementType)
Creates a AbstractLocalViewCreator for the specified element type.

Parameters:
elementType - one of
Throws:
java.lang.IllegalArgumentException - if the specified type is not one of the listed constants.
Method Detail

getElementType

public byte getElementType()
Returns ELEMENT_TYPE_NODE if the creator uses nodes of the model graph as input data and ELEMENT_TYPE_EDGE otherwise.

Returns:
ELEMENT_TYPE_NODE if the creator uses nodes of the model graph as input data and ELEMENT_TYPE_EDGE otherwise.

isSingleFocus

public boolean isSingleFocus()
Returns true if the creator will only accept/use a single graph element as input to create a local view and false otherwise.

Returns:
true if the creator will only accept/use a single graph element as input to create a local view and false otherwise.

setSingleFocus

public void setSingleFocus(boolean singleFocus)
Specifies whether the creator should accept/use either one graph element only or multiple graph elements as input to create a local view.

Parameters:
singleFocus - true if the creator should accept/use a single graph element only; false otherwise.

getTriggerDelay

public int getTriggerDelay()
Returns the delay in milliseconds after which trigger events for local view creation are processed.

Defaults to 100.

Returns:
the delay in milliseconds after which trigger events for local view creation are processed.
See Also:
setTriggerDelay(int), createSelectionTrigger(), createHoverTrigger()

setTriggerDelay

public void setTriggerDelay(int triggerDelay)
Specifies the delay in milliseconds after which trigger events for local view creation are processed.

Defaults to 100.

Parameters:
triggerDelay - the delay in milliseconds after which trigger events for local view creation are processed.
See Also:
getTriggerDelay(), createSelectionTrigger(), createHoverTrigger()

addFocusEdge

public void addFocusEdge(Edge edge)
Adds the specified edge to the collection of input edges the creator uses to create local views.

This method is a no-op if the creator's element type is ELEMENT_TYPE_NODE.

If the creator is in single focus mode, all previously added focus edges are silently removed.

Parameters:
edge - an edge that will be used as input data when creating a local view.
Throws:
java.lang.IllegalArgumentException - if the specified edge does not belong to the creator's model graph.
See Also:
isSingleFocus(), setSingleFocus(boolean)

removeFocusEdge

public void removeFocusEdge(Edge edge)
Removes the specified edge from the collection of input edges the creator uses to create local views.

This method is a no-op if the creator's element type is ELEMENT_TYPE_NODE.

Parameters:
edge - the edge that is to be removed from the collection of input edges the creator uses to create local views.

isFocusEdge

public boolean isFocusEdge(Edge edge)
Returns true if the specified edge is one of the edges the creator currently stores as input data for creating local views; false otherwise.

This method will always return false if the creator's element type is ELEMENT_TYPE_NODE.

Parameters:
edge - the edge to check.
Returns:
true if the specified edge is one of the edges the creator currently stores as input data for creating local views; false otherwise.

clearFocusEdges

public void clearFocusEdges()
Removes all edges which the creator currently stores as input data for creating local views.

This method is a no-op if the creator's element type is ELEMENT_TYPE_NODE.


focusEdges

public java.util.Iterator focusEdges()
Returns and Iterator over all edges that the creator currently stores as input data for creating local views.

Returns:
and Iterator over all edges that the creator currently stores as input data for creating local views.

addFocusNode

public void addFocusNode(Node node)
Adds the specified node to the collection of input nodes the creator uses to create local views.

This method is a no-op if the creator's element type is ELEMENT_TYPE_EDGE.

If the creator is in single focus mode, all previously added focus nodes are silently removed.

Parameters:
node - an node that will be used as input data when creating a local view.
Throws:
java.lang.IllegalArgumentException - if the specified node does not belong to the creator's model graph.
See Also:
isSingleFocus(), setSingleFocus(boolean)

removeFocusNode

public void removeFocusNode(Node node)
Removes the specified node from the collection of input nodes the creator uses to create local views.

This method is a no-op if the creator's element type is ELEMENT_TYPE_EDGE.

Parameters:
node - the node that is to be removed from the collection of input nodes the creator uses to create local views.

isFocusNode

public boolean isFocusNode(Node node)
Returns true if the specified node is one of the nodes the creator currently stores as input data for creating local views; false otherwise.

This method will always return false if the creator's element type is ELEMENT_TYPE_EDGE.

Parameters:
node - the node to check.
Returns:
true if the specified node is one of the nodes the creator currently stores as input data for creating local views; false otherwise.

clearFocusNodes

public void clearFocusNodes()
Removes all nodes which the creator currently stores as input data for creating local views.

This method is a no-op if the creator's element type is ELEMENT_TYPE_EDGE.


focusNodes

public java.util.Iterator focusNodes()
Returns and Iterator over all nodes that the creator currently stores as input data for creating local views.

Returns:
and Iterator over all nodes that the creator currently stores as input data for creating local views.

addSelectionTrigger

public void addSelectionTrigger()
Adds a Graph2DSelectionListener to the creator's model graph that creates a local view on selection changes. If the creator's element type is ELEMENT_TYPE_NODE, the trigger reacts only to node selection events; if the creator's element type is ELEMENT_TYPE_EDGE, the trigger reacts only to edge selection events.

See Also:
removeSelectionTrigger(), createSelectionTrigger()

removeSelectionTrigger

public void removeSelectionTrigger()
Removes the Graph2DSelectionListener, that was added using addSelectionTrigger() from the creator's model graph.

See Also:
addSelectionTrigger(), createSelectionTrigger()

createSelectionTrigger

protected Graph2DSelectionListener createSelectionTrigger()
Creates a Graph2DSelectionListener that creates local view upon selection changes. If the creator's element type is ELEMENT_TYPE_NODE, the listener reacts only to node selection events; if the creator's element type is ELEMENT_TYPE_EDGE, the trigger reacts only to edge selection events. If the creator is in single focus mode, selection events that are fired because a node's or edge's selection state is set to false are ignored. If not in single focus mode, the creator's collection of node's or edge's is replaced by the currently selected elements of the appropriate type in the creator's model graph.

Returns:
a Graph2DSelectionListener that creates local view upon selection changes.
See Also:
addSelectionTrigger(), removeSelectionTrigger()

createHoverTrigger

public ViewMode createHoverTrigger()
Creates a ViewMode that triggers local view creation after the mouse has been hovering over a graph element for a short period of time (the trigger delay). The element over which the mouse hovers will be used as the sole input data for the creator, i.e. all previously stored focus elements will be removed by the view mode.

Returns:
a ViewMode that triggers local view creation after the mouse has been hovering over a graph element for a short period of time (the trigger delay).
See Also:
getTriggerDelay(), setTriggerDelay(int)

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