|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.event.QTMouseController
A QTMouseController is attached to a Space. When the space is added to its container (for instance a QTCanvas in the case of QTDisplaySpaces) it will create an event dispatcher that will translate these container events to the QTMouseEvents that this controller distributes to its registered listeners.
Once created and attached to a space the program registers listeners with the controller based on the type of mouse events a particular task requires. The type of the registered listeners will determine the type of mouse events that the controller will handle.
for mouse events that
target a member of the source space.
Field Summary | |
protected Space |
space
The space which the controller is attached too. |
Constructor Summary | |
QTMouseController()
Creates a mouse controller. |
Method Summary | |
void |
addedTo(java.lang.Object interest)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest. |
void |
addedToSpace(Space s)
This method is called by the space when a Controller is being addedTo the Space s. |
protected void |
addHandler()
This method is called when a controller is added to its space and the controller needs to create its event handler |
void |
addQTMouseListener(QTMouseListener l)
Add a QTMouseListener for this controller. |
protected void |
doMouseClicked(QTMouseEvent e)
This method dispatches the event to the appropriate listeners. |
protected void |
doMouseDragged(QTMouseEvent e)
This method dispatches the event to the appropriate listeners. |
protected void |
doMouseEntered(QTMouseEvent e)
This method dispatches the event to the appropriate listeners. |
protected void |
doMouseExited(QTMouseEvent e)
This method dispatches the event to the appropriate listeners. |
protected void |
doMouseMoved(QTMouseEvent e,
boolean isWithinItsSpace)
This method dispatches the event to the appropriate listeners. |
protected void |
doMousePressed(QTMouseEvent e)
This method dispatches the event to the appropriate listeners. |
protected void |
doMouseReleased(QTMouseEvent e)
This method dispatches the event to the appropriate listeners. |
Space |
getSpace()
This method returns the Space which the MouseController has been attached to. |
void |
mouseClicked(QTMouseEvent e)
If the QTMouseController has a MouseButtonListener(s) it will dispatch click events that occur within its Space's area to those listeners. |
void |
mouseDragged(QTMouseEvent e)
If the QTMouseController has a MouseMoveListener(s) it will dispatch drag events that occur within its Space's area to those listeners. |
void |
mouseEntered(QTMouseEvent e)
If the QTMouseController has a MouseEnterExitListener(s) it will dispatch a mouseEntered event when the mouse moves or is dragged into the space. |
void |
mouseExited(QTMouseEvent e)
If the QTMouseController has a MouseEnterExitListener(s) it will dispatch a mouseExited event when the mouse moves or is dragged out of the space. |
void |
mouseMoved(QTMouseEvent e)
If the QTMouseController has a MouseMoveListener(s) it will dispatch move events that occur within its Space's area to those listeners. |
void |
mousePressed(QTMouseEvent e)
If the QTMouseController has a MouseButtonListener(s) it will dispatch press events that occur within its Space's area to those listeners. |
void |
mouseReleased(QTMouseEvent e)
If the QTMouseController has a MouseButtonListener(s) it will dispatch release events that occur within its Space's area to those listeners. |
protected void |
removeActiveHandler()
This method is called when a controller is removed from its space and it had an active event handler |
void |
removedFrom(java.lang.Object interest)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest. |
void |
removedFromSpace()
Called by the Space when a Controller is being removed from a Space. |
void |
removeQTMouseListener(QTMouseListener l)
Remove a QTMouseListener for this controller. |
protected boolean |
translateAndIsWithin(QTMouseEvent e)
This method returns true if the location of the QTMouseEvent is within the Space's area, or false if it isn't. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Space space
Constructor Detail |
public QTMouseController()
Method Detail |
public Space getSpace()
public void addedToSpace(Space s)
addedToSpace
in interface Controller
s
- the Space being added tosetTargetSpace()
public void removedFromSpace()
removedFromSpace
in interface Controller
public void addedTo(java.lang.Object interest)
addedTo
in interface Listener
interest
- the object that is to be the source of interest for the
the object that implements this interface.public void removedFrom(java.lang.Object interest)
removedFrom
in interface Listener
interest
- the object that was the source of interest for the
the object that implements this interface.protected void addHandler()
protected void removeActiveHandler()
protected boolean translateAndIsWithin(QTMouseEvent e)
If the event is located within the space the coordinates of the event will be translated into the local coordinates of the space, with the top, left point of the space being 0,0. Returning true will also indicate that this translation has been done on the event coordinates.
e
- the mouse eventpublic void addQTMouseListener(QTMouseListener l)
l
- a new QTMouseListenerpublic void removeQTMouseListener(QTMouseListener l)
l
- a new QTMouseListenerpublic void mouseClicked(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMouseClicked(QTMouseEvent e)
e
- the mouse eventpublic void mousePressed(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMousePressed(QTMouseEvent e)
e
- the translated mouse eventpublic void mouseReleased(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMouseReleased(QTMouseEvent e)
e
- the translated mouse eventpublic void mouseDragged(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMouseDragged(QTMouseEvent e)
e
- the translated mouse eventpublic void mouseMoved(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMouseMoved(QTMouseEvent e, boolean isWithinItsSpace)
e
- the translated mouse eventisWithinItsSpace
- if true the mouse moved event is within the enclosing space. If false
it isn't.public void mouseEntered(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMouseEntered(QTMouseEvent e)
e
- the translated mouse eventpublic void mouseExited(QTMouseEvent e)
e
- the QTMouseEvent of this type.protected void doMouseExited(QTMouseEvent e)
e
- the translated mouse event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |