Search in sources :

Example 1 with StapGraph

use of org.eclipse.linuxtools.internal.callgraph.StapGraph in project linuxtools by eclipse.

the class MouseListenerTest method test.

@Test
public void test() {
    StapGraphParser parse = new StapGraphParser();
    parse.setSourcePath(Activator.getPluginLocation() + "eag.graph");
    parse.testRun(new NullProgressMonitor(), true);
    CallgraphView cView = (CallgraphView) ViewFactory.createView("org.eclipse.linuxtools.callgraph.callgraphview");
    StapUIJob j = new StapUIJob("Test Graph UI Job", parse, CallGraphConstants.VIEW_ID);
    j.runInUIThread(new NullProgressMonitor());
    StapGraphMouseListener mListener = cView.getGraph().getMouseListener();
    StapGraph g = cView.getGraph();
    g.setProject(parse.project);
    GraphItem[] nodes = { g.getNode(g.getFirstUsefulNode()) };
    g.setSelection(nodes);
    mListener.mouseDownEvent(0, 0);
    g.draw(StapGraph.CONSTANT_DRAWMODE_TREE, StapGraph.CONSTANT_ANIMATION_FASTEST, g.getFirstUsefulNode());
    mListener.mouseUp(null);
}
Also used : StapGraphParser(org.eclipse.linuxtools.internal.callgraph.StapGraphParser) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) StapGraphMouseListener(org.eclipse.linuxtools.internal.callgraph.graphlisteners.StapGraphMouseListener) CallgraphView(org.eclipse.linuxtools.internal.callgraph.CallgraphView) GraphItem(org.eclipse.zest.core.widgets.GraphItem) StapUIJob(org.eclipse.linuxtools.internal.callgraph.core.StapUIJob) StapGraph(org.eclipse.linuxtools.internal.callgraph.StapGraph) Test(org.junit.Test)

Aggregations

NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 CallgraphView (org.eclipse.linuxtools.internal.callgraph.CallgraphView)1 StapGraph (org.eclipse.linuxtools.internal.callgraph.StapGraph)1 StapGraphParser (org.eclipse.linuxtools.internal.callgraph.StapGraphParser)1 StapUIJob (org.eclipse.linuxtools.internal.callgraph.core.StapUIJob)1 StapGraphMouseListener (org.eclipse.linuxtools.internal.callgraph.graphlisteners.StapGraphMouseListener)1 GraphItem (org.eclipse.zest.core.widgets.GraphItem)1 Test (org.junit.Test)1