quicktime.app.actions
Class MouseResponder

java.lang.Object
  |
  +--quicktime.app.actions.MouseResponder
Direct Known Subclasses:
Dragger, GenericResponder

Deprecated. since QTJava 4.0

public abstract class MouseResponder
extends java.lang.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:
QTMouseController

Field Summary
static int kAnyModifiers
          Deprecated.  
static int kAnyModifiersMask
          Deprecated.  
static int kAnyMouseEvent
          Deprecated.  
static int kAnyOneOfModifiers
          Deprecated.  
static int kClickEvents
          Deprecated.  
static int kDragEvents
          Deprecated.  
static int kEnterEvents
          Deprecated.  
static int kExitEvents
          Deprecated.  
static int kModifiersDisregarded
          Deprecated.  
static int kModifiersExactMatch
          Deprecated.  
static int kMouseEvents
          Deprecated.  
static int kMouseMotionEvents
          Deprecated.  
static int kMouseOrMouseMotionEvents
          Deprecated.  
static int kMoveEvents
          Deprecated.  
static int kNoModifiers
          Deprecated.  
static int kNoModifiersMask
          Deprecated.  
static int kPressReleaseEvents
          Deprecated.  
static int kQTMouseMotionEvents
          Deprecated.  
static int kRolloverEvents
          Deprecated.  
static int kSpecifiedModifiersOrNone
          Deprecated.  
static int kTargetMoveEvents
          Deprecated.  
 int modifierKeyMask
          Deprecated. since QTJava 6.1
 int modifierTestConditions
          Deprecated. since QTJava 6.1
 
Constructor Summary
protected MouseResponder(int modifierKeyMask, int modifierTestConditions, int eventTypes)
          Deprecated. since QTJava 6.1
 
Method Summary
 int activationEventType()
          Deprecated. since QTJava 6.1
protected  void deactivate()
          Deprecated. since QTJava 6.1
 MouseController getMouseController()
          Deprecated. since QTJava 6.1
 boolean isActive()
          Deprecated. since QTJava 6.1
abstract  boolean isAppropriate(java.lang.Object object)
          Deprecated. since QTJava 6.1
 boolean isInterested(int eventType)
          Deprecated. since QTJava 6.1
 boolean isInterested(int eventType, int eventModifiers)
          Deprecated. since QTJava 6.1
 void mouseClicked(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseDragged(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseEntered(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseEnteredTarget(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseExited(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseExitedTarget(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseMoved(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mousePressed(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
 void mouseReleased(java.awt.event.MouseEvent e)
          Deprecated. since QTJava 6.1
protected abstract  void removeTarget()
          Deprecated. since QTJava 6.1
protected abstract  void setTarget(java.lang.Object target)
          Deprecated. since QTJava 6.1
protected abstract  void setTargetSpace(java.lang.Object s)
          Deprecated. since QTJava 6.1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kNoModifiersMask

public static final int kNoModifiersMask
Deprecated. 
See Also:
Constant Field Values

kAnyModifiersMask

public static final int kAnyModifiersMask
Deprecated. 
See Also:
Constant Field Values

kNoModifiers

public static final int kNoModifiers
Deprecated. 
See Also:
Constant Field Values

kAnyModifiers

public static final int kAnyModifiers
Deprecated. 
See Also:
Constant Field Values

kAnyOneOfModifiers

public static final int kAnyOneOfModifiers
Deprecated. 
See Also:
Constant Field Values

kModifiersDisregarded

public static final int kModifiersDisregarded
Deprecated. 
See Also:
Constant Field Values

kModifiersExactMatch

public static final int kModifiersExactMatch
Deprecated. 
See Also:
Constant Field Values

kSpecifiedModifiersOrNone

public static final int kSpecifiedModifiersOrNone
Deprecated. 
See Also:
Constant Field Values

kClickEvents

public static final int kClickEvents
Deprecated. 
See Also:
Constant Field Values

kPressReleaseEvents

public static final int kPressReleaseEvents
Deprecated. 
See Also:
Constant Field Values

kDragEvents

public static final int kDragEvents
Deprecated. 
See Also:
Constant Field Values

kMoveEvents

public static final int kMoveEvents
Deprecated. 
See Also:
Constant Field Values

kEnterEvents

public static final int kEnterEvents
Deprecated. 
See Also:
Constant Field Values

kExitEvents

public static final int kExitEvents
Deprecated. 
See Also:
Constant Field Values

kTargetMoveEvents

public static final int kTargetMoveEvents
Deprecated. 
See Also:
Constant Field Values

kMouseEvents

public static final int kMouseEvents
Deprecated. 
See Also:
Constant Field Values

kMouseMotionEvents

public static final int kMouseMotionEvents
Deprecated. 
See Also:
Constant Field Values

kQTMouseMotionEvents

public static final int kQTMouseMotionEvents
Deprecated. 
See Also:
Constant Field Values

kRolloverEvents

public static final int kRolloverEvents
Deprecated. 
See Also:
Constant Field Values

kMouseOrMouseMotionEvents

public static final int kMouseOrMouseMotionEvents
Deprecated. 
See Also:
Constant Field Values

kAnyMouseEvent

public static final int kAnyMouseEvent
Deprecated. 
See Also:
Constant Field Values

modifierKeyMask

public int modifierKeyMask
Deprecated. since QTJava 6.1

The mask that is used to test which modifier keys will be regarded as valid


modifierTestConditions

public int modifierTestConditions
Deprecated. since QTJava 6.1

The conditions of the modifier keys that will invoke an event

Constructor Detail

MouseResponder

protected MouseResponder(int modifierKeyMask,
                         int modifierTestConditions,
                         int eventTypes)
Deprecated. since QTJava 6.1

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.
Method Detail

setTargetSpace

protected abstract void setTargetSpace(java.lang.Object s)
Deprecated. since QTJava 6.1

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()
Deprecated. since QTJava 6.1

Returns the MouseController that the responder is attached to.

Returns:
a MouseController

isInterested

public boolean isInterested(int eventType)
Deprecated. since QTJava 6.1

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)
Deprecated. since QTJava 6.1

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(java.lang.Object target)
Deprecated. since QTJava 6.1

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()
Deprecated. since QTJava 6.1

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(java.lang.Object object)
Deprecated. since QTJava 6.1

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()
Deprecated. since QTJava 6.1

Returns the event which activated the responder. If the responder is inactive this will return 0.

Returns:
the event type.

isActive

public boolean isActive()
Deprecated. since QTJava 6.1

Returns true if the responder is currently active.

Returns:
true if active, false if not

deactivate

protected void deactivate()
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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(java.awt.event.MouseEvent e)
Deprecated. since QTJava 6.1

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