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, updateFocusenter, getHeight, getTitle, handleChar, handleKey, handleScroll, isVisibleprotected 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)
IComponentContext.setHeight(int).render in interface IComponentrender in class ComponentBasecontext - the Context for the componentpublic void handleButton(Context context, int button)
IComponentContext.setHeight(int).handleButton in interface IComponenthandleButton in class FocusableComponentcontext - the Context for the componentbutton - the button that changed its stateIInterface.LBUTTON,
IInterface.RBUTTONprotected int getHeight()
ComponentBasegetHeight in class ComponentBase