com.cbse.jeasy
Class JERadioButton

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

public class JERadioButton
extends JEObject
implements java.awt.event.KeyListener, java.awt.event.ItemListener

A class using JRadioButton.

Properties
name values comment
id * Id of the object. Let it begin with RB_
label   Text inside the button
buttongroup   Id of the buttongroup. Only one in this group can be selected
mandatory true
false
Defines an entry as mandatory
icon   File for creating an ImageIcon
font   Font of the text.
mnemonic   The mnemonic key used by ALT+
selected true
false
Set true select this entry
constraints   Constraints when added in GridBagLayout
* = 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
JERadioButton(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()
          Clear means set the default selected
 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
 boolean getAntialiasing()
          Gets the anialialising flag
 boolean getBackupEntry()
          Gets the backuped text
 java.lang.String getButtonGroup()
          Gets the buttongroup
 javax.swing.JComponent getComponent()
          Gets the JComponent based on this JEasy Object
 java.awt.Font getFont()
           
 java.lang.String getIcon()
          Gets the icon
 java.lang.Class getJClass()
          Get the JClass
 java.lang.String getLabel()
          Gets the label
 javax.swing.JRadioButton getRadioButton()
          Gets the button
 java.lang.String getXMLtag()
          Gets the XMLtag.
 boolean isMandatory()
          Return if an entry is mandatory
 boolean isSelected()
          Is it selected
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void JEadd(javax.swing.ButtonGroup bgrp)
          Adds the JRadioButton to a ButtonGroup
 void JEadd(java.awt.Container co)
          Adds the JRadioButton to a Container
 void JEadd(java.awt.Container co, java.awt.LayoutManager lm)
          Adds the JRadioButton to a Container.
 void JEadd(java.lang.String border, java.awt.Container co)
          Adds the JRadioButton to a Container with a BorderLayout
 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 radiobutton
 void setEnabled(boolean eb)
          Enables/disables the textfield and the button
 void setMandatory(boolean b)
          Sets the entry mandatory or not
 void setSelected(boolean b)
          Set selected
 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, isEditable, isEnabled, isEnterprise, isProfessional, isStandard, isVisible, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEaddTab, removeProperties, removeProperty, setApplet, setApplLocale, setEditable, setEditable, setEnabled, setFocus, setJCallBack, setMarkable, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JERadioButton

public JERadioButton(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 label

Overrides:
getLabel in class JEObject
Returns:
String

getButtonGroup

public java.lang.String getButtonGroup()
Gets the buttongroup

Returns:
String

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

setMandatory

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


isMandatory

public boolean isMandatory()
Return if an entry is mandatory


getRadioButton

public javax.swing.JRadioButton getRadioButton()
Gets the button

Returns:
JRadioButton

getAntialiasing

public boolean getAntialiasing()
Gets the anialialising flag


getFont

public java.awt.Font getFont()

getXMLtag

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

Overrides:
getXMLtag in class JEObject
Returns:
String

setXMLtag

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


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

isSelected

public boolean isSelected()
Is it selected


setSelected

public void setSelected(boolean b)
Set selected


clear

public void clear()
Clear means set the default selected

Overrides:
clear in class JEObject

setEnabled

public void setEnabled(boolean eb)
Enables/disables the textfield and the button

Overrides:
setEnabled in class JEObject

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

setBackground

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


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 JRadioButton to a Container. Uses the constraints when the LayoutManager is a GridBagLayout.

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

JEadd

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

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

JEadd

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

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

JEadd

public void JEadd(javax.swing.ButtonGroup bgrp)
Adds the JRadioButton to a ButtonGroup

Overrides:
JEadd in class JEObject
Parameters:
ButtonGroup -

keyReleased

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

keyPressed

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

keyTyped

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener