All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.actions.MouseResponder

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

public abstract class MouseResponder
extends Object
This class is an abstract class that is used to provide a base level functionality for objects that respond to Mouse events.

A responder responds to a mouse event based on three conditions being met.

A responder is associated with a controller and when the event and modifiers are matched the controller activates the responder and sends events to the responder whilst the responder is active.

A responder in turn has a target for many mouse events (click, press, drag, release). In these event types the responder is only activated if the controller finds a target where the mouse was pressed. A mouseRelease event may NOT have occured when the mouse was over the selected target, whereas a mouseClick event indicates that the mouse was pressed and released over a particular target within the system mouse click time.

Mouse move, enter and exit events do not have a target - they relate to the space within which the controller has a declared interest.

See Also:
MouseController

Variable Index

 o kAnyModifiers
 o kAnyModifiersMask
 o kAnyMouseEvent
 o kAnyOneOfModifiers
 o kClickEvents
 o kDragEvents
 o kEnterEvents
 o kExitEvents
 o kModifiersDisregarded
 o kModifiersExactMatch
 o kMouseEvents
 o kMouseMotionEvents
 o kMouseOrMouseMotionEvents
 o kMoveEvents
 o kNoModifiers
 o kNoModifiersMask
 o kPressReleaseEvents
 o kQTMouseMotionEvents
 o kRolloverEvents
 o kSpecifiedModifiersOrNone
 o kTargetMoveEvents
 o modifierKeyMask
The mask that is used to test which modifier keys will be regarded as valid
 o modifierTestConditions
The conditions of the modifier keys that will invoke an event

Constructor Index

 o MouseResponder(int, int, int)
You pass in to this constructor the modifier keys and the conditions of the modifier test that will trigger the activation of the responder object.

Method Index

 o activationEventType()
Returns the event which activated the responder.
 o deactivate()
A subclass can call this method to deactivate a responder.
 o getMouseController()
Returns the MouseController that the responder is attached to.
 o isActive()
Returns true if the responder is currently active.
 o isAppropriate(Object)
The MouseController delegates the appropriateness of objects that it can control to the MouseResponder.
 o isInterested(int)
Returns true if the repsonder is interested in the specified event.
 o isInterested(int, int)
Returns true if the repsonder is interested in the specified event.
 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 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 kNoModifiersMask
 public static final int kNoModifiersMask
 o kAnyModifiersMask
 public static final int kAnyModifiersMask
 o kNoModifiers
 public static final int kNoModifiers
 o kAnyModifiers
 public static final int kAnyModifiers
 o kAnyOneOfModifiers
 public static final int kAnyOneOfModifiers
 o kModifiersDisregarded
 public static final int kModifiersDisregarded
 o kModifiersExactMatch
 public static final int kModifiersExactMatch
 o kSpecifiedModifiersOrNone
 public static final int kSpecifiedModifiersOrNone
 o kClickEvents
 public static final int kClickEvents
 o kPressReleaseEvents
 public static final int kPressReleaseEvents
 o kDragEvents
 public static final int kDragEvents
 o kMoveEvents
 public static final int kMoveEvents
 o kEnterEvents
 public static final int kEnterEvents
 o kExitEvents
 public static final int kExitEvents
 o kTargetMoveEvents
 public static final int kTargetMoveEvents
 o kMouseEvents
 public static final int kMouseEvents
 o kMouseMotionEvents
 public static final int kMouseMotionEvents
 o kQTMouseMotionEvents
 public static final int kQTMouseMotionEvents
 o kRolloverEvents
 public static final int kRolloverEvents
 o kMouseOrMouseMotionEvents
 public static final int kMouseOrMouseMotionEvents
 o kAnyMouseEvent
 public static final int kAnyMouseEvent
 o modifierKeyMask
 public int modifierKeyMask
The mask that is used to test which modifier keys will be regarded as valid

 o modifierTestConditions
 public int modifierTestConditions
The conditions of the modifier keys that will invoke an event

Constructors

 o MouseResponder
 protected MouseResponder(int modifierKeyMask,
                          int modifierTestConditions,
                          int eventTypes)
You pass in to this constructor the modifier keys and the conditions of the modifier test that will trigger the activation of the responder object.

Parameters:
modifierKeyMask - the modifier key's mask
modifierTestConditions - the test conditions under which the modifier mask is tested
eventTypes - the mouse events the responder will respond to. This is a read-only property of the responder and determines the kinds of mouse events the responder responds to.

Methods

 o setTargetSpace
 protected abstract 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.
 o getMouseController
 public MouseController getMouseController()
Returns the MouseController that the responder is attached to.

Returns:
a MouseController
 o isInterested
 public boolean isInterested(int eventType)
Returns true if the repsonder is interested in the specified event.

Parameters:
eventType - to test interest
Returns:
true if interested, false if not
 o isInterested
 public boolean isInterested(int eventType,
                             int eventModifiers)
Returns true if the repsonder is interested in the specified event.

Parameters:
eventType - to test interest
eventModifiers - modifier keys of mouse event
Returns:
true if interested, false if not
 o setTarget
 protected abstract 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
 o removeTarget
 protected abstract 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

 o isAppropriate
 public abstract 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
 o activationEventType
 public int activationEventType()
Returns the event which activated the responder. If the responder is inactive this will return 0.

Returns:
the event type.
 o isActive
 public boolean isActive()
Returns true if the responder is currently active.

Returns:
true if active, false if not
 o deactivate
 protected void deactivate()
A subclass can call this method to deactivate a responder. It will not cancel a responder from becoming active again. For instance in drags if the object should no longer be dragged but the user is still going to broadcast mouseDrag events then you can deactivate the responder to ensure that the target will no longer be dragged.

 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
 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
 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
 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
 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
 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
 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
 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
 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index