|
|||||||||
| Home >> All >> jcurses >> [ widgets overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
jcurses.widgets
Class CheckBox

java.lang.Objectjcurses.widgets.Widget
jcurses.widgets.CheckBox
- public class CheckBox
- extends Widget
This class implements a checkbox widget. This checkboxes state is modified by typing a special char (default 'space'). You can register listeners by this widget to track state changes.
| Field Summary | |
private static jcurses.system.InputChar |
__changeStatusChar
|
private static jcurses.system.CharColor |
__checkBoxDefaultColors
|
private static jcurses.system.CharColor |
__focusedCheckBoxDefaultColors
|
private boolean |
_checked
|
private jcurses.system.CharColor |
_focusedCheckboxColors
|
private jcurses.event.ValueChangedListenerManager |
_listenerManager
|
| Fields inherited from class jcurses.widgets.Widget |
_parent, _window |
| Constructor Summary | |
CheckBox()
The constructor creates an unchecked checkbox |
|
CheckBox(boolean checked)
The constructor. |
|
| Method Summary | |
void |
addListener(jcurses.event.ValueChangedListener listener)
Adds listener to the checkbox to track states changes |
private void |
changeColors()
|
protected void |
doPaint()
This method paints the widget. |
protected void |
doRepaint()
This method repaints the widget. |
protected void |
focus()
The method is called bei setFocus to tell widget, thas it has get focus. |
jcurses.system.CharColor |
getDefaultColors()
|
jcurses.system.CharColor |
getFocusedCheckboxColors()
|
private jcurses.system.CharColor |
getFocusedCheckboxDefaultColors()
|
protected jcurses.util.Rectangle |
getPreferredSize()
This method gives the widget container the infomation about the preferred size of this widget. |
boolean |
getValue()
return true, if the checkbox is checked , false otherwise |
protected boolean |
handleInput(jcurses.system.InputChar ch)
The method is called by framework to let the widget handle an input char. |
protected boolean |
isFocusable()
The method declares, whether the widget can handle input ( get focus ), that is, whether this is an input widget. |
void |
removeListener(jcurses.event.ValueChangedListener listener)
Removes listener from the checkbox |
void |
setFocusedCheckboxColors(jcurses.system.CharColor colors)
Sets colors of the checkbox in focused state. |
void |
setValue(boolean value)
Sets checkboxes value |
protected void |
unfocus()
The method is called bei setFocus to tell widget, thas it has lost focus. |
| Methods inherited from class jcurses.widgets.Widget |
getAbsoluteX, getAbsoluteY, getColors, getFocus, getParent, getRectangle, getShortCutsList, getSize, getVisible, getWindow, getX, getY, hasFocus, isVisible, paint, repaint, setColors, setFocus, setParent, setSize, setVisible, setWindow, setX, setY |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
_checked
private boolean _checked
_listenerManager
private jcurses.event.ValueChangedListenerManager _listenerManager
__checkBoxDefaultColors
private static jcurses.system.CharColor __checkBoxDefaultColors
__focusedCheckBoxDefaultColors
private static jcurses.system.CharColor __focusedCheckBoxDefaultColors
_focusedCheckboxColors
private jcurses.system.CharColor _focusedCheckboxColors
__changeStatusChar
private static jcurses.system.InputChar __changeStatusChar
| Constructor Detail |
CheckBox
public CheckBox(boolean checked)
- The constructor.
CheckBox
public CheckBox()
- The constructor creates an unchecked checkbox
| Method Detail |
getDefaultColors
public jcurses.system.CharColor getDefaultColors()
- Overrides:
getDefaultColorsin classWidget
getFocusedCheckboxDefaultColors
private jcurses.system.CharColor getFocusedCheckboxDefaultColors()
getFocusedCheckboxColors
public jcurses.system.CharColor getFocusedCheckboxColors()
setFocusedCheckboxColors
public void setFocusedCheckboxColors(jcurses.system.CharColor colors)
- Sets colors of the checkbox in focused state.
getValue
public boolean getValue()
- return true, if the checkbox is checked , false otherwise
setValue
public void setValue(boolean value)
- Sets checkboxes value
getPreferredSize
protected jcurses.util.Rectangle getPreferredSize()
- Description copied from class:
Widget - This method gives the widget container the infomation about the
preferred size of this widget. Must be implemented by derived classes.
- Specified by:
getPreferredSizein classWidget
doPaint
protected void doPaint()
- Description copied from class:
Widget - This method paints the widget. Will be called by
paint(), only if the widget is visible. Must be implemented be derived classes.
isFocusable
protected boolean isFocusable()
- Description copied from class:
Widget - The method declares, whether the widget can handle input ( get focus ), that is,
whether this is an input widget.
- Overrides:
isFocusablein classWidget
doRepaint
protected void doRepaint()
- Description copied from class:
Widget - This method repaints the widget. Will be called by
paint(), only if the widget is visible. Must be implemented be derived classes.
handleInput
protected boolean handleInput(jcurses.system.InputChar ch)
- Description copied from class:
Widget - The method is called by framework to let the widget handle an input char.
Schould be overrided be derived classes, if these can handle input.
- Overrides:
handleInputin classWidget
changeColors
private void changeColors()
focus
protected void focus()
- Description copied from class:
Widget - The method is called bei
setFocusto tell widget, thas it has get focus. This method schold be overrided bei derived class to react getting focus, for examlple to repaint widget gettig focus.
unfocus
protected void unfocus()
- Description copied from class:
Widget - The method is called bei
setFocusto tell widget, thas it has lost focus. This method schold be overrided bei derived class to react losing focus, for examlple to repaint widget losing focus.
addListener
public void addListener(jcurses.event.ValueChangedListener listener)
- Adds listener to the checkbox to track states changes
removeListener
public void removeListener(jcurses.event.ValueChangedListener listener)
- Removes listener from the checkbox
|
|||||||||
| Home >> All >> jcurses >> [ widgets overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC