prefuse.visual
Class VisualGraph

java.lang.Object
  extended by prefuse.data.tuple.AbstractTupleSet
      extended by prefuse.data.tuple.CompositeTupleSet
          extended by prefuse.data.Graph
              extended by prefuse.visual.VisualGraph
All Implemented Interfaces:
TupleSet, VisualTupleSet

public class VisualGraph
extends Graph
implements VisualTupleSet

A visual abstraction of a graph data structure. NodeItem and EdgeItem tuples provide the visual representations for the nodes and edges of the graph. VisualGraphs should not be created directly, they are created automatically by adding data to a Visualization, for example by using the Visualization.addGraph(String, Graph) method.

Author:
jeffrey heer

Nested Class Summary
 
Nested classes/interfaces inherited from class prefuse.data.Graph
Graph.Listener
 
Field Summary
 
Fields inherited from class prefuse.data.Graph
DEFAULT_NODE_KEY, DEFAULT_SOURCE_KEY, DEFAULT_TARGET_KEY, EDGES, INDEGREE, INEDGES, INLINKS, LINKS_SCHEMA, m_directed, m_edgeTuples, m_links, m_longKey, m_nidx, m_nkey, m_nodeTuples, m_skey, m_spanning, m_tkey, NODES, OUTDEGREE, OUTEDGES, OUTLINKS, UNDIRECTED
 
Fields inherited from interface prefuse.data.tuple.TupleSet
EMPTY_ARRAY
 
Constructor Summary
VisualGraph(VisualTable nodes, VisualTable edges, boolean directed, java.lang.String nodeKey, java.lang.String sourceKey, java.lang.String targetKey)
          Create a new VisualGraph
 
Method Summary
protected  void fireGraphEvent(Table t, int first, int last, int col, int type)
          Fire a graph event.
 java.lang.String getGroup()
          Get the visualization data group name for this graph
 int getNodeIndex(int key)
          Get the node row index value for the given key.
 Visualization getVisualization()
          Get the Visualization associated with this VisualTupleSet.
 void setGroup(java.lang.String group)
          Set the visualization data group name for this graph
 void setVisualization(Visualization vis)
          Set the visualization associated with this VisualGraph
 
Methods inherited from class prefuse.data.Graph
addEdge, addEdge, addGraphModelListener, addLink, addNode, addNodeRow, clear, clearEdges, clearSpanningTree, createLinkTable, dispose, edgeCheck, edgeRows, edgeRows, edgeRows, edges, edges, getAdjacentNode, getAdjacentNode, getDegree, getDegree, getEdge, getEdge, getEdge, getEdgeCount, getEdges, getEdgeSourceField, getEdgeTable, getEdgeTargetField, getInDegree, getInDegree, getKey, getNode, getNodeCount, getNodeFromKey, getNodeIndex, getNodeKeyField, getNodes, getNodeTable, getOutDegree, getOutDegree, getSourceNode, getSourceNode, getSpanningTree, getSpanningTree, getTargetNode, getTargetNode, inEdgeRows, inEdges, init, initLinkTable, inNeighbors, isDirected, neighbors, nodeCheck, nodeRows, nodes, outEdgeRows, outEdges, outNeighbors, remLink, removeAllGraphModelListeners, removeEdge, removeEdge, removeGraphModelListener, removeNode, removeNode, removeTuple, setEdgeTable, setTupleManagers, tuples, tuples, updateDegrees, updateDegrees, updateNodeData
 
Methods inherited from class prefuse.data.tuple.CompositeTupleSet
addColumn, addColumn, addColumn, addColumn, addSet, addTuple, containsSet, containsTuple, getSet, getTupleCount, hasSet, isAddColumnSupported, removeAllSets, removeSet, setNames, sets, setTuple
 
Methods inherited from class prefuse.data.tuple.AbstractTupleSet
addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface prefuse.data.tuple.TupleSet
addColumn, addColumn, addColumn, addColumn, addColumns, addPropertyChangeListener, addPropertyChangeListener, addTuple, addTupleSetListener, clear, containsTuple, getClientProperty, getTupleCount, isAddColumnSupported, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTuple, removeTupleSetListener, setTuple, tuples, tuples, tuples
 

Constructor Detail

VisualGraph

public VisualGraph(VisualTable nodes,
                   VisualTable edges,
                   boolean directed,
                   java.lang.String nodeKey,
                   java.lang.String sourceKey,
                   java.lang.String targetKey)
Create a new VisualGraph

Parameters:
nodes - the visual node table
edges - the visual edge table
directed - indicates if graph edges are directed or undirected
nodeKey - the node table field by which to index the nodes. This value can be null, indicating that just the row indices should be used.
sourceKey - the edge table field storing source node keys
targetKey - the edge table field storing target node keys
Method Detail

fireGraphEvent

protected void fireGraphEvent(Table t,
                              int first,
                              int last,
                              int col,
                              int type)
Fire a graph event. Makes sure to invalidate all edges connected to a node that has been updated.

Overrides:
fireGraphEvent in class Graph
Parameters:
t - the backing table where the change occurred (either a node table or an edge table)
first - the first modified table row
last - the last (inclusive) modified table row
col - the number of the column modified, or EventConstants.ALL_COLUMNS for operations affecting all columns
type - the type of modification, one of EventConstants.INSERT, EventConstants.DELETE, or EventConstants.UPDATE.
See Also:
Graph.fireGraphEvent(prefuse.data.Table, int, int, int, int)

getNodeIndex

public int getNodeIndex(int key)
Get the node row index value for the given key. TODO: test this more thoroughly?


getVisualization

public Visualization getVisualization()
Description copied from interface: VisualTupleSet
Get the Visualization associated with this VisualTupleSet.

Specified by:
getVisualization in interface VisualTupleSet
Returns:
the Visualization instance
See Also:
VisualTupleSet.getVisualization()

setVisualization

public void setVisualization(Visualization vis)
Set the visualization associated with this VisualGraph

Parameters:
vis - the visualization to set

getGroup

public java.lang.String getGroup()
Get the visualization data group name for this graph

Specified by:
getGroup in interface VisualTupleSet
Returns:
the data group name

setGroup

public void setGroup(java.lang.String group)
Set the visualization data group name for this graph

Parameters:
group - the data group name to use


Copyright © 2007 Regents of the University of California