|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | 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. Creates a mouse controller with its responder. |
| Method Summary | |
void |
addedTo(java.lang.Object interest)
Deprecated. 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)
Deprecated. This method is called by the space when a Controller is being addedTo the Space s. |
boolean |
addMember(java.lang.Object member)
Deprecated. If wholespace is set to false, then only objects that are explicitly added to the controller will be controlled by it. |
protected void |
deactivateResponder()
Deprecated. A method that is called whenever the MouseController deactivates its responder. |
protected void |
doDragTarget(java.awt.event.MouseEvent e)
Deprecated. |
protected MouseResponder |
getResponder()
Deprecated. This method returns the MouseResponder that is attached to the MouseController. |
protected abstract java.lang.Object |
getSelected(java.awt.event.MouseEvent event)
Deprecated. This method is called when a MouseController has received a mouse press, click, drag, event in its space. |
abstract Space |
getSpace()
Deprecated. This method returns the Space which the MouseController has been attached to. |
boolean |
hasMember(java.lang.Object object)
Deprecated. Returns true if the member has been explicitly added to this controller. |
boolean |
isAppropriate(java.lang.Object object)
Deprecated. Returns true if the provided object is an appropriate candidate for membership in a collection. |
boolean |
isEmpty()
Deprecated. Returns true if the controller's collection of controllable objects is empty. |
boolean |
isWholespace()
Deprecated. Returns the current setting of the wholespace flag. |
java.util.Enumeration |
members()
Deprecated. Returns an enumeration of all members of this controller. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mouseClick events it will be activated when the user clicks. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mouseDragged events it will be activated when the user drags the mouse within the display space. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mouseEntered events it will be activated when the user's mouse enters the QTCanvas space. |
void |
mouseExited(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mouseExited events it will be deactivated after the user's mouse exits the QTCanvas space. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mouseMoved events it will be activated when the user's mouse moves within the display space. |
void |
mousePressed(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mousePressed events it will be activated when the user presses the mouse within the display space. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Deprecated. If the responder is interested in mouseReleased events it will be activated when the user releases the mouse within the display space. |
void |
removedFrom(java.lang.Object interest)
Deprecated. 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()
Deprecated. Called by the Space when a Controller is being removed from a Space. |
void |
removeMember(java.lang.Object member)
Deprecated. Removes a member from the collection of objects that the controller controls |
protected void |
responderActivated()
Deprecated. A notification method that is called whenever the MouseController activates its responder. |
protected abstract void |
setTargetSpace(Space s)
Deprecated. This method is defined by the subclass to ensure that the incoming Space is an appropriate kind of space for the MouseController to be attached too. |
protected void |
setTranslation()
Deprecated. This method is used to setup translation values for x and y of an event to translate the event into the local coordinate space of a member's display Space. |
void |
setWholespace(boolean flag)
Deprecated. Sets the new value of the wholespace flag. |
int |
size()
Deprecated. Returns the number of members that have been explicitly added to the Controller. |
| 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 eventpublic 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 testpublic 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 Collectionquicktime.app.spaces.Collectionmember - the object to test for membershippublic 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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||