// maintain a set of items that should be interpolated linearly
// this isn't absolutely necessary, but makes the animations nicer
// the PolarLocationAnimator should read this set and act accordingly
m_vis.addFocusGroup(linear, new DefaultTupleSet());
m_vis.getGroup(Visualization.FOCUS_ITEMS).addTupleSetListener(
new TupleSetListener() {
public void tupleSetChanged(TupleSet t, Tuple[] add, Tuple[] rem) {
TupleSet linearInterp = m_vis.getGroup(linear);
if ( add.length < 1 ) return; linearInterp.clear();
for ( Node n = (Node)add[0]; n!=null; n=n.getParent() )
linearInterp.addTuple(n);
}
}
);
//==== Create a highlight group for adding borders based on citation count
DefaultTupleSet citHighlight = new DefaultTupleSet();
m_vis.addFocusGroup("citHighlight", citHighlight);
//==== Create a group for making nodes with comments have red text
DefaultTupleSet commentHighlight = new DefaultTupleSet();
m_vis.addFocusGroup("commentHighlight", commentHighlight);
//==== Initialize the search group, a change listener for it, and add it to the visualization
TupleSetListener newNodeListener = new TupleSetListener() {
public void tupleSetChanged(TupleSet t, Tuple[] add, Tuple[] rem) {
m_vis.cancel("animatePaint");
m_vis.run("recolor");
m_vis.run("animatePaint");
}