edu.washington.cs.supple.wlib.java2
Class AbstractImageBasedWidget
java.lang.Object
edu.washington.cs.supple.render.AbstractWidget
edu.washington.cs.supple.render.SimpleWidget
edu.washington.cs.supple.wlib.java2.AbstractImageBasedWidget
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener, SwingWidget, UnwrappedWidget, Widget
- Direct Known Subclasses:
- ImageWidget, SimpleMapWidget
- public abstract class AbstractImageBasedWidget
- extends SimpleWidget
- implements SwingWidget
- Author:
- kgajos
|
Method Summary |
protected javax.swing.JComponent |
createImageLabel(int hints)
|
protected WidgetDescriptor |
generateWidgetDescriptor()
Subclasses can override this method if their widget descriptor include
extra information |
double |
getDownsample()
returns the factor by which this widget will scale down images from their
desired size (as specified in the corresponding ImageType) |
protected void |
setCurImage(java.awt.Image i)
|
protected void |
setCurImage(javax.swing.ImageIcon newIcon)
|
java.lang.String |
toString()
|
protected void |
updateImage(java.lang.Object o)
sets the internal var representing the current image to be displayed and
updates the widgets |
| Methods inherited from class edu.washington.cs.supple.render.AbstractWidget |
anotherPropertyChanged, clone, clone, disengage, dismissCurrentView, displayDynamic, engage, equals, executeAction, getBag, getConcreteWidget, getConcreteWidget, getCost, getParent, getPath, getSize, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, getWidgetProperties, indexChanged, isEngaged, isEquivalent, legalValuesChanged, likelyValuesChanged, propertyChange, rendersObject, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setEnabled, setParent, setSizeCache, setValue, setWrapper, unwrapWidget, valueChanged |
| 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, getWidgetProperties, hasChildren, isEngaged, isEquivalent, setBag, setCost, setEnabled, setParent, setSizeCache, setWrapper, unwrapWidget |
IMAGE_NOT_AVAILABLE
protected java.lang.String IMAGE_NOT_AVAILABLE
DOWNSAMPLE_PROPERTY
public static final java.lang.String DOWNSAMPLE_PROPERTY
- See Also:
- Constant Field Values
curImage
protected java.awt.Image curImage
curImageIcon
protected javax.swing.ImageIcon curImageIcon
imageLabel
protected javax.swing.JLabel imageLabel
width
protected int width
height
protected int height
desiredWidth
protected int desiredWidth
desiredHeight
protected int desiredHeight
imageWidth
protected int imageWidth
imageHeight
protected int imageHeight
downsample
protected double downsample
AbstractImageBasedWidget
public AbstractImageBasedWidget(UiObject object,
int width,
int height,
int desiredWith,
int desiredHeight)
- Parameters:
object -
AbstractImageBasedWidget
public AbstractImageBasedWidget(UiObject object,
WidgetDescriptor wd,
WidgetFactory f)
getDownsample
public double getDownsample()
- returns the factor by which this widget will scale down images from their
desired size (as specified in the corresponding ImageType)
- Returns:
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
createImageLabel
protected javax.swing.JComponent createImageLabel(int hints)
setCurImage
protected void setCurImage(java.awt.Image i)
setCurImage
protected void setCurImage(javax.swing.ImageIcon newIcon)
updateImage
protected void updateImage(java.lang.Object o)
- sets the internal var representing the current image to be displayed and
updates the widgets
- Parameters:
o - the new image
toString
public java.lang.String toString()
- Overrides:
toString in class AbstractWidget