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
-
container
- The popupmenu uses a scrolling container to
display the popup menu items.
-
current
- The currently selected item.
-
itemFocus
- The items can be drawn with or without
a focus rectangle around it when they
are selected.
-
maxVisible
- The maximum number of visible items, if there are more
items a scrollbar is used.
-
owner
- The owner of this widget.
-
PopupMenu()
-
-
add(PopupMenuItemWidget)
- Add a menu item by giving the menu item directly.
-
add(String)
- Add a menu item.
-
fit()
- Fit the menu in the visible area of the parent window.
-
focusInterest()
- Supports input focus.
-
getCurrentItem()
- The currently selected item.
-
getItem(int)
- Get the item with the given index.
-
getItemCount()
- Get the number of items in this menu.
-
getItemFocus()
- Check whether selected items are painted
with a focus rectangle around it.
-
getMaxVisible()
- Get the maximum number of visible items.
-
getOwner()
- Get the owner.
-
handleEvent(Event)
- Handle events.
-
indexOf(PopupMenuItemWidget)
- Return index of given item.
-
layout()
- Layout the menu items.
-
nextItem()
- Select next item.
-
popdown()
- Hide the PopupMenu.
-
popup(Widget, int, int)
- Show the menu.
-
popup(Widget, int, int, int)
- Show the menu, fixed width.
-
preferredSize()
- Compute the best size for this menu.
-
previousItem()
- Select previous item.
-
select(int)
- Set the current item to the index-th item, with index in [0 ..
-
setItemFocus(boolean)
- Let the selected item paint with a focus
rectangle or not.
-
setMaxVisible(int)
- Set the maximum number of visible items.
-
setOwner(Widget)
- Set the owner.
current
public PopupMenuItemWidget current
- The currently selected item.
If no item is selected, current is null.
- See Also:
- getCurrentItem, select, nextItem, previousItem
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
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
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
container
protected ScrollingContainerWidget container
- The popupmenu uses a scrolling container to
display the popup menu items.
PopupMenu
public PopupMenu()
getOwner
public Widget getOwner()
- Get the owner.
- See Also:
- owner
setOwner
public void setOwner(Widget owner)
- Set the owner.
- See Also:
- owner
getItemFocus
public boolean getItemFocus()
- Check whether selected items are painted
with a focus rectangle around it.
- See Also:
- itemFocus
setItemFocus
public void setItemFocus(boolean itemFocus)
- Let the selected item paint with a focus
rectangle or not.
- See Also:
- itemFocus
getMaxVisible
public int getMaxVisible()
- Get the maximum number of visible items.
- See Also:
- maxVisible
setMaxVisible
public void setMaxVisible(int maxVisible)
- Set the maximum number of visible items.
- See Also:
- maxVisible
popup
public void popup(Widget parent,
int x,
int y)
- Show the menu.
- Overrides:
- popup in class PopupWidget
- See Also:
- popdown
popup
public void popup(Widget parent,
int x,
int y,
int width)
- Show the menu, fixed width.
- See Also:
- popdown
fit
public void fit()
- Fit the menu in the visible area of the parent window.
- Overrides:
- fit in class PopupWidget
add
public void add(String label)
- Add a menu item.
- See Also:
- select
add
public void add(PopupMenuItemWidget item)
- Add a menu item by giving the menu item directly.
- See Also:
- select
layout
public void layout()
- Layout the menu items.
- Overrides:
- layout in class ContainerWidget
preferredSize
public Dimension preferredSize()
- Compute the best size for this menu.
getItemCount
public int getItemCount()
- Get the number of items in this menu.
getItem
public PopupMenuItemWidget getItem(int index)
- Get the item with the given index.
getCurrentItem
public PopupMenuItemWidget getCurrentItem()
- The currently selected item.
If none is selected, null is returned.
- See Also:
- current
nextItem
public void nextItem()
- Select next item.
- See Also:
- current
previousItem
public void previousItem()
- Select previous item.
- See Also:
- current
indexOf
public int indexOf(PopupMenuItemWidget item)
- Return index of given item. Returns -1 if item is not found.
- See Also:
- select
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
popdown
public void popdown()
- Hide the PopupMenu.
- Overrides:
- popdown in class PopupWidget
- See Also:
- popup
handleEvent
public boolean handleEvent(Event evt)
- Handle events.
- Overrides:
- handleEvent in class Widget
focusInterest
public boolean focusInterest()
- Supports input focus.
- Overrides:
- focusInterest in class Widget
All Packages Class Hierarchy This Package Previous Next Index