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

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.ProgressBarWidget
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener, SwingWidget, UnwrappedWidget, Widget

public class ProgressBarWidget
extends SimpleSwingWidget

Author:
kgajos

Field Summary
static int HORIZONTAL
           
protected  IntegerType integerType
           
protected  int orientation
           
protected  javax.swing.JProgressBar progressBar
           
static int VERTICAL
           
 
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
ProgressBarWidget(UiObject object, int orientation)
           
ProgressBarWidget(UiObject object, WidgetDescriptor wd, WidgetFactory f)
           
 
Method Summary
protected  WidgetDescriptor generateWidgetDescriptor()
          Subclasses can override this method if their widget descriptor include extra information
 int getOrientation()
           
 javax.swing.JComponent getSwingComponent(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
 java.lang.String toString()
           
protected  void updateProgressBar(java.lang.Object newValue)
           
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, getWidgetProperties, 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, getBag, getConcreteWidget, getCost, getParent, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, indexChanged, isEngaged, isEquivalent, legalValuesChanged, likelyValuesChanged, propertyChange, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setEnabled, 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, setEnabled, setParent, setSizeCache, setWrapper, unwrapWidget
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

progressBar

protected javax.swing.JProgressBar progressBar

orientation

protected int orientation

integerType

protected IntegerType integerType
Constructor Detail

ProgressBarWidget

public ProgressBarWidget(UiObject object,
                         int orientation)
Parameters:
object -

ProgressBarWidget

public ProgressBarWidget(UiObject object,
                         WidgetDescriptor wd,
                         WidgetFactory f)
Method Detail

getOrientation

public int getOrientation()

generateWidgetDescriptor

protected WidgetDescriptor generateWidgetDescriptor()
Description copied from class: AbstractWidget
Subclasses can override this method if their widget descriptor include extra information

Overrides:
generateWidgetDescriptor in class AbstractWidget
Returns:
a new widget descriptor for this widge

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 not modifiable and have and index

getSwingComponent

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

updateProgressBar

protected void updateProgressBar(java.lang.Object newValue)

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

toString

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