public abstract class AbstractListenerControl extends java.lang.Object implements Control
This is the root class from which all EJMF control panel controls extend.
Subclasses must implement these methods:
Modifier | Constructor and Description |
---|---|
protected |
AbstractListenerControl(Skin skin)
Create an AbstractListenerControl
|
protected |
AbstractListenerControl(Skin skin,
Controller controller)
Create an AbstractListenerControl
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addControlListener(java.util.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.
|
protected abstract java.awt.Component |
createControlComponent(Skin skin)
Subclasses defined this method to supply their
GUI component.
|
protected abstract java.util.EventListener |
createControlListener()
Subclasses of AbstractListenerControl
must define this method to supply an
EventListener to handle events originating
from control's component.
|
java.awt.Component |
getControlComponent()
Return Control Component as required by
Control inteface.
|
Controller |
getController() |
protected java.util.EventListener |
getDefaultControlListener() |
protected void |
initListener(java.util.EventListener listener)
Initializes listener, establishes it as default
and registers it with Control Compoent.
|
boolean |
isOperational()
Return the operational state of this Control.
|
protected abstract void |
removeControlListener(java.util.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.
|
protected void |
setComponent(java.awt.Component component)
Set the GUI component associated with this Control.
|
protected void |
setComponentAndListener(java.awt.Component component,
java.util.EventListener listener)
Set both GUI component and control listener associated
with this Control.
|
void |
setController(Controller controller)
Associates Controller with this Control.
|
protected void |
setControllerHook(Controller controller)
Subclasses override and provide the guts to
setControllerHook if they want to augment the
the work of setController.
|
protected void |
setControlListener(java.util.EventListener listener)
Set the control listener associated with this Control.
|
protected void |
setOperational(boolean flag)
Set the operational state of this Control.
|
java.lang.String |
toString() |
protected final Skin skin
protected AbstractListenerControl(Skin skin)
protected AbstractListenerControl(Skin skin, Controller controller)
controller
- Controller with which this control is associated.public void setController(Controller controller)
controller
- Controller with which this control is associated.java.lang.IllegalArgumentException
- is thrown if attempt is made to set Controller
a second time.protected void setControllerHook(Controller controller)
controller
- Controller with which this control is associated.protected void initListener(java.util.EventListener listener)
listener
- Listener object for this controlpublic java.awt.Component getControlComponent()
getControlComponent
in interface Control
protected void setControlListener(java.util.EventListener listener)
Subclasses should override this method to provide a type-safe public version.
listener
- Listener object for this controlprotected void setComponent(java.awt.Component component)
Subclasses should override this method to provide a type-safe public version.
component
- Component to associate with this control.protected void setComponentAndListener(java.awt.Component component, java.util.EventListener listener)
Subclasses should override this method to provide a type-safe public version.
component
- Component to associate with this control.listener
- Listener object for this controlprotected java.util.EventListener getDefaultControlListener()
public java.lang.String toString()
toString
in class java.lang.Object
protected abstract java.util.EventListener createControlListener()
Subclasses must not return a null listener.
protected abstract java.awt.Component createControlComponent(Skin skin)
Listener registration is handled by AbstractListenerControl.
protected abstract void addControlListener(java.util.EventListener listener)
listener
- Listener object to be added.protected abstract void removeControlListener(java.util.EventListener listener)
listener
- Listener object to be removed.protected void setOperational(boolean flag)
flag
- Set to true to make control operational.public boolean isOperational()
public Controller getController()