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

AtomicControlAdapter

public class AtomicControlAdapter extends Object implements AtomicControl
An AtomicControl is one that can be treated as an individual control and can have its own behaviour. It is a base class for other controls.

Fields Summary
protected Component
component
VARIABLES
private Vector
listeners
protected boolean
isdefault
protected Control
parent
protected boolean
enabled
Constructors Summary
public AtomicControlAdapter(Component c, boolean def, Control parent)
METHODS


          

           
	component = c;
	isdefault = def;
	this.parent = parent;
    
Methods Summary
public voidaddControlChangeListener(com.sun.media.controls.ControlChangeListener ccl)
Add a listener that should be informed if any state of this control changes.

	if (listeners == null) {
	    listeners = new Vector();
	}
	if (ccl != null) {
	    listeners.addElement(ccl);
	}
    
public java.awt.ComponentgetControlComponent()

	return component;
    
public booleangetEnabled()
Returns the enabled/disabled state of the control.

	return enabled;
    
public javax.media.ControlgetParent()
Returns the control group to which this control belongs, if any. Otherwise it returns null.

	return parent;
    
public java.lang.StringgetTip()
Sun specific - Returns the description string for this control.

	return null;
    
public booleangetVisible()
Returns true if this control is available on the control panel. ???

	return true;
    
public voidinformListeners()

	if (listeners != null) {
	    for (int i = 0; i < listeners.size(); i++) {
		ControlChangeListener ccl =
		    (ControlChangeListener) listeners.elementAt(i);
		ccl.controlChanged( new ControlChangeEvent(this) );
	    }
	}
    
public booleanisDefault()
Returns true if this control is available on the default control panel returned for the player in question.

	return isdefault;
    
public booleanisReadOnly()

	return false;
    
public voidremoveControlChangeListener(com.sun.media.controls.ControlChangeListener ccl)
Remove an already added listener. Does nothing if the listener was not previously added.

	if (listeners != null && ccl != null)
	    listeners.removeElement(ccl);
    
public voidsetEnabled(boolean enabled)
Set the enabled/disabled state of the control. Can be useful to temporarily gray out a control due to some constraints.

	this.enabled = enabled;
	if (component != null)
	    component.setEnabled(enabled);
	informListeners();
    
public voidsetParent(javax.media.Control p)

	parent = p;
    
public voidsetTip(java.lang.String tip)
Sun specific - Sets the description string for this control. Should be short since it will be displayed as a tool tip when the mouse hovers over the control for a few seconds.

	//dummy
    
public voidsetVisible(boolean visible)
Specify whether this control should be available on the control panel. ???

	// dummy