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.
- Modifier keys (or none) that determine if the responder is activated
- Matching conditions for the specified modifier keys - the default is kExactMatch
- Events that the particular responder is interested in. Some responders may only
be interested in particular mouse events, for instance the Dragger is only interested in
kPressReleaseEvent | kDragEvent
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
-
kAnyModifiers
-
-
kAnyModifiersMask
-
-
kAnyMouseEvent
-
-
kAnyOneOfModifiers
-
-
kClickEvents
-
-
kDragEvents
-
-
kEnterEvents
-
-
kExitEvents
-
-
kModifiersDisregarded
-
-
kModifiersExactMatch
-
-
kMouseEvents
-
-
kMouseMotionEvents
-
-
kMouseOrMouseMotionEvents
-
-
kMoveEvents
-
-
kNoModifiers
-
-
kNoModifiersMask
-
-
kPressReleaseEvents
-
-
kQTMouseMotionEvents
-
-
kRolloverEvents
-
-
kSpecifiedModifiersOrNone
-
-
kTargetMoveEvents
-
-
modifierKeyMask
- The mask that is used to test which modifier keys will be regarded as valid
-
modifierTestConditions
- The conditions of the modifier keys that will invoke an event
-
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.
-
activationEventType()
- Returns the event which activated the responder.
-
deactivate()
- A subclass can call this method to deactivate a responder.
-
getMouseController()
- Returns the MouseController that the responder is attached to.
-
isActive()
- Returns true if the responder is currently active.
-
isAppropriate(Object)
- The MouseController delegates the appropriateness of objects that it can control
to the MouseResponder.
-
isInterested(int)
- Returns true if the repsonder is interested in the specified event.
-
isInterested(int, int)
- Returns true if the repsonder is interested in the specified event.
-
mouseClicked(MouseEvent)
- Invoked when the mouse has been clicked on a found and valid target within the enclosing space.
-
mouseDragged(MouseEvent)
- Invoked when the mouse has been dragged on a found and valid target within the enclosing space.
-
mouseEntered(MouseEvent)
- Invoked when the mouse enters a QTDrawable space.
-
mouseEnteredTarget(MouseEvent)
- Invoked when a mouseMoved event enters a Target within an enclosing space.
-
mouseExited(MouseEvent)
- Invoked when the mouse exits a QTDrawable space.
-
mouseExitedTarget(MouseEvent)
- Invoked when a mouseMoved event exits a Target within an enclosing space.
-
mouseMoved(MouseEvent)
- Invoked when the mouse button has been moved over a space.
-
mousePressed(MouseEvent)
- Invoked when the mouse has been pressed on a found and valid target within the enclosing space.
-
mouseReleased(MouseEvent)
- Invoked when the mouse has been released after being pressed on a found and valid target within the enclosing space.
-
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
-
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.
-
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.
kNoModifiersMask
public static final int kNoModifiersMask
kAnyModifiersMask
public static final int kAnyModifiersMask
kNoModifiers
public static final int kNoModifiers
kAnyModifiers
public static final int kAnyModifiers
kAnyOneOfModifiers
public static final int kAnyOneOfModifiers
kModifiersDisregarded
public static final int kModifiersDisregarded
kModifiersExactMatch
public static final int kModifiersExactMatch
kSpecifiedModifiersOrNone
public static final int kSpecifiedModifiersOrNone
kClickEvents
public static final int kClickEvents
kPressReleaseEvents
public static final int kPressReleaseEvents
kDragEvents
public static final int kDragEvents
kMoveEvents
public static final int kMoveEvents
kEnterEvents
public static final int kEnterEvents
kExitEvents
public static final int kExitEvents
kTargetMoveEvents
public static final int kTargetMoveEvents
kMouseEvents
public static final int kMouseEvents
kMouseMotionEvents
public static final int kMouseMotionEvents
kQTMouseMotionEvents
public static final int kQTMouseMotionEvents
kRolloverEvents
public static final int kRolloverEvents
kMouseOrMouseMotionEvents
public static final int kMouseOrMouseMotionEvents
kAnyMouseEvent
public static final int kAnyMouseEvent
modifierKeyMask
public int modifierKeyMask
- The mask that is used to test which modifier keys will be regarded as valid
modifierTestConditions
public int modifierTestConditions
- The conditions of the modifier keys that will invoke an event
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.
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.
getMouseController
public MouseController getMouseController()
- Returns the MouseController that the responder is attached to.
- Returns:
- a MouseController
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
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
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
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
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
activationEventType
public int activationEventType()
- Returns the event which activated the responder. If
the responder is inactive this will return 0.
- Returns:
- the event type.
isActive
public boolean isActive()
- Returns true if the responder is currently active.
- Returns:
- true if active, false if not
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.
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
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
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
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
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
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
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
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
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