jTracer  1.03
Stack trace visualization tool
void org.libcsdbg.jtracer.MainFrame.actionPerformed ( ActionEvent  event)

Handler for toolbar and menu action events.

Parameters
[in]eventthe action event

Definition at line 323 of file MainFrame.java.

References org.libcsdbg.jtracer.MainFrame.about, org.libcsdbg.jtracer.SessionManager.cascade(), org.libcsdbg.jtracer.LogPane.clear(), org.libcsdbg.jtracer.MainFrame.desktop, org.libcsdbg.jtracer.Alert.error(), org.libcsdbg.jtracer.Registry.get(), org.libcsdbg.jtracer.MenuBar.getToggleState(), org.libcsdbg.jtracer.MainFrame.log, org.libcsdbg.jtracer.MainFrame.menu, org.libcsdbg.jtracer.SessionManager.setIconified(), org.libcsdbg.jtracer.SessionManager.shiftSelection(), org.libcsdbg.jtracer.MainFrame.startService(), org.libcsdbg.jtracer.MainFrame.status, org.libcsdbg.jtracer.MainFrame.stopService(), and org.libcsdbg.jtracer.MainFrame.tools.

324  {
325  try {
326  String cmd = event.getActionCommand();
327 
328  /* Service menu commands */
329  if (cmd.equals("Start"))
330  startService();
331 
332  else if (cmd.equals("Stop"))
333  stopService();
334 
335  else if (cmd.equals("Restart")) {
336  log.appendln("Restarting server (reload configuration)...", "status");
337  stopService();
338  startService();
339  }
340 
341  else if (cmd.equals("Clear log"))
342  log.clear();
343 
344  else if (cmd.equals("Quit")) {
345  boolean reply = Alert.prompt(this, "Are you sure you want to quit?");
346  if (reply)
347  System.exit(0);
348  }
349 
350 
351  /* View menu commands */
352  else if (cmd.equals("Toolbar")) {
353  if (menu.getToggleState(0))
354  add(tools, BorderLayout.NORTH);
355  else
356  remove(tools);
357 
358  validate();
359  }
360 
361  else if (cmd.equals("Statusbar")) {
362  if (menu.getToggleState(1))
363  add(status, BorderLayout.SOUTH);
364  else
365  remove(status);
366 
367  validate();
368  }
369 
370  else if (cmd.equals("Find"))
371  Alert.error(this, "Not implemented yet", false);
372 
373  else if (cmd.equals("Preferences"))
374  Alert.error(this, "Not implemented yet", false);
375 
376  else if (cmd.equals("Always on top")) {
377  boolean state = menu.getToggleState(2);
378  setAlwaysOnTop(state);
379  desktop.setAlwaysOnTop(-1, state);
380  }
381 
382  else if (cmd.equals("Full screen")) {
383  GraphicsEnvironment env;
384  env = GraphicsEnvironment.getLocalGraphicsEnvironment();
385 
386  GraphicsDevice dev = env.getDefaultScreenDevice();
387  if (!dev.isFullScreenSupported())
388  return;
389 
390  JFrame cur = (JFrame) dev.getFullScreenWindow();
391  if (cur == null)
392  dev.setFullScreenWindow(this);
393  else
394  dev.setFullScreenWindow(null);
395  }
396 
397 
398  /* Client menu commands */
399  else if (cmd.equals("Select previous"))
401 
402  else if (cmd.equals("Select next"))
404 
405  else if (cmd.equals("Close")) {
406  /* This fixes a very tricky bug induced by the OS window manager */
407  toFront();
408  desktop.disposeCurrent();
409  }
410 
411  else if (cmd.equals("Cascade"))
412  desktop.cascade();
413 
414  else if (cmd.equals("Minimize all"))
415  desktop.setIconified(true);
416 
417  else if (cmd.equals("Restore all"))
418  desktop.setIconified(false);
419 
420  else if (cmd.equals("Close all")) {
421  boolean reply = Alert.prompt(this, "Close all client windows?");
422  if (!reply)
423  return;
424 
425  desktop.disposeAll();
426  }
427 
428  else if (cmd.startsWith("Select session")) {
429  String parts[] = cmd.split("\\s");
430  desktop.setCurrent(Integer.valueOf(parts[2]));
431  }
432 
433  /* Help menu commands */
434  else if (
435  cmd.equals("Online documentation") ||
436  cmd.equals("Bug tracker") ||
437  cmd.equals("Submit feedback")
438  ) {
439  Registry conf = Registry.getCurrent();
440  String key = "url-" + cmd.toLowerCase().replace(' ', '-');
441  conf.browse((URL) conf.get("generic", key));
442  }
443 
444  else if (cmd.equals("Check for updates"))
445  Alert.error(this, "Not implemented yet", false);
446 
447  else if (cmd.startsWith("About")) {
448  if (about == null)
449  about = new AboutDialog(this);
450 
451  about.setLocationRelativeTo(this);
452  about.setVisible(true);
453  }
454 
455 
456  /* Session commands /
457  else if (cmd.equals("Remove trace"))
458  setStatus(null, true); */
459  }
460 
461  catch (Throwable t) {
462  Registry.debug(t);
463  }
464  }
ToolBar tools
Application toolbar.
Definition: MainFrame.java:61
AboutDialog about
About dialog.
Definition: MainFrame.java:73
LogPane log
Application logging pane.
Definition: MainFrame.java:67
void stopService()
Stop the server.
Definition: MainFrame.java:159
StatusBar status
Application statusbar.
Definition: MainFrame.java:70
void setIconified(final boolean how)
Minimize or restore all client windows.
MenuBar menu
Application menu.
Definition: MainFrame.java:64
void shiftSelection(int step)
Select the previous/next not iconified client window.
boolean getToggleState(int index)
Get the state of a toggle menu item.
Definition: MenuBar.java:210
void clear()
Remove all contents.
Definition: LogPane.java:164
void startService()
Start the server.
Definition: MainFrame.java:144
SessionManager desktop
Main and window manager.
Definition: MainFrame.java:85

+ Here is the call graph for this function: