Search in sources :

Example 1 with CallTreeTable

use of com.jetbrains.actionscript.profiler.calltreetable.CallTreeTable in project intellij-plugins by JetBrains.

the class CPUSnapshotView method createUIComponents.

private void createUIComponents() {
    myTracesTreeTable = new CallTreeTable(getProject());
    createHotSpotsTreeTable();
    myAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, this);
    filterScope = new ScopeChooserCombo(getProject(), true, false, ProjectFilesScope.NAME);
}
Also used : Alarm(com.intellij.util.Alarm) CallTreeTable(com.jetbrains.actionscript.profiler.calltreetable.CallTreeTable) ScopeChooserCombo(com.intellij.ide.util.scopeChooser.ScopeChooserCombo)

Example 2 with CallTreeTable

use of com.jetbrains.actionscript.profiler.calltreetable.CallTreeTable in project intellij-plugins by JetBrains.

the class CPUSnapshotView method createHotSpotsTreeTable.

private void createHotSpotsTreeTable() {
    myHotSpotsTreeTable = new CallTreeTable(getProject());
    myHotSpotsTreeTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e) {
            final Object node = myHotSpotsTreeTable.getSelectedValue();
            if (!(node instanceof MergedCallNode))
                return;
            myAlarm.cancelAllRequests();
            final MergedCallNode mergedCallNode = (MergedCallNode) node;
            myAlarm.addRequest(() -> {
                FrameInfo[] frames = new FrameInfo[] { mergedCallNode.getFrameInfo() };
                final Pair<Map<FrameInfo, Long>, Map<FrameInfo, Long>> countMaps = mergedCallNode.getCallTree().getCalleesTimeMaps(frames);
                final Map<FrameInfo, Long> countMap = countMaps.getFirst();
                final Map<FrameInfo, Long> selfCountMap = countMaps.getSecond();
                DefaultMutableTreeNode tracesRoot = (DefaultMutableTreeNode) myTracesTreeTable.getSortableTreeTableModel().getRoot();
                JTreeUtil.removeChildren(tracesRoot, myTracesTreeTable.getSortableTreeTableModel());
                fillTreeModelRoot(tracesRoot, mergedCallNode.getCallTree(), countMap, selfCountMap, false, frames);
                myTracesTreeTable.reload();
                TreeUtil.expand(myTracesTreeTable.getTree(), 1);
            }, 500);
        }
    });
}
Also used : FrameInfo(com.jetbrains.actionscript.profiler.sampler.FrameInfo) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) MergedCallNode(com.jetbrains.actionscript.profiler.calltreetable.MergedCallNode) ListSelectionEvent(javax.swing.event.ListSelectionEvent) CallTreeTable(com.jetbrains.actionscript.profiler.calltreetable.CallTreeTable) Map(java.util.Map) ListSelectionListener(javax.swing.event.ListSelectionListener) Pair(com.intellij.openapi.util.Pair)

Aggregations

CallTreeTable (com.jetbrains.actionscript.profiler.calltreetable.CallTreeTable)2 ScopeChooserCombo (com.intellij.ide.util.scopeChooser.ScopeChooserCombo)1 Pair (com.intellij.openapi.util.Pair)1 Alarm (com.intellij.util.Alarm)1 MergedCallNode (com.jetbrains.actionscript.profiler.calltreetable.MergedCallNode)1 FrameInfo (com.jetbrains.actionscript.profiler.sampler.FrameInfo)1 Map (java.util.Map)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1