Search in sources :

Example 1 with TupleSet

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

Example 2 with TupleSet

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

Aggregations

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