FlexOr.utility
Class QuitItem

java.lang.Object
  extended by FlexOr.utility.QuitItem
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class QuitItem
extends java.lang.Object
implements java.awt.event.ActionListener

Create a Quit menu item.

Basic definition comes from "Understanding Object Oriented Programming with Java", Timothy Budd, Addison-Wesley, 1998, p228.

Modified as follows.

  • Moved redundant program text into private support routines.
  • Store a pointer to the application locally for use in dispose.
  • Uses inApplet flag to select between dispose and exit.

    Version:
    1.0 1999 Jan 16
    Author:
    Gunnar Gotshalks

    Constructor Summary
    QuitItem(java.awt.Frame application, boolean inApplet)
              Create new menubar with a new menu Quit containing the menu item Quit.
    QuitItem(java.awt.MenuBar mbar, java.awt.Frame application, boolean inApplet)
              Create new menu Quit containing the menu item Quit.
    QuitItem(java.awt.Menu menu, java.awt.Frame application, boolean inApplet)
              Create new menu item menu item Quit.
    QuitItem(java.awt.MenuItem mitem, java.awt.Frame application, boolean inApplet)
              Attach the action to dispose the applet window or exit the application.
     
    Method Summary
     void actionPerformed(java.awt.event.ActionEvent e)
               
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    QuitItem

    public QuitItem(java.awt.Frame application,
                    boolean inApplet)
    Create new menubar with a new menu Quit containing the menu item Quit.

    Parameters:
    application - the application which should be disposed of or exited.
    inApplet - set to True if invoked from an applet so dispose is the action performed. Set to False if invoked from a stand alone application so exit is the action performed.

    QuitItem

    public QuitItem(java.awt.MenuBar mbar,
                    java.awt.Frame application,
                    boolean inApplet)
    Create new menu Quit containing the menu item Quit.

    Parameters:
    mbar - the menubar in which to place the menu.
    application - the application which should be disposed of or exited.
    inApplet - set to True if invoked from an applet so dispose is the action performed. Set to False if invoked from a stand alone application so exit is the action performed.

    QuitItem

    public QuitItem(java.awt.Menu menu,
                    java.awt.Frame application,
                    boolean inApplet)
    Create new menu item menu item Quit.

    Parameters:
    menu - where to place the menu item.
    application - the application which should be disposed of or exited.
    inApplet - set to True if invoked from an applet so dispose is the action performed. Set to False if invoked from a stand alone application so exit is the action performed.

    QuitItem

    public QuitItem(java.awt.MenuItem mitem,
                    java.awt.Frame application,
                    boolean inApplet)
    Attach the action to dispose the applet window or exit the application.

    Parameters:
    mitem - the menu item to which to attach the dispose/exit action.
    application - the application which should be disposed of or exited.
    inApplet - set to True if invoked from an applet so dispose is the action performed. Set to False if invoked from a stand alone application so exit is the action performed.
    Method Detail

    actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent e)
    Specified by:
    actionPerformed in interface java.awt.event.ActionListener