|
||||||||||
| 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
|
+--conga.gui.AbstractPopupMenu
|
+--conga.gui.WidgetMenu
An advanced popup menu, that replaces the popupmenu
as used in marimba.gui. It is a lightweight
menu, which means that no separate Window is
used to show it. Main difference with the marimba.gui
popup menu is that this popup menu supports cascading menus:
a popup menu can be added to another popup menu.
| 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 | |
WidgetMenu()
Constructs a new WidgetMenu with an empty label. |
|
WidgetMenu(java.lang.String label)
Constructs a new WidgetMenu with the specified label. |
|
| Method Summary | |
void |
add(java.lang.String label)
Add a menu item. |
void |
add(WidgetMenu menu)
Add another WidgetMenu to this menu, this just adds
a WidgetMenuItem with a WidgetMenu
'attached' to it. |
void |
add(WidgetMenuItem item)
Add a menu item by giving the menu item directly. |
void |
addSeparator()
Add a separator to this menu. |
void |
addSeparator(int index)
Insert a separator at the specified position. |
void |
addWidgetMenuListener(WidgetMenuListener l)
Add a WidgetMenu listener. |
void |
clear()
Remove all menu items in this menu, the menu will be empty afterwards. |
protected void |
fireWidgetMenuCanceled()
Notifies WidgetMenuListeners that this WidgetMenu is canceled. |
protected void |
fireWidgetMenuWillBecomeInvisible()
Notifies WidgetMenuListeners
that this popup menu will become invisible. |
protected void |
fireWidgetMenuWillBecomeVisible()
Notifies WidgetMenuListeners
that this popup menu will become visible. |
WidgetMenuItem |
getItem(int index)
Get the item at the specified position. |
int |
getItemCount()
Get the number of items in this menu. |
java.lang.String |
getLabel()
Get the label of this menu. |
java.lang.String |
getMenuContent()
Returns a string representation of the contents of this widget menu. |
long |
getMenuSpeed()
Get the menu speed, which is the number of milliseconds before the new popup menu will popup. |
WidgetMenuItem |
getSelectedItem()
The currently selected item. |
java.lang.String |
getText()
Get the label of this menu. |
java.lang.Object |
getValue()
Get the label value of this menu. |
boolean |
handleEvent(java.awt.Event evt)
Handles keyboard events, in case this popup menu has keyboard focus. |
int |
indexOf(WidgetMenuItem item)
Get the index of given item inside this menu. |
void |
insert(java.lang.String label,
int index)
Insert a menu item at the given position. |
void |
insert(WidgetMenuItem item,
int index)
Insert a menu item at the given position by giving the item directly. |
void |
popdown()
Hides this widget popupmenu; it will make sure that the widget that had the focus (before this menu was popped up) re-gains the focus. |
void |
popup(Widget parent,
int x,
int y)
Shows the popup menu at the x, y position relative to the given parent widget, the menu will have the preferred width after popping up. |
void |
popup(Widget parent,
int x,
int y,
int width)
Shows the popup menu at the x, y position relative to the given parent widget, with the given fixed width. |
void |
popupDirected(Widget parent,
int direction,
int alignment)
Popup this popup menu in the given direction, with the given alignment. |
void |
remove(int index)
Remove the menu item at the given position. |
void |
remove(java.lang.String label)
Remove the first menu item that has the given label. |
void |
remove(WidgetMenuItem item)
Remove a menu item by giving the item directly. |
void |
removeWidgetMenuListener(WidgetMenuListener l)
Remove a WidgetMenu listener. |
void |
selectNextItem()
Select the next item; if there is no selected item yet, it will result in the selection of the first item. |
void |
selectPreviousItem()
Select previous item, if there is no selected item yet, it will result in the selection of the last item. |
void |
setLabel(java.lang.String label)
Set the label of this menu. |
void |
setMenuContent(java.lang.String content)
Set the content of this widget menu to that of the contents of the given formatted string. |
void |
setMenuSpeed(long menuSpeed)
Set the menu speed. |
void |
setSelectedItem(int index)
Set the current item to the index-th item, with index in [0 .. |
void |
setSelectedItem(WidgetMenuItem item)
Select an item by giving the item directly. |
void |
setText(java.lang.String label)
Set the label to the given one. |
void |
setValue(java.lang.Object obj)
Set the label of this menu. |
| Methods inherited from class conga.gui.AbstractPopupMenu |
focusInterest, getInitialPopupHeight, getMaxVisible, getPreferredSize, hasInheritedFont, isPoppedUp, layout, paint, setMaxVisible |
| Methods inherited from class marimba.gui.GroupWidget |
getEditing, getEditor, getFillMode, getFillOptions, getLineMode, getLineOptions, getPattern, getPatternSource, getProperties, init, paramString, 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 |
| Methods inherited from interface marimba.util.TimerClient |
tick |
| Constructor Detail |
public WidgetMenu()
WidgetMenu with an empty label.public WidgetMenu(java.lang.String label)
WidgetMenu with the specified label.label - the label to be added to this menu| Method Detail |
public java.lang.String getMenuContent()
getProperties of widgets
that use a WidgetMenu."One, Two, SubMenu->[SubItem1, SubItem2], Three"setMenuContent(java.lang.String)public void setMenuContent(java.lang.String content)
setProperties of widgets
that use a WidgetMenu.content - a formatted item string, for example: "One, Two, SubMenu->[SubItem1, SubItem2], Three"getMenuContent()public void addWidgetMenuListener(WidgetMenuListener l)
WidgetMenu listener.l - the WidgetMenuListener to addpublic void removeWidgetMenuListener(WidgetMenuListener l)
WidgetMenu listener.
param l the WidgetMenuListener to removeprotected void fireWidgetMenuWillBecomeVisible()
WidgetMenuListeners
that this popup menu will become visible.protected void fireWidgetMenuWillBecomeInvisible()
WidgetMenuListeners
that this popup menu will become invisible.protected void fireWidgetMenuCanceled()
WidgetMenuListeners that this WidgetMenu is canceled.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label - the label for this menupublic java.lang.Object getValue()
getValue in class WidgetgetLabel()public void setValue(java.lang.Object obj)
setValue in class Widgetobj - the label for this menusetLabel(java.lang.String)public java.lang.String getText()
getText in class WidgetgetLabel()public void setText(java.lang.String label)
setText in class Widgetlabel - the label for this menusetLabel(java.lang.String)public long getMenuSpeed()
setMenuSpeed(long)public void setMenuSpeed(long menuSpeed)
menuSpeed - the number of milliseconds after which submenus will (dis)appear.getMenuSpeed()
public void popup(Widget parent,
int x,
int y)
popup in class AbstractPopupMenuparent - the widget which defines the coordinate spacex - the x coordinate position to popup the menuy - the y coordinate position to popup the menupopupDirected(marimba.gui.Widget, int, int)
public void popup(Widget parent,
int x,
int y,
int width)
popup in class AbstractPopupMenuparent - the widget which defines the coordinate spacex - the x coordinate position to popup the menuy - the y coordinate position to popup the menuwidth - the fixed width that the popup menu will have after popping uppopupDirected(marimba.gui.Widget, int, int)
public void popupDirected(Widget parent,
int direction,
int alignment)
popupDirected in class AbstractPopupMenudirection - UP, DOWN, LEFT or RIGHTalignment - LEFT, CENTER or RIGHTpopup(marimba.gui.Widget, int, int)public void popdown()
popdown in class AbstractPopupMenupopup(marimba.gui.Widget, int, int)public void addSeparator()
public void addSeparator(int index)
public void add(java.lang.String label)
#select public void add(WidgetMenuItem item)
#select public void add(WidgetMenu menu)
WidgetMenu to this menu, this just adds
a WidgetMenuItem with a WidgetMenu
'attached' to it.WidgetMenuItem.setSubMenu(conga.gui.WidgetMenu)
public void insert(java.lang.String label,
int index)
public void insert(WidgetMenuItem item,
int index)
public void remove(java.lang.String label)
public void remove(WidgetMenuItem item)
public void remove(int index)
public void clear()
public int getItemCount()
public WidgetMenuItem getItem(int index)
public WidgetMenuItem getSelectedItem()
public void selectNextItem()
getSelectedItem()public void selectPreviousItem()
getSelectedItem()public int indexOf(WidgetMenuItem item)
setSelectedItem(int)public void setSelectedItem(int index)
getSelectedItem(),
indexOf(conga.gui.WidgetMenuItem),
add(java.lang.String)public void setSelectedItem(WidgetMenuItem item)
public boolean handleEvent(java.awt.Event evt)
handleEvent in class AbstractPopupMenumarimba.gui.Widgetevt - the event that needs to be handled by the widgetWidget.postEvent(java.awt.Event)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||