com.cbse.jeasy
Class JECheckBox

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.cbse.jeasy.JECheckBox
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.util.EventListener

public class JECheckBox
extends JEObject
implements java.awt.event.FocusListener, java.awt.event.KeyListener

A class using JCheckBox.

Properties
name values comment
id * Id of the object. Let it begin with CH_
label   Text of the checkbox
mnemonic   The keyboard mnemonic.
icon   File for creating an ImageIcon
tooltip   Text in Tooltip
constraints   Constraints when added in GridBagLayout
selected true
false
a boolean value indicating the initial selection state. If true the checkbox is selected
visible true
false
Set to false will hide the label and the field in panels and tables.
enabled true
false
Set to false will disable the checkbox for changing.
markingBackground true
false
Set to true will use the global background color.
mandatory true
false
Defines an entry as mandatory
* = property you have to set; bold = default value

Version:
%I%, %G%
Author:
H.Pfohl

Field Summary
 
Fields inherited from class com.cbse.jeasy.JEObject
DEVELOPPING, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_TIME, INPUT_ERRORS, NO_INPUT_ERROR, RUNNING
 
Constructor Summary
JECheckBox(java.lang.String s)
          Reads the properties from a string
 
Method Summary
 void backupEntry()
          The current text will be stored internal to check against changes
 void clear()
          Selection clear
 java.lang.Object deserializeValue(java.lang.String s)
          Converts a String to the JClass of the JEObject If the JEObject is a Radiobutton, the function returns a Boolean.
 int examine()
          Checks if an entry is mandatoy
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 boolean getAntialiasing()
          Gets the anialialising flag
 boolean getBackupEntry()
          Gets the backuped text
 javax.swing.JCheckBox getCheckBox()
          Gets the JCheckBox
 javax.swing.JComponent getComponent()
          Gets the JComponent based on this JEasy Object
 java.lang.String geticon()
          Gets the icon
 java.lang.Class getJClass()
          Get the JClass
 java.lang.String getLabel()
          Gets the text of the checkbox
 java.lang.String getMnemonic()
          Gets the mnemonic of the field
 java.lang.String getXMLtag()
          Gets the XMLtag.
 boolean isEditable()
          See isEnabled()
 boolean isEnabled()
          False if the state of the checkbox should not be changed in a Table or Panel
 boolean isMandatory()
          Return if an entry is mandatory
 boolean isSelected()
          Is it selected
 boolean isVisible()
          False if the checkbox should not be shown in a Table or Panel
 void JEadd(java.awt.Container co)
          Adds the JCheckBox to a Container
 void JEadd(java.awt.Container co, java.awt.LayoutManager lm)
          Adds the JCheckBox to a Container.
 void JEadd(java.lang.String border, java.awt.Container co)
          Adds the JCheckBox to a Container with a BorderLayout
 void JEaddTab(javax.swing.JTabbedPane co, java.awt.LayoutManager lm)
          Adds the JCheckBox to a JTabbedPane with its LayoutManager
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void restoreEntry()
          Sets the entry of the component to the backuped value
 java.lang.String serializeValue()
          Gets the value of the button as a String
 void setBackground(java.awt.Color c)
          Sets the background of the checkbox
 void setEditable(boolean eb)
          Enables/disables the box for check
 void setEnabled(boolean bv)
          setEnabled of the checkbox
 void setMandatory(boolean b)
          Sets the entry mandatory or not
 void setSelected(boolean b)
          Set selected
 void setVisible(boolean bv)
          setVisible of the checkbox
 void setXMLtag(java.lang.String s)
          Sets the XMLtag
 void start()
          Creates jfc-Objects with the given properties.
 boolean wasEntryChanged()
          The components compares the current entry with the data stored by backupEntry()
 
Methods inherited from class com.cbse.jeasy.JEObject
getApplet, getApplLocale, getCenter, getEast, getElementAt, getElementSize, getId, getJCallBack, getMode, getName, getNorth, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getSouth, getStarted, getTitle, getType, getWest, isEnterprise, isProfessional, isStandard, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, removeProperties, removeProperty, setApplet, setApplLocale, setEditable, setEnabled, setFocus, setJCallBack, setMarkable, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JECheckBox

public JECheckBox(java.lang.String s)
Reads the properties from a string

Parameters:
s - contains properties and values
See Also:
JE#PropertyString
Method Detail

getLabel

public java.lang.String getLabel()
Gets the text of the checkbox

Overrides:
getLabel in class JEObject
Returns:
String

getXMLtag

