FileDocCategorySizeDatePackage
BitRateAdapter.javaAPI DocJMF 2.1.1e1717Mon May 12 12:20:56 BST 2003com.sun.media.controls

BitRateAdapter

public class BitRateAdapter extends Object implements ActionListener, BitRateControl

Fields Summary
protected int
value
protected int
min
protected int
max
protected boolean
settable
protected TextComp
textComp
Constructors Summary
public BitRateAdapter(int initialBitRate, int minBitRate, int maxBitRate, boolean settable)

	value = initialBitRate;
	min = minBitRate;
	max = maxBitRate;
	this.settable = settable;
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent ae)

	if (textComp != null) {
	    setBitRate(textComp.getIntValue());
	}
    
public intgetBitRate()

	return value;
    
public java.awt.ComponentgetControlComponent()

	if (textComp == null) {
	    textComp = new TextComp(getName(), Integer.toString(value),
				    7, settable);
	    textComp.setActionListener(this);
	}
	return textComp;
    
public intgetMaxSupportedBitRate()

	return max;
    
public intgetMinSupportedBitRate()

	return min;
    
protected java.lang.StringgetName()

	return "Bit Rate";
    
public intsetBitRate(int newValue)

	if (settable) {
	    if (newValue < min)
		newValue = min;
	    if (newValue > max)
		newValue = max;
//	    if (newValue != value) {
            value = newValue;
            if (textComp != null)
                textComp.setValue(Integer.toString(newValue));
//	    }
	    return value;
	} else
	    return -1;