prefuse.action.filter
Class GraphDistanceFilter

java.lang.Object
  extended by prefuse.activity.Activity
      extended by prefuse.action.Action
          extended by prefuse.action.GroupAction
              extended by prefuse.action.filter.GraphDistanceFilter

public class GraphDistanceFilter
extends GroupAction

Filter Action that sets visible all items within a specified graph distance from a set of focus items; all other items will be set to invisible.

Author:
jeffrey heer

Field Summary
protected  BreadthFirstIterator m_bfs
           
protected  int m_distance
           
protected  Predicate m_groupP
           
protected  java.lang.String m_sources
           
 
Fields inherited from class prefuse.action.GroupAction
m_group
 
Fields inherited from class prefuse.action.Action
m_vis
 
Fields inherited from class prefuse.activity.Activity
DEFAULT_STEP_TIME, INFINITY
 
Constructor Summary
GraphDistanceFilter(java.lang.String group)
          Create a new GraphDistanceFilter that processes the given data group and uses a graph distance of 1.
GraphDistanceFilter(java.lang.String group, int distance)
          Create a new GraphDistanceFilter that processes the given data group and uses the given graph distance.
GraphDistanceFilter(java.lang.String group, java.lang.String sources, int distance)
          Create a new GraphDistanceFilter that processes the given data group and uses the given graph distance.
 
Method Summary
 int getDistance()
          Return the graph distance threshold used by this filter.
 java.lang.String getSources()
          Get the name of the group to use as source nodes for measuring graph distance.
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
 void setDistance(int distance)
          Set the graph distance threshold used by this filter.
 void setSources(java.lang.String sources)
          Set the name of the group to use as source nodes for measuring graph distance.
 
Methods inherited from class prefuse.action.GroupAction
getGroup, setGroup
 
Methods inherited from class prefuse.action.Action
getVisualization, run, setVisualization
 
Methods inherited from class prefuse.activity.Activity
addActivityListener, alwaysRunAfter, cancel, fireActivityCancelled, fireActivityFinished, fireActivityScheduled, fireActivityStarted, fireActivityStepped, getDuration, getNextTime, getPace, getPacingFunction, getStartTime, getStepTime, getStopTime, isEnabled, isRunning, isScheduled, removeActivityListener, run, runAfter, runAt, setDuration, setEnabled, setPacingFunction, setStartTime, setStepTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_distance

protected int m_distance

m_sources

protected java.lang.String m_sources

m_groupP

protected Predicate m_groupP

m_bfs

protected BreadthFirstIterator m_bfs
Constructor Detail

GraphDistanceFilter

public GraphDistanceFilter(java.lang.String group)
Create a new GraphDistanceFilter that processes the given data group and uses a graph distance of 1. By default, the Visualization.FOCUS_ITEMS group will be used as the source nodes from which to measure the distance.

Parameters:
group - the group to process. This group should resolve to a Graph instance, otherwise exceptions will be thrown when this Action is run.

GraphDistanceFilter

public GraphDistanceFilter(java.lang.String group,
                           int distance)
Create a new GraphDistanceFilter that processes the given data group and uses the given graph distance. By default, the Visualization.FOCUS_ITEMS group will be used as the source nodes from which to measure the distance.

Parameters:
group - the group to process. This group should resolve to a Graph instance, otherwise exceptions will be thrown when this Action is run.
distance - the graph distance within which items will be visible.

GraphDistanceFilter

public GraphDistanceFilter(java.lang.String group,
                           java.lang.String sources,
                           int distance)
Create a new GraphDistanceFilter that processes the given data group and uses the given graph distance.

Parameters:
group - the group to process. This group should resolve to a Graph instance, otherwise exceptions will be thrown when this Action is run.
sources - the group to use as source nodes for measuring graph distance.
distance - the graph distance within which items will be visible.
Method Detail

getDistance

public int getDistance()
Return the graph distance threshold used by this filter.

Returns:
the graph distance threshold

setDistance

public void setDistance(int distance)
Set the graph distance threshold used by this filter.

Parameters:
distance - the graph distance threshold to use

getSources

public java.lang.String getSources()
Get the name of the group to use as source nodes for measuring graph distance. These form the roots from which the graph distance is measured.

Returns:
the source data group

setSources

public void setSources(java.lang.String sources)
Set the name of the group to use as source nodes for measuring graph distance. These form the roots from which the graph distance is measured.

Parameters:
sources - the source data group

run

public void run(double frac)
Description copied from class: Action
Runs this Action, triggering whatever processing this Action performs. Subclass this method to create custom Actions.

Specified by:
run in class GroupAction
Parameters:
frac - the fraction of this Action's duration that has elapsed.
See Also:
GroupAction.run(double)


Copyright © 2007 Regents of the University of California