📄 mousecontroller.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Mon Jul 15 11:49:45 PDT 2002 --><TITLE>: Class MouseController</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MouseController.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../quicktime/app/actions/MatrixAction.html"><B>PREV CLASS</B></A> <A HREF="../../../quicktime/app/actions/MouseResponder.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="MouseController.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">quicktime.app.actions</FONT><BR>Class MouseController</H2><PRE>java.lang.Object | +--<B>quicktime.app.actions.MouseController</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A>, <A HREF="../../../quicktime/app/spaces/Controller.html">Controller</A>, java.util.EventListener, <A HREF="../../../quicktime/app/spaces/Listener.html">Listener</A>, <A HREF="../../../quicktime/app/spaces/ListenerController.html">ListenerController</A>, java.awt.event.MouseListener, java.awt.event.MouseMotionListener</DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../quicktime/app/display/GroupController.html">GroupController</A>, <A HREF="../../../quicktime/app/anim/SWController.html">SWController</A></DD></DL><HR><B>Deprecated.</B> <I>since QTJava 4.0</I><P><DL><DT>public abstract class <B>MouseController</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../quicktime/app/spaces/ListenerController.html">ListenerController</A>, <A HREF="../../../quicktime/app/spaces/Collection.html">Collection</A>, java.awt.event.MouseListener, java.awt.event.MouseMotionListener</DL><P>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. <P> 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. <P> 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. <P> 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. <P> 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.<P><DL><DT><B>See Also: </B><DD><A HREF="../../../quicktime/app/event/QTMouseController.html"><CODE>QTMouseController</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#xLocationOffset">xLocationOffset</A></B></CODE><BR> <B>Deprecated.</B> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#yLocationOffset">yLocationOffset</A></B></CODE><BR> <B>Deprecated.</B> </TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected </CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#MouseController(quicktime.app.actions.MouseResponder, boolean)">MouseController</A></B>(<A HREF="../../../quicktime/app/actions/MouseResponder.html">MouseResponder</A> mr, boolean wholespace)</CODE><BR> <B>Deprecated.</B> Creates a mouse controller with its responder.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#addedTo(java.lang.Object)">addedTo</A></B>(java.lang.Object interest)</CODE><BR> <B>Deprecated.</B> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#addedToSpace(quicktime.app.spaces.Space)">addedToSpace</A></B>(<A HREF="../../../quicktime/app/spaces/Space.html">Space</A> s)</CODE><BR> <B>Deprecated.</B> This method is called by the space when a Controller is being addedTo the Space s.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#addMember(java.lang.Object)">addMember</A></B>(java.lang.Object member)</CODE><BR> <B>Deprecated.</B> If wholespace is set to false, then only objects that are explicitly added to the controller will be controlled by it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#deactivateResponder()">deactivateResponder</A></B>()</CODE><BR> <B>Deprecated.</B> A method that is called whenever the MouseController deactivates its responder.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#doDragTarget(java.awt.event.MouseEvent)">doDragTarget</A></B>(java.awt.event.MouseEvent e)</CODE><BR> <B>Deprecated.</B> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../quicktime/app/actions/MouseResponder.html">MouseResponder</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#getResponder()">getResponder</A></B>()</CODE><BR> <B>Deprecated.</B> This method returns the MouseResponder that is attached to the MouseController.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected abstract java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#getSelected(java.awt.event.MouseEvent)">getSelected</A></B>(java.awt.event.MouseEvent event)</CODE><BR> <B>Deprecated.</B> This method is called when a MouseController has received a mouse press, click, drag, event in its space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../../quicktime/app/spaces/Space.html">Space</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#getSpace()">getSpace</A></B>()</CODE><BR> <B>Deprecated.</B> This method returns the Space which the MouseController has been attached to.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#hasMember(java.lang.Object)">hasMember</A></B>(java.lang.Object object)</CODE><BR> <B>Deprecated.</B> Returns true if the member has been explicitly added to this controller.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#isAppropriate(java.lang.Object)">isAppropriate</A></B>(java.lang.Object object)</CODE><BR> <B>Deprecated.</B> Returns true if the provided object is an appropriate candidate for membership in a collection.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#isEmpty()">isEmpty</A></B>()</CODE><BR> <B>Deprecated.</B> Returns true if the controller's collection of controllable objects is empty.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#isWholespace()">isWholespace</A></B>()</CODE><BR> <B>Deprecated.</B> Returns the current setting of the wholespace flag.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.Enumeration</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#members()">members</A></B>()</CODE><BR> <B>Deprecated.</B> Returns an enumeration of all members of this controller.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#mouseClicked(java.awt.event.MouseEvent)">mouseClicked</A></B>(java.awt.event.MouseEvent e)</CODE><BR> <B>Deprecated.</B> If the responder is interested in mouseClick events it will be activated when the user clicks.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#mouseDragged(java.awt.event.MouseEvent)">mouseDragged</A></B>(java.awt.event.MouseEvent e)</CODE><BR> <B>Deprecated.</B> If the responder is interested in mouseDragged events it will be activated when the user drags the mouse within the display space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#mouseEntered(java.awt.event.MouseEvent)">mouseEntered</A></B>(java.awt.event.MouseEvent e)</CODE><BR> <B>Deprecated.</B> If the responder is interested in mouseEntered events it will be activated when the user's mouse enters the QTCanvas space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#mouseExited(java.awt.event.MouseEvent)">mouseExited</A></B>(java.awt.event.MouseEvent e)</CODE><BR> <B>Deprecated.</B> If the responder is interested in mouseExited events it will be deactivated after the user's mouse exits the QTCanvas space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/actions/MouseController.html#mouseMoved(java.awt.event.MouseEvent)">mouseMoved</A></B>(java.awt.event.MouseEvent e)</CODE><BR> <B>Deprecated.</B> If the responder is interested in mouseMoved events it will be activated when the user's mouse moves within the display space.</TD></TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -