|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jmex.bui.BComponent
com.jmex.bui.BTextComponent
com.jmex.bui.BLabel
com.jmex.bui.BButton
public class BButton
Displays a simple button that can be depressed and which generates an action event when pressed and released.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jmex.bui.BLabel |
|---|
BLabel.Fit |
| Field Summary | |
|---|---|
protected java.lang.String |
_action
|
protected boolean |
_armed
|
protected boolean |
_pressed
|
static int |
DOWN
Indicates that this button is in the down state. |
protected static int |
STATE_COUNT
|
protected static java.lang.String[] |
STATE_PCLASSES
|
| Fields inherited from class com.jmex.bui.BLabel |
|---|
_label |
| Fields inherited from class com.jmex.bui.BTextComponent |
|---|
_effcols, _effsizes, _haligns, _teffects, _textfacts, _valigns |
| 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 |
| Fields inherited from interface com.jmex.bui.BConstants |
|---|
DEFAULT_SIZE, DEFAULT_SPACING |
| Constructor Summary | |
|---|---|
BButton(BIcon icon,
ActionListener listener,
java.lang.String action)
Creates a button with the specified icon and action. |
|
BButton(BIcon icon,
java.lang.String action)
Creates a button with the specified icon and action. |
|
BButton(java.lang.String text)
Creates a button with the specified textual label. |
|
BButton(java.lang.String text,
ActionListener listener,
java.lang.String action)
Creates a button with the specified label and action. |
|
BButton(java.lang.String text,
java.lang.String action)
Creates a button with the specified label and action. |
|
| Method Summary | |
|---|---|
protected void |
configureStyle(BStyleSheet style)
documentation inherited |
boolean |
dispatchEvent(BEvent event)
Instructs this component to process the supplied event. |
protected void |
fireAction(long when,
int modifiers)
Called when the button is "clicked" which may due to the mouse being pressed and released while over the button or due to keyboard manipulation while the button has focus. |
java.lang.String |
getAction()
Returns the action generated when this button is clicked. |
protected java.lang.String |
getDefaultStyleClass()
Returns the default stylesheet class to be used for all instances of this component. |
int |
getState()
Returns the state of this component, either BComponent.DEFAULT or BComponent.DISABLED. |
protected int |
getStateCount()
Returns the number of different states that this component can take. |
protected java.lang.String |
getStatePseudoClass(int state)
Returns the pseudoclass identifier for the specified component state. |
void |
setAction(java.lang.String action)
Configures the action to be generated when this button is clicked. |
| 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, getEffectColor, getEffectSize, getHorizontalAlignment, getLabelConfig, getTextEffect, getTextFactory, getVerticalAlignment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DOWN
protected boolean _armed
protected boolean _pressed
protected java.lang.String _action
protected static final int STATE_COUNT
protected static final java.lang.String[] STATE_PCLASSES
| Constructor Detail |
|---|
public BButton(java.lang.String text)
text - String
public BButton(java.lang.String text,
java.lang.String action)
ActionEvent
when the button is clicked.
text - Stringaction - String
public BButton(java.lang.String text,
ActionListener listener,
java.lang.String action)
ActionEvent to
the specified ActionListener when the button is clicked.
text - Stringlistener - ActionLIsteneraction - String
public BButton(BIcon icon,
java.lang.String action)
ActionEvent
when the button is clicked.
icon - BIconaction - String
public BButton(BIcon icon,
ActionListener listener,
java.lang.String action)
ActionEvent to
the specified ActionListener when the button is clicked.
icon - BIconlistener - ActionListeneraction - String| Method Detail |
|---|
public void setAction(java.lang.String action)
action - Stringpublic java.lang.String getAction()
public int getState()
BComponentBComponent.DEFAULT or BComponent.DISABLED.
getState in class BComponentpublic boolean dispatchEvent(BEvent event)
BComponentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class BComponentprotected java.lang.String getDefaultStyleClass()
BComponent
getDefaultStyleClass in class BLabelprotected int getStateCount()
BComponent
getStateCount in class BComponentprotected java.lang.String getStatePseudoClass(int state)
BComponentBComponent.DISABLED state maps to disabled and is configured like so:
component:disabled {
color: #CCCCCC; // etc.
}
getStatePseudoClass in class BComponentprotected void configureStyle(BStyleSheet style)
BTextComponent
configureStyle in class BTextComponentstyle - BStyleSheetBComponent.configureStyle(com.jmex.bui.BStyleSheet)
protected void fireAction(long when,
int modifiers)
when - longmodifiers - int
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||