com.yospace.yae.yogi
Class YogiRadioButton

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiImageComponent
              |
              +--com.yospace.yae.yogi.YogiLabel
                    |
                    +--com.yospace.yae.yogi.YogiButton
                          |
                          +--com.yospace.yae.yogi.YogiCheckBox
                                |
                                +--com.yospace.yae.yogi.YogiRadioButton
All Implemented Interfaces:
RendererFactory
Direct Known Subclasses:
YogiTab

public class YogiRadioButton
extends YogiCheckBox

Extends YogiCheckBox and adds the concept of RadioButtonGroup. This allows radio buttons to be grouped together in order to achieve mutex behaviour.


Field Summary
static int PROPERTY_GROUP
          Constant for the group property.
 
Fields inherited from class com.yospace.yae.yogi.YogiCheckBox
PROPERTY_SELECTED
 
Fields inherited from class com.yospace.yae.yogi.YogiLabel
PROPERTY_TEXT, PROPERTY_TEXT_PLACEMENT
 
Fields inherited from class com.yospace.yae.yogi.YogiImageComponent
PROPERTY_IMAGE
 
Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
YogiRadioButton()
          Default constructor sets the radio button group to null.
YogiRadioButton(java.lang.String text, Image image, boolean selected, RadioButtonGroup group)
          Create a YogiRadioButton with the given text, image, selected state and group.
 
Method Summary
 RadioButtonGroup getRadioButtonGroup()
          Returns the RadioButtonGroup associated with this component.
 void setRadioButtonGroup(RadioButtonGroup group)
          Sets this component to be part of the specified RadioButtonGroup.
 void setSelected(boolean state)
          Set the pressed value currently associated with the YogiRadioButton.
 
Methods inherited from class com.yospace.yae.yogi.YogiCheckBox
getCellRendererComponent, isSelected
 
Methods inherited from class com.yospace.yae.yogi.YogiLabel
getText, isTextOnRight, setText, setTextImpl, setTextOnRight
 
Methods inherited from class com.yospace.yae.yogi.YogiImageComponent
getImage, getImageName, setImage, setImage
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, add, addPropertyChangeListener, bringForwards, bringInFrontOf, bringToFront, contains, containsComponent, ensureVisible, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, sendBackwards, sendBehind, sendToBack, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_GROUP

public static final int PROPERTY_GROUP
Constant for the group property.
Constructor Detail

YogiRadioButton

public YogiRadioButton()
Default constructor sets the radio button group to null.

YogiRadioButton

public YogiRadioButton(java.lang.String text,
                       Image image,
                       boolean selected,
                       RadioButtonGroup group)
Create a YogiRadioButton with the given text, image, selected state and group.
Parameters:
text - the text to be displayed.
image - the name of the image to be displayed.
selected - whether this radio button is the currently selected one.
group - the radio button group with which this radio button is to be associated.
Method Detail

setSelected

public void setSelected(boolean state)
Set the pressed value currently associated with the YogiRadioButton.

If the value changes, the component is repainted and a YogiCheckBox.PROPERTY_SELECTED change event is fired.

Overrides:
setSelected in class YogiCheckBox
Parameters:
state - the pressed state for this component.

getRadioButtonGroup

public RadioButtonGroup getRadioButtonGroup()
Returns the RadioButtonGroup associated with this component.
Returns:
the RadioButtonGroup.

setRadioButtonGroup

public void setRadioButtonGroup(RadioButtonGroup group)
Sets this component to be part of the specified RadioButtonGroup.

If the group changes, a PROPERTY_GROUP change event is fired.

Parameters:
group - the RadioButtonGroup to attach this YogiRadioButton to.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.