com.yospace.yae.yogi
Class YogiCheckBox

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
All Implemented Interfaces:
RendererFactory
Direct Known Subclasses:
YogiRadioButton

public class YogiCheckBox
extends YogiButton


Field Summary
static int PROPERTY_SELECTED
          Constant for the selected property
 
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
YogiCheckBox()
          Default constructor sets up basic default model with the image set to null, text set to the empty string and selected set to false.
YogiCheckBox(java.lang.String text, Image image, boolean selected)
          Create a YogiCheckBox with the given text, image and selected state.
 
Method Summary
 YogiComponent getCellRendererComponent(AbstractTable table, java.lang.Object value, boolean isSelected, boolean cellHasFocus)
          Provided to implement the RendererFactory interface.
 boolean isSelected()
          Returns whether the YogiCheckBox is currently checked.
 void setSelected(boolean state)
          Set the selected value of the YogiCheckBox.
 
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_SELECTED

public static final int PROPERTY_SELECTED
Constant for the selected property
Constructor Detail

YogiCheckBox

public YogiCheckBox()
Default constructor sets up basic default model with the image set to null, text set to the empty string and selected set to false.

YogiCheckBox

public YogiCheckBox(java.lang.String text,
                    Image image,
                    boolean selected)
Create a YogiCheckBox with the given text, image and selected state.
Parameters:
text - the text to be displayed.
image - the image to be displayed.
selected - whether the check box is to be initially selected or not.
Method Detail

isSelected

public boolean isSelected()
Returns whether the YogiCheckBox is currently checked.
Returns:
the checked state of this component.

setSelected

public void setSelected(boolean state)
Set the selected value of the YogiCheckBox.

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

Parameters:
state - the desired checked state for this component.

getCellRendererComponent

public YogiComponent getCellRendererComponent(AbstractTable table,
                                              java.lang.Object value,
                                              boolean isSelected,
                                              boolean cellHasFocus)
Provided to implement the RendererFactory interface. Returns a YogiCheckBox customised to the arguments passed from the AbstractTable subclass.
Overrides:
getCellRendererComponent in class YogiLabel
Parameters:
table - The table for which the check box is rendering.
value - The object to be custom rendererd.
isSelected - The selected state of the object to be custom rendererd.
cellHasFocus - The focus state of the object to be custom rendererd.
Returns:
the custom rendered YogiCheckBox.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.