|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--quicktime.app.actions.MouseController
The MouseController marshals mouse events that occur within the space it is attached to and activates its MouseResponder if the received events are of interest to that responder. Thus the MouseController delegates the response to a mouse event to its MouseResponder.
The test to see if an object is a valid candidate is controlled through the setting of the wholespace variable. If wholespace is true then any object that is in the Controller's space is a candidate for response. If wholespace is false then the object must be a member of the controllers list of objects.
Subclasses define specialised controllers that deal with some kind of Space know how to extract objects that are from that Space if the usage of the MouseController requires the selection of a target object. If the MouseController selects an object it hands it off to its MouseResponder which must be able to deal with the kind of object that is selected. However, neither the MouseController or MouseResponder as such have any requirement about the types of spaces, members, etc. that they deal with. The particular controllers and responders decide these issues for themselves.
The two QTDisplaySpaces in the current release both provide MouseController subclasses for extracting an object the user clicks on. SWController for SWCompositor and GroupController for GroupDrawable. The type of object these Controllers returned are documented in those classes. The Responders that can deal with these members can be defined by the application - a Dragger responder is provided that drags a Transformable selection within a QTDrawable space.
In the MouseControllers addedTo and removedFrom methods it registers its interest in the Mouse events that are generated by that java.awt.Component which is the source of that event. Typically the top level Space will be addedTo some kind of Component and the Space itself propogates this to its contained members and controllers so the application will generally have no need to call these methods explicitly.
QTMouseController| Field Summary | |
protected int |
xLocationOffset
Deprecated. |
protected int |
yLocationOffset
Deprecated. |
| Constructor Summary | |
protected |
MouseController(MouseResponder mr,
boolean wholespace)
Deprecated. since QTJava 6.1 |
| Method Summary | |
void |
addedTo(java.lang.Object interest)
Deprecated. since QTJava 6.1 |
void |
addedToSpace(Space s)
Deprecated. since QTJava 6.1 |
boolean |
addMember(java.lang.Object member)
Deprecated. since QTJava 6.1 |
protected void |
deactivateResponder()
Deprecated. since QTJava 6.1 |
protected void |
doDragTarget(java.awt.event.MouseEvent e)
Deprecated. |
protected MouseResponder |
getResponder()
Deprecated. since QTJava 6.1 |
protected abstract java.lang.Object |
getSelected(java.awt.event.MouseEvent event)
Deprecated. since QTJava 6.1 |
abstract Space |
getSpace()
Deprecated. since QTJava 6.1 |
boolean |
hasMember(java.lang.Object object)
Deprecated. since QTJava 6.1 |
boolean |
isAppropriate(java.lang.Object object)
Deprecated. since QTJava 6.1 |
boolean |
isEmpty()
Deprecated. since QTJava 6.1 |
boolean |
isWholespace()
Deprecated. since QTJava 6.1 |
java.util.Enumeration |
members()
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 |
mouseExited(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 |
void |
removedFrom(java.lang.Object interest)
Deprecated. since QTJava 6.1 |
void |
removedFromSpace()
Deprecated. since QTJava 6.1 |
void |
removeMember(java.lang.Object member)
Deprecated. since QTJava 6.1 |
protected void |
responderActivated()
Deprecated. since QTJava 6.1 |
protected abstract void |
setTargetSpace(Space s)
Deprecated. since QTJava 6.1 |
protected void |
setTranslation()
Deprecated. since QTJava 6.1 |
void |
setWholespace(boolean flag)
Deprecated. since QTJava 6.1 |
int |
size()
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 |
protected int xLocationOffset
protected int yLocationOffset
| Constructor Detail |
protected MouseController(MouseResponder mr,
boolean wholespace)
mr - the responder that will become active to respond to mouse eventswholespace - sets the value of the wholespace flag| Method Detail |
public abstract Space getSpace()
public final void addedToSpace(Space s)
addedToSpace in interface Controllers - the Space being added tosetTargetSpace()public void removedFromSpace()
removedFromSpace in interface Controllerprotected MouseResponder getResponder()
protected abstract void setTargetSpace(Space s)
s - public void addedTo(java.lang.Object interest)
addedTo in interface Listenerinterest - 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 Listenerinterest - the object that was the source of interest for the
the object that implements this interface.
protected abstract java.lang.Object getSelected(java.awt.event.MouseEvent event)
throws QTException
event - a mouse down event
QTExceptionpublic boolean isWholespace()
public void setWholespace(boolean flag)
flag - if true all objects in the controller's space are potentially controllable.public boolean addMember(java.lang.Object member)
addMember in interface Collectionmember - the new member object that will be controlled.
public boolean isAppropriate(java.lang.Object object)
isAppropriate in interface Collectionobject - the object to test
DynamicCollection,
Protocolpublic void removeMember(java.lang.Object member)
removeMember in interface Collectionmember - the object that will be removed from the controller.public java.util.Enumeration members()
members in interface Collectionpublic boolean isEmpty()
isEmpty in interface Collectionpublic int size()
size in interface Collectionpublic boolean hasMember(java.lang.Object object)
hasMember in interface Collectionobject - the object to test for membership
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - the mouse eventprotected void setTranslation()
The method sets the value of the protected instance variables xLocationOffset and yLocation offset.
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - the mouse eventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - the mouse eventprotected void doDragTarget(java.awt.event.MouseEvent e)
protected void deactivateResponder()
protected void responderActivated()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||