use of prefuse.data.tuple.TupleSet in project qi4j-sdk by Qi4j.
the class StackedGraphDisplay method setSelectedValue.
@Override
public void setSelectedValue(Object object) {
if (object == null) {
return;
}
NodeItem item = null;
Iterator iter = m_vis.items(GRAPH_NODES);
while (iter.hasNext()) {
NodeItem tItem = (NodeItem) iter.next();
Object tObj = tItem.get(USER_OBJECT);
if (tObj.equals(object)) {
item = tItem;
break;
}
}
if (item != null) {
int depth = item.getDepth();
boolean relayout = false;
if (depth > stackedLayout.getZoom()) {
stackedLayout.zoom(depth);
relayout = true;
}
TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
ts.setTuple(item);
if (relayout) {
run();
} else {
m_vis.run(AUTO_PAN_ACTION);
}
}
}
use of prefuse.data.tuple.TupleSet in project qi4j-sdk by Qi4j.
the class TreeGraphDisplay method setSelectedValue.
/**
* select the specified object
*
* @param object the object to select eg: Descriptor
*/
@Override
public void setSelectedValue(Object object) {
if (object == null) {
return;
}
VisualItem item = null;
Iterator iter = m_vis.items(GRAPH_NODES);
while (iter.hasNext()) {
VisualItem tItem = (VisualItem) iter.next();
Object tObj = tItem.get(USER_OBJECT);
if (tObj.equals(object)) {
item = tItem;
break;
}
}
if (item != null) {
TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
ts.setTuple(item);
m_vis.run(FILTER_ACTION);
}
}
Aggregations