package framework; import java.awt.event.*; import java.awt.*; import java.io.*; import javax.swing.*; /** Controller that handles all items in the Help menu. */ public class HelpMenuController extends Controller { /** Initializes appWindow. @param aw the app window that created this controller. */ public HelpMenuController(AppWindow aw) { super(aw); } /** Indirectly called by all items in the Help menu. @param e the action event fired by the Help menu items */ public void actionPerformed(ActionEvent e) { try { if (e.getSource() instanceof JMenuItem) { String arg = e.getActionCommand(); if (arg.equals("About")) handleAbout(); else if (arg.equals("Help")) handleHelp(); } } catch (Exception x) { FrameworkUtils.error("Exception thrown: " + x); } } /** Called when the user selects Help/About. This method calls AppWindow.about. */ protected void handleAbout() { appWindow.about(); } /** Called when the user selects Help/Help. This method calls AppWindow.help. */ protected void handleHelp() { appWindow.help(); } }