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:
- createControlListener()
- createControlComponent()
- addControlListener(EventListener listener)
- removeControlListener(EventListener listener)
-
AbstractListenerControl()
- Create an AbstractListenerControl
-
AbstractListenerControl(Controller)
- Create an AbstractListenerControl
-
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.
-
createControlComponent()
-
Subclasses defined this method to supply their
GUI component.
-
createControlListener()
-
Subclasses of AbstractListenerControl
must define this method to supply an
EventListener to handle events originating
from control's component.
-
getControlComponent()
- Return Control Component as required by
Control inteface.
-
getController()
-
-
getDefaultControlListener()
-
-
initListener(EventListener)
- Initializes listener, establishes it as default
and registers it with Control Compoent.
-
isOperational()
-
Return the operational state of this Control.
-
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.
-
setComponent(Component)
- Set the GUI component associated with this Control.
-
setComponentAndListener(Component, EventListener)
- Set both GUI component and control listener associated
with this Control.
-
setController(Controller)
- Associates Controller with this Control.
-
setControllerHook(Controller)
- Subclasses override and provide the guts to
setControllerHook if they want to augment the
the work of setController.
-
setControlListener(EventListener)
- Set the control listener associated with this Control.
-
setOperational(boolean)
-
Set the operational state of this Control.
-
toString()
-
AbstractListenerControl
protected AbstractListenerControl()
- Create an AbstractListenerControl
AbstractListenerControl
protected AbstractListenerControl(Controller controller)
- Create an AbstractListenerControl
- Parameters:
- controller - Controller with which this control is associated.
setController
public void setController(Controller controller)
- Associates Controller with this Control.
- Parameters:
- controller - Controller with which this control is associated.
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.
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
getControlComponent
public Component getControlComponent()
- Return Control Component as required by
Control inteface.
- Returns:
- Control component
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
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.
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
getDefaultControlListener
protected EventListener getDefaultControlListener()
- Returns:
- the default listener for this Control.
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
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
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
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.
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.
setOperational
protected void setOperational(boolean flag)
- Set the operational state of this Control.
- Parameters:
- flag - Set to true to make control operational.
isOperational
public boolean isOperational()
- Return the operational state of this Control.
- Returns:
- true if control is operational
getController
public Controller getController()
- Returns:
- associated Controller.
All Packages Class Hierarchy This Package Previous Next Index