All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.actions.GenericResponder

java.lang.Object
   |
   +----quicktime.app.actions.MouseResponder
           |
           +----quicktime.app.actions.GenericResponder

public class GenericResponder
extends MouseResponder
This is a generic responder for MouseEvents. It places no conditions on the the containing space or target. An application can also register QTMouseListeners and MouseListeners with this responder in which case the GenericResponder will invoke the appropriate method on the registered listeners.


Variable Index

 o space
This is the QTDrawable space within which the Dragger's target is enclosed and contained
 o target
This is the Transformable target of the Dragger action

Constructor Index

 o GenericResponder(int, int, int)
Set some parameters that will create a GenericResponder that will respond to all mouse events (including mouseMoveTarget events).

Method Index

 o addMouseListener(MouseListener)
Registers a MouseListener to this responder.
 o addMouseMotionListener(MouseMotionListener)
Registers a MouseListener to this responder.
 o addQTMouseMotionListener(QTMouseMotionListener)
Registers a QTMouseMotionListener to this responder.
 o asAnyMouseListener(int, int)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseListener, MouseMotionListener or QTMouseMotionListener interfaces.
 o asMouseListener(int, int)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseListener interface.
 o asMouseMotionListener(int, int)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseMotionListener interface.
 o asMouseOrMouseMotionListener(int, int)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseListener or MouseMotionListener interfaces.
 o asQTMouseMotionListener(int, int)
Creates a GenericResponder that is interested in mouse events that are covered by the QTMouseMotionListener interface.
 o asRolloverListener(int, int)
Creates a GenericResponder that is interested in mouse events that are covered by the QTMouseMotionListener interface.
 o getSpace()
Returns the Space that the controller has been attached too.
 o getTarget()
Returns the Target that the controller is currently controlling.
 o isAppropriate(Object)
The MouseController delegates the appropriateness of objects that it can control to the MouseResponder.
 o mouseClicked(MouseEvent)
Invoked when the mouse has been clicked on a found and valid target within the enclosing space.
 o mouseDragged(MouseEvent)
Invoked when the mouse has been dragged on a found and valid target within the enclosing space.
 o mouseEntered(MouseEvent)
Invoked when the mouse enters a QTDrawable space.
 o mouseEnteredTarget(MouseEvent)
Invoked when a mouseMoved event enters a Target within an enclosing space.
 o mouseExited(MouseEvent)
Invoked when the mouse exits a QTDrawable space.
 o mouseExitedTarget(MouseEvent)
Invoked when a mouseMoved event exits a Target within an enclosing space.
 o mouseMoved(MouseEvent)
Invoked when the mouse button has been moved over a space.
 o mousePressed(MouseEvent)
Invoked when the mouse has been pressed on a found and valid target within the enclosing space.
 o mouseReleased(MouseEvent)
Invoked when the mouse has been released after being pressed on a found and valid target within the enclosing space.
 o removeMouseListener(MouseListener)
Removes the specified MouseListener from the GenericResponder.
 o removeMouseMotionListener(MouseMotionListener)
Removes the specified MouseListener from the GenericResponder.
 o removeQTMouseMotionListener(QTMouseMotionListener)
Removes the specified QTMouseMotionListener from the GenericResponder.
 o removeTarget()
When the Responder is deactivated from the MouseController the controller uses this method to tell the Responder that it no longer has a target to act upon
 o setTarget(Object)
This method is called by the MouseController when it has returned a target (say from a mousePressed event) and the Controller sets the target that the MouseResponder will then respond to.
 o setTargetSpace(Object)
The MouseController asks its MouseResponder if the space it has been added to is an appropriate Space for the MouseResponder to deal with.

Variables

 o target
 protected Object target
This is the Transformable target of the Dragger action

 o space
 protected Object space
This is the QTDrawable space within which the Dragger's target is enclosed and contained

Constructors

 o GenericResponder
 public GenericResponder(int modifierKeyMask,
                         int modifierTestConditions,
                         int eventTypes)
Set some parameters that will create a GenericResponder that will respond to all mouse events (including mouseMoveTarget events).

