public class GMenu
extends nxm.sys.libg.GWidget
implements java.awt.event.ActionListener
Left click to select or toggle an entry and exit.
Middle click to select an entry without exiting.
Right click to exit selecting the default if present.
Keypress selects the first entry beginning with that key.
Middle click over the title enters the configuration menu.
Life = Temporary - exit when selected
Sticky - stay until right mouse click
Permanent - never exit
Items = Auto - reorganize to fit window
Option - only show current selection item until clicked
OneRow - all items appear in a single horizontal row
NColumn - arrange items into N columns
Title = Auto - choose title position to fit window
Top - place title at top
Left - place title at left
Right - place title at right
Bottom - place title at bottom
NColumns = number of columns (when applicable)
Item = 0 - this is an action menu, buttons are always raised
N - this is a state menu, current selection is depressed
-1 - this is a state menu, without a current selection
If NOSTATE, don't act as state menu, even if set to non-zero value
If NODEPRESS, don't depress current selection
If INPUT, allow keyboard entry of non-listed item in CHOICE menu
If TOGGLELIST, return current list in message not just the item that changed
| Modifier and Type | Field and Description |
|---|---|
static int |
ASSUMESTATE |
static int |
BUTTON
Flags: BUTTON -- Is a Button Group GMenu.
|
static int |
CHKBOX |
static int |
CHOICE
Flags: CHOICE -- Is a Choice GMenu.
|
static int |
CS
Flags: CS -- Return values Case Sensitive (do NOT upper case).
|
nxm.sys.lib.Table |
ctab |
static java.awt.Color |
DEF_DISABLED_COLOR
default color for disabled items.
|
static java.lang.String |
flagsList
flags mask.
|
static int |
FLAT |
static int |
INPUT |
java.lang.String |
list |
static int |
NCOL |
static int |
NODEPRESS |
static int |
NOSTATE |
static int |
ONEROW |
static int |
ROLLUP |
static int |
SETCOL |
static int |
TBOTTOM |
static int |
TLEFT |
static int |
TMASK |
static int |
TOFF |
static int |
TOGGLE |
static int |
TOGGLELIST |
static int |
TRIGHT |
static int |
TTOP |
actionType, bbox, bw, callback, CHANGED_BY_CLICK, CHANGED_BY_MSG, CHANGED_BY_POLL, CHANGED_BY_USER_INPUT, compression, CONCAT, DEF_ACTION_TYPE, DEFBW, DISABLE_LIST, doubleBuffer, FIX, fixHeight, fixLineHeight, fixWidth, flags, flagsRequiringRefresh, group, HEADLESS, INLINE, label, MONITOR, NOEDIT, NOMSG, pDetach, PERM, pGroup, rMoved, rx, ry, STICKY, ta, th, TITLE, tw, units, userAction, VBOX, VBOXMO, wp, zoneBACK, BOLD, button, CENTER, cursorList, DEFAULT_WINDOW_POSITION, dtime, eventFilter, eventFilterList, EXIT, fm, font, FRONT, g, hasFocus, headless, HILIT, hkl, htime, ICON, INIT, keycode, LEFT_MOUSE_BUTTON, LOLIT, MAXIM, mh, MIDDLE_MOUSE_BUTTON, modifiers, MW, name, NOICON, NOKEY, NOMIDDLEMOUSE, NOMOUSE, NOMOVE, NOPUSHPOP, NOREFRESH, pactive, panel, parent, pos, pushParent, px, py, pz, RIGHT, RIGHT_MOUSE_BUTTON, SB_ADJUST, SB_ALERT, SB_CHKBOX, SB_DEF, SB_FLAT, SB_FLAT_SHADE, SB_HAIRLINE, SB_HILIT, SB_LINE, SB_REV, SB_SEPERATOR, SB_SHADE, SB_SHADE_PUSHPOP, SB_SHADEX, SB_UNHILIT, SLIDER_ACTIVE, SLIDER_INSET, SLIDER_NOTRACK, stateList, status, theme, themeList, useSwing| Constructor and Description |
|---|
GMenu(java.lang.Object parent,
java.lang.String name,
java.lang.String list,
int item,
int flags,
nxm.sys.inc.MessageHandler mh) |
GMenu(java.lang.String label,
java.lang.Object parent,
java.lang.String name,
int flags,
nxm.sys.inc.MessageHandler mh) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
addItem(java.lang.String item) |
void |
addItem(java.lang.String item,
boolean toggleOn) |
void |
close()
Close the graphics window.
|
void |
disableAllItems()
Disable all the items in the menu.
|
void |
disableItem(java.lang.String item)
Disable an item on the menu, but leave it visible.
|
void |
enableAllItems()
Enable all the items in the menu.
|
void |
enableItem(java.lang.String item)
Re-enable an item that has been disabled.
|
java.awt.Color |
getDisabledItemColor() |
java.lang.String |
getDisabledItemColorString() |
java.lang.String |
getItem(int i) |
int |
getItemCount() |
int |
getItemIndex() |
int |
getItemIndex(java.lang.String text)
Find the index of the item with the given value.
|
java.lang.String |
getItems()
Get the list of menu items.
|
java.lang.Object |
getKey(java.lang.String name)
Get the value of an object's keyed field.
|
java.lang.String |
getLegend()
Returns a string containing instructions on mouse actions for this widget.
|
java.awt.Color |
getSelectedTextColor()
Gets the color of the selected text in the GMenu.
|
java.lang.String |
getSelectedTextColorString()
Gets the color of the selected text.
|
java.awt.Color |
getSelectionColor()
Gets the background color of the text field selection.
|
java.lang.String |
getSelectionColorString()
Gets the background color of the selection.
|
java.lang.String |
getText() |
java.lang.Object |
getValue()
Gets the current value of this widget in the form of an Object.
|
java.lang.String |
getValue(int item,
boolean uc) |
boolean |
isItemEnabled(java.lang.String item)
Check to see if an item has been disabled.
|
boolean |
isSet(java.lang.String maskName)
Determine if mask is set when in TOGGLE mode.
|
void |
open(java.lang.String name,
java.lang.String list,
int item) |
void |
paint()
Refresh this window.
|
boolean |
poll()
Poll for change in monitor.
|
int |
processMessage(nxm.sys.lib.Message msg)
process message.
|
void |
remItem(java.lang.String item) |
void |
resize(int mode)
Handle resize of this window.
|
void |
select(int i,
int button) |
void |
selectAlt(int i,
int button) |
void |
setAction(java.lang.String text)
Sets the value of this widget.
|
void |
setAltSize(int width,
int height) |
void |
setColumns(int nc) |
void |
setDisabledItemColor(java.awt.Color color) |
void |
setDisabledItemColor(java.lang.String color) |
void |
setDisabledItems(java.lang.String items)
Disable one or more items on the menu, but leave them visible.
|
void |
setDisableMask(int mask)
Sets the Disable mask of items.
|
void |
setFlags(int flags)
Set the flags, remove any that are invalid for specified type.
|
void |
setItem(int index,
java.lang.String item) |
void |
setItemColor(java.lang.String item,
java.awt.Color color)
Set the color of an individual item.
|
void |
setItemColor(java.lang.String item,
java.lang.String color)
Set the color of an individual item.
|
void |
setItemColors(nxm.sys.lib.Table t)
Set the colors of the MENU items.
|
void |
setItemColorTable(nxm.sys.lib.Table t) |
void |
setItems(java.lang.String list)
Sets the list of pickable items in the menu.
|
java.lang.Object |
setKey(java.lang.String name,
java.lang.Object value)
Set the value of an object's keyed field.
|
void |
setNoStateMask(int mask)
Sets the Toggle mask of items.
|
void |
setSelectedTextColor(java.awt.Color c)
Sets the color of the selected text in the GMenu.
|
void |
setSelectedTextColor(java.lang.String color)
Sets the color of the selected text.
|
void |
setSelectionColor(java.awt.Color c)
Sets the background selection color of the textfield.
|
void |
setSelectionColor(java.lang.String c)
Sets the background selection color of the selection.
|
void |
setup()
Perform necessary steps to set up this window graphically, such as
calculate dimensions of display components.
|
void |
setValue(int item) |
void |
setValue(java.lang.String text)
Sets the value of this widget.
|
java.lang.String |
toString()
Returns a string representation of this widget.
|
addTo, addTo, configure, fixHeight, fixLineHeight, fixWidth, formatReadOut, getActionType, getActionTypeString, getActionTypeString, getFlag, getFlags, getGroup, getID, getLabel, getReadOut, getToolTipText, getUnits, getValueString, getWidgetPanel, getWidgetTheme, hasLocalTheme, isEnabled, isShow, isStretchable, keyPressed, keyReleased, layout, mouseClicked, mouseEntered, mouseMoved, open, open, paintComponent, placeTextInput, process, refreshValue, rubberbox, setActionType, setActionType, setBounds, setCompression, setCorner, setDisabledColor, setDisabledColor, setEnabled, setFlag, setFlags, setFrom, setGroup, setLabel, setMidas, setMonitor, setShow, setShow, setTitle, setToolTipText, setUnits, setupBean, setWidgetPanel, setWidgetTheme, setWidgetThemeFromTable, toggleEnabled, toListaddOn, addOn, addOn, addOn, addTo, clear, componentHidden, componentMoved, componentResized, componentShown, display, drawHSlider, drawString, drawVSlider, exportImage, focusGained, focusLost, getClipBounds, getCursor, getDisplay, getEmbeddedCommandID, getEnableAdvancedPopOut, getFocus, getKeys, getMWName, getNoAltTitle, getPanel, getPopBounds, getPopDevice, getPopWindow, getStatus, getTitle, hasFocus, isDoubleBuffered, isPanelVisible, isPopped, keyTyped, mouseDragged, mouseExited, mousePressed, mouseReleased, moveDisplay, newFont, place, place, pop, pop, pop, preprocess, print, process, pullGAlertToFront, refresh, refresh, reParent, setAltTitle, setBounds, setClipBounds, setCursor, setCursor, setDisplay, setDoubleBuffered, setEnableAdvancedPopOut, setEventFilter, setEventFilter, setFontSize, setGraphics, setHandler, setHeadless, setLocation, setName, setNoAltTitle, setPopBounds, setPopBounds, setPopWindow, setSize, setStatusBar, setTheme, setTheme, setTheme, setTheme, setTheme, shadowarrow, shadowbox, shadowboxCustomIcon, sliderboxpublic static java.lang.String flagsList
public static final int CHOICE
public static final int BUTTON
public static final int TOGGLE
public static final int CHKBOX
public static final int TTOP
public static final int TLEFT
public static final int TRIGHT
public static final int TBOTTOM
public static final int TMASK
public static final int TOFF
public static final int ONEROW
public static final int NCOL
public static final int SETCOL
public static final int TOGGLELIST
public static final int INPUT
public static final int CS
public static final int NOSTATE
public static final int NODEPRESS
public static final int ROLLUP
public static final int FLAT
public static final int ASSUMESTATE
public static final java.awt.Color DEF_DISABLED_COLOR
public java.lang.String list
public nxm.sys.lib.Table ctab
public GMenu(java.lang.Object parent,
java.lang.String name,
java.lang.String list,
int item,
int flags,
nxm.sys.inc.MessageHandler mh)
public GMenu(java.lang.String label,
java.lang.Object parent,
java.lang.String name,
int flags,
nxm.sys.inc.MessageHandler mh)
public void open(java.lang.String name,
java.lang.String list,
int item)
public void close()
nxm.sys.libg.MWindowclose in class nxm.sys.libg.GWidgetpublic void setItems(java.lang.String list)
list - A comma-separated list of choices (e.g. "Bird,Dog,Cat").public java.lang.String getItems()
public int getItemCount()
public void resize(int mode)
nxm.sys.libg.MWindowresize in class nxm.sys.libg.GWidgetmode - the resize mode >0 to call setBounds()public void setup()
nxm.sys.libg.MWindowsetup in class nxm.sys.libg.GWidgetpublic void paint()
nxm.sys.libg.MWindowMWindow to
perform any actions required to refresh the window.paint in class nxm.sys.libg.GWidgetpublic void setNoStateMask(int mask)
mask - The bit mask value to set topublic void setDisableMask(int mask)
mask - The bit mask value to set topublic void setSelectedTextColor(java.awt.Color c)
c - The color to set topublic void setSelectedTextColor(java.lang.String color)
color - The color to set topublic java.lang.String getSelectedTextColorString()
public java.awt.Color getSelectedTextColor()
public void setSelectionColor(java.awt.Color c)
c - The Color to setpublic void setSelectionColor(java.lang.String c)
c - The Color to setpublic java.lang.String getSelectionColorString()
public java.awt.Color getSelectionColor()
public java.lang.String getLegend()
nxm.sys.libg.GWidgetgetLegend in class nxm.sys.libg.GWidgetpublic void setFlags(int flags)
setFlags in class nxm.sys.libg.GWidgetpublic int processMessage(nxm.sys.lib.Message msg)
processMessage in interface nxm.sys.inc.MessageHandlerprocessMessage in class nxm.sys.libg.GWidgetmsg - The message.Commandable.NORMAL after processing the message or Commandable.NOOP
if the message is not processed.public void select(int i,
int button)
public void selectAlt(int i,
int button)
public boolean poll()
nxm.sys.libg.GWidgetpoll in class nxm.sys.libg.GWidgetpublic boolean isSet(java.lang.String maskName)
maskName - Mask namepublic java.lang.Object getValue()
nxm.sys.libg.GWidgetgetValue in class nxm.sys.libg.GWidgetpublic java.lang.String getItem(int i)
public java.lang.String getValue(int item,
boolean uc)
public void setAction(java.lang.String text)
nxm.sys.libg.GWidgetsetAction in class nxm.sys.libg.GWidgettext - the new value for this widget.public int getItemIndex(java.lang.String text)
text - the value of the itempublic void setValue(java.lang.String text)
nxm.sys.libg.GWidgetsetValue in class nxm.sys.libg.GWidgettext - the new value for this widget.public void setValue(int item)
public void setColumns(int nc)
public void addItem(java.lang.String item)
public void addItem(java.lang.String item,
boolean toggleOn)
public void remItem(java.lang.String item)
public void setItem(int index,
java.lang.String item)
public int getItemIndex()
public void setItemColorTable(nxm.sys.lib.Table t)
public void setItemColors(nxm.sys.lib.Table t)
t - Table of MENUITEM=COLOR key valuespublic void setItemColor(java.lang.String item,
java.lang.String color)
item - Menu item namecolor - Color namepublic void setItemColor(java.lang.String item,
java.awt.Color color)
item - Menu item namecolor - Color objectpublic void setDisabledItems(java.lang.String items)
items - The text of the items, comma separated, to disabledisableItem(String)public void disableItem(java.lang.String item)
item - The text of the item to disablepublic void enableItem(java.lang.String item)
item - The text of the item to re-enablepublic boolean isItemEnabled(java.lang.String item)
item - The text of the item to checkpublic void enableAllItems()
public void disableAllItems()
public void setDisabledItemColor(java.awt.Color color)
public void setDisabledItemColor(java.lang.String color)
public java.awt.Color getDisabledItemColor()
public java.lang.String getDisabledItemColorString()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic java.lang.String getText()
public java.lang.Object setKey(java.lang.String name,
java.lang.Object value)
nxm.sys.inc.KeyablesetKey in interface nxm.sys.inc.KeyablesetKey in class nxm.sys.libg.GWidgetname - The key identifying the value.value - The new value to associate with the key.value) or the value that would be returned by Keyable.getKey(String)
immediately after this method call. Since there can be some ambiguity the return value here should
probably be ignored.public java.lang.Object getKey(java.lang.String name)
nxm.sys.inc.KeyablegetKey in interface nxm.sys.inc.KeyablegetKey in class nxm.sys.libg.GWidgetname - The key identifying the value.public java.lang.String toString()
nxm.sys.libg.GWidgettoString in class nxm.sys.libg.GWidgetpublic void setAltSize(int width,
int height)