jewl
Class Menu

java.lang.Object
  extended byjewl.Window
      extended byjewl.Control
          extended byjewl.TextControl
              extended byjewl.Menu

public class Menu
extends TextControl

A drop-down menu which can be attached to a frame's menu bar or as a submenu of another menu. Menus can contain menu items and other submenus. They can also include separators, which appear as horizontal bars which divide the menu into separate sections. Unlike most other windows, menus cannot be given a size or position, and you cannot change their size or position.

Since menus are not containers, the parent window of all the menus and submenus in a frame will actually be the frame itself.


Field Summary
 
Fields inherited from class jewl.TextControl
CENTER, CENTRE, LEFT, RIGHT
 
Constructor Summary
Menu(AppletPanel parent, java.lang.String text)
          Construct a new menu attached to an applet's menu bar.
Menu(Frame parent, java.lang.String text)
          Construct a new menu attached to a frame's menu bar.
Menu(Menu parent, java.lang.String text)
          Construct a new menu attached to another menu.
 
Method Summary
 void addSeparator()
          Add a separator line to this menu.
 void resetAll()
          Clear the checkmarks on all this menu's menu items.
 void setLocation(int left, int top)
          Set the location of this menu within the parent window.
 void setSize(int width, int height)
          Set the size of this menu.
 
Methods inherited from class jewl.TextControl
getAlignment, getText, setAlignment, setKey, setText
 
Methods inherited from class jewl.Control
disable, enable, enable, getToolTip, isEnabled, setToolTip
 
Methods inherited from class jewl.Window
addEventListener, commandAvailable, getCommand, getFont, getHeight, getID, getLeft, getScreenHeight, getScreenWidth, getSource, getTop, getWidth, hide, init, isVisible, nextCommand, parent, root, setFont, setID, show, show
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Menu

public Menu(Frame parent,
            java.lang.String text)
Construct a new menu attached to a frame's menu bar.

Parameters:
parent - the menu's parent frame.
text - the initial text displayed by the button.

Menu

public Menu(AppletPanel parent,
            java.lang.String text)
Construct a new menu attached to an applet's menu bar.

Parameters:
parent - the menu's parent applet panel.
text - the initial text displayed by the button.

Menu

public Menu(Menu parent,
            java.lang.String text)
Construct a new menu attached to another menu.

Parameters:
parent - the menu's parent menu.
text - the initial text displayed by the button.
Method Detail

setSize

public void setSize(int width,
                    int height)
Set the size of this menu. Menus cannot be resized, so this method does nothing.

Overrides:
setSize in class Window
Parameters:
width - ignored.
height - ignored.

setLocation

public void setLocation(int left,
                        int top)
Set the location of this menu within the parent window. Menus cannot be moved, so this method does nothing.

Overrides:
setLocation in class Window
Parameters:
left - ignored.
top - ignored.

addSeparator

public void addSeparator()
Add a separator line to this menu.


resetAll

public void resetAll()
Clear the checkmarks on all this menu's menu items.