Search this API

y.view
Class VisibilityFilter

java.lang.Object
  extended by y.view.VisibilityFilter
All Implemented Interfaces:
Filter

public class VisibilityFilter
extends java.lang.Object
implements Filter

A Filter for graph elements that accepts/reject elements based on their visibility.

 

Field Summary
static int ALL
          Visibility state bit mask representing any visibility state.
static int INVISIBLE
          Visibility state bit mask representing the invisible state.
static int VISIBLE
          Visibility state bit mask representing the visible state.
 
Constructor Summary
VisibilityFilter(Graph2D graph)
          Constructs a new VisibilityFilter for the specified Graph2D that accepts only visible elements.
VisibilityFilter(Graph2D graph, int nodeVisibility, int nodeLabelVisibility, int edgeVisibility, int edgeLabelVisibility)
          Constructs a new VisibilityFilter for the specified Graph2D.
 
Method Summary
 boolean accept(java.lang.Object o)
          Returns true, iff the specified graph element's visibility matches this filter's current visibility setting for the corresponding element type and false otherwise.
 int getEdgeLabelVisibility()
          Returns the visibility bit mask against which the visibility state of edge labels is checked in this filter's accept method.
 int getEdgeVisibility()
          Returns the visibility bit mask against which the visibility state of edges, ports, and bends is checked in this filter's accept method.
 int getNodeLabelVisibility()
          Returns the visibility bit mask against which the visibility state of node labels is checked in this filter's accept method.
 int getNodeVisibility()
          Returns the visibility bit mask against which the visibility state of nodes and node ports is checked in this filter's accept method.
 void setEdgeLabelVisibility(int edgeLabelVisibility)
          Specifies the visibility state of edge labels which are to be accepted by this filter.
 void setEdgeVisibility(int edgeVisibility)
          Specifies the visibility state of edges, ports, and bends which are to be accepted by this filter.
 void setNodeLabelVisibility(int nodeLabelVisibility)
          Specifies the visibility state of node labels which are to be accepted by this filter.
 void setNodeVisibility(int nodeVisibility)
          Specifies the visibility state of nodes and node ports which are to be accepted by this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
Visibility state bit mask representing any visibility state.

See Also:
Constant Field Values

VISIBLE

public static final int VISIBLE
Visibility state bit mask representing the visible state. A node or an edge is considered to be visible if its associated realizer is visible. A port or a bend is considered to be visible if its associated edge is visible. A node port is considered to be visible if its associated node is visible.

See Also:
Constant Field Values

INVISIBLE

public static final int INVISIBLE
Visibility state bit mask representing the invisible state. A node or an edge is considered to be invisible if its associated realizer is not visible. A port or a bend is considered to be invisible if its associated edge is invisible. A node port is considered to be invisible if its associated node is visible.

See Also:
Constant Field Values
Constructor Detail

VisibilityFilter

public VisibilityFilter(Graph2D graph)
Constructs a new VisibilityFilter for the specified Graph2D that accepts only visible elements.

Parameters:
graph - the Graph2D whose elements are to be filtered.

VisibilityFilter

public VisibilityFilter(Graph2D graph,
                        int nodeVisibility,
                        int nodeLabelVisibility,
                        int edgeVisibility,
                        int edgeLabelVisibility)
Constructs a new VisibilityFilter for the specified Graph2D.

Parameters:
graph - the Graph2D whose elements are to be filtered.
nodeVisibility - determines which nodes and node ports to accept. The nodeVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.
nodeLabelVisibility - determines which node labels to accept. The nodeLabelVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.
edgeVisibility - determines which edges, ports, and bends to accept. The edgeVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.
edgeLabelVisibility - determines which edge labels to accept. The edgeLabelVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.
Method Detail

getNodeVisibility

public int getNodeVisibility()
Returns the visibility bit mask against which the visibility state of nodes and node ports is checked in this filter's accept method. A node is considered to be visible if graph.getRealizer(node).isVisible() returns true and invisible otherwise. The visibility state of a node port is considered to be the visibility state of its associated node.

Returns:
the visibility bit mask against which the visibility state of nodes and node ports is checked in this filter's accept method.
See Also:
setNodeVisibility(int), accept(Object)

setNodeVisibility

public void setNodeVisibility(int nodeVisibility)
Specifies the visibility state of nodes and node ports which are to be accepted by this filter. A node is considered to be visible if graph.getRealizer(node).isVisible() returns true and invisible otherwise. The visibility state of a node port is considered to be the visibility state of its associated node.

Parameters:
nodeVisibility - determines which nodes and node ports to accept. The nodeVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.

getNodeLabelVisibility

public int getNodeLabelVisibility()
Returns the visibility bit mask against which the visibility state of node labels is checked in this filter's accept method.

Returns:
the visibility bit mask against which the visibility state of node labels is checked in this filter's accept method.
See Also:
setNodeLabelVisibility(int), accept(Object)

setNodeLabelVisibility

public void setNodeLabelVisibility(int nodeLabelVisibility)
Specifies the visibility state of node labels which are to be accepted by this filter.

Parameters:
nodeLabelVisibility - determines which node labels to accept. The nodeLabelVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.

getEdgeVisibility

public int getEdgeVisibility()
Returns the visibility bit mask against which the visibility state of edges, ports, and bends is checked in this filter's accept method. An edge is considered to be visible if graph.getRealizer(edge).isVisible() returns true and invisible otherwise. The visibility state of a port or bend is considered to be the visibility state of its associated edge.

Returns:
the visibility bit mask against which the visibility state of edges, ports, and bends is checked in this filter's accept method.
See Also:
setEdgeVisibility(int), accept(Object)

setEdgeVisibility

public void setEdgeVisibility(int edgeVisibility)
Specifies the visibility state of edges, ports, and bends which are to be accepted by this filter. An edge is considered to be visible if graph.getRealizer(edge).isVisible() returns true and invisible otherwise. The visibility state of a port or bend is considered to be the visibility state of its associated edge.

Parameters:
edgeVisibility - determines which edges, ports, and bends to accept. The edgeVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.

getEdgeLabelVisibility

public int getEdgeLabelVisibility()
Returns the visibility bit mask against which the visibility state of edge labels is checked in this filter's accept method.

Returns:
the visibility bit mask against which the visibility state of edge labels is checked in this filter's accept method.
See Also:
setEdgeLabelVisibility(int), accept(Object)

setEdgeLabelVisibility

public void setEdgeLabelVisibility(int edgeLabelVisibility)
Specifies the visibility state of edge labels which are to be accepted by this filter.

Parameters:
edgeLabelVisibility - determines which edge labels to accept. The edgeLabelVisibility argument is an integer bit mask that may be ALL or a bitwise union of VISIBLE and/or INVISIBLE.

accept

public boolean accept(java.lang.Object o)
Returns true, iff the specified graph element's visibility matches this filter's current visibility setting for the corresponding element type and false otherwise.

Specified by:
accept in interface Filter
Parameters:
o - the graph element to be tested.
Returns:
true, iff the specified graph element's visibility matches this filter's current visibility setting for the corresponding element type and false otherwise.

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