shape.html

来自「API資料大全」· HTML 代码 · 共 582 行 · 第 1/2 页

HTML
582
字号
<DL><DD>Tests if the specified coordinates are inside the boundary of the  <code>Shape</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>x,&nbsp;y</CODE> - the specified coordinates<DT><B>Returns:</B><DD><code>true</code> if the specified coordinates are inside          the <code>Shape</code> boundary; <code>false</code>         otherwise.</DL></DD></DL><HR><A NAME="contains(java.awt.geom.Point2D)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(<A HREF="../../java/awt/geom/Point2D.html">Point2D</A>&nbsp;p)</PRE><DL><DD>Tests if a specified <A HREF="../../java/awt/geom/Point2D.html"><CODE>Point2D</CODE></A> is inside the boundary of the <code>Shape</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - a specified <code>Point2D</code><DT><B>Returns:</B><DD><code>true</code> if the specified <code>Point2D</code> is           inside the boundary of the <code>Shape</code>;		<code>false</code> otherwise.</DL></DD></DL><HR><A NAME="intersects(double, double, double, double)"><!-- --></A><H3>intersects</H3><PRE>public boolean <B>intersects</B>(double&nbsp;x,                          double&nbsp;y,                          double&nbsp;w,                          double&nbsp;h)</PRE><DL><DD>Tests if the interior of the <code>Shape</code> intersects the  interior of a specified rectangular area. The rectangular area is considered to intersect the <code>Shape</code>  if any point is contained in both the interior of the  <code>Shape</code> and the specified rectangular area. <p> This method might conservatively return <code>true</code> when: <ul> <li> there is a high probability that the rectangular area and the <code>Shape</code> intersect, but <li> the calculations to accurately determine this intersection are prohibitively expensive. </ul> This means that this method might return <code>true</code> even though the rectangular area does not intersect the <code>Shape</code>. The <A HREF="../../java/awt/geom/Area.html"><CODE>Area</CODE></A> class can be used to perform  more accurate computations of geometric intersection for any  <code>Shape</code> object if a more precise answer is required.<DD><DL><DT><B>Parameters:</B><DD><CODE>x,&nbsp;y</CODE> - the coordinates of the specified rectangular area<DD><CODE>w</CODE> - the width of the specified rectangular area<DD><CODE>h</CODE> - the height of the specified rectangular area<DT><B>Returns:</B><DD><code>true</code> if the interior of the <code>Shape</code> and 		the interior of the rectangular area intersect, or are 		both highly likely to intersect and intersection calculations  		would be too expensive to perform; <code>false</code> otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/awt/geom/Area.html"><CODE>Area</CODE></A></DL></DD></DL><HR><A NAME="intersects(java.awt.geom.Rectangle2D)"><!-- --></A><H3>intersects</H3><PRE>public boolean <B>intersects</B>(<A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;r)</PRE><DL><DD>Tests if the interior of the <code>Shape</code> intersects the  interior of a specified <code>Rectangle2D</code>. This method might conservatively return <code>true</code> when: <ul> <li> there is a high probability that the <code>Rectangle2D</code> and the <code>Shape</code> intersect, but <li> the calculations to accurately determine this intersection are prohibitively expensive. </ul> This means that this method might return <code>true</code> even though the <code>Rectangle2D</code> does not intersect the <code>Shape</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the specified <code>Rectangle2D</code><DT><B>Returns:</B><DD><code>true</code> if the interior of the <code>Shape</code> and   		the interior of the specified <code>Rectangle2D</code>		intersect, or are both highly likely to intersect and intersection		calculations would be too expensive to perform; <code>false</code> 		otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Shape.html#intersects(double, double, double, double)"><CODE>intersects(double, double, double, double)</CODE></A></DL></DD></DL><HR><A NAME="contains(double, double, double, double)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(double&nbsp;x,                        double&nbsp;y,                        double&nbsp;w,                        double&nbsp;h)</PRE><DL><DD>Tests if the interior of the <code>Shape</code> entirely contains  the specified rectangular area.  All coordinates that lie inside the rectangular area must lie within the <code>Shape</code> for the entire rectanglar area to be considered contained within the  <code>Shape</code>. <p> This method might conservatively return <code>false</code> when: <ul> <li> the <code>intersect</code> method returns <code>true</code> and <li> the calculations to determine whether or not the <code>Shape</code> entirely contains the rectangular area are prohibitively expensive. </ul> This means that this method might return <code>false</code> even though the <code>Shape</code> contains the rectangular area. The <code>Area</code> class can be used to perform more accurate  computations of geometric intersection for any <code>Shape</code> object if a more precise answer is required.<DD><DL><DT><B>Parameters:</B><DD><CODE>x,&nbsp;y</CODE> - the coordinates of the specified rectangular area<DD><CODE>w</CODE> - the width of the specified rectangular area<DD><CODE>h</CODE> - the height of the specified rectangular area<DT><B>Returns:</B><DD><code>true</code> if the interior of the <code>Shape</code> 		entirely contains the specified rectangular area; 		<code>false</code> otherwise or, if the <code>Shape</code>    		contains the rectangular area and the   		<code>intersects</code> method returns <code>true</code>  		and the containment calculations would be too expensive to 		perform.<DT><B>See Also: </B><DD><A HREF="../../java/awt/geom/Area.html"><CODE>Area</CODE></A>, <A HREF="../../java/awt/Shape.html#intersects(double, double, double, double)"><CODE>intersects(double, double, double, double)</CODE></A></DL></DD></DL><HR><A NAME="contains(java.awt.geom.Rectangle2D)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(<A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;r)</PRE><DL><DD>Tests if the interior of the <code>Shape</code> entirely contains the  specified <code>Rectangle2D</code>. This method might conservatively return <code>false</code> when: <ul> <li> the <code>intersect</code> method returns <code>true</code> and <li> the calculations to determine whether or not the <code>Shape</code> entirely contains the <code>Rectangle2D</code> are prohibitively expensive. </ul> This means that this method might return <code>false</code> even    though the <code>Shape</code> contains the <code>Rectangle2D</code>. The <code>Area</code> class can be used to perform more accurate  computations of geometric intersection for any <code>Shape</code>   object if a more precise answer is required.<DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - The specified <code>Rectangle2D</code><DT><B>Returns:</B><DD><code>true</code> if the interior of the <code>Shape</code>          entirely contains the <code>Rectangle2D</code>;          <code>false</code> otherwise or, if the <code>Shape</code>          contains the <code>Rectangle2D</code> and the          <code>intersects</code> method returns <code>true</code>          and the containment calculations would be too expensive to          perform.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Shape.html#contains(double, double, double, double)"><CODE>contains(double, double, double, double)</CODE></A></DL></DD></DL><HR><A NAME="getPathIterator(java.awt.geom.AffineTransform)"><!-- --></A><H3>getPathIterator</H3><PRE>public <A HREF="../../java/awt/geom/PathIterator.html">PathIterator</A> <B>getPathIterator</B>(<A HREF="../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;at)</PRE><DL><DD>Returns an iterator object that iterates along the  <code>Shape</code> boundary and provides access to the geometry of the  <code>Shape</code> outline.  If an optional <A HREF="../../java/awt/geom/AffineTransform.html"><CODE>AffineTransform</CODE></A> is specified, the coordinates returned in the iteration are transformed accordingly. <p> Each call to this method returns a fresh <code>PathIterator</code> object that traverses the geometry of the <code>Shape</code> object independently from any other <code>PathIterator</code> objects in use at the same time. <p> It is recommended, but not guaranteed, that objects  implementing the <code>Shape</code> interface isolate iterations that are in process from any changes that might occur to the original object's geometry during such iterations. <p> Before using a particular implementation of the <code>Shape</code>  interface in more than one thread simultaneously, refer to its  documentation to verify that it guarantees that iterations are isolated  from modifications.<DD><DL><DT><B>Parameters:</B><DD><CODE>at</CODE> - an optional <code>AffineTransform</code> to be applied to the 		coordinates as they are returned in the iteration, or 		<code>null</code> if untransformed coordinates are desired<DT><B>Returns:</B><DD>a new <code>PathIterator</code> object, which independently    		traverses the geometry of the <code>Shape</code>.</DL></DD></DL><HR><A NAME="getPathIterator(java.awt.geom.AffineTransform, double)"><!-- --></A><H3>getPathIterator</H3><PRE>public <A HREF="../../java/awt/geom/PathIterator.html">PathIterator</A> <B>getPathIterator</B>(<A HREF="../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;at,                                    double&nbsp;flatness)</PRE><DL><DD>Returns an iterator object that iterates along the <code>Shape</code> boundary and provides access to a flattened view of the <code>Shape</code> outline geometry. <p> Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are returned by the iterator. <p> If an optional <code>AffineTransform</code> is specified, the coordinates returned in the iteration are transformed accordingly. <p> The amount of subdivision of the curved segments is controlled by the <code>flatness</code> parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. Note that a limit on the accuracy of the flattened path might be silently imposed, causing very small flattening parameters to be treated as larger values.  This limit, if there is one, is defined by the particular implementation that is used. <p> Each call to this method returns a fresh <code>PathIterator</code> object that traverses the <code>Shape</code> object geometry  independently from any other <code>PathIterator</code> objects in use at the same time. <p> It is recommended, but not guaranteed, that objects  implementing the <code>Shape</code> interface isolate iterations that are in process from any changes that might occur to the original object's geometry during such iterations. <p> Before using a particular implementation of this interface in more than one thread simultaneously, refer to its documentation to verify that it guarantees that iterations are isolated from modifications.<DD><DL><DT><B>Parameters:</B><DD><CODE>at</CODE> - an optional <code>AffineTransform</code> to be applied to the 		coordinates as they are returned in the iteration, or 		<code>null</code> if untransformed coordinates are desired<DD><CODE>flatness</CODE> - the maximum distance that the line segments used to          approximate the curved segments are allowed to deviate          from any point on the original curve<DT><B>Returns:</B><DD>a new <code>PathIterator</code> that independently traverses  		the <code>Shape</code> geometry.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Shape.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/awt/PrintGraphics.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/awt/Stroke.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>  &nbsp;&nbsp;<A HREF="Shape.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?