polygon.html
来自「API資料大全」· HTML 代码 · 共 788 行 · 第 1/3 页
HTML
788 行
<A NAME="contains(int, int)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(int x, int y)</PRE><DL><DD>Determines whether the specified coordinates are contained in this <code>Polygon</code>. <p> (The <code>contains</code> method is based on code by Hanpeter van Vliet [hvvliet@inter.nl.net].)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the specified coordinates to be tested<DT><B>Returns:</B><DD><code>true</code> if this <code>Polygon</code> contains the specified coordinates, (<i>x</i>, <i>y</i>); <code>false</code> otherwise.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="inside(int, int)"><!-- --></A><H3>inside</H3><PRE>public boolean <B>inside</B>(int x, int y)</PRE><DL><DD><B>Deprecated.</B> <I>As of JDK version 1.1, replaced by <code>contains(int, int)</code>.</I><P><DD><DL></DL></DD></DL><HR><A NAME="getBounds2D()"><!-- --></A><H3>getBounds2D</H3><PRE>public <A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A> <B>getBounds2D</B>()</PRE><DL><DD>Returns the high precision bounding box of the <A HREF="../../java/awt/Shape.html"><CODE>Shape</CODE></A>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#getBounds2D()">getBounds2D</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <A HREF="../../java/awt/geom/Rectangle2D.html"><CODE>Rectangle2D</CODE></A> that precisely bounds the <code>Shape</code>.</DL></DD></DL><HR><A NAME="contains(double, double)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(double x, double y)</PRE><DL><DD>Tests if the specified coordinates are inside the boundary of the <code>Shape</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#contains(double, double)">contains</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the specified coordinates<DT><B>Returns:</B><DD><code>true</code> if the <code>Shape</code> contains the specified coordinates; <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> p)</PRE><DL><DD>Tests if a specified <A HREF="../../java/awt/geom/Point2D.html"><CODE>Point2D</CODE></A> is inside the boundary of this <code>Polygon</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#contains(java.awt.geom.Point2D)">contains</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - a specified <code>Point2D</code><DT><B>Returns:</B><DD><code>true</code> if this <code>Polygon</code> contains the specified <code>Point2D</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 x, double y, double w, double h)</PRE><DL><DD>Tests if the interior of this <code>Polygon</code> intersects the interior of a specified set of rectangular coordinates.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#intersects(double, double, double, double)">intersects</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the coordinates of the specified rectangular shape's top-left corner<DD><CODE>w</CODE> - the width of the specified rectangular shape<DD><CODE>h</CODE> - the height of the specified rectangular shape<DT><B>Returns:</B><DD><code>true</code> if the interior of this <code>Polygon</code> and the interior of the specified set of rectangular coordinates intersect each other; <code>false</code> otherwise.</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> r)</PRE><DL><DD>Tests if the interior of this <code>Polygon</code> intersects the interior of a specified <code>Rectangle2D</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#intersects(java.awt.geom.Rectangle2D)">intersects</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - a specified <code>Rectangle2D</code><DT><B>Returns:</B><DD><code>true</code> if this <code>Polygon</code> and the interior of the specified <code>Rectangle2D</code> intersect each other; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="contains(double, double, double, double)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(double x, double y, double w, double h)</PRE><DL><DD>Tests if the interior of this <code>Polygon</code> entirely contains the specified set of rectangular coordinates.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#contains(double, double, double, double)">contains</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the coordinate of the top-left corner of the specified set of rectangular coordinates<DD><CODE>w</CODE> - the width of the set of rectangular coordinates<DD><CODE>h</CODE> - the height of the set of rectangular coordinates<DT><B>Returns:</B><DD><code>true</code> if this <code>Polygon</code> entirely contains the specified set of rectangular coordinates; <code>false</code> otherwise.</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> r)</PRE><DL><DD>Tests if the interior of this <code>Polygon</code> entirely contains the specified <code>Rectangle2D</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#contains(java.awt.geom.Rectangle2D)">contains</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the specified <code>Rectangle2D</code><DT><B>Returns:</B><DD><code>true</code> if this <code>Polygon</code> entirely contains the specified <code>Rectangle2D</code>; <code>false</code> otherwise.</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> at)</PRE><DL><DD>Returns an iterator object that iterates along the boundary of this <code>Polygon</code> and provides access to the geometry of the outline of this <code>Polygon</code>. An optional <A HREF="../../java/awt/geom/AffineTransform.html"><CODE>AffineTransform</CODE></A> can be specified so that the coordinates returned in the iteration are transformed accordingly.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#getPathIterator(java.awt.geom.AffineTransform)">getPathIterator</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><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 <A HREF="../../java/awt/geom/PathIterator.html"><CODE>PathIterator</CODE></A> object that provides access to the geometry of this <code>Polygon</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> at, double flatness)</PRE><DL><DD>Returns an iterator object that iterates along the boundary of the <code>Shape</code> and provides access to the geometry of the outline of the <code>Shape</code>. Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are returned by the iterator. Since polygons are already flat, the <code>flatness</code> parameter is ignored. An optional <code>AffineTransform</code> can be specified in which case the coordinates returned in the iteration are transformed accordingly.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#getPathIterator(java.awt.geom.AffineTransform, double)">getPathIterator</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><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 amount that the control points for a given curve can vary from colinear before a subdivided curve is replaced by a straight line connecting the endpoints. Since polygons are already flat the <code>flatness</code> parameter is ignored.<DT><B>Returns:</B><DD>a <code>PathIterator</code> object that provides access to the <code>Shape</code> object's 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> </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/Polygon.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-files/index-1.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><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/awt/Point.html"><B>PREV CLASS</B></A> <A HREF="../../java/awt/PopupMenu.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="Polygon.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><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 + -
显示快捷键?