46 |
46 |
47 |
47 |
48 public class PowerPlugin extends AbstractPiPlugin |
48 public class PowerPlugin extends AbstractPiPlugin |
49 implements IViewMenu, ITrace, IClassReplacer, IVisualizable, IEventListener |
49 implements IViewMenu, ITrace, IClassReplacer, IVisualizable, IEventListener |
50 { |
50 { |
|
51 |
|
52 /** The plug-in ID */ |
|
53 public static final String PLUGIN_ID = "com.nokia.carbide.cpp.pi.power"; //$NON-NLS-1$ |
|
54 |
51 private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID + ".power"; //$NON-NLS-1$ |
55 private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID + ".power"; //$NON-NLS-1$ |
|
56 /** context help id of the main page */ |
|
57 public static final String HELP_CONTEXT_ID_MAIN_PAGE = HELP_CONTEXT_ID + ".powerPageContext"; //$NON-NLS-1$ |
52 |
58 |
53 // There will be three graphs - one each for editor pages 0, 1, 2 |
59 // There will be three graphs - one each for editor pages 0, 1, 2 |
54 // This code may assume that page 0 has the threads graph, 1 the binaries, and 2 the functions |
60 // This code may assume that page 0 has the threads graph, 1 the binaries, and 2 the functions |
55 private final static int GRAPH_COUNT = 3; |
61 private final static int GRAPH_COUNT = 3; |
56 |
62 |
143 |
149 |
144 public String getTraceName() { |
150 public String getTraceName() { |
145 return "Power"; //$NON-NLS-1$ |
151 return "Power"; //$NON-NLS-1$ |
146 } |
152 } |
147 |
153 |
|
154 /* (non-Javadoc) |
|
155 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceTitle() |
|
156 */ |
|
157 public String getTraceTitle() { |
|
158 return Messages.getString("PowerPlugin.0"); //$NON-NLS-1$ |
|
159 } |
|
160 |
148 public int getTraceId() { |
161 public int getTraceId() { |
149 return 11; |
162 return 11; |
|
163 } |
|
164 |
|
165 /* (non-Javadoc) |
|
166 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#parseTraceFiles(java.io.File[]) |
|
167 */ |
|
168 public ParsedTraceData parseTraceFiles(File[] files) throws Exception { |
|
169 throw new UnsupportedOperationException(); |
150 } |
170 } |
151 |
171 |
152 public ParsedTraceData parseTraceFile(File file) throws Exception |
172 public ParsedTraceData parseTraceFile(File file) throws Exception |
153 { |
173 { |
154 try |
174 try |
232 { |
252 { |
233 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.THREADS_PAGE, uid)).action(actionString); |
253 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.THREADS_PAGE, uid)).action(actionString); |
234 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.BINARIES_PAGE, uid)).action(actionString); |
254 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.BINARIES_PAGE, uid)).action(actionString); |
235 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.FUNCTIONS_PAGE, uid)).action(actionString); |
255 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.FUNCTIONS_PAGE, uid)).action(actionString); |
236 } else if (actionString.equals("scroll")) //$NON-NLS-1$ |
256 } else if (actionString.equals("scroll")) //$NON-NLS-1$ |
237 { |
257 { |
238 if ( !(event.data instanceof String) |
|
239 || !((String)event.data).equals("FigureCanvas")) //$NON-NLS-1$ |
|
240 return; |
|
241 |
|
242 PIEvent be = new PIEvent(event, PIEvent.SCROLLED); |
258 PIEvent be = new PIEvent(event, PIEvent.SCROLLED); |
243 |
259 |
244 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.THREADS_PAGE, uid)).piEventReceived(be); |
260 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.THREADS_PAGE, uid)).piEventReceived(be); |
245 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.BINARIES_PAGE, uid)).piEventReceived(be); |
261 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.BINARIES_PAGE, uid)).piEventReceived(be); |
246 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.FUNCTIONS_PAGE, uid)).piEventReceived(be); |
262 ((PowerTraceGraph)trace.getTraceGraph(PIPageEditor.FUNCTIONS_PAGE, uid)).piEventReceived(be); |