View Javadoc

1   package org.xrn.gui;
2   
3   import java.awt.event.ActionEvent;
4   import java.awt.event.ActionListener;
5   
6   import javax.swing.JMenu;
7   import javax.swing.JMenuItem;
8   
9   /***
10   * Menu item "Help" of the menu bar
11   * TODO Description
12   * @author Carsten Maneg
13   * Date Nov 7, 2004
14   * Time 6:40:54 PM
15   */
16  public class HelpMenu extends JMenu implements ActionListener{
17      private JMenuItem helpMenuItem;
18      private JMenuItem aboutMenuItem;
19      
20      private HelpWindow helpBearbF;
21  
22      private XRNMainWindow mainWindow;
23  
24      /***
25       * Constructor
26       * @param mainWindow
27       */
28      public HelpMenu( XRNMainWindow mainWindow ){
29          super( "Help" );
30          this.mainWindow = mainWindow;
31  
32          helpMenuItem = new JMenuItem( " Show help " );
33          helpMenuItem.addActionListener( this );
34          add( helpMenuItem );
35  
36          aboutMenuItem = new JMenuItem( " About " );
37          aboutMenuItem.addActionListener( this );
38          add( aboutMenuItem );
39      }
40      
41      /***
42       * 
43       */
44      public void actionPerformed( ActionEvent e ){
45    	
46          if ( e.getSource( ) == helpMenuItem ){
47      	
48              helpBearbF = new HelpWindow( mainWindow, "showHelp" );
49              mainWindow.setBereich( helpBearbF, true );
50          }
51          if ( e.getSource( ) == aboutMenuItem ){
52      	
53              helpBearbF = new HelpWindow( mainWindow, "aboutTool" );
54              mainWindow.setBereich( helpBearbF, true );
55          }
56      }
57  }