All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class fix.MenuBarPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----fix.MenuBarPanel

public class MenuBarPanel
extends Panel
This class is a Panel that encapsulates and acts like a MenuBar. The MenuBar can have multiple menus, and each of them can contain other menus as menu items. The MenuBarPanel is a Panel, and so can be added to any Container, and the user will still be able to click on it and see it behave like a menubar.

This code is (c) 1998 Leemon Baird <leemon@cs.cmu.edu>, http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely. If the code is modified, please state so in the comments.

Version:
1.0 22 June 98
Author:
Leemon Baird

Variable Index

 o popup
popup menu used to implement each menu

Constructor Index

 o MenuBarPanel(MenuBar)
given a menubar, this returns a panel that acts like an equivalent menubar

Method Index

 o getMaximumSize()
 o getMinimumSize()
 o getPreferredSize()
 o handleEvent(Event)
 o menuBarToChoice(Panel, MenuBar)
convert a menubar into an equivalent Panel filled with a Choice corresponding to each menu.
 o paint(Graphics)

Variables

 o popup
 public PopupMenu popup[]
popup menu used to implement each menu

Constructors

 o MenuBarPanel
 public MenuBarPanel(MenuBar mb)
given a menubar, this returns a panel that acts like an equivalent menubar

Methods

 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Container
 o getMaximumSize
 public Dimension getMaximumSize()
Overrides:
getMaximumSize in class Container
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Container
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o handleEvent
 public boolean handleEvent(Event e)
Overrides:
handleEvent in class Component
 o menuBarToChoice
 public void menuBarToChoice(Panel p,
                             MenuBar mb)
convert a menubar into an equivalent Panel filled with a Choice corresponding to each menu.


All Packages  Class Hierarchy  This Package  Previous  Next  Index