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

java.lang.Object
  extended byedu.washington.cs.supple.render.AbstractWidget
      extended byedu.washington.cs.supple.render.SimpleWidget
          extended byedu.washington.cs.supple.wlib.java2.SimpleSwingWidget
              extended byedu.washington.cs.supple.wlib.java2.SpinnerWidget
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener, SwingWidget, UnwrappedWidget, Widget
Direct Known Subclasses:
TouchSpinnerWidget

public class SpinnerWidget
extends SimpleSwingWidget

Author:
kgajos

Field Summary
 IntegerType intType
           
protected  javax.swing.JSpinner spinner
           
 
Fields inherited from class edu.washington.cs.supple.wlib.java2.SimpleSwingWidget
currentComponent, finalComponent
 
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
SpinnerWidget(UiObject object)
           
 
Method Summary
 javax.swing.JComponent getSwingComponent(int hints)
           
 WidgetProperties getWidgetProperties()
          Returns the corresponding WidgetProperties
protected  void legalValuesChanged(java.beans.PropertyChangeEvent evt)
          reacts to the change in the list of legal values in the underlying object
protected  javax.swing.JSpinner makeSpinner(javax.swing.SpinnerModel model)
           
protected  javax.swing.SpinnerModel makeSpinnerModel()
          Creates spinner model that is adequate to the underlying data type
protected  javax.swing.SpinnerModel makeSpinnerModel(java.util.Vector data)
           
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
 void setEnabled(boolean enabled)
          This method is exposed only so that wrappers can access it; others should stay away
 java.lang.String toString()
           
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.wlib.java2.SimpleSwingWidget
engage, getConcreteWidget, getSize, refreshDisplay
 
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, equals, executeAction, generateWidgetDescriptor, getBag, getConcreteWidget, getCost, getParent, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, indexChanged, isEngaged, isEquivalent, likelyValuesChanged, propertyChange, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setParent, setSizeCache, setValue, setWrapper, 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, getBag, getConcreteWidget, getCost, getEffortEstimate, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, hasChildren, isEngaged, isEquivalent, setBag, setCost, setParent, setSizeCache, setWrapper, unwrapWidget
 

Field Detail

intType

public IntegerType intType

spinner

protected javax.swing.JSpinner spinner
Constructor Detail

SpinnerWidget

public SpinnerWidget(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 SimpleSwingWidget
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 all modifiable instances of the Integer type and for enumerable types with an ordering; false otherwise

getSwingComponent

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

makeSpinner

protected javax.swing.JSpinner makeSpinner(javax.swing.SpinnerModel model)

makeSpinnerModel

protected javax.swing.SpinnerModel makeSpinnerModel(java.util.Vector data)

makeSpinnerModel

protected javax.swing.SpinnerModel makeSpinnerModel()
Creates spinner model that is adequate to the underlying data type

Returns:
new SpinnerModel

toString

public java.lang.String toString()
Overrides:
toString in class AbstractWidget

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

legalValuesChanged

protected void legalValuesChanged(java.beans.PropertyChangeEvent evt)
reacts to the change in the list of legal values in the underlying object

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

setEnabled

public void setEnabled(boolean enabled)
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:
enabled - indicates if the underlying object is active