All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.actions.Dragger

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

public class Dragger
extends MouseResponder
The Dragger is a particular type of MouseResponder that performs the action of moving the Dragger's target (a Transformable object) according to the drag movements of the mouse.

Dragger's can be constrained to keep their target object completely within their enclosing space, or allow the target to be dragged out of that space to a default minimum view of 1 row or column of pixels of the target.

When a constraining condition is reached the Dragger will invoke the trigger method of an attached Actionable object.


Variable Index

 o actor
The actor that will be invoked (if set) when the dragger reaches a constraining condition
 o kConstrainAll
Use these as constraint flags to restrict dragging operations
 o kConstrainBottom
Use these as constraint flags to restrict dragging operations
 o kConstrainHorizontal
Use these as constraint flags to restrict dragging operations
 o kConstrainLeft
Use these as constraint flags to restrict dragging operations
 o kConstrainNone
Use these as constraint flags to restrict dragging operations
 o kConstrainRight
Use these as constraint flags to restrict dragging operations
 o kConstrainTop
Use these as constraint flags to restrict dragging operations
 o kConstrainVertical
Use these as constraint flags to restrict dragging operations
 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
 o xBufferIfUnConstrained
The number of pixels on the horizontal axis that an object can be dragged beyond the bounds if the dragging action is unconstrained.
 o yBufferIfUnConstrained
The number of pixels on the vertical axis that an object can be dragged beyond the bounds if the dragging action is unconstrained.

Constructor Index

 o Dragger(int)
Create a Dragger object
 o Dragger(int, int)
Create a Dragger object with specified modifier keys and test conditions under which those modifier keys are matched.
 o Dragger(int, int, int)
Set some parameters that will create DragActions.

Method Index

 o getActionable()
This method retreives the current actor that is attached to the action
 o getConstrained()
Returns the current constraint setting
 o isAppropriate(Object)
The Dragger knows how to drag objects of type Transformable around.
 o mouseDragged(MouseEvent)
This method will allow the user to drag the transformable object around.
 o mousePressed(MouseEvent)
This method is called by the MouseController when the mouse is first pressed down on a valid Transformable object within the space it is controlling.
 o removeTarget()
When the MouseController detects that the drag operation is completed it notifies the Dragger to remove its target as the user no longer is dragging.
 o setActionable(Actionable)
This method sets the actionable object of the action.
 o setConstrained(int)
Using the constrain constants dragging can be constrained in any direction.
 o setTarget(Object)
Sets the target of the Dragger.
 o setTargetSpace(Object)
This method sets the containing Space of a target of a MouseResponder.

Variables

 o kConstrainNone
 public static final int kConstrainNone
Use these as constraint flags to restrict dragging operations

 o kConstrainLeft
 public static final int kConstrainLeft
Use these as constraint flags to restrict dragging operations

 o kConstrainRight
 public static final int kConstrainRight
Use these as constraint flags to restrict dragging operations

 o kConstrainTop
 public static final int kConstrainTop
Use these as constraint flags to restrict dragging operations

 o kConstrainBottom
 public static final int kConstrainBottom
Use these as constraint flags to restrict dragging operations

 o kConstrainHorizontal
 public static final int kConstrainHorizontal
Use these as constraint flags to restrict dragging operations

 o kConstrainVertical
 public static final int kConstrainVertical
Use these as constraint flags to restrict dragging operations

 o kConstrainAll
 public static final int kConstrainAll
Use these as constraint flags to restrict dragging operations

 o actor
 protected Actionable actor
The actor that will be invoked (if set) when the dragger reaches a constraining condition

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

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

 o xBufferIfUnConstrained
 protected int xBufferIfUnConstrained
The number of pixels on the horizontal axis that an object can be dragged beyond the bounds if the dragging action is unconstrained. The default is one

 o yBufferIfUnConstrained
 protected int yBufferIfUnConstrained
The number of pixels on the vertical axis that an object can be dragged beyond the bounds if the dragging action is unconstrained. The default is one

Constructors

 o Dragger
 public Dragger(int modifierKeyMask)
Create a Dragger object

Parameters:
modifierKeyMask - - if specified will determine which modifier keys must be depressed for the action to be invoked. The modifierTestConditions is set in this case to MouseResonder.kModifiersExactMatch
 o Dragger
 public Dragger(int modifierKeyMask,
                int modifierTestConditions)
Create a Dragger object with specified modifier keys and test conditions under which those modifier keys are matched.

Parameters:
modifierKeyMask - - if specified will determine which modifier keys must be depressed for the action to be invoked.
modifierTestConditions - the test conditions under which the modifier mask is tested
 o Dragger
 public Dragger(int modifierKeyMask,
                int modifierTestConditions,
                int additionalEvents)
Set some parameters that will create DragActions.

Parameters:
modifierKeyMask - - if specified will determine which modifier keys must be depressed for the action to be invoked.
modifierTestConditions - the test conditions under which the modifier mask is tested
additionalEvents - additional mouse events the responder will respond to

Methods

 o setTargetSpace
 protected void setTargetSpace(Object o)
This method sets the containing Space of a target of a MouseResponder. For a Dragger this space must be a QTDrawable.

Parameters:
o - the containing space of the potential targets of the Dragger.
Overrides:
setTargetSpace in class MouseResponder
 o setActionable
 public void setActionable(Actionable actor)
This method sets the actionable object of the action.

 o getActionable
 public Actionable getActionable()
This method retreives the current actor that is attached to the action

 o isAppropriate
 public boolean isAppropriate(Object object)
The Dragger knows how to drag objects of type Transformable around. Thus this method returns true if the incoming object implements the Transformable interface.

Parameters:
object - the object to test
Returns:
a boolean
Overrides:
isAppropriate in class MouseResponder
 o setTarget
 protected void setTarget(Object t)
Sets the target of the Dragger. Generally this will be some kind of Transformable object that the user has clicked on and the MouseController has extracted. This becomes the active Target of the Dragger for the duration of the mouseDrag event.

Parameters:
t - the Transformable target
Overrides:
setTarget in class MouseResponder
 o removeTarget
 protected void removeTarget()
When the MouseController detects that the drag operation is completed it notifies the Dragger to remove its target as the user no longer is dragging.

Overrides:
removeTarget in class MouseResponder
 o setConstrained
 public void setConstrained(int flag)
Using the constrain constants dragging can be constrained in any direction.

Parameters:
flag - constraint flag
 o getConstrained
 public int getConstrained()
Returns the current constraint setting

 o mousePressed
 public void mousePressed(MouseEvent event)
This method is called by the MouseController when the mouse is first pressed down on a valid Transformable object within the space it is controlling. For efficiency it is assumed that the overall characteristics of the enclosing space will not be changing during the duration of the drag event - ie. the Matrix of the enclosing space is not changing during a mouse drag. However the Target's matrix can and will change as a result of the drag operation.

Parameters:
event - the mouse down event that may begin the drag action
Overrides:
mousePressed in class MouseResponder
 o mouseDragged
 public void mouseDragged(MouseEvent event)
This method will allow the user to drag the transformable object around. This method also does constraints testing based on the current state of the constraints.

Parameters:
event - the mouse drag event that triggered the drag action.
Overrides:
mouseDragged in class MouseResponder

All Packages  Class Hierarchy  This Package  Previous  Next  Index