public class ToggleButton extends FocusableComponent
Modifier and Type | Field and Description |
---|---|
protected IButtonRenderer<java.lang.Boolean> |
renderer
Renderer for this component.
|
protected IToggleable |
toggle
Setting to be toggled by left click.
|
label
Constructor and Description |
---|
ToggleButton(IBooleanSetting setting,
IButtonRenderer<java.lang.Boolean> renderer)
Constructor using boolean setting.
|
ToggleButton(ILabeled label,
IToggleable toggle,
IButtonRenderer<java.lang.Boolean> renderer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getHeight()
Return height of component.
|
void |
handleButton(Context context,
int button)
Should be called by the parent when a mouse button state changes.
|
void |
render(Context context)
Redraw component on screen.
|
exit, handleFocus, hasFocus, releaseFocus, updateFocus
enter, getHeight, getTitle, handleChar, handleKey, handleScroll, isVisible
protected IToggleable toggle
protected IButtonRenderer<java.lang.Boolean> renderer
public ToggleButton(ILabeled label, IToggleable toggle, IButtonRenderer<java.lang.Boolean> renderer)
label
- the label for the componenttoggle
- the togglerenderer
- the renderer for this componentpublic ToggleButton(IBooleanSetting setting, IButtonRenderer<java.lang.Boolean> renderer)
setting
- the setting in questionrenderer
- the renderer for this componentpublic void render(Context context)
IComponent
Context.setHeight(int)
.render
in interface IComponent
render
in class ComponentBase
context
- the Context
for the componentpublic void handleButton(Context context, int button)
IComponent
Context.setHeight(int)
.handleButton
in interface IComponent
handleButton
in class FocusableComponent
context
- the Context
for the componentbutton
- the button that changed its stateIInterface.LBUTTON
,
IInterface.RBUTTON
protected int getHeight()
ComponentBase
getHeight
in class ComponentBase