|
||||||||||
| 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
|
+--marimba.gui.DropDownMenu
A simple drop down menu, that is automatically popped up if the choices are given to the constructor. It automatically positions itself correctly based on the parameters that were passed to the constructor.
| Field Summary | |
boolean |
autoSize
Determines whether the width of the user should be used when popping up this dropdown menu. |
Widget |
user
The widget that uses this DropDownMenu. DropDownMenu sets the current value of the user and invokes the user.action() method when a choice is being made out of the available choices of this DropDownMenu. The value is being set using user.setValue(new Integer(int)) where "int" is the index of the choice that was made. |
| Fields inherited from class marimba.gui.PopupMenu |
container, current, dragged, itemFocus, maxVisible, mouseUpPopDown, owner, poppingDown, scrollJump, ticking |
| 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 | |
DropDownMenu(Widget user,
boolean autoSize)
Constructor that sets the user and whether to autoSize, the max. |
|
DropDownMenu(Widget user,
boolean autoSize,
int maxVisible)
Constructor that sets the user, whether to autoSize and the max. |
|
DropDownMenu(Widget user,
java.lang.String[] choices,
boolean autoSize)
Constructor without setting the max number of visible items, the dropdown is popped up automatically! |
|
DropDownMenu(Widget user,
java.lang.String[] choices,
boolean autoSize,
int maxVisible)
Constructor: Show a dropDownMenu that belongs to the given widget. The items that should be in this menu are passed in the parameter called "choices", the dropdown is popped up automatically! |
|
| Method Summary | |
void |
fit()
When fitting this dropdown menu make sure it is properly positioned, it can also be above the user! That initial position is determined by the constructor of this class, this method just makes sure it fits on the screen. |
boolean |
handleEvent(java.awt.Event evt)
Handle mouse events: the owner receives all mouse drag and mouse up events from this dropdown menu, the user's value is set when an action event occurs by passing its setValue method an Integer object that is the index of the menu item. |
void |
popup()
The popup method that automatically determines where it should position itself, based on the parameters that were passed into the constructor. |
void |
selectNextItem()
Select next item, do not loop around when the last item has been reached. |
void |
selectPreviousItem()
Select previous item, do not loop around when the first item has been reached. |
| Methods inherited from class marimba.gui.PopupMenu |
add, add, addSeparator, addSeparator, clear, focusInterest, getCurrentItem, getItem, getItemCount, getItemFocus, getMaxVisible, getOwner, getPopupHeight, getPreferredSize, indexOf, insert, insert, layout, layoutContainer, nextItem, paint, popdown, popup, popup, preferredSize, previousItem, remove, remove, remove, select, select, selectNextItem, selectPreviousItem, setItemFocus, setMaxVisible, setMouseUpPopDown, setOwner, tick |
| 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 Widget user
public boolean autoSize
| Constructor Detail |
public DropDownMenu(Widget user,
boolean autoSize)
popup(),
PopupMenu.add(String),
PopupMenu.add(PopupMenuItemWidget)
public DropDownMenu(Widget user,
boolean autoSize,
int maxVisible)
popup(),
PopupMenu.add(String),
PopupMenu.add(PopupMenuItemWidget)
public DropDownMenu(Widget user,
java.lang.String[] choices,
boolean autoSize)
autoSize - if false, the width of the choicewidget is used.
public DropDownMenu(Widget user,
java.lang.String[] choices,
boolean autoSize,
int maxVisible)
autoSize - if false, the width of the choicewidget is used.| Method Detail |
public void popup()
public void fit()
fit in class PopupMenupublic void selectNextItem()
selectNextItem in class PopupMenuPopupMenu.currentpublic void selectPreviousItem()
selectPreviousItem in class PopupMenuPopupMenu.currentpublic boolean handleEvent(java.awt.Event evt)
handleEvent in class PopupMenuuser,
PopupMenu.owner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||