net.sf.fmj.ejmf.toolkit.gui.controls
Class MouseListenerControl

java.lang.Object
  extended by net.sf.fmj.ejmf.toolkit.gui.controls.AbstractListenerControl
      extended by net.sf.fmj.ejmf.toolkit.gui.controls.MouseListenerControl
All Implemented Interfaces:
Control
Direct Known Subclasses:
StandardFastForwardControl, StandardReverseControl

public abstract class MouseListenerControl
extends AbstractListenerControl

All button which require a mouse listener extend MouseListenerControl. Such buttons, for example, need to recognize mousePressed and mouseReleased as different events. MouseListenerControl supplies public methods for manipulating a control's EventListener as an MouseListener thereby providing type-safety at runtime.


Field Summary
 
Fields inherited from class net.sf.fmj.ejmf.toolkit.gui.controls.AbstractListenerControl
skin
 
Constructor Summary
protected MouseListenerControl(Skin skin)
          Create a MouseListenerControl
protected MouseListenerControl(Skin skin, Controller controller)
          Create a MouseListenerControl and associate it with a Controller.
 
Method Summary
protected  void addControlListener(java.util.EventListener listener)
          Add control semantics to this Control.
protected  void removeControlListener(java.util.EventListener listener)
          Remove control semantics from this Control.
 void setComponent(javax.swing.AbstractButton button)
          Type-safe way to set Control Component.
 void setComponentAndListener(javax.swing.AbstractButton button, java.awt.event.MouseListener listener)
          Type-safe way to set Control Component and control listener.
 void setControlListener(java.awt.event.MouseListener listener)
          Type-safe way to set Control listener.
 
Methods inherited from class net.sf.fmj.ejmf.toolkit.gui.controls.AbstractListenerControl
createControlComponent, createControlListener, getControlComponent, getController, getDefaultControlListener, initListener, isOperational, setComponent, setComponentAndListener, setController, setControllerHook, setControlListener, setOperational, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MouseListenerControl

protected MouseListenerControl(Skin skin,
                               Controller controller)
Create a MouseListenerControl and associate it with a Controller.

Parameters:
controller - A Controller with which control is to be associated.

MouseListenerControl

protected MouseListenerControl(Skin skin)
Create a MouseListenerControl

Method Detail

addControlListener

protected void addControlListener(java.util.EventListener listener)
Add control semantics to this Control.

Specified by:
addControlListener in class AbstractListenerControl
Parameters:
listener - java.util.EventListener representing control semantics to be added.

removeControlListener

protected void removeControlListener(java.util.EventListener listener)
Remove control semantics from this Control.

Specified by:
removeControlListener in class AbstractListenerControl
Parameters:
listener - java.util.EventListener representing control semantics to be removed.

setComponentAndListener

public void setComponentAndListener(javax.swing.AbstractButton button,
                                    java.awt.event.MouseListener listener)
Type-safe way to set Control Component and control listener.

Parameters:
button - An AbstractButton that serves as Control component.
listener - A ChangeListener that implements Control semantics.

setControlListener

public void setControlListener(java.awt.event.MouseListener listener)
Type-safe way to set Control listener.

Parameters:
listener - A ChangeListener that implements Control semantics.

setComponent

public void setComponent(javax.swing.AbstractButton button)
Type-safe way to set Control Component.

Parameters:
button - An AbstractButton that acts as control component.