Java DTV API 1.3
18-Nov-2009

com.sun.dtv.lwuit
Class RadioButton

java.lang.Object
  extended by com.sun.dtv.lwuit.Component
      extended by com.sun.dtv.lwuit.Label
          extended by com.sun.dtv.lwuit.Button
              extended by com.sun.dtv.lwuit.RadioButton
All Implemented Interfaces:
Animation, StyleListener, Animated, MatteEnabled, ViewOnlyComponent

public class RadioButton
extends Button

RadioButton is a Button that maintains a selection state exclusively within a specific ButtonGroup.


Field Summary
 
Fields inherited from class com.sun.dtv.lwuit.Button
STATE_DEFAULT, STATE_PRESSED, STATE_ROLLOVER
 
Fields inherited from class com.sun.dtv.lwuit.Component
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
 
Fields inherited from interface com.sun.dtv.ui.ViewOnlyComponent
HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_JUSTIFIED, HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_RIGHT, SCALE_ASPECT_PROOF, SCALE_NO, SCALE_NO_ASPECT_PROOF, STATE_DISABLED, STATE_ENABLED, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_JUSTIFIED, VERTICAL_ALIGN_TOP
 
Fields inherited from interface com.sun.dtv.ui.Animated
ALTERNATING, LOOP, REPEATING
 
Constructor Summary
RadioButton()
          Creates an empty radio button.
RadioButton(Image icon)
          Constructs a radio with the given icon.
RadioButton(String text)
          Constructs a radio with the given text.
RadioButton(String text, Image icon)
          Constructs a radio with the given text and icon.
 
Method Summary
 boolean isSelected()
          Returns true if the radio button is selected.
 void paint(Graphics g)
          This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.
 void setSelected(boolean selected)
          Selects the current radio button.
 String toString()
          Overriden to return a useful value for debugging purposes.
 
Methods inherited from class com.sun.dtv.lwuit.Button
addActionListener, getPressedIcon, getRolloverIcon, getState, keyPressed, keyReleased, pointerPressed, pointerReleased, removeActionListener, setPressedIcon, setRolloverIcon
 
Methods inherited from class com.sun.dtv.lwuit.Label
animate, getAlignment, getAnimateContent, getBaselineResizeBehavior, getGap, getGraphicContent, getHorizontalAlignment, getIcon, getInteractionState, getMatte, getScalingMode, getShiftText, getText, getTextContent, getTextLayoutManager, getTextPosition, getVerticalAlignment, isDoubleBuffered, isEndsWith3Points, isOpaque, isTickerEnabled, isTickerRunning, processEvent, setAlignment, setAnimateContent, setEndsWith3Points, setGap, setGraphicContent, setHorizontalAlignment, setIcon, setInteractionState, setMatte, setScalingMode, setShiftText, setText, setTextContent, setTextLayoutManager, setTextPosition, setTickerEnabled, setVerticalAlignment, startTicker, stopTicker
 
Methods inherited from class com.sun.dtv.lwuit.Component
addFocusListener, calcPreferredSize, contains, deinitialize, getAbsoluteX, getAbsoluteY, getAnimationMode, getBaseline, getBottomGap, getBounds, getClientProperty, getComponentForm, getDelay, getHeight, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPosition, getPreferredSize, getRepetitionMode, getScrollAnimationSpeed, getScrollX, getScrollY, getSideGap, getStyle, getUIID, getWidth, getX, getY, handlesInput, hasFocus, initialize, isEnabled, isFocusable, isFocusPainted, isInitialized, isRunning, isScrollableX, isScrollableY, isScrollVisible, isSmoothScrolling, isVisible, jumpTo, keyRepeated, longKeyPress, paintBackgrounds, paintComponent, paintComponent, pointerDragged, putClientProperty, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, setAnimationMode, setCellRenderer, setDelay, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setHeight, setInitialized, setIsScrollVisible, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredSize, setRepetitionMode, setScrollAnimationSpeed, setScrollX, setScrollY, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setStyle, setUIID, setVisible, setWidth, setX, setY, start, stop, styleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RadioButton

public RadioButton(String text)
Constructs a radio with the given text.

Parameters:
text - to display next to the button

RadioButton

public RadioButton()
Creates an empty radio button.


RadioButton

public RadioButton(Image icon)
Constructs a radio with the given icon.

Parameters:
icon - icon to show next to the button

RadioButton

public RadioButton(String text,
                   Image icon)
Constructs a radio with the given text and icon.

Parameters:
text - to display next to the button
icon - icon to show next to the button
Method Detail

toString

public String toString()
Description copied from class: Component
Overriden to return a useful value for debugging purposes. Overrides Object.toString.

Overrides:
toString in class Component
Returns:
a string representation of this component

isSelected

public boolean isSelected()
Returns true if the radio button is selected.

Returns:
true if the radio button is selected

setSelected

public void setSelected(boolean selected)
Selects the current radio button.

Parameters:
selected - value for selection

paint

public void paint(Graphics g)
Description copied from class: Component
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.

Specified by:
paint in interface Animation
Specified by:
paint in interface ViewOnlyComponent
Overrides:
paint in class Button
Parameters:
g - the component graphics

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.