Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jcurses.widgets
Class CheckBox  view CheckBox download CheckBox.java

java.lang.Object
  extended byjcurses.widgets.Widget
      extended byjcurses.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:
getDefaultColors in class Widget

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:
getPreferredSize in class Widget

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.

Specified by:
doPaint in class Widget

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:
isFocusable in class Widget

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.

Specified by:
doRepaint in class Widget

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:
handleInput in class Widget

changeColors

private void changeColors()

focus

protected void focus()
Description copied from class: Widget
The method is called bei setFocus to 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.

Overrides:
focus in class Widget

unfocus

protected void unfocus()
Description copied from class: Widget
The method is called bei setFocus to 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.

Overrides:
unfocus in class Widget

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