All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.controls.AbstractListenerControl

java.lang.Object
   |
   +----ejmf.toolkit.controls.AbstractListenerControl

public abstract class AbstractListenerControl
extends Object
implements Control
An AbstractListenerControl provides a Component-Listener model for Controls, allowing the two elements to be changed independently of each other.

This is the root class from which all EJMF control panel controls extend.

Subclasses must implement these methods:


Constructor Index

 o AbstractListenerControl()
Create an AbstractListenerControl
 o AbstractListenerControl(Controller)
Create an AbstractListenerControl

Method Index

 o addControlListener(EventListener)
Since different controls may have different types of listeners, each subclass should define addControlListener to register the correct type of listener with component.
 o createControlComponent()
Subclasses defined this method to supply their GUI component.
 o createControlListener()
Subclasses of AbstractListenerControl must define this method to supply an EventListener to handle events originating from control's component.
 o getControlComponent()
Return Control Component as required by Control inteface.
 o getController()
 o getDefaultControlListener()
 o initListener(EventListener)
Initializes listener, establishes it as default and registers it with Control Compoent.
 o isOperational()
Return the operational state of this Control.
 o removeControlListener(EventListener)
Since different controls may have different types of listeners, each subclass should define removeControlListener to remove listener from component listener list in a type-safe way.
 o setComponent(Component)
Set the GUI component associated with this Control.
 o setComponentAndListener(Component, EventListener)
Set both GUI component and control listener associated with this Control.
 o setController(Controller)
Associates Controller with this Control.
 o setControllerHook(Controller)
Subclasses override and provide the guts to setControllerHook if they want to augment the the work of setController.
 o setControlListener(EventListener)
Set the control listener associated with this Control.
 o setOperational(boolean)
Set the operational state of this Control.
 o toString()

Constructors

 o AbstractListenerControl
 protected AbstractListenerControl()
Create an AbstractListenerControl

 o AbstractListenerControl
 protected AbstractListenerControl(Controller controller)
Create an AbstractListenerControl

Parameters:
controller - Controller with which this control is associated.

Methods

 o setController
 public void setController(Controller controller)
Associates Controller with this Control.

Parameters:
controller - Controller with which this control is associated.
 o setControllerHook
 protected void setControllerHook(Controller controller)
Subclasses override and provide the guts to setControllerHook if they want to augment the the work of setController.

Parameters:
controller - Controller with which this control is associated.
 o initListener
 protected void initListener(EventListener listener)
Initializes listener, establishes it as default and registers it with Control Compoent.

Parameters:
listener - Listener object for this control
 o getControlComponent
 public Component getControlComponent()
Return Control Component as required by Control inteface.

Returns:
Control component
 o setControlListener
 protected void setControlListener(EventListener listener)
Set the control listener associated with this Control.

Subclasses should override this method to provide a type-safe public version.

Parameters:
listener - Listener object for this control
 o setComponent
 protected void setComponent(Component component)
Set the GUI component associated with this Control.

Subclasses should override this method to provide a type-safe public version.

Parameters:
component - Component to associate with this control.
 o setComponentAndListener
 protected void setComponentAndListener(Component component,
                                        EventListener listener)
Set both GUI component and control listener associated with this Control.

Subclasses should override this method to provide a type-safe public version.

Parameters:
component - Component to associate with this control.
listener - Listener object for this control
 o getDefaultControlListener
 protected EventListener getDefaultControlListener()
Returns:
the default listener for this Control.
 o toString
 public String toString()
Returns:
fully-qualified class name. This value can be used as search key in response to Controller.getControl(name)
Overrides:
toString in class Object
 o createControlListener
 protected abstract EventListener createControlListener()
Subclasses of AbstractListenerControl must define this method to supply an EventListener to handle events originating from control's component.

Subclasses must not return a null listener.

Returns:
an EventListener
 o createControlComponent
 protected abstract Component createControlComponent()
Subclasses defined this method to supply their GUI component. Subclasses must not return a null component.

Listener registration is handled by AbstractListenerControl.

Returns:
a Component
 o addControlListener
 protected abstract void addControlListener(EventListener listener)
Since different controls may have different types of listeners, each subclass should define addControlListener to register the correct type of listener with component.

Parameters:
listener - Listener object to be added.
 o removeControlListener
 protected abstract void removeControlListener(EventListener listener)
Since different controls may have different types of listeners, each subclass should define removeControlListener to remove listener from component listener list in a type-safe way.

Parameters:
listener - Listener object to be removed.
 o setOperational
 protected void setOperational(boolean flag)
Set the operational state of this Control.

Parameters:
flag - Set to true to make control operational.
 o isOperational
 public boolean isOperational()
Return the operational state of this Control.

Returns:
true if control is operational
 o getController
 public Controller getController()
Returns:
associated Controller.

All Packages  Class Hierarchy  This Package  Previous  Next  Index