com.jmex.bui
Class BMenuItem
java.lang.Object
com.jmex.bui.BComponent
com.jmex.bui.BTextComponent
com.jmex.bui.BLabel
com.jmex.bui.BMenuItem
- All Implemented Interfaces:
- BConstants
- Direct Known Subclasses:
- BComboBox.ComboMenuItem
public class BMenuItem
- extends BLabel
Displays a single menu item.
| Fields inherited from class com.jmex.bui.BComponent |
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Fields inherited from interface com.jmex.bui.BConstants |
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
|
Constructor Summary |
BMenuItem(BIcon icon,
String action)
Creates a menu item with the specified icon that will generate an
ActionEvent with the specified action when selected. |
BMenuItem(String text,
BIcon icon,
String action)
Creates a menu item with the specified text and icon that will generate
an ActionEvent with the specified action when selected. |
BMenuItem(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(BEvent 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. |
protected String |
getDefaultStyleClass()
Returns the default stylesheet class to be used for all instances of this component. |
| Methods inherited from class com.jmex.bui.BLabel |
computePreferredSize, getFit, getIcon, getIconTextGap, getText, layout, renderComponent, setFit, setIcon, setIconTextGap, setOrientation, setText, wasAdded, wasRemoved |
| Methods inherited from class com.jmex.bui.BTextComponent |
checkNonDefault, checkNonDefaultInt, checkNonDefaultVal, configureStyle, getEffectColor, getEffectSize, getHorizontalAlignment, getLabelConfig, getLineSpacing, getTextEffect, getTextFactory, getTextFactory, getVerticalAlignment |
| Methods inherited from class com.jmex.bui.BComponent |
acceptsFocus, addListener, applyDefaultStates, boundsToString, changeCursor, createTooltipComponent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getFocusTarget, getHeight, getHitComponent, getInsets, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, invalidate, isAdded, isEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, restoreScissorState, setAlpha, setBackground, setBounds, setCursor, setEnabled, setLocation, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleClass, setTooltipRelativeToMouse, setTooltipText, setVisible, stateDidChange, updateCursor, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_action
protected String _action
_armed
protected boolean _armed
_pressed
protected boolean _pressed
BMenuItem
public BMenuItem(String text,
String action)
- Creates a menu item with the specified text that will generate an
ActionEvent with the specified action when selected.
BMenuItem
public BMenuItem(BIcon icon,
String action)
- Creates a menu item with the specified icon that will generate an
ActionEvent with the specified action when selected.
BMenuItem
public BMenuItem(String text,
BIcon icon,
String action)
- Creates a menu item with the specified text and icon that will generate
an
ActionEvent with the specified action when selected.
getAction
public String getAction()
- Returns the action configured for this menu item.
dispatchEvent
public boolean dispatchEvent(BEvent event)
- Description copied from class:
BComponent
- Instructs this component to process the supplied event. If the event is not processed, it
will be passed up to its parent component for processing. Derived classes should thus only
call
super.dispatchEvent for events that they did not "consume".
- Overrides:
dispatchEvent in class BComponent
- Returns:
- true if this event was consumed, false if not.
getDefaultStyleClass
protected String getDefaultStyleClass()
- Description copied from class:
BComponent
- Returns the default stylesheet class to be used for all instances of this component. Derived
classes will likely want to override this method and set up a default class for their type
of component.
- Overrides:
getDefaultStyleClass in class BLabel
fireAction
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.
Copyright © 2008 Michael Bayne.
All Rights Reserved.