|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--marimba.gui.Widget
|
+--marimba.gui.ContainerWidget
|
+--marimba.gui.GroupWidget
|
+--marimba.gui.PopupWidget
|
+--marimba.gui.PopupMenu
A popup menu, it displays a scrollbar using a scrolling container if necessary. This menu uses the list of PopupMenuItemWidgets, and tracks the current selection via that mechanism, rather than by using an index directly.
PopupMenuItemWidget| Field Summary | |
protected ScrollingContainerWidget |
container
The popupmenu uses a scrolling container to display the popup menu items. |
PopupMenuItemWidget |
current
The currently selected item. |
protected boolean |
dragged
Has the user dragged with the mouse? |
boolean |
itemFocus
The items can be drawn with or without a focus rectangle around it when they are selected. |
int |
maxVisible
The maximum number of visible items, if there are more items a scrollbar is used. |
protected boolean |
mouseUpPopDown
Should the menu popdown when the MOUSE_UP event is detected? |
Widget |
owner
The owner of this widget. |
protected boolean |
poppingDown
indicates whether popdown() is being executed for LOST_FOCUS event |
protected int |
scrollJump
Negative is scrolling up, positive is down (unfortunately). |
protected boolean |
ticking
Are we currently on the timer's list? |
| Fields inherited from class marimba.gui.PopupWidget |
player |
| Fields inherited from class marimba.gui.GroupWidget |
editing, fillMode, fillOptions, lineMode, lineOptions, patsrc, pattern, prevtx, prevty |
| Fields inherited from class marimba.gui.ContainerWidget |
content |
| Fields inherited from class marimba.gui.Widget |
adapter, background, clazz, defaultBackground, defaultFont, defaultForeground, defaultHilite, directGraphics, disabled, east, editor, focus, font, foreground, height, hilite, layoutMgr, name, north, nwidgets, parent, script, south, tip, transparent, tx, ty, valid, visible, wBackground, west, wFont, wForeground, wHilite, widgets, width, wScript, wTip, x, y |
| Fields inherited from interface marimba.gui.WidgetConstants |
ALWAYS, ANYWHERE, APPLET, ASCENDING, BLINK, BLUE, BONGO_EVENT, BOTH, BOTTOM, BOXED, BUTTON, CENTER, CHAR, CHECK, COLLAPSE_EVENT, CONTENT, DESCENDING, DETACHED, DIAGONAL, DOWN, DRAG, EXCLUSIVE, EXPAND_EVENT, FILL, FILLED, GREEN, HORIZONTAL, INSIDE, INVISIBLE, JAVA_VERSION, JAVAOS, JDK10, JDK11, LAYERS, LEFT, LOWERED, MAC, MULTIPLE, NETCASTER, NETSCAPE, NEVER, NONE, NT, OPTIONAL, OS_ARCH, OS_NAME, OS_VERSION, OUTLINE, PAGE_DOWN, PAGE_EVENT, PAGE_UP, PATTERN, PC, PICTURE, PLAIN, PROPORTIONAL, RADIO, RAISED, RED, REST_EVENT, RIGHT, ROUNDED, SCALE, SCROLLBAR, SCROLLING, SOLID, SQUARE, TEXT_CHANGED_EVENT, TOP, TOPLEFT, TRUNCATE, UNDERLINE, UNIX, UP, VERTICAL, WAKE_EVENT, WIN95, WINDOWS, WORD |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
PopupMenu()
|
|
| Method Summary | |
void |
add(PopupMenuItemWidget item)
Add a menu item by giving the menu item directly. |
void |
add(java.lang.String label)
Add a menu item. |
void |
addSeparator()
Add a separator to this menu. |
void |
addSeparator(int index)
Insert a separator at the specified position. |
void |
clear()
Remove all menu items in this menu, the menu will be empty after this. |
void |
fit()
Fit the menu in the visible area of the parent window. |
boolean |
focusInterest()
Supports input focus. |
PopupMenuItemWidget |
getCurrentItem()
The currently selected item. |
PopupMenuItemWidget |
getItem(int index)
Get the item at the specified position. |
int |
getItemCount()
Get the number of items in this menu. |
boolean |
getItemFocus()
Check whether selected items are painted with a focus rectangle around it. |
int |
getMaxVisible()
Get the maximum number of visible items. |
Widget |
getOwner()
Get the owner. |
protected int |
getPopupHeight()
The initial height of the popup menu. |
java.awt.Dimension |
getPreferredSize()
Compute the best size for this menu. |
boolean |
handleEvent(java.awt.Event evt)
Handle events. |
int |
indexOf(PopupMenuItemWidget item)
Return index of given item. |
void |
insert(PopupMenuItemWidget item,
int index)
Insert a menu item at the given position by giving the item directly. |
void |
insert(java.lang.String label,
int index)
Insert a menu item at the given position. |
void |
layout()
Layout the menu items. |
protected void |
layoutContainer()
Set the properties of the container correctly, called by the layout method. |
void |
nextItem()
Deprecated. As of Bongo version 1.1. |
void |
paint(java.awt.Graphics g,
int cx,
int cy,
int cw,
int ch)
Paint the background |
void |
popdown()
Hide the PopupMenu. |
void |
popup(Widget parent,
int x,
int y)
Show the menu. |
void |
popup(Widget parent,
int x,
int y,
int width)
Show the menu, and force the width to a certain number of pixels. |
java.awt.Dimension |
preferredSize()
Deprecated. As of Bongo version 1.1. |
void |
previousItem()
Deprecated. As of Bongo version 1.1. |
void |
remove(int index)
Remove the menu item at the given position. |
void |
remove(PopupMenuItemWidget item)
Remove a menu item by giving the item directly. |
void |
remove(java.lang.String label)
Remove the first menu item that has the given label. |
void |
select(int index)
Set the current item to the index-th item, with index in [0 .. |
void |
select(PopupMenuItemWidget item)
Select an item by giving the item directly. |
void |
selectNextItem()
The default always has been to wrap around the bottom. |
void |
selectNextItem(boolean wrap)
Select the next item, if there is no current item yet, it will result in the selection of the first item. |
void |
selectPreviousItem()
The default always has been to wrap around the bottom. |
void |
selectPreviousItem(boolean wrap)
Select previous item, if there is no current item yet, it will result in the selection of the last item. |
void |
setItemFocus(boolean itemFocus)
Let the selected item paint with a focus rectangle or not. |
void |
setMaxVisible(int maxVisible)
Set the maximum number of visible items. |
void |
setMouseUpPopDown(boolean popDown)
Set whether the popupmenu should popdown on the first mouse up event. |
void |
setOwner(Widget owner)
Set the owner. |
long |
tick(long tm,
java.lang.Object arg)
Take care of timer scrolls. |
| Methods inherited from class marimba.gui.PopupWidget |
getPlayerPanel, isShowing, paramString, popup, postEvent, repaint, repaint, repaintParent, replace |
| Methods inherited from class marimba.gui.GroupWidget |
getEditing, getEditor, getFillMode, getFillOptions, getLineMode, getLineOptions, getPattern, getPatternSource, getProperties, init, setEditing, setFillMode, setLineMode, setPattern, setProperties, update, updateArea, waitForPattern |
| Methods inherited from class marimba.gui.ContainerWidget |
findInFocus, findWidget, firstInFocus, getChildProperties, getContent, newContent, nextInFocus, previousInFocus |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public PopupMenuItemWidget current
getCurrentItem(),
select(int),
selectNextItem(),
selectPreviousItem()public Widget owner
getOwner(),
setOwner(marimba.gui.Widget)public boolean itemFocus
getItemFocus(),
setItemFocus(boolean)public int maxVisible
getMaxVisible(),
setMaxVisible(int)protected ScrollingContainerWidget container
protected boolean dragged
protected boolean ticking
protected int scrollJump
ticking,
tick(long, java.lang.Object),
handleEvent(java.awt.Event)protected boolean mouseUpPopDown
setMouseUpPopDown(boolean)protected boolean poppingDown
| Constructor Detail |
public PopupMenu()
| Method Detail |
public Widget getOwner()
ownerpublic void setOwner(Widget owner)
ownerpublic boolean getItemFocus()
itemFocuspublic void setItemFocus(boolean itemFocus)
itemFocuspublic int getMaxVisible()
maxVisiblepublic void setMaxVisible(int maxVisible)
maxVisibleprotected int getPopupHeight()
popup(marimba.gui.Widget, int, int)
public void popup(Widget parent,
int x,
int y)
popup in class PopupWidgetpopdown(),
getPopupHeight()
public void popup(Widget parent,
int x,
int y,
int width)
popdown(),
getPopupHeight()public void fit()
fit in class PopupWidgetpublic void addSeparator()
public void addSeparator(int index)
public void add(java.lang.String label)
select(int)public void add(PopupMenuItemWidget item)
select(int)
public void insert(java.lang.String label,
int index)
public void insert(PopupMenuItemWidget item,
int index)
public void remove(java.lang.String label)
public void remove(PopupMenuItemWidget item)
public void remove(int index)
public void clear()
public java.awt.Dimension getPreferredSize()
getPreferredSize in class ContainerWidgetpublic int getItemCount()
public PopupMenuItemWidget getItem(int index)
public PopupMenuItemWidget getCurrentItem()
currentpublic void selectNextItem()
public void selectNextItem(boolean wrap)
wrap - Wrap back to zero when we go off the end?currentpublic void selectPreviousItem()
public void selectPreviousItem(boolean wrap)
wrap - Wrap back to the end of the list if we pass 0?currentpublic int indexOf(PopupMenuItemWidget item)
select(int)public void select(int index)
current,
indexOf(marimba.gui.PopupMenuItemWidget),
add(java.lang.String)public void select(PopupMenuItemWidget item)
public void setMouseUpPopDown(boolean popDown)
mouseUpPopDownpublic void popdown()
popdown in class PopupWidgetpopup(marimba.gui.Widget, int, int)protected void layoutContainer()
layout()public void layout()
layout in class ContainerWidget
public void paint(java.awt.Graphics g,
int cx,
int cy,
int cw,
int ch)
paint in class GroupWidget
public long tick(long tm,
java.lang.Object arg)
tick in interface TimerClienttick in class Widgetmarimba.gui.WidgetTimerClientpublic boolean handleEvent(java.awt.Event evt)
handleEvent in class Widgetmarimba.gui.Widgetevt - the event that needs to be handled by the widgetWidget.postEvent(java.awt.Event)public boolean focusInterest()
focusInterest in class Widgetmarimba.gui.WidgetWidget.focus,
Widget.requestFocus()public java.awt.Dimension preferredSize()
getPreferredSize()public void nextItem()
selectNextItem()public void previousItem()
selectPreviousItem()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||