Search in sources :

Example 6 with GraphNode

use of org.eclipse.zest.core.widgets.GraphNode in project linuxtools by eclipse.

the class StapGraphMouseListener method controlDoubleClick.

private void controlDoubleClick() {
    if (graph.getDrawMode() == StapGraph.CONSTANT_DRAWMODE_AGGREGATE) {
        GraphNode node = getAggregateNodeFromSelection();
        if (node == null) {
            return;
        }
        // $NON-NLS-1$
        String functionName = (String) node.getData("AGGREGATE_NAME");
        FileFinderOpener.findAndOpen(graph.getProject(), functionName);
        node.unhighlight();
    } else {
        StapNode node = getNodeFromSelection();
        if (node == null) {
            return;
        }
        int caller = node.getData().id;
        if (caller < graph.getFirstUsefulNode()) {
            // The only node that satisfies this condition should be main
            caller = graph.getFirstUsefulNode();
        }
        FileFinderOpener.findAndOpen(graph.getProject(), graph.getNodeData(caller).name);
        node.unhighlight();
    }
    graph.setSelection(null);
}
Also used : GraphNode(org.eclipse.zest.core.widgets.GraphNode) StapNode(org.eclipse.linuxtools.internal.callgraph.StapNode)

Aggregations

GraphNode (org.eclipse.zest.core.widgets.GraphNode)6 StapNode (org.eclipse.linuxtools.internal.callgraph.StapNode)2 NumberFormat (java.text.NumberFormat)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1 TreeSet (java.util.TreeSet)1 Label (org.eclipse.draw2d.Label)1 Color (org.eclipse.swt.graphics.Color)1