edu.washington.cs.supple.wlib.java2
Class AbstractRadioButtonWidget

java.lang.Object
  extended byedu.washington.cs.supple.render.AbstractWidget
      extended byedu.washington.cs.supple.render.SimpleWidget
          extended byedu.washington.cs.supple.wlib.java2.AbstractRadioButtonWidget
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener, SwingWidget, UnwrappedWidget, Widget
Direct Known Subclasses:
HorizontalRadioButtonWidget, HorizontalToggleButtonSetWidget, VerticalRadioButtonWidget, VerticalToggleButtonSetWidget

public abstract class AbstractRadioButtonWidget
extends SimpleWidget
implements SwingWidget

Author:
kgajos

Field Summary
protected  java.util.Hashtable buttons
           
 
Fields inherited from class edu.washington.cs.supple.render.AbstractWidget
bag, cost, engaged, object, parent, stateVar, textLabel, type, widgetDescriptor, wrapper
 
Fields inherited from interface edu.washington.cs.supple.render.Widget
MAX_HINT, NO_BORDER, NO_NAME, TOP_LEVEL_WIDGET
 
Constructor Summary
AbstractRadioButtonWidget(UiObject object)
           
 
Method Summary
protected  void deselectAllButtons()
           
 javax.swing.JComponent getSwingComponent(int hints)
           
 WidgetProperties getWidgetProperties()
          Returns the corresponding WidgetProperties
protected  javax.swing.JToggleButton makeButton(java.lang.Object value)
          Creates a button for a given value
protected abstract  javax.swing.JPanel makePanel(int hints)
           
static boolean rendersObject(UiObject object)
          A static method for testing the applicability of the widget given a type of the UI component to be rendered
protected  void setButtonValue(java.lang.Object v)
          Ensures that the button state reflects the selection of the value passed in as the input
 void setEnabled(boolean active)
          This method is exposed only so that wrappers can access it; others should stay away
protected  void valueChanged(java.beans.PropertyChangeEvent evt)
          Subclasses should override this method if they want to update display the value of the underlying type changes
 
Methods inherited from class edu.washington.cs.supple.render.SimpleWidget
childIterator, getEffortEstimate, hasChildren
 
Methods inherited from class edu.washington.cs.supple.render.AbstractWidget
anotherPropertyChanged, clone, clone, disengage, dismissCurrentView, displayDynamic, engage, equals, executeAction, generateWidgetDescriptor, getBag, getConcreteWidget, getConcreteWidget, getCost, getParent, getPath, getSize, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, indexChanged, isEngaged, isEquivalent, legalValuesChanged, likelyValuesChanged, propertyChange, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setParent, setSizeCache, setValue, setWrapper, toString, unwrapWidget
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.washington.cs.supple.render.Widget
childIterator, clone, clone, disengage, engage, getBag, getConcreteWidget, getConcreteWidget, getCost, getEffortEstimate, getPath, getSize, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, hasChildren, isEngaged, isEquivalent, setBag, setCost, setParent, setSizeCache, setWrapper, unwrapWidget
 

Field Detail

buttons

protected java.util.Hashtable buttons
Constructor Detail

AbstractRadioButtonWidget

public AbstractRadioButtonWidget(UiObject object)
Method Detail

getWidgetProperties

public WidgetProperties getWidgetProperties()
Description copied from interface: Widget
Returns the corresponding WidgetProperties

Specified by:
getWidgetProperties in interface Widget
Overrides:
getWidgetProperties in class AbstractWidget
Returns:
properties associated with this widget

rendersObject

public static boolean rendersObject(UiObject object)
A static method for testing the applicability of the widget given a type of the UI component to be rendered

Returns:
true for instances of types that are enumerable and that have indexes

getSwingComponent

public javax.swing.JComponent getSwingComponent(int hints)
Specified by:
getSwingComponent in interface SwingWidget
Parameters:
hints - specifies the variant of the widget to be rendered
Returns:
a renderable component

makePanel

protected abstract javax.swing.JPanel makePanel(int hints)

makeButton

protected javax.swing.JToggleButton makeButton(java.lang.Object value)
Creates a button for a given value

Parameters:
value - the value to create a button for
Returns:
the button

setButtonValue

protected void setButtonValue(java.lang.Object v)
Ensures that the button state reflects the selection of the value passed in as the input

Parameters:
v - the new value to be shown

deselectAllButtons

protected void deselectAllButtons()

valueChanged

protected void valueChanged(java.beans.PropertyChangeEvent evt)
Description copied from class: AbstractWidget
Subclasses should override this method if they want to update display the value of the underlying type changes

Overrides:
valueChanged in class AbstractWidget
Parameters:
evt - property change event with details

setEnabled

public void setEnabled(boolean active)
Description copied from interface: Widget
This method is exposed only so that wrappers can access it; others should stay away

Specified by:
setEnabled in interface Widget
Overrides:
setEnabled in class AbstractWidget
Parameters:
active - indicates if the underlying object is active