You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(73) |
Sep
(92) |
Oct
(9) |
Nov
(80) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(92) |
Feb
(52) |
Mar
(71) |
Apr
(64) |
May
(53) |
Jun
(10) |
Jul
(111) |
Aug
(93) |
Sep
(134) |
Oct
|
Nov
|
Dec
|
From: Lukas P. <pe...@us...> - 2002-08-31 08:40:37
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/data In directory usw-pr-cvs1:/tmp/cvs-serv2629 Modified Files: BacktraceSupport.java Added Files: MergeFrameData.java Log Message: better design of backtrace --- NEW FILE: MergeFrameData.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.data; import java.util.*; import net.sourceforge.javaprofiler.jpi.FrameRef; /** This class represents a group of <code>TraceRef</code> objects which share * the same frame at some trace level. Object of this class provides access to * the shared frame and to a list of merged traces. * @author Lukas Petru */ public class MergeFrameData { private final FrameRef frame; private final List traces; public MergeFrameData(FrameRef keyFrame, List tracesBucket) { frame=keyFrame; traces=tracesBucket; } public FrameRef getFrame() { return frame; } public List getTraces() { return traces; } } /* * $Log: MergeFrameData.java,v $ * Revision 1.1 2002/08/31 08:40:34 petrul * better design of backtrace * */ Index: BacktraceSupport.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/data/BacktraceSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BacktraceSupport.java 23 Aug 2002 18:13:42 -0000 1.1 --- BacktraceSupport.java 31 Aug 2002 08:40:34 -0000 1.2 *************** *** 45,56 **** */ public class BacktraceSupport { ! /** Splits a list of <code>TraceRef</code> objects into a map which has ! * <code>FrameRef</code> of selected level as key and a list of traces ! * containing this frame as a value. * @param traces List of <code>TraceRef</code>. * @param level Has value 1 to N, where value 1 means last called method * and higher numbers mean callers. */ ! public static Map split(List traces, int level) { if (level < 1) throw new IllegalArgumentException(String.valueOf(level)); --- 45,56 ---- */ public class BacktraceSupport { ! /** Splits a list of <code>TraceRef</code> objects into a list of <code> ! * MergeFrameData</code>. The traces are split by frame of a selected ! * level. * @param traces List of <code>TraceRef</code>. * @param level Has value 1 to N, where value 1 means last called method * and higher numbers mean callers. */ ! public static List split(List traces, int level) { if (level < 1) throw new IllegalArgumentException(String.valueOf(level)); *************** *** 70,74 **** bucket.add(tr); } ! return map; } --- 70,82 ---- bucket.add(tr); } ! // convert map to MergeFrameData list ! List res=new ArrayList(); ! it=map.entrySet().iterator(); ! while (it.hasNext()) { ! java.util.Map.Entry entry=(java.util.Map.Entry) it.next(); ! res.add(new MergeFrameData((FrameRef) entry.getKey(), ! (List) entry.getValue())); ! } ! return res; } *************** *** 115,118 **** --- 123,129 ---- /* * $Log$ + * Revision 1.2 2002/08/31 08:40:34 petrul + * better design of backtrace + * * Revision 1.1 2002/08/23 18:13:42 petrul * added cpu backtrace view |
From: Lukas P. <pe...@us...> - 2002-08-31 08:39:44
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv2426 Modified Files: Bundle.properties Added Files: ShowTable.java Log Message: action Show Table --- NEW FILE: ShowTable.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.actions; import org.openide.util.actions.NodeAction; import org.openide.util.HelpCtx; import org.openide.nodes.Node; import java.awt.BorderLayout; import org.openide.TopManager; import org.openide.explorer.ExplorerPanel; import org.openide.explorer.view.ListTableView; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import java.util.ResourceBundle; import org.openide.util.NbBundle; public class ShowTable extends NodeAction { private static ResourceBundle bundle=NbBundle.getBundle(ShowTable.class); protected boolean enable(Node[] activatedNodes) { if (activatedNodes.length!=1 || !(activatedNodes[0] instanceof PSelectorNode)) return false; int type=((PSelectorNode) activatedNodes[0]).getType(); return InterfaceRepository.hasAlloc(type) || InterfaceRepository.hasCPU(type)||InterfaceRepository.hasMon(type); } protected void performAction(Node[] activatedNodes) { if (activatedNodes.length!=1 || !(activatedNodes[0] instanceof PSelectorNode)) return; final int type=((PSelectorNode) activatedNodes[0]).getType(); class DataTable extends ExplorerPanel { DataTable() { ListTableView view=new ListTableView(); add(view, BorderLayout.CENTER); Sheet.Set set=new Sheet.Set(); if (InterfaceRepository.hasAlloc(type)) AllocStatProperty.addProperties(set, null); if (InterfaceRepository.hasCPU(type)) CPUStatProperty.addProperties(set, null); if (InterfaceRepository.hasMon(type)) MonStatProperty.addProperties(set, null); view.setProperties(set.getProperties()); } } ExplorerPanel panel=new DataTable(); panel.getExplorerManager().setRootContext(activatedNodes[0]); panel.open(); } public String getName() { return bundle.getString("LBL_ShowTable"); } public HelpCtx getHelpCtx() { return new HelpCtx(getClass()); } } /* * $Log: ShowTable.java,v $ * Revision 1.1 2002/08/31 08:39:41 petrul * action Show Table * */ Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/Bundle.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Bundle.properties 23 Aug 2002 18:12:22 -0000 1.6 --- Bundle.properties 31 Aug 2002 08:39:41 -0000 1.7 *************** *** 63,64 **** --- 63,65 ---- LBL_CTAction=Open Call Tree LBL_BTAction=Open Backtrace + LBL_ShowTable=Show Table \ No newline at end of file |
From: Lukas P. <pe...@us...> - 2002-08-31 08:37:44
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv2083 Modified Files: AllocTraceData.java CPUTraceData.java MonTraceData.java Log Message: fixed getMethod() Index: AllocTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTraceData.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** AllocTraceData.java 24 Jul 2002 22:29:21 -0000 1.23 --- AllocTraceData.java 31 Aug 2002 08:37:39 -0000 1.24 *************** *** 110,119 **** /** ! * Returns allocation data for this method. * * @return allocation data for this method. */ public MethodRef getMethod() { ! return ((FrameData) frames.get(0)).getMethod(); } --- 110,119 ---- /** ! * Returns the last called method of this trace. * * @return allocation data for this method. */ public MethodRef getMethod() { ! return ((FrameRef) frames.get(frames.size()-1)).getMethod(); } *************** *** 249,252 **** --- 249,255 ---- /* * $Log$ + * Revision 1.24 2002/08/31 08:37:39 petrul + * fixed getMethod() + * * Revision 1.23 2002/07/24 22:29:21 vachis * implements new interfaces for getting roots and info Index: CPUTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUTraceData.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** CPUTraceData.java 24 Jul 2002 22:29:22 -0000 1.17 --- CPUTraceData.java 31 Aug 2002 08:37:39 -0000 1.18 *************** *** 97,106 **** /** ! * Returns profiling data for this method. * * @return profiling data for this method. */ public MethodRef getMethod() { ! return ((FrameData) frames.get(0)).getMethod(); } --- 97,106 ---- /** ! * Returns the last called method of this trace. * * @return profiling data for this method. */ public MethodRef getMethod() { ! return ((FrameRef) frames.get(frames.size()-1)).getMethod(); } *************** *** 207,210 **** --- 207,213 ---- /* * $Log$ + * Revision 1.18 2002/08/31 08:37:39 petrul + * fixed getMethod() + * * Revision 1.17 2002/07/24 22:29:22 vachis * implements new interfaces for getting roots and info Index: MonTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonTraceData.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** MonTraceData.java 24 Jul 2002 22:29:22 -0000 1.15 --- MonTraceData.java 31 Aug 2002 08:37:39 -0000 1.16 *************** *** 97,106 **** /** ! * Returns profiling data for this method. * * @return profiling data for this method. */ public MethodRef getMethod() { ! return ((FrameData) frames.get(0)).getMethod(); } --- 97,106 ---- /** ! * Returns the last called method of this trace. * * @return profiling data for this method. */ public MethodRef getMethod() { ! return ((FrameRef) frames.get(frames.size()-1)).getMethod(); } *************** *** 209,212 **** --- 209,215 ---- /* * $Log$ + * Revision 1.16 2002/08/31 08:37:39 petrul + * fixed getMethod() + * * Revision 1.15 2002/07/24 22:29:22 vachis * implements new interfaces for getting roots and info |
From: Lukas P. <pe...@us...> - 2002-08-28 18:48:55
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources In directory usw-pr-cvs1:/tmp/cvs-serv30706 Modified Files: BacktraceIcon.gif Log Message: Index: BacktraceIcon.gif =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources/BacktraceIcon.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 Binary files /tmp/cvsmWFylo and /tmp/cvsArIWpC differ |
From: Lukas P. <pe...@us...> - 2002-08-28 18:13:04
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources In directory usw-pr-cvs1:/tmp/cvs-serv10365 Modified Files: CallTreeIcon.gif Log Message: Index: CallTreeIcon.gif =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources/CallTreeIcon.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 Binary files /tmp/cvs0bcNIR and /tmp/cvsohJTaz differ |
From: Lukas P. <pe...@us...> - 2002-08-28 18:07:37
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources In directory usw-pr-cvs1:/tmp/cvs-serv6931 Modified Files: FramesNodeIcon.gif Log Message: icon Index: FramesNodeIcon.gif =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources/FramesNodeIcon.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 Binary files /tmp/cvs8PPs2a and /tmp/cvsg79xTb differ |
From: Lukas P. <pe...@us...> - 2002-08-28 18:06:30
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv6044 Added Files: AllocSheet.java BacktraceItemSheet.java CallTreeItemSheet.java ClassSheet.java CPUSheet.java FieldSheet.java MethodSheet.java MonSheet.java SheetFactory.java ThreadgroupSheet.java ThreadSheet.java TypeSheet.java Log Message: property sheets for nodes ver 2 --- NEW FILE: AllocSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.jpi.AllocStat; public class AllocSheet implements SheetFactory { private AllocStat ref; public AllocSheet(AllocStat reference) { ref=reference; } public Sheet create() { Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); AllocStatProperty.addProperties(set, ref); sh.put(set); return sh; } } /* * $Log: AllocSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: BacktraceItemSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import java.util.List; import org.openide.TopManager; import org.openide.nodes.Node; import org.openide.nodes.Sheet; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.jpi.FrameRef; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; import net.sourceforge.javaprofiler.module.nodes.CPUStatProperty; import net.sourceforge.javaprofiler.jpi.CPUStat; /** Serves for creation of PropertySheet for call backtrace item. * @author Lukas Petru */ public class BacktraceItemSheet implements SheetFactory { private FrameRef frRef; private List traces; /** Constructs a sheet from the given data. * @param ref Data of method and line number. * @param list List of <code>CPUStat</code> */ public BacktraceItemSheet(FrameRef ref, List list) { frRef=ref; traces=list; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(BacktraceItemSheet.class); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr=new PropertySupport.Reflection(frRef.getMethod() .getParentClass(), String.class, "getName", null); pr.setName("Class"); pr.setDisplayName(bundle.getString("LBL_BTItemClass")); set.put(pr); pr=new PropertySupport.Reflection(frRef.getMethod(), String.class, "getName", null); pr.setName("Method"); pr.setDisplayName(bundle.getString("LBL_BTItemMethodName")); set.put(pr); pr=new PropertySupport.Reflection(frRef.getMethod(), String.class, "getSignature", null); pr.setName("MethodSignature"); pr.setDisplayName(bundle.getString("LBL_BTItemMethodSignature")); set.put(pr); pr=new PropertySupport.Reflection(frRef, int.class, "getLineNo", null); pr.setName("LineNumber"); pr.setDisplayName(bundle.getString("LBL_CTItemLineNo")); set.put(pr); CPUStat stat=BacktraceSupport.getSumOfCPUStat(traces); CPUStatProperty.addProperties(set, stat); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: BacktraceItemSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: CallTreeItemSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.CallTreeRef; /** Serves for creation of PropertySheet for call tree item. * @author Lukas Petru */ public class CallTreeItemSheet implements SheetFactory { private CallTreeRef ctRef; public CallTreeItemSheet(CallTreeRef ref) { ctRef=ref; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(CallTreeItemSheet.class); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr=new PropertySupport.Reflection(ctRef.getFrame() .getMethod(), String.class, "toString", null); pr.setName("Method"); pr.setDisplayName(bundle.getString("LBL_CTItemMethod")); set.put(pr); pr=new PropertySupport.Reflection(ctRef.getFrame(), int.class, "getLineNo", null); pr.setName("LineNumber"); pr.setDisplayName(bundle.getString("LBL_CTItemLineNo")); set.put(pr); pr=new PropertySupport.Reflection(ctRef, int.class, "getCPUCumulativeTime", null); pr.setName("CumulativeTime"); pr.setDisplayName(bundle.getString("LBL_CTItemCumulativeTime")); set.put(pr); pr=new PropertySupport.Reflection(ctRef, int.class, "getCPUPureTime", null); pr.setName("PureTime"); pr.setDisplayName(bundle.getString("LBL_CTItemPureTime")); set.put(pr); pr=new PropertySupport.Reflection(ctRef, int.class, "getCPUHitsCount", null); pr.setName("HitsCount"); pr.setDisplayName(bundle.getString("LBL_CTItemHits")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: CallTreeItemSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: ClassSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.ClassRef; public class ClassSheet implements SheetFactory { private ClassRef ref; public ClassSheet(ClassRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getSourceFileName", null); pr.setName("SourceFile"); pr.setDisplayName(bundle.getString("LBL_SourceFile")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: ClassSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: CPUSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.jpi.CPUStat; public class CPUSheet implements SheetFactory { private CPUStat ref; public CPUSheet(CPUStat reference) { ref=reference; } public Sheet create() { Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); CPUStatProperty.addProperties(set, ref); sh.put(set); return sh; } } /* * $Log: CPUSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: FieldSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.FieldRef; public class FieldSheet implements SheetFactory { private FieldRef ref; public FieldSheet(FieldRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref.getParentClass(), String.class, "toString", null); pr.setName("ParentClass"); pr.setDisplayName(bundle.getString("LBL_ParentClass")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getSignature", null); pr.setName("Signature"); pr.setDisplayName(bundle.getString("LBL_Signature")); set.put(pr); pr=new PropertySupport.Reflection(ref, boolean.class, "isStatic", null); pr.setName("isStatic"); pr.setDisplayName(bundle.getString("LBL_isStatic")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: FieldSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: MethodSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.MethodRef; public class MethodSheet implements SheetFactory { private MethodRef ref; public MethodSheet(MethodRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref.getParentClass(), String.class, "toString", null); pr.setName("ParentClass"); pr.setDisplayName(bundle.getString("LBL_ParentClass")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getSignature", null); pr.setName("Signature"); pr.setDisplayName(bundle.getString("LBL_Signature")); set.put(pr); pr=new PropertySupport.Reflection(ref, int.class, "getStartLineNo", null); pr.setName("StartLineNo"); pr.setDisplayName(bundle.getString("LBL_StartLineNo")); set.put(pr); pr=new PropertySupport.Reflection(ref, int.class, "getEndLineNo", null); pr.setName("EndLineNo"); pr.setDisplayName(bundle.getString("LBL_EndLineNo")); set.put(pr); AllocStatProperty.addProperties(set, ref); CPUStatProperty.addProperties(set, ref); MonStatProperty.addProperties(set, ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: MethodSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: MonSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.jpi.MonStat; public class MonSheet implements SheetFactory { private MonStat ref; public MonSheet(MonStat reference) { ref=reference; } public Sheet create() { Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); MonStatProperty.addProperties(set, ref); sh.put(set); return sh; } } /* * $Log: MonSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: SheetFactory.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.nodes.Sheet; /** SheetFactory enables lazy creation of a property sheet for some <code>Node * <code>. To be used from <code>AbstractNode.createSheet()</code> method. * @author Lukas Petru */ public interface SheetFactory { public Sheet create(); } /* * $Log: SheetFactory.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: ThreadgroupSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import java.util.Date; import net.sourceforge.javaprofiler.jpi.ThreadGroupRef; public class ThreadgroupSheet implements SheetFactory { private ThreadGroupRef ref; public ThreadgroupSheet(ThreadGroupRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: ThreadgroupSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: ThreadSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import java.util.Date; import net.sourceforge.javaprofiler.jpi.ThreadRef; public class ThreadSheet implements SheetFactory { private ThreadRef ref; public ThreadSheet(ThreadRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); if (ref.getParentThread() != null) { pr=new PropertySupport.Reflection(ref.getParentThread(), String.class, "getName", null); } else { pr=new PropertySupport.ReadOnly("", String.class, "", "") { public Object getValue() throws IllegalAccessException, InvocationTargetException {return "null";} }; } pr.setName("ParentThread"); pr.setDisplayName(bundle.getString("LBL_ParentThread")); set.put(pr); pr=new PropertySupport.Reflection(ref.getStartTime(), String.class, "toString", null); pr.setName("StartTime"); pr.setDisplayName(bundle.getString("LBL_StartTime")); set.put(pr); pr=new PropertySupport.Reflection(ref.getEndTime(), String.class, "toString", null); pr.setName("EndTime"); pr.setDisplayName(bundle.getString("LBL_EndTime")); set.put(pr); // currently, only AllocStat AllocStatProperty.addProperties(set, ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: ThreadSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: TypeSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.TypeRef; public class TypeSheet implements SheetFactory { private TypeRef ref; public TypeSheet(TypeRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); if (ref.getComponentClass() != null) { pr=new PropertySupport.Reflection(ref.getComponentClass(), String.class, "toString", null); } else { pr=new PropertySupport.ReadOnly("", String.class, "", "") { public Object getValue() throws IllegalAccessException, InvocationTargetException {return "null";} }; } pr.setName("ComponentClass"); pr.setDisplayName(bundle.getString("LBL_ComponentClass")); set.put(pr); pr=new PropertySupport.Reflection(ref, boolean.class, "isArray", null); pr.setName("isArray"); pr.setDisplayName(bundle.getString("LBL_isArray")); set.put(pr); pr=new PropertySupport.Reflection(ref, boolean.class, "isArrayOfPrimitives", null); pr.setName("isArrayOfPrimitives"); pr.setDisplayName(bundle.getString("LBL_isArrayOfPrimitives")); set.put(pr); AllocStatProperty.addProperties(set, ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: TypeSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ |
From: Lukas P. <pe...@us...> - 2002-08-28 18:04:23
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4941/sheets Log Message: Directory /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets added to the repository |
From: Lukas P. <pe...@us...> - 2002-08-28 18:03:28
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv4092 Modified Files: SessionsNode.java Log Message: temporary change, shows two nodes per one snapshot Index: SessionsNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/SessionsNode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SessionsNode.java 16 May 2002 11:59:44 -0000 1.4 --- SessionsNode.java 28 Aug 2002 18:03:26 -0000 1.5 *************** *** 81,85 **** } else if (key instanceof Snapshot) { // key is Snapshot ! return new Node[]{new SnapshotNode((Snapshot)key)}; } else { // key is ConListener --- 81,86 ---- } else if (key instanceof Snapshot) { // key is Snapshot ! return new Node[]{new SnapshotNode2((Snapshot)key), ! new SnapshotNode((Snapshot)key)}; } else { // key is ConListener *************** *** 102,105 **** --- 103,109 ---- /* * $Log$ + * Revision 1.5 2002/08/28 18:03:26 petrul + * temporary change, shows two nodes per one snapshot + * * Revision 1.4 2002/05/16 11:59:44 stolis * Listener nodes added under sessions node. |
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3565 Added Files: InterfaceRepository.java PDataChildren.java PDataNode.java PSelectorChildren.java SnapshotNode2.java Log Message: nodes, version 2 --- NEW FILE: InterfaceRepository.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import net.sourceforge.javaprofiler.jpi.*; class InterfaceRepository { private static boolean isInit=false; private static Map class2Type=null; public static int objectType(Object sample) { init(); Iterator it=class2Type.entrySet().iterator(); while (it.hasNext()) { java.util.Map.Entry entry=(java.util.Map.Entry) it.next(); Class testClass=(Class) entry.getKey(); if (testClass.isInstance(sample)) return ((Integer) entry.getValue()).intValue(); } throw new IllegalArgumentException("Illegal:"+String.valueOf(sample)); } public static int[] getChildTypes(int type) { switch(type) { case Constants.NONE: return new int[]{Constants.THREAD, Constants.CPU_TRACE, Constants.MON_TRACE, Constants.TYPE, Constants.ALLOC_TRACE, Constants.THREADGROUP, Constants.CLASS}; case Constants.THREAD: return new int[]{Constants.CPU_THREAD_TRACE, Constants.MON_THREAD_TRACE}; case Constants.CPU_TRACE: return new int[]{Constants.FRAME, Constants.CPU_THREAD_TRACE}; case Constants.CPU_THREAD_TRACE: return new int[]{}; case Constants.MON_TRACE: return new int[]{Constants.FRAME, Constants.MON_THREAD_TRACE}; case Constants.MON_THREAD_TRACE: return new int[]{}; case Constants.TYPE: return new int[]{Constants.ALLOC_TYPE_TRACE}; case Constants.ALLOC_TRACE: return new int[]{Constants.FRAME, Constants.ALLOC_TYPE_TRACE}; case Constants.ALLOC_TYPE_TRACE: return new int[]{}; case Constants.THREADGROUP: return new int[]{Constants.THREAD}; case Constants.CLASS: return new int[]{Constants.FIELD, Constants.METHOD}; case Constants.METHOD: return new int[]{}; case Constants.FIELD: return new int[]{}; } throw new IllegalArgumentException("Illegal:"+String.valueOf(type)); } public static String getListName(int type) { switch(type) { case Constants.THREAD: return "Threads"; case Constants.CPU_TRACE: return "CPUTraces"; case Constants.CPU_THREAD_TRACE: return "CPUThreadTraces"; case Constants.MON_TRACE: return "MonTraces"; case Constants.MON_THREAD_TRACE: return "MonThreadTraces"; case Constants.TYPE: return "Types"; case Constants.ALLOC_TRACE: return "AllocTraces"; case Constants.ALLOC_TYPE_TRACE: return "AllocTypeTraces"; case Constants.FRAME: return "Frames"; case Constants.THREADGROUP: return "ThreadGroups"; case Constants.CLASS: return "Classes"; case Constants.METHOD: return "Methods"; case Constants.FIELD: return "Fields"; } throw new IllegalArgumentException(String.valueOf(type)); } public static String getSelectorIconBase(int type) { switch(type) { case Constants.FRAME: return "/net/sourceforge/javaprofiler/module/resources/" + "FramesNodeIcon"; default: return "/org/openide/resources/localFS"; } } private static void init() { if (!isInit) { class2Type=new HashMap(); class2Type.put(VirtualMachineImageRef.class, new Integer(Constants.NONE)); class2Type.put(ThreadRef.class, new Integer(Constants.THREAD)); class2Type.put(CPUTraceRef.class, new Integer(Constants.CPU_TRACE)); class2Type.put(CPUThreadTraceRef.class, new Integer(Constants.CPU_THREAD_TRACE)); class2Type.put(MonTraceRef.class, new Integer(Constants.MON_TRACE)); class2Type.put(MonThreadTraceRef.class, new Integer(Constants.MON_THREAD_TRACE)); class2Type.put(TypeRef.class, new Integer(Constants.TYPE)); class2Type.put(AllocTraceRef.class, new Integer(Constants.ALLOC_TRACE)); class2Type.put(AllocTypeTraceRef.class, new Integer(Constants.ALLOC_TYPE_TRACE)); class2Type.put(FrameRef.class, new Integer(Constants.FRAME)); class2Type.put(ThreadGroupRef.class, new Integer(Constants.THREADGROUP)); class2Type.put(ClassRef.class, new Integer(Constants.CLASS)); class2Type.put(MethodRef.class, new Integer(Constants.METHOD)); class2Type.put(FieldRef.class, new Integer(Constants.FIELD)); isInit=true; } } } /* * $Log: InterfaceRepository.java,v $ * Revision 1.1 2002/08/28 18:02:38 petrul * nodes, version 2 * */ --- NEW FILE: PDataChildren.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.nodes.AbstractNode; import net.sourceforge.javaprofiler.jpi.*; import net.sourceforge.javaprofiler.module.sheets.*; class PDataChildren extends Children.Array { private final List data; PDataChildren(List list) { data=list; } protected Collection initCollection() { List nodeList=new ArrayList(); if (data.size()==0) return nodeList; Iterator it=data.iterator(); int i=1; while (it.hasNext()) { Object o=it.next(); Node node=createNode(o); node.setName(String.valueOf(i++)); nodeList.add(node); } return nodeList; } private Node createThreadRef(ThreadRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new ThreadSheet(oo)); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createCPUTraceRef(CPUTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new CPUSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createCPUThreadTraceRef(CPUThreadTraceRef oo) { AbstractNode node=new PDataNode(Children.LEAF, new CPUSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createMonTraceRef(MonTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new MonSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createMonThreadTraceRef(MonThreadTraceRef oo) { AbstractNode node=new PDataNode(Children.LEAF, new MonSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createTypeRef(TypeRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new TypeSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createAllocTraceRef(AllocTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new AllocSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createAllocTypeTraceRef(AllocTypeTraceRef oo) { AbstractNode node=new PDataNode(Children.LEAF, new AllocSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createFrameRef(FrameRef oo) { AbstractNode node=new AbstractNode(Children.LEAF); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createThreadGroupRef(ThreadGroupRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new ThreadgroupSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createClassRef(ClassRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), new ClassSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createMethodRef(MethodRef oo) { AbstractNode node=new PDataNode(Children.LEAF, new MethodSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createFieldRef(FieldRef oo) { AbstractNode node=new PDataNode(Children.LEAF, new FieldSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); return node; } private Node createNode(Object o) { if (o instanceof ThreadRef) { return createThreadRef((ThreadRef) o); } else if (o instanceof CPUTraceRef) { return createCPUTraceRef((CPUTraceRef) o); } else if (o instanceof CPUThreadTraceRef) { return createCPUThreadTraceRef((CPUThreadTraceRef) o); } else if (o instanceof MonTraceRef) { return createMonTraceRef((MonTraceRef) o); } else if (o instanceof MonThreadTraceRef) { return createMonThreadTraceRef((MonThreadTraceRef) o); } else if (o instanceof TypeRef) { return createTypeRef((TypeRef) o); } else if (o instanceof AllocTraceRef) { return createAllocTraceRef((AllocTraceRef) o); } else if (o instanceof AllocTypeTraceRef) { return createAllocTypeTraceRef((AllocTypeTraceRef) o); } else if (o instanceof FrameRef) { return createFrameRef((FrameRef) o); } else if (o instanceof ThreadGroupRef) { return createThreadGroupRef((ThreadGroupRef) o); } else if (o instanceof ClassRef) { return createClassRef((ClassRef) o); } else if (o instanceof MethodRef) { return createMethodRef((MethodRef) o); } else if (o instanceof FieldRef) { return createFieldRef((FieldRef) o); } else { // never happens AbstractNode node=new AbstractNode(Children.LEAF); node.setDisplayName("error"); node.setIconBase("/org/openide/resources/pending"); return node; } } } /* * $Log: PDataChildren.java,v $ * Revision 1.1 2002/08/28 18:02:38 petrul * nodes, version 2 * */ --- NEW FILE: PDataNode.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; import net.sourceforge.javaprofiler.module.sheets.SheetFactory; /** An enhancement to <code>AbstractNode</code> adding support for <code> * SheetFactory</code>. It also disables copy action. * @author Lukas Petru */ public class PDataNode extends AbstractNode { private SheetFactory sheet; public PDataNode(Children children) { this(children, null); } public PDataNode(Children children, SheetFactory shFactory) { super(children); sheet=shFactory; } public Sheet createSheet() { Sheet res=(sheet!=null) ? sheet.create() : super.createSheet(); sheet=null; return res; } public boolean canCopy() { return false; } public HelpCtx getHelpCtx() { return new HelpCtx(getClass()); } } --- NEW FILE: PSelectorChildren.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import org.openide.TopManager; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.nodes.AbstractNode; import org.openide.nodes.PropertySupport; import net.sourceforge.javaprofiler.jpi.VirtualMachineImageRef; class PSelectorChildren extends Children.Array { private final Object source; PSelectorChildren(Object selectFrom) { source=selectFrom; } protected Collection initCollection() { int type=InterfaceRepository.objectType(source); int[] childTypes=InterfaceRepository.getChildTypes(type); if (childTypes.length==0) return Collections.EMPTY_LIST; List nodeList=new ArrayList(); nodeList.addAll(getSpecialNodes()); for (int i=0; i<childTypes.length; i++) { String listName=InterfaceRepository.getListName(childTypes[i]); List childrenList=getChildren(source, "get" + listName); Children children; if (childrenList.size()==0) children=Children.LEAF; else children=new PDataChildren(childrenList); AbstractNode node=new AbstractNode(children); node.setName(listName); node.setDisplayName(listName); // icon node.setIconBase(InterfaceRepository.getSelectorIconBase( childTypes[i])); nodeList.add(node); } return nodeList; } private List getChildren(Object parent, String getter) { try { Node.Property pr=new PropertySupport.Reflection(parent, List.class, getter, null); List data=(List) pr.getValue(); return data; } catch (Exception e) { TopManager.getDefault().notifyException(e); throw new RuntimeException(getter); } } List getSpecialNodes() { int type=InterfaceRepository.objectType(source); if (source instanceof VirtualMachineImageRef) { List nodeList=new ArrayList(); VirtualMachineImageRef ref=(VirtualMachineImageRef) source; AbstractNode node=new CallTreeNode(new CallTreeChildren( ref.getThreadGroups())); node.setName("CallTree"); node.setDisplayName("Call Tree"); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/CallTreeIcon"); nodeList.add(node); node=new CallTreeNode(new BacktraceChildren( ref.getCPUTraces(), 1)); node.setName("Backtrace"); node.setDisplayName("Merg CPUTraces"); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/BacktraceIcon"); nodeList.add(node); return nodeList; } else return Collections.EMPTY_LIST; } } /* * $Log: PSelectorChildren.java,v $ * Revision 1.1 2002/08/28 18:02:38 petrul * nodes, version 2 * */ --- NEW FILE: SnapshotNode2.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License Version * 1.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is available at http://www.sun.com/ * * The Original Code is the Java Profiler module. * The Initial Developers of the Original Code are Jan Stola, Pavel Vacha, * Michal Pise, Petr Luner, Lukas Petru and Marek Przeczek. * Portions created by Jan Stola are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Pavel Vacha are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Michal Pise are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Petr Luner are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Lukas Petru are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Marek Przeczek are Copyright (C) 2000-2001. All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.io.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.*; import javax.swing.*; import javax.swing.border.TitledBorder; import org.openide.*; import org.openide.actions.*; import org.openide.nodes.*; import org.openide.filesystems.*; import org.openide.loaders.DataFolder; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.SystemAction; import net.sourceforge.javaprofiler.jpi.VirtualMachineImageRef; import net.sourceforge.javaprofiler.module.data.Snapshot; import net.sourceforge.javaprofiler.module.actions.*; import net.sourceforge.javaprofiler.module.data.ProfilerData; /** * Node for one snapshot. * * @author Jan Stola, LukasPetru */ public class SnapshotNode2 extends AbstractNode implements SnapshotCookie { private Snapshot snapshot; private static ResourceBundle bundle=NbBundle.getBundle(SnapshotNode.class); public SnapshotNode2(Snapshot snapshot) { super(new PSelectorChildren(snapshot.getSnapshot())); this.snapshot=snapshot; setIconBase("/net/sourceforge/javaprofiler/module/resources/SnapshotNodeIcon"); setDisplayName(snapshot.getName()); setShortDescription(NbBundle.getMessage(SnapshotNode.class, "HINT_snapshotNode")); getCookieSet().add(this); } /** Returns the <code>Snapshot</code> object that is represented by this * node. */ public Snapshot getSnapshot() { return snapshot; } protected SystemAction[] createActions() { return new SystemAction[] { SystemAction.get(CloseSnapshotAction.class), SystemAction.get(SaveSnapshotAction.class), null, SystemAction.get(PropertiesAction.class) }; } public HelpCtx getHelpCtx() { return new HelpCtx(SnapshotNode.class); } protected Sheet createSheet() { Sheet sheet=super.createSheet(); Sheet.Set props=sheet.get(Sheet.PROPERTIES); if (props==null) { props=Sheet.createPropertiesSet(); sheet.put(props); } props.put(new PropertySupport.ReadWrite("name", String.class, bundle.getString("LBL_snapshotName"), bundle.getString("HINT_snapshotName")) { public Object getValue() { return snapshot.getName(); } public void setValue(Object o) { snapshot.setName((String)o); SnapshotNode2.this.setDisplayName(snapshot.getName()); } }); props.put(new PropertySupport.ReadOnly("time", long.class, bundle.getString("LBL_snapshotTime"), bundle.getString("HINT_snapshotTime")) { public Object getValue() { return new Long(snapshot.getSnapshot().time()); } }); props.put(new PropertySupport.ReadOnly("totalMemory", long.class, bundle.getString("LBL_totalMemory"), bundle.getString("HINT_totalMemory")) { public Object getValue() { return new Long(snapshot.getSnapshot().totalMemory()); } }); props.put(new PropertySupport.ReadOnly("freeMemory", long.class, bundle.getString("LBL_freeMemory"), bundle.getString("HINT_freeMemory")) { public Object getValue() { return new Long(snapshot.getSnapshot().freeMemory()); } }); props.put(new PropertySupport.ReadOnly("takenMemory", long.class, bundle.getString("LBL_takenMemory"), bundle.getString("HINT_takenMemory")) { public Object getValue() { return new Long(snapshot.getSnapshot().totalMemory()-snapshot.getSnapshot().freeMemory()); } }); return sheet; } public boolean canCopy() { return false; } /** * Closes the snapshot. */ public boolean close() { ProfilerData.getData().removeSnapshot(snapshot); return true; } /** * Saves the snapshot. */ public void save() { final DataFolderPanel dfp=new DataFolderPanel(); DialogDescriptor dd=new DialogDescriptor(dfp, bundle.getString("LBL_saveSnapshotDialog"), true, new ActionListener() { public void actionPerformed(ActionEvent evt) { ObjectOutputStream oos=null; try { DataFolder df=(DataFolder)dfp.getPropertyValue(); FileObject pf=df.getPrimaryFile(); FileObject fo=pf.createData(dfp.getSnapshotName(), "snapshot"); //NOI18N FileLock fl=fo.lock(); OutputStream os=fo.getOutputStream(fl); oos=new ObjectOutputStream(os); oos.writeObject(snapshot.getSnapshot()); } catch (Exception e) { TopManager.getDefault().notifyException(e); } finally { try { if (oos!=null) oos.close(); } catch (IOException ioe) {} } } }); Dialog dialog=TopManager.getDefault().createDialog(dd); dialog.setVisible(true); } /** Tells if this snapshot was created with call-tree information. For use * by the OpenCallTree action. */ public boolean isCallTreeEnabled() { //PENDING return true; } } /* * $Log: SnapshotNode2.java,v $ * Revision 1.1 2002/08/28 18:02:38 petrul * nodes, version 2 * */ |
From: Lukas P. <pe...@us...> - 2002-08-28 18:00:08
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv2114 Modified Files: BacktraceChildren.java CallTreeChildren.java CallTreeNode.java Log Message: property sheets moved to sheets package Index: BacktraceChildren.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/BacktraceChildren.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BacktraceChildren.java 23 Aug 2002 18:15:13 -0000 1.1 --- BacktraceChildren.java 28 Aug 2002 18:00:05 -0000 1.2 *************** *** 42,45 **** --- 42,46 ---- import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; + import net.sourceforge.javaprofiler.module.sheets.*; /** This children object is constructed from a list of <code>CPUTrace</code> *************** *** 99,104 **** /* * $Log$ ! * Revision 1.1 2002/08/23 18:15:13 petrul ! * added cpu backtrace view * */ --- 100,105 ---- /* * $Log$ ! * Revision 1.2 2002/08/28 18:00:05 petrul ! * property sheets moved to sheets package * */ Index: CallTreeChildren.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/CallTreeChildren.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CallTreeChildren.java 20 Aug 2002 19:13:39 -0000 1.1 --- CallTreeChildren.java 28 Aug 2002 18:00:05 -0000 1.2 *************** *** 40,44 **** import org.openide.nodes.Node; import net.sourceforge.javaprofiler.jpi.*; ! import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; /** This class converts a list of JPI objects into <code>Node</code> objects. --- 40,44 ---- import org.openide.nodes.Node; import net.sourceforge.javaprofiler.jpi.*; ! import net.sourceforge.javaprofiler.module.sheets.*; /** This class converts a list of JPI objects into <code>Node</code> objects. *************** *** 102,106 **** CallTreeChildren(oo.getThreads())); node.setDisplayName("Group " + oo.getName()); ! node.setIconBase("/org/openide/resources/groupShadow"); return node; } else if (o instanceof ThreadRef) { --- 102,106 ---- CallTreeChildren(oo.getThreads())); node.setDisplayName("Group " + oo.getName()); ! node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof ThreadRef) { *************** *** 113,117 **** node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); ! node.setIconBase("/org/openide/resources/groupShadow"); return node; } else if (o instanceof CallTreeRef) { --- 113,117 ---- node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); ! node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof CallTreeRef) { *************** *** 120,124 **** // never happens AbstractNode node=new AbstractNode(Children.LEAF); ! node.setName("error"); node.setIconBase("/org/openide/resources/pending"); return node; --- 120,124 ---- // never happens AbstractNode node=new AbstractNode(Children.LEAF); ! node.setDisplayName("error"); node.setIconBase("/org/openide/resources/pending"); return node; Index: CallTreeNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/CallTreeNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** CallTreeNode.java 23 Aug 2002 18:19:01 -0000 1.2 --- CallTreeNode.java 28 Aug 2002 18:00:05 -0000 1.3 *************** *** 38,49 **** import org.openide.nodes.Children; import org.openide.util.HelpCtx; - - import org.openide.TopManager; import org.openide.nodes.Sheet; ! import org.openide.nodes.Node; ! import org.openide.nodes.PropertySupport; ! import net.sourceforge.javaprofiler.jpi.CallTreeRef; ! import java.util.ResourceBundle; ! import org.openide.util.NbBundle; /** An enhancement to <code>AbstractNode</code> adding support for <code> --- 38,43 ---- import org.openide.nodes.Children; import org.openide.util.HelpCtx; import org.openide.nodes.Sheet; ! import net.sourceforge.javaprofiler.module.sheets.*; /** An enhancement to <code>AbstractNode</code> adding support for <code> *************** *** 78,126 **** } ! /** Serves for creation of PropertySheet for call tree item. ! * @author Lukas Petru ! */ ! class CallTreeItemSheet implements SheetFactory { ! private CallTreeRef ctRef; ! ! public CallTreeItemSheet(CallTreeRef ref) { ! ctRef=ref; ! } ! ! public Sheet create() { ! ResourceBundle bundle=NbBundle.getBundle(CallTreeItemSheet.class); ! Sheet sh=new Sheet(); ! Sheet.Set set=Sheet.createPropertiesSet(); ! try { ! Node.Property pr=new PropertySupport.Reflection(ctRef.getFrame() ! .getMethod(), String.class, "toString", null); ! pr.setName("Method"); ! pr.setDisplayName(bundle.getString("LBL_CTItemMethod")); ! set.put(pr); ! pr=new PropertySupport.Reflection(ctRef.getFrame(), int.class, ! "getLineNo", null); ! pr.setName("LineNumber"); ! pr.setDisplayName(bundle.getString("LBL_CTItemLineNo")); ! set.put(pr); ! pr=new PropertySupport.Reflection(ctRef, int.class, ! "getCPUCumulativeTime", null); ! pr.setName("CumulativeTime"); ! pr.setDisplayName(bundle.getString("LBL_CTItemCumulativeTime")); ! set.put(pr); ! pr=new PropertySupport.Reflection(ctRef, int.class, ! "getCPUPureTime", null); ! pr.setName("PureTime"); ! pr.setDisplayName(bundle.getString("LBL_CTItemPureTime")); ! set.put(pr); ! pr=new PropertySupport.Reflection(ctRef, int.class, ! "getCPUHitsCount", null); ! pr.setName("HitsCount"); ! pr.setDisplayName(bundle.getString("LBL_CTItemHits")); ! set.put(pr); ! } catch (NoSuchMethodException e) { ! TopManager.getDefault().notifyException(e); ! } ! sh.put(set); ! return sh; ! } ! } \ No newline at end of file --- 72,79 ---- } ! /* ! * $Log$ ! * Revision 1.3 2002/08/28 18:00:05 petrul ! * property sheets moved to sheets package ! * ! */ \ No newline at end of file |
From: Lukas P. <pe...@us...> - 2002-08-28 17:58:50
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv1405 Removed Files: BacktraceItemSheet.java SheetFactory.java Log Message: property sheets moved to sheets package --- BacktraceItemSheet.java DELETED --- --- SheetFactory.java DELETED --- |
From: Lukas P. <pe...@us...> - 2002-08-28 17:56:00
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv31932 Modified Files: SnapshotImpl.java Log Message: fixed children adding to parents' lists Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** SnapshotImpl.java 23 Aug 2002 18:09:58 -0000 1.31 --- SnapshotImpl.java 28 Aug 2002 17:55:54 -0000 1.32 *************** *** 854,857 **** --- 854,858 ---- lf.addType( newObj ); up.addTrace( newObj ); + ((TypeData) up.getType()).addTrace( newObj ); return newObj; } *************** *** 1050,1054 **** CPUThreadTraceData newObj = new CPUThreadTraceData( sid, up, lf ); lf.addThread( newObj ); ! up.addTrace( newObj ); return newObj; } --- 1051,1056 ---- CPUThreadTraceData newObj = new CPUThreadTraceData( sid, up, lf ); lf.addThread( newObj ); ! up.addTrace( newObj ); ! ((ThreadData) up.getThread()).addCPUTrace( newObj ); return newObj; } *************** *** 1106,1109 **** --- 1108,1112 ---- lf.addThread( newObj ); up.addTrace( newObj ); + ((ThreadData) up.getThread()).addMonTrace( newObj ); return newObj; } *************** *** 1143,1146 **** --- 1146,1152 ---- /* * $Log$ + * Revision 1.32 2002/08/28 17:55:54 petrul + * fixed children adding to parents' lists + * * Revision 1.31 2002/08/23 18:09:58 petrul * reversed list of frames |
From: Pavel V. <va...@us...> - 2002-08-26 19:30:17
|
Update of /cvsroot/javaprofiler/jpi/net/sourceforge/javaprofiler/jpi In directory usw-pr-cvs1:/tmp/cvs-serv19874 Modified Files: Bootstrap.java Log Message: fix in loaded class name Index: Bootstrap.java =================================================================== RCS file: /cvsroot/javaprofiler/jpi/net/sourceforge/javaprofiler/jpi/Bootstrap.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Bootstrap.java 21 Aug 2002 13:04:47 -0000 1.2 --- Bootstrap.java 26 Aug 2002 19:30:14 -0000 1.3 *************** *** 57,62 **** try { // FIXME manager = (ConnectorManager) Class.forName( ! "net.sourceforge.javaprofiler.jpiimpl.ConnectorManagerImpl").newInstance(); ! } catch ( Exception e) {} return manager; } --- 57,70 ---- try { // FIXME manager = (ConnectorManager) Class.forName( ! "net.sourceforge.javaprofiler.jpiimpl.connect.ConnectorManagerImpl").newInstance(); ! } catch ( ClassNotFoundException e) { ! throw new RuntimeException( "Error in finding class ConnectorManager: " ! + e.getMessage() ); ! } catch ( InstantiationException e ) { ! throw new RuntimeException( "Error in intatitation ConnectorManager: " ! + e.getMessage() ); ! } catch ( IllegalAccessException e ) { ! throw new RuntimeException( "IllegalAccessException" + e.getMessage() ); ! } return manager; } *************** *** 65,68 **** --- 73,79 ---- /* * $Log$ + * Revision 1.3 2002/08/26 19:30:14 vachis + * fix in loaded class name + * * Revision 1.2 2002/08/21 13:04:47 vachis * VirtualMachineManager renamed to ConnectorManager |
From: Lukas P. <pe...@us...> - 2002-08-23 18:21:14
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv22415 Modified Files: SessionNode.java Log Message: added realtime nodes Index: SessionNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/SessionNode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SessionNode.java 14 Jul 2002 18:04:57 -0000 1.4 --- SessionNode.java 23 Aug 2002 18:21:12 -0000 1.5 *************** *** 31,34 **** --- 31,35 ---- import net.sourceforge.javaprofiler.jpi.Snapshot; + import net.sourceforge.javaprofiler.jpiimpl.VirtualMachineImpl; import net.sourceforge.javaprofiler.module.actions.*; import net.sourceforge.javaprofiler.module.data.Session; *************** *** 45,49 **** public SessionNode(Session session) { ! super(Children.LEAF); this.session=session; setIconBase("/net/sourceforge/javaprofiler/module/resources/SessionNodeIcon"); --- 46,51 ---- public SessionNode(Session session) { ! super(new RealtimeTextChildren(new String[]{"ThreadGroups", "Threads", ! "Classes", "Types", "Methods"})); this.session=session; setIconBase("/net/sourceforge/javaprofiler/module/resources/SessionNodeIcon"); *************** *** 108,111 **** --- 110,114 ---- public void destroy() { + ((VirtualMachineImpl) session.getVM()).destroyRealtimeImage(); session.getVM().exit(0); ProfilerData.getData().removeSession(session); *************** *** 152,159 **** --- 155,169 ---- } + /** Returns realtime image object. */ + public Object getData() { + return ((VirtualMachineImpl) session.getVM()).realtimeImage(); + } } /* * $Log$ + * Revision 1.5 2002/08/23 18:21:12 petrul + * added realtime nodes + * * Revision 1.4 2002/07/14 18:04:57 stolis * Resource bundle is static, not instance field. |
From: Lukas P. <pe...@us...> - 2002-08-23 18:20:25
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv21887 Added Files: RealtimeChildren.java RealtimeTextChildren.java Log Message: added realtime nodes --- NEW FILE: RealtimeChildren.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import java.beans.FeatureDescriptor; import org.openide.TopManager; import org.openide.nodes.Children; import org.openide.nodes.AbstractNode; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import net.sourceforge.javaprofiler.jpi.*; import javax.swing.SwingUtilities; /** This class converts a list of JPI objects into <code>Node</code> objects. * Properly handled classes include <code>ThreadGroupRef</code>, * <code>ThreadRef</code>, <code>ClassRef</code>, <code>TypeRef</code>, <code> * MethodRef</code>. The list is taken from an instance object using specified * getter method and using Reflection. * @author Lukas Petru */ public class RealtimeChildren extends Children.Array { private Object instance; private String getterName; private int childType; private List data=Collections.EMPTY_LIST; private int shownCount; private ChildrenListener listener; public RealtimeChildren(Object object, String getter, int type) { instance=object; getterName=getter; childType=type; } protected Collection initCollection() { try { addChildrenListener(instance, childType); Node.Property pr=new PropertySupport.Reflection(instance, List.class, getterName, null); data=(List) pr.getValue(); } catch (Exception e) { TopManager.getDefault().notifyException(e); } shownCount=data.size(); List nodeList=new ArrayList(); if (data.size()==0) return nodeList; Iterator it=data.iterator(); int i=1; while (it.hasNext()) { Object o=it.next(); Node node=createRealtimeNode(o); node.setName(String.valueOf(i++)); nodeList.add(node); } return nodeList; } void update() { int nw=data.size(); if (nw > shownCount) { List l=data.subList(shownCount, nw); List nodeList=new ArrayList(); Iterator it=l.iterator(); int i=shownCount+1; while (it.hasNext()) { Object o=it.next(); Node node=createRealtimeNode(o); node.setName(String.valueOf(i++)); nodeList.add(node); } add((Node[]) nodeList.toArray(new Node[nw-shownCount])); shownCount=nw; } } private void removeChildrenListener(Object to, int type) { try { to.getClass().getMethod("removeChildrenListener", new Class[]{int.class, ChildrenListener.class}) .invoke(to, new Object[]{new Integer(type), getListener()}); } catch (Exception e) { TopManager.getDefault().notifyException(e); } } private void addChildrenListener(Object to, int type) { try { to.getClass().getMethod("addChildrenListener", new Class[]{int.class, ChildrenListener.class}) .invoke(to, new Object[]{new Integer(type), getListener()}); } catch (Exception e) { TopManager.getDefault().notifyException(e); } } private ChildrenListener getListener() { if (listener==null) { listener=new CustomChildrenListener(this); } return listener; } private Node createRealtimeNode(Object o) { if (o instanceof ThreadRef) { ThreadRef oo=(ThreadRef) o; AbstractNode node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof ThreadGroupRef) { ThreadGroupRef oo=(ThreadGroupRef) o; AbstractNode node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof ClassRef) { ClassRef oo=(ClassRef) o; AbstractNode node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof TypeRef) { TypeRef oo=(TypeRef) o; AbstractNode node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof MethodRef) { MethodRef oo=(MethodRef) o; AbstractNode node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); return node; } else { // never happens AbstractNode node=new AbstractNode(Children.LEAF); node.setIconBase("/org/openide/resources/pending"); return node; } } } /** This class notifies tied RealtimeChildren object when new children are * available. * @author Lukas Petru */ class CustomChildrenListener implements ChildrenListener { private RealtimeChildren children; public CustomChildrenListener(RealtimeChildren ch) { children=ch; } public void childrenAdded(ChildrenEvent event) { SwingUtilities.invokeLater(new Runnable() { public void run() { children.update(); } }); } public void childrenChanged(ChildrenEvent event) { } } /* * $Log: RealtimeChildren.java,v $ * Revision 1.1 2002/08/23 18:20:18 petrul * added realtime nodes * */ --- NEW FILE: RealtimeTextChildren.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import org.openide.nodes.Children; import org.openide.nodes.AbstractNode; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import net.sourceforge.javaprofiler.jpi.*; /** This class converts a list of String into list of nodes with the same names. * The nodes will have children taken from some list property of realtime * image. The list property is chosen according the String value. * @author Lukas Petru */ public class RealtimeTextChildren extends Children.Array { private String[] texts; public RealtimeTextChildren(String[] text) { texts=text; } protected Collection initCollection() { if (texts.length==0) return Collections.EMPTY_LIST; List nodeList=new ArrayList(); Object parent=((SessionNode) getNode()).getData(); for (int i=0; i<texts.length; i++) { AbstractNode node=new CallTreeNode(new RealtimeChildren(parent, "get"+texts[i], getChildType(texts[i]))); node.setIconBase("/org/openide/resources/groupShadow"); node.setName(texts[i]); nodeList.add(node); } return nodeList; } private int getChildType(String name) { if (name.compareTo("Threads")==0) return Constants.THREAD; else if (name.compareTo("ThreadGroups")==0) return Constants.THREADGROUP; else if (name.compareTo("Classes")==0) return Constants.CLASS; else if (name.compareTo("Types")==0) return Constants.TYPE; else if (name.compareTo("Methods")==0) return Constants.METHOD; else return Constants.NONE; } } /* * $Log: RealtimeTextChildren.java,v $ * Revision 1.1 2002/08/23 18:20:18 petrul * added realtime nodes * */ |
From: Lukas P. <pe...@us...> - 2002-08-23 18:19:04
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv21475 Modified Files: CallTreeNode.java Log Message: SheetFactory released after use Index: CallTreeNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/CallTreeNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CallTreeNode.java 20 Aug 2002 19:13:39 -0000 1.1 --- CallTreeNode.java 23 Aug 2002 18:19:01 -0000 1.2 *************** *** 64,68 **** public Sheet createSheet() { ! return (sheet!=null) ? sheet.create() : super.createSheet(); } --- 64,70 ---- public Sheet createSheet() { ! Sheet res=(sheet!=null) ? sheet.create() : super.createSheet(); ! sheet=null; ! return res; } *************** *** 72,76 **** public HelpCtx getHelpCtx() { ! return new HelpCtx(CallTreeNode.class); } } --- 74,78 ---- public HelpCtx getHelpCtx() { ! return new HelpCtx(getClass()); } } |
From: Lukas P. <pe...@us...> - 2002-08-23 18:17:42
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources In directory usw-pr-cvs1:/tmp/cvs-serv21110 Added Files: BacktraceIcon.gif BacktraceItemIcon.gif Log Message: added cpu backtrace view --- NEW FILE: BacktraceIcon.gif --- GIF89a --- NEW FILE: BacktraceItemIcon.gif --- GIF89a |
From: Lukas P. <pe...@us...> - 2002-08-23 18:16:35
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv20685 Modified Files: Bundle.properties SnapshotNode.java Log Message: added cpu backtrace view Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/Bundle.properties,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Bundle.properties 20 Aug 2002 19:13:39 -0000 1.7 --- Bundle.properties 23 Aug 2002 18:16:32 -0000 1.8 *************** *** 181,182 **** --- 181,185 ---- LBL_CTItemPureTime=Pure Time LBL_CTItemHits=Hits Count + LBL_BTItemClass=Class + LBL_BTItemMethodName=Method Name + LBL_BTItemMethodSignature=Method Signature Index: SnapshotNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/SnapshotNode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SnapshotNode.java 20 Aug 2002 19:13:39 -0000 1.4 --- SnapshotNode.java 23 Aug 2002 18:16:32 -0000 1.5 *************** *** 72,75 **** --- 72,76 ---- return new SystemAction[] { SystemAction.get(OpenCallTree.class), + SystemAction.get(OpenBacktrace.class), null, SystemAction.get(CloseSnapshotAction.class), *************** *** 244,247 **** --- 245,251 ---- /* * $Log$ + * Revision 1.5 2002/08/23 18:16:32 petrul + * added cpu backtrace view + * * Revision 1.4 2002/08/20 19:13:39 petrul * separate call-tree window |
From: Lukas P. <pe...@us...> - 2002-08-23 18:15:17
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv20133 Added Files: BacktraceChildren.java BacktraceItemSheet.java Log Message: added cpu backtrace view --- NEW FILE: BacktraceChildren.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import org.openide.nodes.Children; import org.openide.nodes.AbstractNode; import org.openide.nodes.Node; import net.sourceforge.javaprofiler.jpi.*; import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; /** This children object is constructed from a list of <code>CPUTrace</code> * objects. Each child represents one FrameRef at a given level. * @author Lukas Petru */ public class BacktraceChildren extends Children.Array { private List traces; private int level; /** Constructs children. * @param list List of <code>CPUTrace</code>. * @param frameLevel Level of frame for which to create nodes. Level 1 is * the last called method in a trace. */ public BacktraceChildren(List list, int frameLevel) { traces=list; level=frameLevel; } protected Collection initCollection() { if (traces.size()==0) return Collections.EMPTY_LIST; java.util.Map map=BacktraceSupport.split(traces, level); traces=null; List nodeList=new ArrayList(); Iterator it=map.entrySet().iterator(); int i=1; while (it.hasNext()) { java.util.Map.Entry entry=(java.util.Map.Entry) it.next(); Node node=createBTNode(entry.getKey(), entry.getValue()); node.setName(String.valueOf(i++)); nodeList.add(node); } return nodeList; } private Node createBTNode(Object key, Object value) { FrameRef oo=(FrameRef) key; List bucket=(List) value; Children ch; if (bucket.size()==1 && ((TraceRef) bucket.get(0)).getFrames().size()<= level) ch=Children.LEAF; else ch=new BacktraceChildren(bucket, level+1); AbstractNode node=new CallTreeNode(ch, new BacktraceItemSheet(oo, bucket)); node.setDisplayName(oo.getMethod().toString() + oo.getMethod() .getSignature()); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/BacktraceItemIcon"); return node; } } /* * $Log: BacktraceChildren.java,v $ * Revision 1.1 2002/08/23 18:15:13 petrul * added cpu backtrace view * */ --- NEW FILE: BacktraceItemSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.List; import org.openide.TopManager; import org.openide.nodes.Node; import org.openide.nodes.Sheet; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.jpi.FrameRef; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; import net.sourceforge.javaprofiler.jpi.CPUStat; /** Serves for creation of PropertySheet for call backtrace item. * @author Lukas Petru */ class BacktraceItemSheet implements SheetFactory { private FrameRef frRef; private List traces; /** Constructs a sheet from the given data. * @param ref Data of method and line number. * @param list List of <code>CPUStat</code> */ public BacktraceItemSheet(FrameRef ref, List list) { frRef=ref; traces=list; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(BacktraceItemSheet.class); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr=new PropertySupport.Reflection(frRef.getMethod() .getParentClass(), String.class, "getName", null); pr.setName("Class"); pr.setDisplayName(bundle.getString("LBL_BTItemClass")); set.put(pr); pr=new PropertySupport.Reflection(frRef.getMethod(), String.class, "getName", null); pr.setName("Method"); pr.setDisplayName(bundle.getString("LBL_BTItemMethodName")); set.put(pr); pr=new PropertySupport.Reflection(frRef.getMethod(), String.class, "getSignature", null); pr.setName("MethodSignature"); pr.setDisplayName(bundle.getString("LBL_BTItemMethodSignature")); set.put(pr); pr=new PropertySupport.Reflection(frRef, int.class, "getLineNo", null); pr.setName("LineNumber"); pr.setDisplayName(bundle.getString("LBL_CTItemLineNo")); set.put(pr); CPUStat stat=BacktraceSupport.getSumOfCPUStat(traces); CPUStatProperty.addProperties(set, stat); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: BacktraceItemSheet.java,v $ * Revision 1.1 2002/08/23 18:15:13 petrul * added cpu backtrace view * */ |
From: Lukas P. <pe...@us...> - 2002-08-23 18:13:48
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/data In directory usw-pr-cvs1:/tmp/cvs-serv19585 Added Files: BacktraceSupport.java Log Message: added cpu backtrace view --- NEW FILE: BacktraceSupport.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.data; import java.util.*; import net.sourceforge.javaprofiler.jpi.TraceRef; import net.sourceforge.javaprofiler.jpi.FrameRef; import net.sourceforge.javaprofiler.jpi.CPUStat; import net.sourceforge.javaprofiler.jpi.CPUStatListener; /** Support for showing backtrace view. * @author Lukas Petru */ public class BacktraceSupport { /** Splits a list of <code>TraceRef</code> objects into a map which has * <code>FrameRef</code> of selected level as key and a list of traces * containing this frame as a value. * @param traces List of <code>TraceRef</code>. * @param level Has value 1 to N, where value 1 means last called method * and higher numbers mean callers. */ public static Map split(List traces, int level) { if (level < 1) throw new IllegalArgumentException(String.valueOf(level)); Map map=new HashMap(); Iterator it=traces.iterator(); while (it.hasNext()) { TraceRef tr=(TraceRef) it.next(); List frames=tr.getFrames(); if (frames.size() < level) continue; FrameRef keyFrame=(FrameRef) frames.get(frames.size()-level); List bucket=(List) map.get(keyFrame); if (bucket==null) { bucket=new ArrayList(); map.put(keyFrame, bucket); } bucket.add(tr); } return map; } /** Sums a list of <code>CPUStat</code> and returns a new <code>CPUStat * </code> with the summed values. */ public static CPUStat getSumOfCPUStat(List list) { CPUStatSum sum=new CPUStatSum(); Iterator it=list.iterator(); while (it.hasNext()) { CPUStat stat=(CPUStat) it.next(); sum.add(stat); } return sum; } /** Helper class for summing CPUStat. */ private static class CPUStatSum implements CPUStat { private long hits; private long time; private void add(CPUStat stat) { hits += stat.getCPUHitsCount(); time += stat.getCPUPureTime(); } public long getCPUHitsCount() { return hits; } public long getCPUPureTime() { return time; } public void addCPUStatListener( CPUStatListener listener) { throw new UnsupportedOperationException(); } public void removeCPUStatListener( CPUStatListener listener) { throw new UnsupportedOperationException(); } } } /* * $Log: BacktraceSupport.java,v $ * Revision 1.1 2002/08/23 18:13:42 petrul * added cpu backtrace view * */ |
From: Lukas P. <pe...@us...> - 2002-08-23 18:12:25
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv18965 Modified Files: Bundle.properties Added Files: OpenBacktrace.java Log Message: added cpu backtrace view --- NEW FILE: OpenBacktrace.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.actions; import org.openide.TopManager; import org.openide.util.actions.NodeAction; import org.openide.util.HelpCtx; import org.openide.nodes.Node; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; import net.sourceforge.javaprofiler.module.nodes.BacktraceChildren; import net.sourceforge.javaprofiler.module.nodes.SnapshotNode; import net.sourceforge.javaprofiler.jpi.Snapshot; import java.util.ResourceBundle; import org.openide.util.NbBundle; /** Opens a new window with backtrace. It should be attached to a <code>Snapshot * </code> node. The view contains CPUTraces which expand from the last called * method to caller methods. * @author Lukas Petru */ public class OpenBacktrace extends NodeAction { private static ResourceBundle bundle=NbBundle.getBundle(OpenBacktrace .class); protected boolean enable(Node[] activatedNodes) { return (activatedNodes.length==1); } protected void performAction(Node[] activatedNodes) { if (activatedNodes.length!=1) return; Snapshot sn=((SnapshotNode) activatedNodes[0]).getSnapshot().getSnapshot (); AbstractNode node=new CallTreeNode(new BacktraceChildren(sn .getCPUTraces(), 1)); node.setName("Backtrace"); String snName=activatedNodes[0].getDisplayName(); if (snName.length()==0) snName="(unnamed)"; node.setDisplayName("Backtrace of " + snName); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/BacktraceIcon"); TopManager.getDefault().getNodeOperation().explore(node); } public String getName() { return bundle.getString("LBL_BTAction"); } public HelpCtx getHelpCtx() { return new HelpCtx(OpenBacktrace.class); } } /* * $Log: OpenBacktrace.java,v $ * Revision 1.1 2002/08/23 18:12:22 petrul * added cpu backtrace view * */ Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/Bundle.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Bundle.properties 20 Aug 2002 19:11:57 -0000 1.5 --- Bundle.properties 23 Aug 2002 18:12:22 -0000 1.6 *************** *** 61,63 **** LBL_terminateAction=Terminate HINT_terminateAction=Terminates listening for the connection from the profiled process. ! LBL_CTAction=Open Call Tree \ No newline at end of file --- 61,64 ---- LBL_terminateAction=Terminate HINT_terminateAction=Terminates listening for the connection from the profiled process. ! LBL_CTAction=Open Call Tree ! LBL_BTAction=Open Backtrace |
From: Lukas P. <pe...@us...> - 2002-08-23 18:10:01
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv17873 Modified Files: SnapshotImpl.java Log Message: reversed list of frames Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** SnapshotImpl.java 9 Aug 2002 00:34:26 -0000 1.30 --- SnapshotImpl.java 23 Aug 2002 18:09:58 -0000 1.31 *************** *** 703,712 **** int i; ! List frames = new ArrayList( trcInfo.numFrames ); ! for ( i = 0; i < num; i++ ) ! frames.add(new FrameData( trcInfo.frames[i].lineno, ! ((MethodData) libIDs.get( ! new Integer(trcInfo.frames[i].methodObjId ))), ! (i==0) ? null : ((FrameData) frames.get(i-1)) )); return frames; }; --- 703,713 ---- int i; ! List frames = new ArrayList(num); ! FrameData caller=null; ! for (i=num-1; i>=0; i--) { ! caller=new FrameData(trcInfo.frames[i].lineno, (MethodData) libIDs ! .get(new Integer(trcInfo.frames[i].methodObjId)), caller); ! frames.add(caller); ! } return frames; }; *************** *** 1142,1145 **** --- 1143,1149 ---- /* * $Log$ + * Revision 1.31 2002/08/23 18:09:58 petrul + * reversed list of frames + * * Revision 1.30 2002/08/09 00:34:26 vachis * fix (didn't compile) |
From: Lukas P. <pe...@us...> - 2002-08-23 18:08:39
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv17469 Modified Files: FrameData.java Log Message: equals() method less restrictive Index: FrameData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/FrameData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** FrameData.java 30 May 2002 22:38:17 -0000 1.3 --- FrameData.java 23 Aug 2002 18:08:36 -0000 1.4 *************** *** 99,102 **** --- 99,103 ---- } + /* petrul: Why is this here? I don't want it. if ( this.caller == null ) { if ( o.caller != null ) *************** *** 107,111 **** return false; } ! return true; } --- 108,113 ---- return false; } ! */ ! return true; } *************** *** 115,119 **** (caller.hashCode() & 0xFFFFFF) << 6 + (line & 0xFF);*/ ! return method.hashCode() + caller.hashCode() + line; } --- 117,121 ---- (caller.hashCode() & 0xFFFFFF) << 6 + (line & 0xFF);*/ ! return method.hashCode() + line; } *************** *** 122,125 **** --- 124,130 ---- /* * $Log$ + * Revision 1.4 2002/08/23 18:08:36 petrul + * equals() method less restrictive + * * Revision 1.3 2002/05/30 22:38:17 vachis * changed interface to jpi |
From: Lukas P. <pe...@us...> - 2002-08-23 18:07:31
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv17086 Modified Files: VirtualMachineImpl.java Log Message: Refreshing thread scheduling and cancelling. Index: VirtualMachineImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/VirtualMachineImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** VirtualMachineImpl.java 31 Jul 2002 21:34:43 -0000 1.12 --- VirtualMachineImpl.java 23 Aug 2002 18:07:29 -0000 1.13 *************** *** 48,52 **** public VirtualMachineImpl(IProf iprof) { this.iprof=iprof; ! realtime = new ImageR( iprof, false ); } --- 48,54 ---- public VirtualMachineImpl(IProf iprof) { this.iprof=iprof; ! ImageR rt = new ImageR( iprof, false ); ! realtime = rt; ! rt.getTimer().schedule(rt.getTimerTask(), 1000, 1000); } *************** *** 265,272 **** --- 267,287 ---- } + /** Cancels background task and releases reference to realtime image. You + * cannot call <code>realtimeImage()</code> after you've called this + * method. + */ + public void destroyRealtimeImage() { + if (realtime != null) { + ((ImageR) realtime).getTimerTask().cancel(); + realtime=null; + } + } } /* * $Log$ + * Revision 1.13 2002/08/23 18:07:29 petrul + * Refreshing thread scheduling and cancelling. + * * Revision 1.12 2002/07/31 21:34:43 vachis * method renamed to isShutdown() |