|
|||||||||
| 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
com.jmex.bui.BToggleButton
public class BToggleButton
Like a BButton except that it toggles between two states
(selected and normal) when clicked.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jmex.bui.BLabel |
|---|
BLabel.Fit |
| Field Summary | |
|---|---|
protected boolean |
_selected
Used to track whether we are selected or not. |
static int |
DISSELECTED
Indicates that this button is in the selected state and is disabled. |
static int |
SELECTED
Indicates that this button is in the selected state. |
protected static int |
STATE_COUNT
|
protected static String[] |
STATE_PCLASSES
|
| Fields inherited from class com.jmex.bui.BButton |
|---|
_action, _armed, _pressed, DOWN |
| Fields inherited from class com.jmex.bui.BLabel |
|---|
_label |
| Fields inherited from class com.jmex.bui.BTextComponent |
|---|
_effcols, _effsizes, _haligns, _lineSpacings, _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 |
|---|
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
| Constructor Summary | |
|---|---|
BToggleButton(BIcon icon,
String action)
Creates a button with the specified icon and action. |
|
BToggleButton(String text)
Creates a button with the specified textual label. |
|
BToggleButton(String text,
String action)
Creates a button with the specified label and action. |
|
| Method Summary | |
|---|---|
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. |
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 String |
getStatePseudoClass(int state)
Returns the pseudoclass identifier for the specified component state. |
boolean |
isSelected()
Returns whether or not this button is in the selected state. |
void |
setSelected(boolean selected)
Configures the selected state of this button. |
| Methods inherited from class com.jmex.bui.BButton |
|---|
configureStyle, dispatchEvent, getAction, getDefaultStyleClass, setAction |
| 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, getEffectColor, getEffectSize, getHorizontalAlignment, getLabelConfig, getLineSpacing, getTextEffect, getTextFactory, 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 SELECTED
public static final int DISSELECTED
protected boolean _selected
protected static final int STATE_COUNT
protected static final String[] STATE_PCLASSES
| Constructor Detail |
|---|
public BToggleButton(String text)
public BToggleButton(String text,
String action)
ActionEvent when the button
changes state.
public BToggleButton(BIcon icon,
String action)
ActionEvent when the button
changes state.
| Method Detail |
|---|
public boolean isSelected()
public void setSelected(boolean selected)
public int getState()
BComponentBComponent.DEFAULT or BComponent.DISABLED.
getState in class BButtonprotected int getStateCount()
BComponent
getStateCount in class BButtonprotected String getStatePseudoClass(int state)
BComponentBComponent.DISABLED state maps to disabled and is configured like so:
component:disabled {
color: #CCCCCC; // etc.
}
getStatePseudoClass in class BButton
protected void fireAction(long when,
int modifiers)
BButton
fireAction in class BButton
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||