Package tripleplay.ui
Class ImageButton
- All Implemented Interfaces:
Clickable<ImageButton>
A button that uses images for its different states.
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.ui.Element
Element.Take
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a button with the supplied image for use in up and down states.ImageButton
(TileSource up, TileSource down) Creates a button with the supplied up and down images. -
Method Summary
Modifier and TypeMethodDescriptionvoid
click()
Programmatically triggers a click of this button.react.SignalView<ImageButton>
clicked()
A signal that is emitted when this element is clicked.onClick
(react.SignalView.Listener<? super ImageButton> onClick) A convenience method for registering a click handler.setDown
(TileSource down) Configures the image used in our down state.setUp
(TileSource up) Configures the image used in our up state.toString()
Methods inherited from class tripleplay.ui.Element
addStyles, addStyles, bindEnabled, bindVisible, bounds, constraint, enabledSlot, hierarchyChanged, isAdded, isEnabled, isShowing, isVisible, location, parent, setConstraint, setEnabled, setStyles, setStyles, setVisible, size, styles, visibleSlot, x, y
-
Constructor Details
-
ImageButton
Creates a button with the supplied image for use in up and down states. -
ImageButton
Creates a button with the supplied up and down images.
-
-
Method Details
-
setUp
Configures the image used in our up state. -
setDown
Configures the image used in our down state. -
click
public void click()Programmatically triggers a click of this button. This triggers the action sound, but does not cause any change in the button's visualization. Note: this does not check the button's enabled state, so the caller must handle that if appropriate.- Specified by:
click
in interfaceClickable<ImageButton>
-
onClick
A convenience method for registering a click handler. Assumes you don't need the result ofSignalView.connect(react.SignalView.Listener<? super T>)
, because it throws it away. -
clicked
Description copied from interface:Clickable
A signal that is emitted when this element is clicked.- Specified by:
clicked
in interfaceClickable<ImageButton>
-
toString
-