|
||||||||||
| 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.Button
public class Button
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.threerings.opengl.gui.Label |
|---|
Label.Fit |
| Field Summary | |
|---|---|
static int |
DOWN
Indicates that this button is in the down state. |
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
DEFAULT, DISABLED, HOVER |
| 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 | |
|---|---|
Button(GlContext ctx,
Icon icon,
ActionListener listener,
String action)
Creates a button with the specified icon and action. |
|
Button(GlContext ctx,
Icon icon,
ActionListener listener,
String action,
Object argument)
Creates a button with the specified icon, action, and argument. |
|
Button(GlContext ctx,
Icon icon,
String action)
Creates a button with the specified icon and action. |
|
Button(GlContext ctx,
Icon icon,
String action,
Object argument)
Creates a button with the specified icon, action, and argument. |
|
Button(GlContext ctx,
String text)
Creates a button with the specified textual label. |
|
Button(GlContext ctx,
String text,
ActionListener listener,
String action)
Creates a button with the specified label and action. |
|
Button(GlContext ctx,
String text,
ActionListener listener,
String action,
Object argument)
Creates a button with the specified label, action, and argument. |
|
Button(GlContext ctx,
String text,
String action)
Creates a button with the specified label and action. |
|
Button(GlContext ctx,
String text,
String action,
Object argument)
Creates a button with the specified label, action, and argument. |
|
| Method Summary | |
|---|---|
boolean |
dispatchEvent(Event event)
Instructs this component to process the supplied event. |
void |
doClick()
Programmatically activates the button. |
String |
getAction()
Returns the action generated when this button is clicked. |
Object |
getArgument()
Get the argument dispatched by this button. |
String |
getFeedbackSound()
Returns a reference to the feedback sound used by this component. |
int |
getState()
Returns the state of this component, either Component.DEFAULT or Component.DISABLED. |
void |
setAction(String action)
Configures the action to be generated when this button is clicked. |
void |
setArgument(Object argument)
Set the argument dispatched by this button. |
| Methods inherited from class com.threerings.opengl.gui.Label |
|---|
getFit, getIcon, getIconTextGap, getLabelRenderer, getText, setFit, setIcon, setIconTextGap, setOrientation, setPreferredWidth, setText, setTextRotation |
| Methods inherited from class com.threerings.opengl.gui.TextComponent |
|---|
getEffectColor, getEffectSize, getHorizontalAlignment, getLineSpacing, getTextEffect, getTextFactory, getVerticalAlignment |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DOWN
| Constructor Detail |
|---|
public Button(GlContext ctx,
String text)
public Button(GlContext ctx,
String text,
String action)
ActionEvent when the button is
clicked.
public Button(GlContext ctx,
String text,
String action,
Object argument)
public Button(GlContext ctx,
String text,
ActionListener listener,
String action)
ActionEvent to the specified ActionListener when the button is clicked.
public Button(GlContext ctx,
String text,
ActionListener listener,
String action,
Object argument)
public Button(GlContext ctx,
Icon icon,
String action)
ActionEvent when the button is clicked.
public Button(GlContext ctx,
Icon icon,
String action,
Object argument)
public Button(GlContext ctx,
Icon icon,
ActionListener listener,
String action)
ActionEvent to the specified ActionListener when the button is clicked.
public Button(GlContext ctx,
Icon icon,
ActionListener listener,
String action,
Object argument)
| Method Detail |
|---|
public void setAction(String action)
public String getAction()
public void setArgument(Object argument)
public Object getArgument()
public String getFeedbackSound()
public void doClick()
public int getState()
ComponentComponent.DEFAULT or Component.DISABLED.
getState in class Componentpublic boolean dispatchEvent(Event event)
Componentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||