org-netbeans-modules-profiler

16:40:07.276 INFO  jd.cli.Main - Decompiling org-netbeans-modules-profiler.jar
package org.netbeans.modules.profiler;

import org.netbeans.lib.profiler.ui.components.FilterComponent.FilterListener;
import org.netbeans.lib.profiler.ui.cpu.SnapshotFlatProfilePanel;

class CPUSnapshotPanel$1
  implements FilterComponent.FilterListener
{
  CPUSnapshotPanel$1(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void filterChanged()
  {
    if (!CPUSnapshotPanel.access$1600(this$0))
    {
      CPUSnapshotPanel.access$1602(this$0, true);
      CPUSnapshotPanel.access$400(this$0).setFilterValues(CPUSnapshotPanel.access$200(this$0).getFilterValue(), CPUSnapshotPanel.access$200(this$0).getFilterType());
      CPUSnapshotPanel.access$1602(this$0, false);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

class CPUSnapshotPanel$10
  extends DefaultListCellRenderer
{
  CPUSnapshotPanel$10(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public Component getListCellRendererComponent(JList paramJList, Object paramObject, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    DefaultListCellRenderer localDefaultListCellRenderer = (DefaultListCellRenderer)super.getListCellRendererComponent(paramJList, paramObject, paramInt, paramBoolean1, paramBoolean2);
    if (paramObject == CPUSnapshotPanel.access$1900()) {
      localDefaultListCellRenderer.setIcon(CPUSnapshotPanel.access$2000());
    } else if (paramObject == CPUSnapshotPanel.access$2100()) {
      localDefaultListCellRenderer.setIcon(CPUSnapshotPanel.access$2200());
    } else if (paramObject == CPUSnapshotPanel.access$2300()) {
      localDefaultListCellRenderer.setIcon(CPUSnapshotPanel.access$2400());
    }
    return localDefaultListCellRenderer;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.10
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

class CPUSnapshotPanel$11
  extends AbstractAction
{
  CPUSnapshotPanel$11(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    CPUSnapshotPanel.access$2500(this$0);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.11
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

class CPUSnapshotPanel$12
  extends AbstractAction
{
  CPUSnapshotPanel$12(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    CPUSnapshotPanel.access$2600(this$0);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.12
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

class CPUSnapshotPanel$13
  extends AbstractAction
{
  CPUSnapshotPanel$13(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.performFindPrevious();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.13
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

class CPUSnapshotPanel$14
  extends AbstractAction
{
  CPUSnapshotPanel$14(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.performFindNext();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.14
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import org.netbeans.lib.profiler.ui.components.FilterComponent.FilterListener;
import org.netbeans.lib.profiler.ui.cpu.SnapshotFlatProfilePanel;

class CPUSnapshotPanel$2
  implements FilterComponent.FilterListener
{
  CPUSnapshotPanel$2(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void filterChanged()
  {
    if (!CPUSnapshotPanel.access$1600(this$0))
    {
      CPUSnapshotPanel.access$1602(this$0, true);
      CPUSnapshotPanel.access$200(this$0).setFilterValues(CPUSnapshotPanel.access$400(this$0).getFilterValue(), CPUSnapshotPanel.access$400(this$0).getFilterType());
      CPUSnapshotPanel.access$1602(this$0, false);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.Component;
import org.netbeans.lib.profiler.ui.cpu.CCTDisplay;
import org.netbeans.lib.profiler.ui.cpu.CombinedPanel;

class CPUSnapshotPanel$3
  extends CombinedPanel
{
  CPUSnapshotPanel$3(CPUSnapshotPanel paramCPUSnapshotPanel, int paramInt, Component paramComponent1, Component paramComponent2)
  {
    super(paramInt, paramComponent1, paramComponent2);
  }
  
  public void requestFocus()
  {
    if (CPUSnapshotPanel.access$500(this$0) != null) {
      CPUSnapshotPanel.access$500(this$0).requestFocus();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import org.netbeans.lib.profiler.ui.cpu.CombinedPanel;

class CPUSnapshotPanel$4
  extends ComponentAdapter
{
  CPUSnapshotPanel$4(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void componentShown(ComponentEvent paramComponentEvent)
  {
    CPUSnapshotPanel.access$1700(this$0).setDividerLocation(0.5D);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.Component;
import javax.swing.JButton;
import javax.swing.JToolBar;
import org.netbeans.lib.profiler.ui.UIUtils;

class CPUSnapshotPanel$5
  extends JToolBar
{
  CPUSnapshotPanel$5(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public Component add(Component paramComponent)
  {
    if ((paramComponent instanceof JButton)) {
      UIUtils.fixButtonUI((JButton)paramComponent);
    }
    return super.add(paramComponent);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.5
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.Dimension;
import javax.swing.JComboBox;

class CPUSnapshotPanel$6
  extends JComboBox
{
  CPUSnapshotPanel$6(CPUSnapshotPanel paramCPUSnapshotPanel, Object[] paramArrayOfObject)
  {
    super(paramArrayOfObject);
  }
  
  public Dimension getMaximumSize()
  {
    return new Dimension(getPreferredSizewidth + 20, getPreferredSizeheight);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.6
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

class CPUSnapshotPanel$7
{
  CPUSnapshotPanel$7(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public String toString()
  {
    return CPUSnapshotPanel.access$1800();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.7
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

class CPUSnapshotPanel$8
{
  CPUSnapshotPanel$8(CPUSnapshotPanel paramCPUSnapshotPanel, String paramString) {}
  
  public String toString()
  {
    return val$tname;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.8
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.Dimension;
import javax.swing.JComboBox;

class CPUSnapshotPanel$9
  extends JComboBox
{
  CPUSnapshotPanel$9(CPUSnapshotPanel paramCPUSnapshotPanel, Object[] paramArrayOfObject)
  {
    super(paramArrayOfObject);
  }
  
  public Dimension getMinimumSize()
  {
    Dimension localDimension = super.getMinimumSize();
    width = 1;
    return localDimension;
  }
  
  public Dimension getMaximumSize()
  {
    Dimension localDimension = super.getPreferredSize();
    width += 50;
    return localDimension;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.9
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.util.ArrayList;
import java.util.List;
import javax.swing.JTabbedPane;
import org.netbeans.lib.profiler.common.ProfilingSettings;
import org.netbeans.lib.profiler.results.CCTNode;
import org.netbeans.lib.profiler.results.cpu.CPUResultsSnapshot;
import org.netbeans.lib.profiler.results.cpu.PrestimeCPUCCTNode;
import org.netbeans.lib.profiler.ui.cpu.CCTDisplay;
import org.netbeans.lib.profiler.ui.cpu.CPUResUserActionsHandler.Adapter;
import org.netbeans.lib.profiler.ui.cpu.ReverseCallGraphPanel;
import org.netbeans.lib.profiler.ui.cpu.SnapshotFlatProfilePanel;
import org.netbeans.lib.profiler.ui.cpu.SubtreeCallGraphPanel;
import org.netbeans.modules.profiler.ui.stp.ProfilingSettingsManager;
import org.netbeans.modules.profiler.ui.stp.ProfilingSettingsManager.ProfilingSettingsDescriptor;
import org.netbeans.modules.profiler.ui.stp.Utils;
import org.netbeans.modules.profiler.utils.IDEUtils;

final class CPUSnapshotPanel$CPUActionsHandler
  extends CPUResUserActionsHandler.Adapter
{
  private CPUSnapshotPanel$CPUActionsHandler(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public void addMethodToRoots(String paramString1, String paramString2, String paramString3)
  {
    ProfilingSettings[] arrayOfProfilingSettings1 = ProfilingSettingsManager.getDefault().getProfilingSettings().getProfilingSettings();
    
    ArrayList localArrayList = new ArrayList();
    for (Object localObject2 : arrayOfProfilingSettings1) {
      if (Utils.isCPUSettings(((ProfilingSettings)localObject2).getProfilingType())) {
        localArrayList.add(localObject2);
      }
    }
    ??? = IDEUtils.selectSettings(16, (ProfilingSettings[])localArrayList.toArray(new ProfilingSettings[localArrayList.size()]), null);
    if (??? == null) {
      return;
    }
    ((ProfilingSettings)???).addRootMethod(paramString1, paramString2, paramString3);
    if (localArrayList.contains(???))
    {
      ProfilingSettingsManager.getDefault().storeProfilingSettings(arrayOfProfilingSettings1, (ProfilingSettings)???);
    }
    else
    {
      ProfilingSettings[] arrayOfProfilingSettings2 = new ProfilingSettings[arrayOfProfilingSettings1.length + 1];
      System.arraycopy(arrayOfProfilingSettings1, 0, arrayOfProfilingSettings2, 0, arrayOfProfilingSettings1.length);
      arrayOfProfilingSettings2[arrayOfProfilingSettings1.length] = ???;
      ProfilingSettingsManager.getDefault().storeProfilingSettings(arrayOfProfilingSettings2, (ProfilingSettings)???);
    }
  }
  
  public void find(Object paramObject, String paramString)
  {
    if (paramObject == CPUSnapshotPanel.access$000(this$0))
    {
      CPUSnapshotPanel.access$100(this$0, paramString);
      CPUSnapshotPanel.access$300(this$0).setSelectedComponent(CPUSnapshotPanel.access$200(this$0));
      CPUSnapshotPanel.access$200(this$0).selectMethod(paramString);
    }
    else if (paramObject == CPUSnapshotPanel.access$200(this$0))
    {
      CPUSnapshotPanel.access$100(this$0, paramString);
      CPUSnapshotPanel.access$300(this$0).setSelectedComponent(CPUSnapshotPanel.access$000(this$0));
      this$0.performFindFirst();
    }
    else if (paramObject == CPUSnapshotPanel.access$400(this$0))
    {
      CPUSnapshotPanel.access$100(this$0, paramString);
      
      this$0.performFindFirst();
    }
    else if (paramObject == CPUSnapshotPanel.access$500(this$0))
    {
      CPUSnapshotPanel.access$100(this$0, paramString);
      
      CPUSnapshotPanel.access$400(this$0).selectMethod(paramString);
    }
  }
  
  public void showReverseCallGraph(CPUResultsSnapshot paramCPUResultsSnapshot, int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean)
  {
    if (CPUSnapshotPanel.access$600(this$0) != null) {
      CPUSnapshotPanel.access$300(this$0).remove(CPUSnapshotPanel.access$600(this$0));
    }
    CPUSnapshotPanel.access$602(this$0, new ReverseCallGraphPanel(this));
    CPUSnapshotPanel.access$600(this$0).setDataToDisplay(paramCPUResultsSnapshot, paramInt1, paramInt3);
    CPUSnapshotPanel.access$600(this$0).setSelectedMethodId(paramInt2);
    CPUSnapshotPanel.access$600(this$0).setSorting(paramInt4, paramBoolean);
    CPUSnapshotPanel.access$600(this$0).prepareResults();
    CPUSnapshotPanel.access$600(this$0).setFindString(CPUSnapshotPanel.access$000(this$0).getFindString());
    CPUSnapshotPanel.access$300(this$0).addTab(CPUSnapshotPanel.access$600(this$0).getShortTitle(), CPUSnapshotPanel.access$700(), CPUSnapshotPanel.access$600(this$0), CPUSnapshotPanel.access$600(this$0).getTitle());
    CPUSnapshotPanel.access$300(this$0).setSelectedComponent(CPUSnapshotPanel.access$600(this$0));
  }
  
  public void showSourceForMethod(String paramString1, String paramString2, String paramString3)
  {
    NetBeansProfiler.getDefaultNB().openJavaSource(paramString1, paramString2, paramString3);
  }
  
  public void showSubtreeCallGraph(CPUResultsSnapshot paramCPUResultsSnapshot, CCTNode paramCCTNode, int paramInt1, int paramInt2, boolean paramBoolean)
  {
    if (!(paramCCTNode instanceof PrestimeCPUCCTNode)) {
      return;
    }
    if (CPUSnapshotPanel.access$800(this$0) != null) {
      CPUSnapshotPanel.access$300(this$0).remove(CPUSnapshotPanel.access$800(this$0));
    }
    CPUSnapshotPanel.access$802(this$0, new SubtreeCallGraphPanel(this));
    CPUSnapshotPanel.access$800(this$0).setDataToDisplay(paramCPUResultsSnapshot, (PrestimeCPUCCTNode)paramCCTNode, paramInt1);
    CPUSnapshotPanel.access$800(this$0).setSorting(paramInt2, paramBoolean);
    CPUSnapshotPanel.access$800(this$0).prepareResults();
    CPUSnapshotPanel.access$800(this$0).setFindString(CPUSnapshotPanel.access$000(this$0).getFindString());
    CPUSnapshotPanel.access$300(this$0).addTab(CPUSnapshotPanel.access$800(this$0).getShortTitle(), CPUSnapshotPanel.access$900(), CPUSnapshotPanel.access$800(this$0), CPUSnapshotPanel.access$800(this$0).getTitle());
    CPUSnapshotPanel.access$300(this$0).setSelectedComponent(CPUSnapshotPanel.access$800(this$0));
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.CPUActionsHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import javax.swing.JMenuItem;
import org.netbeans.lib.profiler.results.cpu.CPUResultsSnapshot;
import org.netbeans.lib.profiler.ui.cpu.CCTDisplay;
import org.netbeans.lib.profiler.ui.cpu.CPUSelectionHandler;
import org.netbeans.lib.profiler.ui.cpu.SnapshotFlatProfilePanel;
import org.netbeans.lib.profiler.utils.formatting.Formattable;
import org.netbeans.lib.profiler.utils.formatting.MethodNameFormatter;
import org.netbeans.lib.profiler.utils.formatting.MethodNameFormatterFactory;

final class CPUSnapshotPanel$CPUSnapshotSelectionHandler
  implements CPUSelectionHandler
{
  private boolean cct;
  
  private CPUSnapshotPanel$CPUSnapshotSelectionHandler(CPUSnapshotPanel paramCPUSnapshotPanel, boolean paramBoolean)
  {
    cct = paramBoolean;
  }
  
  public void methodSelected(int paramInt1, int paramInt2, int paramInt3)
  {
    if (CPUSnapshotPanel.access$1000(this$0)) {
      return;
    }
    if (paramInt2 == -1) {
      return;
    }
    if (cct)
    {
      if ((paramInt1 >= -1) && (CPUSnapshotPanel.access$400(this$0).getCurrentThreadId() != paramInt1))
      {
        CPUSnapshotPanel.access$400(this$0).setDataToDisplay(CPUSnapshotPanel.access$400(this$0).getSnapshot(), paramInt1, paramInt3);
        CPUSnapshotPanel.access$400(this$0).prepareResults();
      }
      if (CPUSnapshotPanel.access$1100(this$0))
      {
        if (CPUSnapshotPanel.access$500(this$0).getPopupFindItem() != null) {
          CPUSnapshotPanel.access$500(this$0).getPopupFindItem().setEnabled(false);
        }
        CPUSnapshotPanel.access$1002(this$0, true);
        CPUSnapshotPanel.access$400(this$0).selectMethod(paramInt2);
        CPUSnapshotPanel.access$1002(this$0, false);
      }
      else if (CPUSnapshotPanel.access$500(this$0).getPopupFindItem() != null)
      {
        CPUSnapshotPanel.access$500(this$0).getPopupFindItem().setEnabled(true);
      }
    }
    else if (CPUSnapshotPanel.access$1200(this$0))
    {
      if (CPUSnapshotPanel.access$400(this$0).getPopupFindItem() != null) {
        CPUSnapshotPanel.access$400(this$0).getPopupFindItem().setEnabled(false);
      }
      int i = CPUSnapshotPanel.access$400(this$0).getCurrentView();
      String[] arrayOfString = CPUSnapshotPanel.access$1300(this$0).getMethodClassNameAndSig(paramInt2, i);
      
      CPUSnapshotPanel.access$500(this$0).setFindString(MethodNameFormatterFactory.getDefault().getFormatter().formatMethodName(arrayOfString[0], arrayOfString[1], arrayOfString[2]).toFormatted());
      
      CPUSnapshotPanel.access$1002(this$0, true);
      CPUSnapshotPanel.access$500(this$0).silentlyFindFirst();
      CPUSnapshotPanel.access$1002(this$0, false);
    }
    else if (CPUSnapshotPanel.access$400(this$0).getPopupFindItem() != null)
    {
      CPUSnapshotPanel.access$400(this$0).getPopupFindItem().setEnabled(true);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.CPUSnapshotSelectionHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;

class CPUSnapshotPanel$CombinedViewTracker
  extends FocusAdapter
{
  private Object lastFocusOwner;
  
  private CPUSnapshotPanel$CombinedViewTracker(CPUSnapshotPanel paramCPUSnapshotPanel) {}
  
  public Object getLastFocusOwner()
  {
    return lastFocusOwner;
  }
  
  public void focusGained(FocusEvent paramFocusEvent)
  {
    lastFocusOwner = paramFocusEvent.getSource();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.profiler.CPUSnapshotPanel.CombinedViewTracker
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.profiler;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.image.BufferedImage;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.accessibility.AccessibleContext;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.ImageIcon;
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenuItem;
import javax.swing.JTabbedPane;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
import javax.swing.KeyStroke;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.lib.profiler.common.ProfilingSettings;
import org.netbeans.lib.profiler.results.CCTNode;
import org.netbeans.lib.profiler.results.ExportDataDumper;
import org.netbeans.lib.profiler.results.ResultsSnapshot;
import org.netbeans.lib.profiler.results.cpu.CPUResultsSnapshot;
import org.netbeans.lib.profiler.results.cpu.PrestimeCPUCCTNode;
import org.netbeans.lib.profiler.ui.UIUtils;
import org.netbeans.lib.profiler.ui.components.FilterComponent.FilterListener;
import org.netbeans.lib.profiler.ui.cpu.CCTDisplay;
import org.netbeans.lib.profiler.ui.cpu.CPUResUserActionsHandler.Adapter;
import org.netbeans.lib.profiler.ui.cpu.CPUSelectionHandler;
import org.netbeans.lib.profiler.ui.cpu.CombinedPanel;
import org.netbeans.lib.profiler.ui.cpu.ReverseCallGraphPanel;
import org.netbeans.lib.profiler.ui.cpu.ScreenshotProvider;
import org.netbeans.lib.profiler.ui.cpu.SnapshotFlatProfilePanel;
import org.netbeans.lib.profiler.ui.cpu.SubtreeCallGraphPanel;
import org.netbeans.lib.profiler.utils.StringUtils;
import org.netbeans.lib.profiler.utils.formatting.Formattable;
import org.netbeans.lib.profiler.utils.formatting.MethodNameFormatter;
import org.netbeans.lib.profiler.utils.formatting.MethodNameFormatterFactory;
import org.netbeans.modules.profiler.actions.FindNextAction;
import org.netbeans.modules.profiler.actions.FindPreviousAction;
import org.netbeans.modules.profiler.ui.FindDialog;
import org.netbeans.modules.profiler.ui.stp.ProfilingSettingsManager;
import org.netbeans.modules.profiler.ui.stp.ProfilingSettingsManager.ProfilingSettingsDescriptor;
import org.netbeans.modules.profiler.utils.IDEUtils;
import org.openide.actions.FindAction;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.actions.SystemAction;

public final class CPUSnapshotPanel
  extends SnapshotPanel
  implements ActionListener, ChangeListener, SnapshotResultsWindow.FindPerformer, SaveViewAction.ViewProvider, ExportAction.ExportProvider
{
  private final class CPUActionsHandler
    extends CPUResUserActionsHandler.Adapter
  {
    private CPUActionsHandler() {}
    
    public void addMethodToRoots(String paramString1, String paramString2, String paramString3)
    {
      ProfilingSettings[] arrayOfProfilingSettings1 = ProfilingSettingsManager.getDefault().getProfilingSettings().getProfilingSettings();
      
      ArrayList localArrayList = new ArrayList();
      for (Object localObject2 : arrayOfProfilingSettings1) {
        if (org.netbeans.modules.profiler.ui.stp.Utils.isCPUSettings(((ProfilingSettings)localObject2).getProfilingType())) {
          localArrayList.add(localObject2);
        }
      }
      ??? = IDEUtils.selectSettings(16, (ProfilingSettings[])localArrayList.toArray(new ProfilingSettings[localArrayList.size()]), null);
      if (??? == null) {
        return;
      }
      ((ProfilingSettings)???).addRootMethod(paramString1, paramString2, paramString3);
      if (localArrayList.contains(???))
      {
        ProfilingSettingsManager.getDefault().storeProfilingSettings(arrayOfProfilingSettings1, (ProfilingSettings)???);
      }
      else
      {
        ProfilingSettings[] arrayOfProfilingSettings2 = new ProfilingSettings[arrayOfProfilingSettings1.length + 1];
        System.arraycopy(arrayOfProfilingSettings1, 0, arrayOfProfilingSettings2, 0, arrayOfProfilingSettings1.length);
        arrayOfProfilingSettings2[arrayOfProfilingSettings1.length] = ???;
        ProfilingSettingsManager.getDefault().storeProfilingSettings(arrayOfProfilingSettings2, (ProfilingSettings)???);
      }
    }
    
    public void find(Object paramObject, String paramString)
    {
      if (paramObject == cctPanel)
      {
        CPUSnapshotPanel.this.setFindString(paramString);
        tabs.setSelectedComponent(flatPanel);
        flatPanel.selectMethod(paramString);
      }
      else if (paramObject == flatPanel)
      {
        CPUSnapshotPanel.this.setFindString(paramString);
        tabs.setSelectedComponent(cctPanel);
        performFindFirst();
      }
      else if (paramObject == combinedFlat)
      {
        CPUSnapshotPanel.this.setFindString(paramString);
        
        performFindFirst();
      }
      else if (paramObject == combinedCCT)
      {
        CPUSnapshotPanel.this.setFindString(paramString);
        
        combinedFlat.selectMethod(paramString);
      }
    }
    
    public void showReverseCallGraph(CPUResultsSnapshot paramCPUResultsSnapshot, int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean)
    {
      if (backtraceView != null) {
        tabs.remove(backtraceView);
      }
      backtraceView = new ReverseCallGraphPanel(this);
      backtraceView.setDataToDisplay(paramCPUResultsSnapshot, paramInt1, paramInt3);
      backtraceView.setSelectedMethodId(paramInt2);
      backtraceView.setSorting(paramInt4, paramBoolean);
      backtraceView.prepareResults();
      backtraceView.setFindString(cctPanel.getFindString());
      tabs.addTab(backtraceView.getShortTitle(), CPUSnapshotPanel.BACK_TRACES_TAB_ICON, backtraceView, backtraceView.getTitle());
      tabs.setSelectedComponent(backtraceView);
    }
    
    public void showSourceForMethod(String paramString1, String paramString2, String paramString3)
    {
      NetBeansProfiler.getDefaultNB().openJavaSource(paramString1, paramString2, paramString3);
    }
    
    public void showSubtreeCallGraph(CPUResultsSnapshot paramCPUResultsSnapshot, CCTNode paramCCTNode, int paramInt1, int paramInt2, boolean paramBoolean)
    {
      if (!(paramCCTNode instanceof PrestimeCPUCCTNode)) {
        return;
      }
      if (subtreeView != null) {
        tabs.remove(subtreeView);
      }
      subtreeView = new SubtreeCallGraphPanel(this);
      subtreeView.setDataToDisplay(paramCPUResultsSnapshot, (PrestimeCPUCCTNode)paramCCTNode, paramInt1);
      subtreeView.setSorting(paramInt2, paramBoolean);
      subtreeView.prepareResults();
      subtreeView.setFindString(cctPanel.getFindString());
      tabs.addTab(subtreeView.getShortTitle(), CPUSnapshotPanel.SUBTREE_TAB_ICON, subtreeView, subtreeView.getTitle());
      tabs.setSelectedComponent(subtreeView);
    }
  }
  
  private final class CPUSnapshotSelectionHandler
    implements CPUSelectionHandler
  {
    private boolean cct;
    
    private CPUSnapshotSelectionHandler(boolean paramBoolean)
    {
      cct = paramBoolean;
    }
    
    public void methodSelected(int paramInt1, int paramInt2, int paramInt3)
    {
      if (internalSelChange) {
        return;
      }
      if (paramInt2 == -1) {
        return;
      }
      if (cct)
      {
        if ((paramInt1 >= -1) && (combinedFlat.getCurrentThreadId() != paramInt1))
        {
          combinedFlat.setDataToDisplay(combinedFlat.getSnapshot(), paramInt1, paramInt3);
          combinedFlat.prepareResults();
        }
        if (slaveModeDown)
        {
          if (combinedCCT.getPopupFindItem() != null) {
            combinedCCT.getPopupFindItem().setEnabled(false);
          }
          internalSelChange = true;
          combinedFlat.selectMethod(paramInt2);
          internalSelChange = false;
        }
        else if (combinedCCT.getPopupFindItem() != null)
        {
          combinedCCT.getPopupFindItem().setEnabled(true);
        }
      }
      else if (slaveModeUp)
      {
        if (combinedFlat.getPopupFindItem() != null) {
          combinedFlat.getPopupFindItem().setEnabled(false);
        }
        int i = combinedFlat.getCurrentView();
        String[] arrayOfString = snapshot.getMethodClassNameAndSig(paramInt2, i);
        
        combinedCCT.setFindString(MethodNameFormatterFactory.getDefault().getFormatter().formatMethodName(arrayOfString[0], arrayOfString[1], arrayOfString[2]).toFormatted());
        
        internalSelChange = true;
        combinedCCT.silentlyFindFirst();
        internalSelChange = false;
      }
      else if (combinedFlat.getPopupFindItem() != null)
      {
        combinedFlat.getPopupFindItem().setEnabled(true);
      }
    }
  }
  
  private class CombinedViewTracker
    extends FocusAdapter
  {
    private Object lastFocusOwner;
    
    private CombinedViewTracker() {}
    
    public Object getLastFocusOwner()
    {
      return lastFocusOwner;
    }
    
    public void focusGained(FocusEvent paramFocusEvent)
    {
      lastFocusOwner = paramFocusEvent.getSource();
    }
  }
  
  private static final String METHODS_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_MethodsString");
  private static final String CLASSES_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_ClassesString");
  private static final String PACKAGES_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_PackagesString");
  private static final String CALLTREE_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_CallTreeString");
  private static final String HOTSPOTS_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_HotSpotsString");
  private static final String COMBINED_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_CombinedString");
  private static final String INFO_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_InfoString");
  private static final String CALLTREE_TAB_DESCR = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_CallTreeTabDescr");
  private static final String HOTSPOT_TAB_DESCR = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_HotSpotTabDescr");
  private static final String COMBINED_TAB_DESCR = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_CombinedTabDescr");
  private static final String INFO_TAB_DESCR = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_InfoTabDescr");
  private static final String ALL_THREADS_ITEM = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_AllThreadsItem");
  private static final String VIEW_LABEL_STRING = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_ViewLabelString");
  private static final String TOGGLE_DOWN_TOOLTIP = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_ToggleDownToolTip");
  private static final String TOGGLE_UP_TOOLTIP = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_ToggleUpToolTip");
  private static final String PANEL_TITLE = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_PanelTitle");
  private static final String FIND_IN_STATEMENT = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_FindInStatement");
  private static final String AGGREGATION_COMBO_ACCESS_NAME = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_AggregationComboAccessName");
  private static final String AGGREGATION_COMBO_ACCESS_DESCR = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_AggregationComboAccessDescr");
  private static final String THREADS_COMBO_ACCESS_NAME = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_ThreadsComboAccessName");
  private static final String THREADS_COMBO_ACCESS_DESCR = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_ThreadsComboAccessDescr");
  private static final String STRING_NOT_FOUND_MSG = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_StringNotFoundMsg");
  private static final String FIND_ACTION_TOOLTIP = NbBundle.getMessage(CPUSnapshotPanel.class, "CPUSnapshotPanel_FindActionTooltip");
  private static final String FIND_IN_HOTSPOTS_STRING = MessageFormat.format(FIND_IN_STATEMENT, new Object[] { HOTSPOTS_STRING });
  private static final String FIND_IN_CALLTREE_STRING = MessageFormat.format(FIND_IN_STATEMENT, new Object[] { CALLTREE_STRING });
  private static final ImageIcon CLASSES_ICON = org.netbeans.modules.profiler.ui.Utils.CLASS_ICON;
  private static final ImageIcon METHODS_ICON = org.netbeans.modules.profiler.ui.Utils.METHODS_ICON;
  private static final ImageIcon PACKAGES_ICON = org.netbeans.modules.profiler.ui.Utils.PACKAGE_ICON;
  private static final ImageIcon CALL_TREE_TAB_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/callTreeTab.png", false);
  private static final ImageIcon HOTSPOTS_TAB_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/hotspotsTab.png", false);
  private static final ImageIcon COMBINED_TAB_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/combinedTab.png", false);
  private static final ImageIcon INFO_TAB_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/infoTab.png", false);
  private static final ImageIcon BACK_TRACES_TAB_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/backTracesTab.png", false);
  private static final ImageIcon SUBTREE_TAB_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/subtree.png", false);
  private static final ImageIcon SLAVE_DOWN_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/slaveDown.png", false);
  private static final ImageIcon SLAVE_UP_ICON = ImageUtilities.loadImageIcon("org/netbeans/modules/profiler/resources/slaveUp.png", false);
  private static final double SPLIT_HALF = 0.5D;
  private CCTDisplay cctPanel;
  private CCTDisplay combinedCCT;
  private CPUResultsSnapshot snapshot;
  private CombinedPanel combined;
  private CombinedViewTracker combinedViewTracker;
  private JButton findActionPresenter;
  private JButton findNextPresenter;
  private JButton findPreviousPresenter;
  private JComboBox aggregationCombo;
  private JComboBox threadsCombo;
  private JTabbedPane tabs = new JTabbedPane(3);
  private JToggleButton slaveToggleButtonDown;
  private JToggleButton slaveToggleButtonUp;
  private LoadedSnapshot loadedSnapshot;
  private ReverseCallGraphPanel backtraceView;
  private SaveViewAction saveViewAction;
  private SnapshotFlatProfilePanel combinedFlat;
  private SnapshotFlatProfilePanel flatPanel;
  private SnapshotInfoPanel infoPanel;
  private SubtreeCallGraphPanel subtreeView;
  private int[] threadIds;
  private boolean internalChange = false;
  private boolean internalFilterChange = false;
  private boolean internalSelChange = false;
  private boolean slaveModeDown = true;
  private boolean slaveModeUp = true;
  private int currentAggregationMode;
  
  public CPUSnapshotPanel(LoadedSnapshot paramLoadedSnapshot, int paramInt, boolean paramBoolean)
  {
    loadedSnapshot = paramLoadedSnapshot;
    snapshot = ((CPUResultsSnapshot)paramLoadedSnapshot.getSnapshot());
    
    CPUActionsHandler localCPUActionsHandler = new CPUActionsHandler(null);
    CPUSnapshotSelectionHandler localCPUSnapshotSelectionHandler1 = new CPUSnapshotSelectionHandler(true, null);
    CPUSnapshotSelectionHandler localCPUSnapshotSelectionHandler2 = new CPUSnapshotSelectionHandler(false, null);
    
    setLayout(new BorderLayout());
    
    flatPanel = new SnapshotFlatProfilePanel(localCPUActionsHandler);
    cctPanel = new CCTDisplay(localCPUActionsHandler);
    infoPanel = new SnapshotInfoPanel(paramLoadedSnapshot);
    combinedFlat = new SnapshotFlatProfilePanel(localCPUActionsHandler, localCPUSnapshotSelectionHandler2);
    combinedCCT = new CCTDisplay(localCPUActionsHandler, localCPUSnapshotSelectionHandler1);
    
    flatPanel.setSorting(paramInt, paramBoolean);
    cctPanel.setSorting(paramInt, paramBoolean);
    combinedFlat.setSorting(paramInt, paramBoolean);
    combinedCCT.setSorting(paramInt, paramBoolean);
    if (cctPanel.getPopupFindItem() != null)
    {
      cctPanel.getPopupFindItem().setText(FIND_IN_HOTSPOTS_STRING);
      cctPanel.getPopupFindItem().setVisible(true);
    }
    if (flatPanel.getPopupFindItem() != null)
    {
      flatPanel.getPopupFindItem().setText(FIND_IN_CALLTREE_STRING);
      flatPanel.getPopupFindItem().setVisible(true);
    }
    if (combinedFlat.getPopupFindItem() != null)
    {
      combinedFlat.getPopupFindItem().setText(FIND_IN_CALLTREE_STRING);
      combinedFlat.getPopupFindItem().setVisible(true);
    }
    if (combinedCCT.getPopupFindItem() != null)
    {
      combinedCCT.getPopupFindItem().setText(FIND_IN_HOTSPOTS_STRING);
      combinedCCT.getPopupFindItem().setVisible(true);
    }
    flatPanel.setDataToDisplay(snapshot, -1, 0);
    cctPanel.setDataToDisplay(snapshot, 0);
    combinedFlat.setDataToDisplay(snapshot, -1, 0);
    combinedCCT.setDataToDisplay(snapshot, 0);
    
    flatPanel.prepareResults();
    cctPanel.prepareResults();
    combinedCCT.prepareResults();
    combinedFlat.prepareResults();
    infoPanel.updateInfo();
    
    flatPanel.addFilterListener(new FilterComponent.FilterListener()
    {
      public void filterChanged()
      {
        if (!internalFilterChange)
        {
          internalFilterChange = true;
          combinedFlat.setFilterValues(flatPanel.getFilterValue(), flatPanel.getFilterType());
          internalFilterChange = false;
        }
      }
    });
    combinedFlat.addFilterListener(new FilterComponent.FilterListener()
    {
      public void filterChanged()
      {
        if (!internalFilterChange)
        {
          internalFilterChange = true;
          flatPanel.setFilterValues(combinedFlat.getFilterValue(), combinedFlat.getFilterType());
          internalFilterChange = false;
        }
      }
    });
    combined = new CombinedPanel(0, combinedCCT, combinedFlat)
    {
      public void requestFocus()
      {
        if (combinedCCT != null) {
          combinedCCT.requestFocus();
        }
      }
    };
    combined.setResizeWeight(0.5D);
    
    combined.setBorder(BorderFactory.createEmptyBorder());
    combined.addComponentListener(new ComponentAdapter()
    {
      public void componentShown(ComponentEvent paramAnonymousComponentEvent)
      {
        combined.setDividerLocation(0.5D);
      }
    });
    tabs.addTab(CALLTREE_STRING, CALL_TREE_TAB_ICON, cctPanel, CALLTREE_TAB_DESCR);
    tabs.addTab(HOTSPOTS_STRING, HOTSPOTS_TAB_ICON, flatPanel, HOTSPOT_TAB_DESCR);
    tabs.addTab(COMBINED_STRING, COMBINED_TAB_ICON, combined, COMBINED_TAB_DESCR);
    tabs.addTab(INFO_STRING, INFO_TAB_ICON, infoPanel, INFO_TAB_DESCR);
    add(tabs, "Center");
    
    tabs.addChangeListener(this);
    
    JToolBar local5 = new JToolBar()
    {
      public Component add(Component paramAnonymousComponent)
      {
        if ((paramAnonymousComponent instanceof JButton)) {
          UIUtils.fixButtonUI((JButton)paramAnonymousComponent);
        }
        return super.add(paramAnonymousComponent);
      }
    };
    local5.setFloatable(false);
    local5.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
    local5.setBorder(BorderFactory.createEmptyBorder(4, 0, 4, 0));
    
    local5.add(new ExportAction(this, loadedSnapshot));
    local5.add(saveViewAction = new SaveViewAction(this));
    
    local5.addSeparator();
    
    aggregationCombo = new JComboBox(new Object[] { METHODS_STRING, CLASSES_STRING, PACKAGES_STRING })
    {
      public Dimension getMaximumSize()
      {
        return new Dimension(getPreferredSizewidth + 20, getPreferredSizeheight);
      }
    };
    aggregationCombo.getAccessibleContext().setAccessibleName(AGGREGATION_COMBO_ACCESS_NAME);
    aggregationCombo.getAccessibleContext().setAccessibleDescription(AGGREGATION_COMBO_ACCESS_DESCR);
    
    currentAggregationMode = 0;
    
    String[] arrayOfString = snapshot.getThreadNames();
    Object[] arrayOfObject = new Object[arrayOfString.length + 1];
    arrayOfObject[0 = new Object()
    {
      public String toString()
      {
        return CPUSnapshotPanel.ALL_THREADS_ITEM;
      }
    };
    for (int i = 0; i < arrayOfString.length; i++)
    {
      final String str = arrayOfString[i];
      arrayOfObject[(i + 1) = new Object()
      {
        public String toString()
        {
          return str;
        }
      };
    }
    threadIds = snapshot.getThreadIds();
    
    threadsCombo = new JComboBox(arrayOfObject)
    {
      public Dimension getMinimumSize()
      {
        Dimension localD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd