prefuse.action
Class EncoderAction

java.lang.Object
  extended by prefuse.activity.Activity
      extended by prefuse.action.Action
          extended by prefuse.action.GroupAction
              extended by prefuse.action.ItemAction
                  extended by prefuse.action.EncoderAction
Direct Known Subclasses:
ColorAction, FontAction, ShapeAction, SizeAction, StrokeAction

public abstract class EncoderAction
extends ItemAction

ItemAction instance that can also maintain a collection of rule mappings that can be used by subclasses to create particular rule-mappings for encoding data values.

Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.action.ItemAction
m_predicate
 
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
EncoderAction()
          Create a new EncoderAction that processes all data groups.
EncoderAction(java.lang.String group)
          Create a new EncoderAction that processes the specified group.
EncoderAction(java.lang.String group, Predicate filter)
          Create a new EncoderAction that processes the specified group.
EncoderAction(Visualization vis)
          Create a new EncoderAction that processes all groups.
EncoderAction(Visualization vis, java.lang.String group)
          Create a new EncoderAction that processes the specified group.
EncoderAction(Visualization vis, java.lang.String group, Predicate filter)
          Create a new EncoderAction that processes the specified group.
 
Method Summary
protected  void add(Predicate p, java.lang.Object value)
          Add a mapping rule to this EncoderAction.
 void clear()
          Remove all rule mappings from this encoder.
protected  void finish()
          Perform any necessary clean-up after this encoder can be used.
protected  java.lang.Object lookup(VisualItem item)
          Lookup the value mapped to by the given item.
 boolean remove(Predicate p)
          Remove rules using the given predicate from this encoder.
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
protected  void setup()
          Perform any necessary setup before this encoder can be used.
 void setVisualization(Visualization vis)
          Set the Visualization processed by this Action.
 
Methods inherited from class prefuse.action.ItemAction
getFilterPredicate, process, setFilterPredicate
 
Methods inherited from class prefuse.action.GroupAction
getGroup, setGroup
 
Methods inherited from class prefuse.action.Action
getVisualization, run
 
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
 

Constructor Detail

EncoderAction

public EncoderAction()
Create a new EncoderAction that processes all data groups.


EncoderAction

public EncoderAction(Visualization vis)
Create a new EncoderAction that processes all groups.

Parameters:
vis - the Visualization to process
See Also:
Visualization.ALL_ITEMS

EncoderAction

public EncoderAction(java.lang.String group)
Create a new EncoderAction that processes the specified group.

Parameters:
group - the name of the group to process

EncoderAction

public EncoderAction(java.lang.String group,
                     Predicate filter)
Create a new EncoderAction that processes the specified group.

Parameters:
group - the name of the group to process
filter - the filtering Predicate

EncoderAction

public EncoderAction(Visualization vis,
                     java.lang.String group)
Create a new EncoderAction that processes the specified group.

Parameters:
vis - the Visualization to process
group - the data group to process

EncoderAction

public EncoderAction(Visualization vis,
                     java.lang.String group,
                     Predicate filter)
Create a new EncoderAction that processes the specified group.

Parameters:
vis - the Visualization to process
group - the name of the group to process
filter - the filtering Predicate
Method Detail

add

protected void add(Predicate p,
                   java.lang.Object value)
Add a mapping rule to this EncoderAction. This method is protected, subclasses should crate public add methods of their own to enforce their own type constraints.

Parameters:
p - the rule Predicate
value - the value to map to

lookup

protected java.lang.Object lookup(VisualItem item)
Lookup the value mapped to by the given item.

Parameters:
item - the item to lookup
Returns:
the result of the rule lookup

clear

public void clear()
Remove all rule mappings from this encoder.


remove

public boolean remove(Predicate p)
Remove rules using the given predicate from this encoder. This method will not remove rules in which this predicate is used within a composite of clauses, such as an AND or OR. It only removes rules using this predicate as the top-level trigger.

Parameters:
p - the predicate to remove
Returns:
true if a rule was successfully removed, false otherwise

setVisualization

public void setVisualization(Visualization vis)
Description copied from class: Action
Set the Visualization processed by this Action.

Overrides:
setVisualization in class Action
Parameters:
vis - the Visualization to process.
See Also:
Action.setVisualization(prefuse.Visualization)

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.

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

setup

protected void setup()
Perform any necessary setup before this encoder can be used. By default does nothing. Subclasses can override this method to perform custom setup before the Action is used.


finish

protected void finish()
Perform any necessary clean-up after this encoder can be used. By default does nothing. Subclasses can override this method to perform custom clean-up after the Action is used.



Copyright © 2007 Regents of the University of California