public java.lang.String getXMLtag()
Gets the XMLtag. Returns the id if no XMLtag is specified

Overrides:
getXMLtag in class JEObject
Returns:
String

getMnemonic

public java.lang.String getMnemonic()
Gets the mnemonic of the field


setMandatory

public void setMandatory(boolean b)
Sets the entry mandatory or not


isMandatory

public boolean isMandatory()
Return if an entry is mandatory


setXMLtag

public void setXMLtag(java.lang.String s)
Sets the XMLtag


getJClass

public java.lang.Class getJClass()
Get the JClass

Overrides:
getJClass in class JEObject
Returns:

getComponent

public javax.swing.JComponent getComponent()
Gets the JComponent based on this JEasy Object

Overrides:
getComponent in class JEObject
Returns:
JComponent

geticon

public java.lang.String geticon()
Gets the icon

Returns:
String

getCheckBox

public javax.swing.JCheckBox getCheckBox()
Gets the JCheckBox

Returns:
JCheckBox

getAntialiasing

public boolean getAntialiasing()
Gets the anialialising flag


isSelected

public boolean isSelected()
Is it selected

Returns:
true/false

setSelected

public void setSelected(boolean b)
Set selected


setVisible

public void setVisible(boolean bv)
setVisible of the checkbox

Overrides:
setVisible in class JEObject

isVisible

public boolean isVisible()
False if the checkbox should not be shown in a Table or Panel

Overrides:
isVisible in class JEObject
Returns:
visible

setEnabled

public void setEnabled(boolean bv)
setEnabled of the checkbox

Overrides:
setEnabled in class JEObject

isEnabled

public boolean isEnabled()
False if the state of the checkbox should not be changed in a Table or Panel

Overrides:
isEnabled in class JEObject
Returns:
enabled

isEditable

public boolean isEditable()
See isEnabled()

Overrides:
isEditable in class JEObject
Returns:
editable

setEditable

public void setEditable(boolean eb)
Enables/disables the box for check

Overrides:
setEditable in class JEObject

clear

public void clear()
Selection clear

Overrides:
clear in class JEObject

setBackground

public void setBackground(java.awt.Color c)
Sets the background of the checkbox


backupEntry

public void backupEntry()
The current text will be stored internal to check against changes

Overrides:
backupEntry in class JEObject

getBackupEntry

public boolean getBackupEntry()
Gets the backuped text

Returns:
String

restoreEntry

public void restoreEntry()
Sets the entry of the component to the backuped value

Overrides:
restoreEntry in class JEObject

examine

public int examine()
Checks if an entry is mandatoy

Returns:
0 if an entry is set or mandatory is false else JEObject.INPUT_ERROR_MANDATORY

wasEntryChanged

public boolean wasEntryChanged()
The components compares the current entry with the data stored by backupEntry()

Overrides:
wasEntryChanged in class JEObject
Returns:
true data was changed false current data is equal backup data

deserializeValue

public java.lang.Object deserializeValue(java.lang.String s)
Converts a String to the JClass of the JEObject If the JEObject is a Radiobutton, the function returns a Boolean.

Overrides:
deserializeValue in class JEObject
Returns:
Object

serializeValue

public java.lang.String serializeValue()
Gets the value of the button as a String

Overrides:
serializeValue in class JEObject
Returns:
String

start

public void start()
Creates jfc-Objects with the given properties. The font of the label is set to global.labelFont.

Overrides:
start in class JEObject

JEadd

public void JEadd(java.awt.Container co,
                  java.awt.LayoutManager lm)
Adds the JCheckBox to a Container. Uses the constraints when the LayoutManager is a GridBagLayout.

Overrides:
JEadd in class JEObject
Parameters:
Container - where the JCheckBox is added

JEadd

public void JEadd(java.lang.String border,
                  java.awt.Container co)
Adds the JCheckBox to a Container with a BorderLayout

Overrides:
JEadd in class JEObject
Parameters:
String - "North" "South" "West" "East" "Center"
Container - where the JCheckBox is added

JEadd

public void JEadd(java.awt.Container co)
Adds the JCheckBox to a Container

Overrides:
JEadd in class JEObject
Parameters:
Container - where the JCheckBox is added

JEaddTab

public void JEaddTab(javax.swing.JTabbedPane co,
                     java.awt.LayoutManager lm)
Adds the JCheckBox to a JTabbedPane with its LayoutManager

Overrides:
JEaddTab in class JEObject
Parameters:
JTabbedPane - to hold the JEObject
LayoutManager - of the JTabbedPane

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener