edu.ucla.stat.SOCR.touchgraph.graphlayout.graphelements
Class Locality

java.lang.Object
  extended by edu.ucla.stat.SOCR.touchgraph.graphlayout.graphelements.GraphEltSet
      extended by edu.ucla.stat.SOCR.touchgraph.graphlayout.graphelements.Locality
All Implemented Interfaces:
ImmutableGraphEltSet
Direct Known Subclasses:
VisibleLocality

public class Locality
extends GraphEltSet

Locality: A way of representing a subset of a larger set of nodes. Allows for both manipulation of the subset, and manipulation of the larger set. For instance, one can call removeNode to delete it from the subset, or deleteNode to remove it from the larger set. Locality is used in conjunction with LocalityUtils, which handle locality shift animations. More synchronization will almost definitely be required.

Version:
1.22-jre1.1 $Id: Locality.java,v 1.1 2010/01/20 20:38:32 jiecui Exp $
Author:
Alexander Shapiro

Field Summary
protected  GraphEltSet completeEltSet
           
 
Fields inherited from class edu.ucla.stat.SOCR.touchgraph.graphlayout.graphelements.GraphEltSet
edges, nodeIDRegistry, nodes
 
Constructor Summary
Locality(GraphEltSet ges)
          Constructor with GraphEltSet ges.
 
Method Summary
 void addAll()
           
 void addEdge(Edge e)
          Add the Edge edge to the graph.
 void addNode(Node n)
          Add the Node node to the graph, and registers the Node via its ID.
 void addNodeWithEdges(Node n)
           
 void clearAll()
          Clear all nodes and edges.
 boolean deleteEdge(Edge e)
          Delete the Edge edge.
 void deleteEdges(java.util.Vector edgesToDelete)
          Delete the Edges contained within the Vector edgedToDelete.
 boolean deleteNode(Node node)
          Delete the Node node, returning true if successful.
 void deleteNodes(java.util.Vector nodesToDelete)
          Delete the Nodes contained within the Vector nodesToDelete.
 Edge findEdge(Node from, Node to)
          Return an Edge spanning Node from to Node to.
 GraphEltSet getCompleteEltSet()
           
 void removeAll()
           
 boolean removeEdge(Edge e)
           
 void removeEdges(java.util.Vector edgesToRemove)
           
 boolean removeNode(Node node)
           
 void removeNodes(java.util.Vector nodesToRemove)
           
 
Methods inherited from class edu.ucla.stat.SOCR.touchgraph.graphlayout.graphelements.GraphEltSet
addEdge, contains, contains, deleteEdge, edgeAt, edgeCount, edgeNum, findNode, findNodeByURL, findNodeLabelContaining, forAllEdges, forAllNodePairs, forAllNodes, getFirstNode, getRandomNode, nodeAt, nodeCount, nodeNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

completeEltSet

protected GraphEltSet completeEltSet
Constructor Detail

Locality

public Locality(GraphEltSet ges)
Constructor with GraphEltSet ges.

Method Detail

getCompleteEltSet

public GraphEltSet getCompleteEltSet()

addNode

public void addNode(Node n)
             throws TGException
Description copied from class: GraphEltSet
Add the Node node to the graph, and registers the Node via its ID. If no ID exists, no registration occurs.

Overrides:
addNode in class GraphEltSet
Throws:
TGException

addEdge

public void addEdge(Edge e)
Description copied from class: GraphEltSet
Add the Edge edge to the graph.

Overrides:
addEdge in class GraphEltSet

addNodeWithEdges

public void addNodeWithEdges(Node n)
                      throws TGException
Throws:
TGException

addAll

public void addAll()
            throws TGException
Throws:
TGException

findEdge

public Edge findEdge(Node from,
                     Node to)
Description copied from class: GraphEltSet
Return an Edge spanning Node from to Node to.

Specified by:
findEdge in interface ImmutableGraphEltSet
Overrides:
findEdge in class GraphEltSet

deleteEdge

public boolean deleteEdge(Edge e)
Description copied from class: GraphEltSet
Delete the Edge edge.

Overrides:
deleteEdge in class GraphEltSet

deleteEdges

public void deleteEdges(java.util.Vector edgesToDelete)
Description copied from class: GraphEltSet
Delete the Edges contained within the Vector edgedToDelete.

Overrides:
deleteEdges in class GraphEltSet

removeEdge

public boolean removeEdge(Edge e)

removeEdges

public void removeEdges(java.util.Vector edgesToRemove)

deleteNode

public boolean deleteNode(Node node)
Description copied from class: GraphEltSet
Delete the Node node, returning true if successful.

Overrides:
deleteNode in class GraphEltSet

deleteNodes

public void deleteNodes(java.util.Vector nodesToDelete)
Description copied from class: GraphEltSet
Delete the Nodes contained within the Vector nodesToDelete.

Overrides:
deleteNodes in class GraphEltSet

removeNode

public boolean removeNode(Node node)

removeNodes

public void removeNodes(java.util.Vector nodesToRemove)

removeAll

public void removeAll()

clearAll

public void clearAll()
Description copied from class: GraphEltSet
Clear all nodes and edges.

Overrides:
clearAll in class GraphEltSet