Cytoscape 2.8.0 API

cytoscape.render.stateful
Class GraphRenderer

java.lang.Object
  extended by cytoscape.render.stateful.GraphRenderer

public final class GraphRenderer
extends Object

This class contains a chunk of procedural code that stitches together several external modules in an effort to efficiently render graphs.


Field Summary
static int LOD_CUSTOM_GRAPHICS
          DOCUMENT ME!
static int LOD_DASHED_EDGES
          DOCUMENT ME!
static int LOD_EDGE_ANCHORS
          DOCUMENT ME!
static int LOD_EDGE_ARROWS
          DOCUMENT ME!
static int LOD_EDGE_LABELS
          DOCUMENT ME!
static int LOD_HIGH_DETAIL
          A bit representing....
static int LOD_NODE_BORDERS
          DOCUMENT ME!
static int LOD_NODE_LABELS
          DOCUMENT ME!
static int LOD_TEXT_AS_SHAPE
          DOCUMENT ME!
 
Method Summary
static void computeClosedPath(PathIterator origPath, GeneralPath rtnVal)
          A utility method that converts an open GeneralPath into a closed GeneralPath.
static boolean computeEdgeEndpoints(GraphGraphics grafx, float[] srcNodeExtents, byte srcNodeShape, byte srcArrow, float srcArrowSize, EdgeAnchors anchors, float[] trgNodeExtents, byte trgNodeShape, byte trgArrow, float trgArrowSize, float[] rtnValSrc, float[] rtnValTrg)
          Calculates the edge endpoints given two nodes, any edge anchors, and any arrows.
static int renderGraph(FixedGraph graph, SpacialIndex2D nodePositions, GraphLOD lod, NodeDetails nodeDetails, EdgeDetails edgeDetails, IntHash nodeBuff, GraphGraphics grafx, Paint bgPaint, double xCenter, double yCenter, double scaleFactor)
          Renders a graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOD_HIGH_DETAIL

public static final int LOD_HIGH_DETAIL
A bit representing....

See Also:
Constant Field Values

LOD_NODE_BORDERS

public static final int LOD_NODE_BORDERS
DOCUMENT ME!

See Also:
Constant Field Values

LOD_NODE_LABELS

public static final int LOD_NODE_LABELS
DOCUMENT ME!

See Also:
Constant Field Values

LOD_EDGE_ARROWS

public static final int LOD_EDGE_ARROWS
DOCUMENT ME!

See Also:
Constant Field Values

LOD_DASHED_EDGES

public static final int LOD_DASHED_EDGES
DOCUMENT ME!

See Also:
Constant Field Values

LOD_EDGE_ANCHORS

public static final int LOD_EDGE_ANCHORS
DOCUMENT ME!

See Also:
Constant Field Values

LOD_EDGE_LABELS

public static final int LOD_EDGE_LABELS
DOCUMENT ME!

See Also:
Constant Field Values

LOD_TEXT_AS_SHAPE

public static final int LOD_TEXT_AS_SHAPE
DOCUMENT ME!

See Also:
Constant Field Values

LOD_CUSTOM_GRAPHICS

public static final int LOD_CUSTOM_GRAPHICS
DOCUMENT ME!

See Also:
Constant Field Values
Method Detail

renderGraph

public static final int renderGraph(FixedGraph graph,
                                    SpacialIndex2D nodePositions,
                                    GraphLOD lod,
                                    NodeDetails nodeDetails,
                                    EdgeDetails edgeDetails,
                                    IntHash nodeBuff,
                                    GraphGraphics grafx,
                                    Paint bgPaint,
                                    double xCenter,
                                    double yCenter,
                                    double scaleFactor)
Renders a graph.

Parameters:
graph - the graph topology; nodes in this graph must correspond to objKeys in nodePositions (the SpacialIndex2D parameter) and vice versa.
nodePositions - defines the positions and extents of nodes in graph; each entry (objKey) in this structure must correspond to a node in graph (the FixedGraph parameter) and vice versa; the order in which nodes are rendered is defined by a non-reversed overlap query on this structure.
lod - defines the different levels of detail; an appropriate level of detail is chosen based on the results of method calls on this object.
nodeDetails - defines details of nodes such as colors, node border thickness, and shape; the node arguments passed to methods on this object will be nodes in the graph parameter.
edgeDetails - defines details of edges such as colors, thickness, and arrow type; the edge arguments passed to methods on this object will be edges in the graph parameter.
nodeBuff - this is a computational helper that is required in the implementation of this method; when this method returns, nodeBuff is in a state such that an edge in graph has been rendered by this method if and only if it touches at least one node in this nodeBuff set; no guarantee made regarding edgeless nodes.
grafx - the graphics context that is to render this graph.
bgPaint - the background paint to use when calling grafx.clear().
xCenter - the xCenter parameter to use when calling grafx.clear().
yCenter - the yCenter parameter to use when calling grafx.clear().
scaleFactor - the scaleFactor parameter to use when calling grafx.clear().
Returns:
bits representing the level of detail that was rendered; the return value is a bitwise-or'ed value of the LOD_* constants.

computeEdgeEndpoints

public static final boolean computeEdgeEndpoints(GraphGraphics grafx,
                                                 float[] srcNodeExtents,
                                                 byte srcNodeShape,
                                                 byte srcArrow,
                                                 float srcArrowSize,
                                                 EdgeAnchors anchors,
                                                 float[] trgNodeExtents,
                                                 byte trgNodeShape,
                                                 byte trgArrow,
                                                 float trgArrowSize,
                                                 float[] rtnValSrc,
                                                 float[] rtnValTrg)
Calculates the edge endpoints given two nodes, any edge anchors, and any arrows.

Parameters:
grafx - The GraphGraphics being used to render everything. Used only to calculate the edge intersection of the node.
srcNodeExtents - The extents of the source node.
srcNodeShape - The node shape type.
srcArrow - The source arrow type.
srcArrowSize - The source arrow size.
anchors - an EdgeAnchors object listing any anchors for the edge, possibly null.
trgNodeExtents - The extends of the target node.
trgNodeShape - The target node type.
trgArrow - The target arrow type.
trgArrowSize - The target arrow size.
rtnValSrc - The array where X,Y positions of the source end of the edge are stored.
rtnValTrg - The array where X,Y positions of the target end of the edge are stored.
Returns:
DOCUMENT ME!

computeClosedPath

public static final void computeClosedPath(PathIterator origPath,
                                           GeneralPath rtnVal)
A utility method that converts an open GeneralPath into a closed GeneralPath. The GraphGraphics.getEdgePath() method returns an open general path that is simply a list of segments from the source node to the target node that doesn't include a SEG_CLOSE segment. This method traces such a path, reverses course and traces the same path backwards ending with a SEG_CLOSE to create a closed path. This method appears to only be used in one place (in ding) where it is used for creating a path suitable for determining whether an edge intersets a selected (or clicked) region. It's not clear why this method is even being used in that case because GeneralPath.intersect seems to work on open paths as well as closed paths.

Parameters:
origPath - DOCUMENT ME!
rtnVal - DOCUMENT ME!

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.