QualityAdapterpublic class QualityAdapter extends Object implements ActionListener, QualityControl
Fields Summary |
---|
protected float | preferredValue | protected float | minValue | protected float | maxValue | protected float | value | protected boolean | settable | protected boolean | isTSsupported | protected SliderComp | sliderComp | private float | scale |
Constructors Summary |
---|
public QualityAdapter(float preferred, float min, float max, boolean settable)
this(preferred,min,max,false,settable);
| public QualityAdapter(float preferred, float min, float max, boolean isTSsupported, boolean settable)
preferredValue = preferred;
minValue = min;
maxValue = max;
value = preferred;
this.settable = settable;
this.isTSsupported = isTSsupported;
|
Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent ae)
float newValue = sliderComp.getFloatValue() / scale;
setQuality(newValue);
| public java.awt.Component | getControlComponent()
if (sliderComp == null) {
sliderComp = new SliderComp(getName(),
minValue * scale,
maxValue * scale,
value * scale);
sliderComp.setActionListener(this);
}
return sliderComp;
| protected java.lang.String | getName()
return "Quality";
| public float | getPreferredQuality()
return preferredValue;
| public float | getQuality()
return value;
| public boolean | isTemporalSpatialTradeoffSupported()
return isTSsupported;
| public float | setQuality(float newValue)
if (newValue < minValue)
newValue = minValue;
else if (newValue > maxValue)
newValue = maxValue;
// if (newValue != value) {
value = newValue;
if (sliderComp != null) {
sliderComp.setValue(value * scale);
}
// }
if (settable)
return value;
else
return -1;
|
|