quicktime.app.event
Class QTMouseEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--quicktime.app.event.QTMouseEvent
All Implemented Interfaces:
java.io.Serializable

public class QTMouseEvent
extends java.util.EventObject

This class is used by QuickTime objects that have an action associated with them. When those object's actions are fired they will generate an action event, with those objects as the source of the event, to any registered listeners

A QTMouseEvent's source is the space within which the event occured. Some controllers that broadcast a QTMouseEvent may also have targetted the mouse event to a particular member object in the space.

See Also:
Serialized Form

Field Summary
static int kMouseClick
          The mouse clicked event type.
static int kMouseDragged
          The mouse dragged event type.
static int kMouseEntered
          The mouse entered event type.
static int kMouseExited
          The mouse exited event type.
static int kMouseMoved
          The mouse moved event type.
static int kMousePressed
          The mouse pressed event type.
static int kMouseReleased
          The mouse released event type.
static int kMouseTargetEnter
          The mouse entered a target
static int kMouseTargetExit
          The mouse exited a target
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
QTMouseEvent(java.lang.Object source)
          Constructs an QTMouseEvent object with the specified source object.
QTMouseEvent(java.lang.Object source, int eventType, int x, int y, long when, int modifiers, int clickCount)
          Constructs an QTMouseEvent object with the specified source object.
 
Method Summary
 void consume()
          QTMouseEvents can be consumed by any of their listeners.
 int getClickCount()
           
 int getEventType()
           
 QDPoint getLocation()
           
 int getModifiers()
           
 java.lang.Object getTarget()
           
 long getWhen()
           
 int getX()
           
 int getY()
           
 void initialiseEventProfile(int eventType, int x, int y, long when, int modifiers, int clickCount)
          Sets the characteristics of the MouseEvent.
 boolean isConsumed()
           
 void setTarget(java.lang.Object target)
           
 java.lang.String toString()
           
 void translate(int x, int y)
          Translates the location of the event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kMouseClick

public static final int kMouseClick
The mouse clicked event type.

kMousePressed

public static final int kMousePressed
The mouse pressed event type.

kMouseReleased

public static final int kMouseReleased
The mouse released event type.

kMouseMoved

public static final int kMouseMoved
The mouse moved event type.

kMouseEntered

public static final int kMouseEntered
The mouse entered event type.

kMouseExited

public static final int kMouseExited
The mouse exited event type.

kMouseDragged

public static final int kMouseDragged
The mouse dragged event type.

kMouseTargetEnter

public static final int kMouseTargetEnter
The mouse entered a target

kMouseTargetExit

public static final int kMouseTargetExit
The mouse exited a target
Constructor Detail

QTMouseEvent

public QTMouseEvent(java.lang.Object source)
Constructs an QTMouseEvent object with the specified source object.
Parameters:
source - the object where the event originated

QTMouseEvent

public QTMouseEvent(java.lang.Object source,
                    int eventType,
                    int x,
                    int y,
                    long when,
                    int modifiers,
                    int clickCount)
Constructs an QTMouseEvent object with the specified source object.
Parameters:
source - the object where the event originated
eventType - the type of mouse event
x - the x location of the event
y - the y location of the event
when - when the event occured
modifiers - the modifiers held down during this action
clickCount - the number of clicks within the system click time that occured.
Method Detail

getLocation

public QDPoint getLocation()
Returns:
the location of the event in the space's local coordinates

getModifiers

public int getModifiers()
Returns:
the modifiers held down during this action event.

getTarget

public java.lang.Object getTarget()
Returns:
the target or null of the event

setTarget

public void setTarget(java.lang.Object target)
Parameters:
target - the target of the event

getX

public int getX()
Returns:
the x position of the event relative to the source's enclosing space.

getY

public int getY()
Returns:
the y position of the event relative to the source's enclosing space.

getWhen

public long getWhen()
Returns:
the when the event happened.

getClickCount

public int getClickCount()
Returns:
the number of clicks.

getEventType

public int getEventType()
Returns:
the type of mouse event.

translate

public void translate(int x,
                      int y)
Translates the location of the event.
Parameters:
x - the offset to the x coordinate position
y - the offset to the y coordinate position

initialiseEventProfile

public void initialiseEventProfile(int eventType,
                                   int x,
                                   int y,
                                   long when,
                                   int modifiers,
                                   int clickCount)
Sets the characteristics of the MouseEvent. This will also set the target to null and consumed to false.
Parameters:
eventType - the type of mouse event
x - the x location of the event
y - the y location of the event
when - when the event occured
modifiers - the modifiers held down during this action
clickCount - the number of clicks within the system click time that occured.

consume

public void consume()
QTMouseEvents can be consumed by any of their listeners. If the event is consumed it will not be passed on to any other listeners. Calling this method indicates that the event is consumed.

isConsumed

public boolean isConsumed()
Returns:
true if the event is consumed.

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject
Returns:
a String representation of this object.