Class marimba.gui.PopupMenu
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class marimba.gui.PopupMenu

java.lang.Object
   |
   +----marimba.gui.Widget
           |
           +----marimba.gui.ContainerWidget
                   |
                   +----marimba.gui.GroupWidget
                           |
                           +----marimba.gui.PopupWidget
                                   |
                                   +----marimba.gui.PopupMenu

public class PopupMenu
extends PopupWidget
A popup menu, it displays a scrollbar using a scrolling container if necessary.
Version:
1.27, 01/17/97
Author:
Klaas Waslander

Variable Index

 o container
The popupmenu uses a scrolling container to display the popup menu items.
 o current
The currently selected item.
 o itemFocus
The items can be drawn with or without a focus rectangle around it when they are selected.
 o maxVisible
The maximum number of visible items, if there are more items a scrollbar is used.
 o owner
The owner of this widget.

Constructor Index

 o PopupMenu()

Method Index

 o add(PopupMenuItemWidget)
Add a menu item by giving the menu item directly.
 o add(String)
Add a menu item.
 o fit()
Fit the menu in the visible area of the parent window.
 o focusInterest()
Supports input focus.
 o getCurrentItem()
The currently selected item.
 o getItem(int)
Get the item with the given index.
 o getItemCount()
Get the number of items in this menu.
 o getItemFocus()
Check whether selected items are painted with a focus rectangle around it.
 o getMaxVisible()
Get the maximum number of visible items.
 o getOwner()
Get the owner.
 o handleEvent(Event)
Handle events.
 o indexOf(PopupMenuItemWidget)
Return index of given item.
 o layout()
Layout the menu items.
 o nextItem()
Select next item.
 o popdown()
Hide the PopupMenu.
 o popup(Widget, int, int)
Show the menu.
 o popup(Widget, int, int, int)
Show the menu, fixed width.
 o preferredSize()
Compute the best size for this menu.
 o previousItem()
Select previous item.
 o select(int)
Set the current item to the index-th item, with index in [0 ..
 o setItemFocus(boolean)
Let the selected item paint with a focus rectangle or not.
 o setMaxVisible(int)
Set the maximum number of visible items.
 o setOwner(Widget)
Set the owner.

Variables

 o current
  public PopupMenuItemWidget current
The currently selected item. If no item is selected, current is null.
See Also:
getCurrentItem, select, nextItem, previousItem
 o owner
  public Widget owner
The owner of this widget. When the menu is being popped down it will let this widget request focus.
See Also:
getOwner, setOwner
 o itemFocus
  public boolean itemFocus
The items can be drawn with or without a focus rectangle around it when they are selected.
See Also:
getItemFocus, setItemFocus
 o maxVisible
  public int maxVisible
The maximum number of visible items, if there are more items a scrollbar is used. If this number is zero or smaller the max number of visible items is determined by the size of the menu.
See Also:
getMaxVisible, setMaxVisible
 o container
  protected ScrollingContainerWidget container
The popupmenu uses a scrolling container to display the popup menu items.

Constructors

 o PopupMenu
  public PopupMenu()

Methods

 o getOwner
  public Widget getOwner()
Get the owner.
See Also:
owner
 o setOwner
  public void setOwner(Widget owner)
Set the owner.
See Also:
owner
 o getItemFocus
  public boolean getItemFocus()
Check whether selected items are painted with a focus rectangle around it.
See Also:
itemFocus
 o setItemFocus
  public void setItemFocus(boolean itemFocus)
Let the selected item paint with a focus rectangle or not.
See Also:
itemFocus
 o getMaxVisible
  public int getMaxVisible()
Get the maximum number of visible items.
See Also:
maxVisible
 o setMaxVisible
  public void setMaxVisible(int maxVisible)
Set the maximum number of visible items.
See Also:
maxVisible
 o popup
  public void popup(Widget parent,
                    int x,
                    int y)
Show the menu.
Overrides:
popup in class PopupWidget
See Also:
popdown
 o popup
  public void popup(Widget parent,
                    int x,
                    int y,
                    int width)
Show the menu, fixed width.
See Also:
popdown
 o fit
  public void fit()
Fit the menu in the visible area of the parent window.
Overrides:
fit in class PopupWidget
 o add
  public void add(String label)
Add a menu item.
See Also:
select
 o add
  public void add(PopupMenuItemWidget item)
Add a menu item by giving the menu item directly.
See Also:
select
 o layout
  public void layout()
Layout the menu items.
Overrides:
layout in class ContainerWidget
 o preferredSize
  public Dimension preferredSize()
Compute the best size for this menu.
 o getItemCount
  public int getItemCount()
Get the number of items in this menu.
 o getItem
  public PopupMenuItemWidget getItem(int index)
Get the item with the given index.
 o getCurrentItem
  public PopupMenuItemWidget getCurrentItem()
The currently selected item. If none is selected, null is returned.
See Also:
current
 o nextItem
  public void nextItem()
Select next item.
See Also:
current
 o previousItem
  public void previousItem()
Select previous item.
See Also:
current
 o indexOf
  public int indexOf(PopupMenuItemWidget item)
Return index of given item. Returns -1 if item is not found.
See Also:
select
 o select
  public void select(int index)
Set the current item to the index-th item, with index in [0 .. getItemCount()]. If an invalid number is given, the first item becomes the current one.
See Also:
current, indexOf, add
 o popdown
  public void popdown()
Hide the PopupMenu.
Overrides:
popdown in class PopupWidget
See Also:
popup
 o handleEvent
  public boolean handleEvent(Event evt)
Handle events.
Overrides:
handleEvent in class Widget
 o focusInterest
  public boolean focusInterest()
Supports input focus.
Overrides:
focusInterest in class Widget

All Packages  Class Hierarchy  This Package  Previous  Next  Index