Parameters:
modifierKeyMask - determines which modifier keys (or none) which must be depressed for the action to be invoked.
modifierTestConditions - determines the conditions under which the responder is activated when the specified modifierKeyMask conditions are met.
eventTypes - specifies the mouse event types that the responder is interested in.

Methods

 o asMouseListener
 public static GenericResponder asMouseListener(int modifierKeyMask,
                                                int modifierTestConditions)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseListener interface.

Parameters:
modifierKeyMask - the state of the modifier keys to activate this responder
modifierTestConditions - the match criteria that are applied to the modifier keys
Returns:
a GenericResponder
See Also:
kMouseEvents
 o asMouseMotionListener
 public static GenericResponder asMouseMotionListener(int modifierKeyMask,
                                                      int modifierTestConditions)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseMotionListener interface.

Parameters:
modifierKeyMask - the state of the modifier keys to activate this responder
modifierTestConditions - the match criteria that are applied to the modifier keys
Returns:
a GenericResponder
See Also:
kMouseMotionEvents
 o asMouseOrMouseMotionListener
 public static GenericResponder asMouseOrMouseMotionListener(int modifierKeyMask,
                                                             int modifierTestConditions)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseListener or MouseMotionListener interfaces.

Parameters:
modifierKeyMask - the state of the modifier keys to activate this responder
modifierTestConditions - the match criteria that are applied to the modifier keys
Returns:
a GenericResponder
See Also:
kMouseOrMouseMotionEvents
 o asQTMouseMotionListener
 public static GenericResponder asQTMouseMotionListener(int modifierKeyMask,
                                                        int modifierTestConditions)
Creates a GenericResponder that is interested in mouse events that are covered by the QTMouseMotionListener interface. This is ideal for doing rollover effects on member objects in a QT space where the objects are stationary as these objects have no need for the MouseExit event.

Parameters:
modifierKeyMask - the state of the modifier keys to activate this responder
modifierTestConditions - the match criteria that are applied to the modifier keys
Returns:
a GenericResponder
See Also:
kQTMouseMotionEvents
 o asRolloverListener
 public static GenericResponder asRolloverListener(int modifierKeyMask,
                                                   int modifierTestConditions)
Creates a GenericResponder that is interested in mouse events that are covered by the QTMouseMotionListener interface. This is ideal for doing rollover effects on member objects in a QT space where the objects can be repositioned by dragging by the user as the object is notified by a MouseExit method from the MouseListener interest.

Parameters:
modifierKeyMask - the state of the modifier keys to activate this responder
modifierTestConditions - the match criteria that are applied to the modifier keys
Returns:
a GenericResponder
See Also:
kRolloverEvents
 o asAnyMouseListener
 public static GenericResponder asAnyMouseListener(int modifierKeyMask,
                                                   int modifierTestConditions)
Creates a GenericResponder that is interested in mouse events that are covered by the MouseListener, MouseMotionListener or QTMouseMotionListener interfaces.

Parameters:
modifierKeyMask - the state of the modifier keys to activate this responder
modifierTestConditions - the match criteria that are applied to the modifier keys
Returns:
a GenericResponder
See Also:
kAnyMouseEvent
 o setTargetSpace
 protected void setTargetSpace(Object s)
The MouseController asks its MouseResponder if the space it has been added to is an appropriate Space for the MouseResponder to deal with. If not the MouseResponder subclass that implements this method throws a ClassCastException and the MouseController will not be added to the Space.

Parameters:
s - the Space to which the responder's controller has been added.
Overrides:
setTargetSpace in class MouseResponder
 o setTarget
 protected void setTarget(Object target)
This method is called by the MouseController when it has returned a target (say from a mousePressed event) and the Controller sets the target that the MouseResponder will then respond to.

Parameters:
target - the object that is the selected target of the MouseEvent
Overrides:
setTarget in class MouseResponder
 o removeTarget
 protected void removeTarget()
When the Responder is deactivated from the MouseController the controller uses this method to tell the Responder that it no longer has a target to act upon

Overrides:
removeTarget in class MouseResponder
 o getSpace
 public Object getSpace()
Returns the Space that the controller has been attached too.

Returns:
the container space.
 o getTarget
 public Object getTarget()
