com.touchgraph.graphlayout
Class LocalityUtils

java.lang.Object
  extended by com.touchgraph.graphlayout.LocalityUtils

public class LocalityUtils
extends Object

LocalityUtils: Utilities for switching locality. Animation effects require a reference to TGPanel.

Includes enhancement from v1.22's locality switching, at radius 1 or 2.

Version:
1.21 $Id: LocalityUtils.java,v 3.3 2005/03/07 06:29:10 altheim Exp $
Author:
Alexander Shapiro, Murray Altheim (2002-09-19 added thread groups)

Nested Class Summary
protected  class LocalityUtils.ShiftLocaleThread
          The thread that gets instantiated for doing the locality shift animation.
 
Field Summary
protected  boolean fastFinishShift
          If finish fast is true, quickly wrap up animation.
static int INFINITE_LOCALITY_RADIUS
          Constant indicating an "infinite" locality, i.e., even unconnected graphs are included.
protected  Locality locality
           
protected  LocalityUtils.ShiftLocaleThread shiftLocaleThread
           
protected  TGPanel tgPanel
           
 
Constructor Summary
LocalityUtils(Locality loc, TGPanel tgp)
           
 
Method Summary
 void addAllGraphElts()
           
protected  void addNearNodes(Hashtable distHash, int radius)
          Add to locale nodes within radius distance of a focal node.
 void collapseNode(Node collapseNode)
          Opposite of expand node, works like hide node except that the selected node is not hidden.
 void expandNode(Node n)
          Add to locale nodes that are one edge away from a given node.
 void extendLocalityTo(Node n)
          Add to locale the provided Node, using the currently selected Node as the starting basis.
 void fastFinishAnimation()
           
 void hideNode(Node hideNode)
          Hides a node, and all the nodes attached to it.
protected  boolean isShiftingLocality()
          Returns true if the locality shifting thread is active.
protected  boolean markDistantNodes(Collection subgraph)
          Mark for deletion nodes not contained within distHash.
protected  void removeMarkedNodes()
           
 void setLocale(Node n, int radius)
           
 void setLocale(Node n, int radius, int maxAddEdgeCount, int maxExpandEdgeCount, boolean unidirectional)
           
protected  void unmarkNewAdditions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFINITE_LOCALITY_RADIUS

public static final int INFINITE_LOCALITY_RADIUS
Constant indicating an "infinite" locality, i.e., even unconnected graphs are included.

See Also:
Constant Field Values

fastFinishShift

protected boolean fastFinishShift
If finish fast is true, quickly wrap up animation.


tgPanel

protected TGPanel tgPanel

locality

protected Locality locality

shiftLocaleThread

protected LocalityUtils.ShiftLocaleThread shiftLocaleThread
Constructor Detail

LocalityUtils

public LocalityUtils(Locality loc,
                     TGPanel tgp)
Method Detail

fastFinishAnimation

public void fastFinishAnimation()

markDistantNodes

protected boolean markDistantNodes(Collection subgraph)
Mark for deletion nodes not contained within distHash.


removeMarkedNodes

protected void removeMarkedNodes()

addNearNodes

protected void addNearNodes(Hashtable distHash,
                            int radius)
                     throws TGException
Add to locale nodes within radius distance of a focal node.

Throws:
TGException

unmarkNewAdditions

protected void unmarkNewAdditions()

isShiftingLocality

protected boolean isShiftingLocality()
Returns true if the locality shifting thread is active.


setLocale

public void setLocale(Node n,
                      int radius,
                      int maxAddEdgeCount,
                      int maxExpandEdgeCount,
                      boolean unidirectional)
               throws TGException
Throws:
TGException

setLocale

public void setLocale(Node n,
                      int radius)
               throws TGException
Throws:
TGException

addAllGraphElts

public void addAllGraphElts()
                     throws TGException
Throws:
TGException

expandNode

public void expandNode(Node n)
Add to locale nodes that are one edge away from a given node. This method does not utilize "fastFinishShift" so it's likely that synchronization errors will occur.


extendLocalityTo

public void extendLocalityTo(Node n)
Add to locale the provided Node, using the currently selected Node as the starting basis. This method does not utilize "fastFinishShift" so it's likely that synchronization errors will occur.


hideNode

public void hideNode(Node hideNode)
Hides a node, and all the nodes attached to it.


collapseNode

public void collapseNode(Node collapseNode)
Opposite of expand node, works like hide node except that the selected node is not hidden.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.