|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.TextComponent
com.threerings.opengl.gui.Label
com.threerings.opengl.gui.MenuItem
public class MenuItem
Displays a single menu item.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.Label |
|---|
Label.Fit |
| Field Summary | |
|---|---|
protected String |
_action
|
protected Object |
_argument
|
protected boolean |
_armed
|
protected boolean |
_pressed
|
| Fields inherited from class com.threerings.opengl.gui.Label |
|---|
_label |
| Fields inherited from class com.threerings.opengl.gui.TextComponent |
|---|
_effcols, _effsizes, _haligns, _lineSpacings, _teffects, _textfacts, _valigns |
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
_alpha, _backgrounds, _borders, _colors, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Fields inherited from interface com.threerings.opengl.gui.UIConstants |
|---|
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
| Constructor Summary | |
|---|---|
MenuItem(GlContext ctx,
Icon icon,
String action)
Creates a menu item with the specified icon that will generate an ActionEvent with the specified action when selected. |
|
MenuItem(GlContext ctx,
String text,
Icon icon,
String action)
Creates a menu item with the specified text and icon that will generate an ActionEvent with the specified action when selected. |
|
MenuItem(GlContext ctx,
String text,
Icon icon,
String action,
Object argument)
Creates a menu item with the specified text and icon that will generate an ActionEvent with the specified action and argument when selected. |
|
MenuItem(GlContext ctx,
String text,
String action)
Creates a menu item with the specified text that will generate an ActionEvent with the specified action when selected. |
|
| Method Summary | |
|---|---|
boolean |
dispatchEvent(Event event)
Instructs this component to process the supplied event. |
protected void |
fireAction(long when,
int modifiers)
Called when the menu item is "clicked" which may due to the mouse being pressed and released while over the item or due to keyboard manipulation while the item has focus. |
String |
getAction()
Returns the action configured for this menu item. |
Object |
getArgument()
Returns the argument of the action for this menu item. |
protected String |
getDefaultStyleConfig()
Returns the name of the default config to be used for all instances of this component. |
| Methods inherited from class com.threerings.opengl.gui.Label |
|---|
computePreferredSize, getFit, getIcon, getIconTextGap, getLabelRenderer, getText, layout, renderComponent, setFit, setIcon, setIconTextGap, setOrientation, setPreferredWidth, setText, setTextRotation |
| Methods inherited from class com.threerings.opengl.gui.TextComponent |
|---|
getEffectColor, getEffectSize, getHorizontalAlignment, getLabelRendererConfig, getLineSpacing, getTextEffect, getTextFactory, getTextFactory, getVerticalAlignment, updateFromStyleConfig |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String _action
protected Object _argument
protected boolean _armed
protected boolean _pressed
| Constructor Detail |
|---|
public MenuItem(GlContext ctx,
String text,
String action)
ActionEvent with the specified action when selected.
public MenuItem(GlContext ctx,
Icon icon,
String action)
ActionEvent with the specified action when selected.
public MenuItem(GlContext ctx,
String text,
Icon icon,
String action)
ActionEvent with the specified action when selected.
public MenuItem(GlContext ctx,
String text,
Icon icon,
String action,
Object argument)
ActionEvent with the specified action and argument when selected.
| Method Detail |
|---|
public String getAction()
public Object getArgument()
public boolean dispatchEvent(Event event)
Componentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class Componentprotected String getDefaultStyleConfig()
Component
getDefaultStyleConfig in class Label
protected void fireAction(long when,
int modifiers)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||