Returns the Target that the controller is currently controlling. This will be null if the mouse event is not targetted, or the Responder is not currently responding to a mouse event.

Returns:
the current target or null
 o isAppropriate
 public boolean isAppropriate(Object object)
The MouseController delegates the appropriateness of objects that it can control to the MouseResponder. The MouseResponder returns true if the given object is the type of object that it can control.

Parameters:
object - the object to test
Returns:
true if the object is the type of object that the Responder can control
Overrides:
isAppropriate in class MouseResponder
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a found and valid target within the enclosing space.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseClicked in class MouseResponder
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Invoked when the mouse enters a QTDrawable space. There is no target set for events of this kind.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseEntered in class MouseResponder
 o mouseExited
 public void mouseExited(MouseEvent e)
Invoked when the mouse exits a QTDrawable space. There is no target set for events of this kind.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseExited in class MouseResponder
 o mouseEnteredTarget
 public void mouseEnteredTarget(MouseEvent e)
Invoked when a mouseMoved event enters a Target within an enclosing space. The Target is set for events of this kind.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseEnteredTarget in class MouseResponder
 o mouseExitedTarget
 public void mouseExitedTarget(MouseEvent e)
Invoked when a mouseMoved event exits a Target within an enclosing space. The Target is set for events of this kind.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseExitedTarget in class MouseResponder
 o mouseMoved
 public void mouseMoved(MouseEvent e)
Invoked when the mouse button has been moved over a space. There is no target set for events of this kind. (with no buttons no down).

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseMoved in class MouseResponder
 o mousePressed
 public void mousePressed(MouseEvent e)
Invoked when the mouse has been pressed on a found and valid target within the enclosing space.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mousePressed in class MouseResponder
 o mouseDragged
 public void mouseDragged(MouseEvent e)
Invoked when the mouse has been dragged on a found and valid target within the enclosing space. This method is only called if the responder has been activated by a mouse pressed event.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseDragged in class MouseResponder
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Invoked when the mouse has been released after being pressed on a found and valid target within the enclosing space.

Parameters:
e - the MouseEvent that triggered this event
Overrides:
mouseReleased in class MouseResponder
 o addQTMouseMotionListener
 public void addQTMouseMotionListener(QTMouseMotionListener ql)
Registers a QTMouseMotionListener to this responder. The listener will be invoked with any of the mouse events the responder is invoked by. If the Responder has not been created to listen to these type of events then the listener will not be registered. The application can test this by calling:
		myGenericResponder.isInterested (MouseResponder.kQTMouseMotionEvents)
 
The intereste in mouseMotionEvents is a contained interest of QTMouseMotion events, and is thus the minimal requirement to register this kind of listener.

Parameters:
ql - the new QTMouseMotionListener
 o removeQTMouseMotionListener
 public void removeQTMouseMotionListener(QTMouseMotionListener ql)
Removes the specified QTMouseMotionListener from the GenericResponder.

Parameters:
ql - the QTMouseMotionListener to remove
 o addMouseListener
 public void addMouseListener(MouseListener ml)
Registers a MouseListener to this responder. The listener will be invoked with any of the mouse events the responder is invoked by. If the Responder has not been created to listen to these type of events then the listener will not be registered. The application can test this by calling:
		myGenericResponder.isInterested (MouseResponder.kMouseEvents)
 

Parameters:
ml - the new MouseListener
 o removeMouseListener
 public void removeMouseListener(MouseListener ml)
Removes the specified MouseListener from the GenericResponder.

Parameters:
ml - the MouseListener to remove
 o addMouseMotionListener
 public void addMouseMotionListener(MouseMotionListener ml)
Registers a MouseListener to this responder. The listener will be invoked with any of the mouse events the responder is invoked by. If the Responder has not been created to listen to these type of events then the listener will not be registered. The application can test this by calling:
		myGenericResponder.isInterested (MouseResponder.kMouseMotionEvents)
 

Parameters:
ml - the new MouseListener
 o removeMouseMotionListener
 public void removeMouseMotionListener(MouseMotionListener ml)
Removes the specified MouseListener from the GenericResponder.

Parameters:
ml - the MouseListener to remove

All Packages  Class Hierarchy  This Package  Previous  Next  Index