Search in sources :

Example 1 with VisualItem

use of prefuse.visual.VisualItem 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);
    }
}
Also used : TupleSet(prefuse.data.tuple.TupleSet) Iterator(java.util.Iterator) VisualItem(prefuse.visual.VisualItem)

Aggregations

Iterator (java.util.Iterator)1 TupleSet (prefuse.data.tuple.TupleSet)1 VisualItem (prefuse.visual.VisualItem)1