polygon.html

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

HTML
788
字号
<CODE>&nbsp;<A HREF="../../java/awt/geom/PathIterator.html">PathIterator</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#getPathIterator(java.awt.geom.AffineTransform)">getPathIterator</A></B>(<A HREF="../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;at)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/geom/PathIterator.html">PathIterator</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#getPathIterator(java.awt.geom.AffineTransform, double)">getPathIterator</A></B>(<A HREF="../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;at,                double&nbsp;flatness)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#inside(int, int)">inside</A></B>(int&nbsp;x,       int&nbsp;y)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>As of JDK version 1.1, replaced by <code>contains(int, int)</code>.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#intersects(double, double, double, double)">intersects</A></B>(double&nbsp;x,           double&nbsp;y,           double&nbsp;w,           double&nbsp;h)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if the interior of this <code>Polygon</code> intersects the  interior of a specified set of rectangular coordinates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#intersects(java.awt.geom.Rectangle2D)">intersects</A></B>(<A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;r)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if the interior of this <code>Polygon</code> intersects the interior of a specified <code>Rectangle2D</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#translate(int, int)">translate</A></B>(int&nbsp;deltaX,          int&nbsp;deltaY)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translates the vertices of the <code>Polygon</code> by  <code>deltaX</code> along the x axis and by  <code>deltaY</code> along the y axis.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="npoints"><!-- --></A><H3>npoints</H3><PRE>public int <B>npoints</B></PRE><DL><DD>The total number of points. This value can be NULL.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Polygon.html#addPoint(int, int)"><CODE>addPoint(int, int)</CODE></A></DL></DD></DL><HR><A NAME="xpoints"><!-- --></A><H3>xpoints</H3><PRE>public int[] <B>xpoints</B></PRE><DL><DD>The array of <i>x</i> coordinates.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Polygon.html#addPoint(int, int)"><CODE>addPoint(int, int)</CODE></A></DL></DD></DL><HR><A NAME="ypoints"><!-- --></A><H3>ypoints</H3><PRE>public int[] <B>ypoints</B></PRE><DL><DD>The array of <i>y</i> coordinates.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Polygon.html#addPoint(int, int)"><CODE>addPoint(int, int)</CODE></A></DL></DD></DL><HR><A NAME="bounds"><!-- --></A><H3>bounds</H3><PRE>protected <A HREF="../../java/awt/Rectangle.html">Rectangle</A> <B>bounds</B></PRE><DL><DD>Bounds of the polygon. This value can be NULL. Please see the javadoc comments getBounds().<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Polygon.html#getBoundingBox()"><CODE>getBoundingBox()</CODE></A>, <A HREF="../../java/awt/Polygon.html#getBounds()"><CODE>getBounds()</CODE></A></DL></DD></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Polygon()"><!-- --></A><H3>Polygon</H3><PRE>public <B>Polygon</B>()</PRE><DL><DD>Creates an empty polygon.</DL><HR><A NAME="Polygon(int[], int[], int)"><!-- --></A><H3>Polygon</H3><PRE>public <B>Polygon</B>(int[]&nbsp;xpoints,               int[]&nbsp;ypoints,               int&nbsp;npoints)</PRE><DL><DD>Constructs and initializes a <code>Polygon</code> from the specified  parameters.<DD><DL><DT><B>Parameters:</B><DD><CODE>xpoints</CODE> - an array of <i>x</i> coordinates<DD><CODE>ypoints</CODE> - an array of <i>y</i> coordinates<DD><CODE>npoints</CODE> - the total number of points in the    				<code>Polygon</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NegativeArraySizeException.html">NegativeArraySizeException</A></CODE> - if the value of                       <code>npoints</code> is negative.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="translate(int, int)"><!-- --></A><H3>translate</H3><PRE>public void <B>translate</B>(int&nbsp;deltaX,                      int&nbsp;deltaY)</PRE><DL><DD>Translates the vertices of the <code>Polygon</code> by  <code>deltaX</code> along the x axis and by  <code>deltaY</code> along the y axis.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>deltaX</CODE> - the amount to translate along the <i>x</i> axis<DD><CODE>deltaY</CODE> - the amount to translate along the <i>y</i> axis<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="addPoint(int, int)"><!-- --></A><H3>addPoint</H3><PRE>public void <B>addPoint</B>(int&nbsp;x,                     int&nbsp;y)</PRE><DL><DD>Appends the specified coordinates to this <code>Polygon</code>.  <p> If an operation that calculates the bounding box of this      <code>Polygon</code> has already been performed, such as   <code>getBounds</code> or <code>contains</code>, then this  method updates the bounding box.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x,&nbsp;y</CODE> - the specified coordinates<DT><B>See Also: </B><DD><A HREF="../../java/awt/Polygon.html#getBounds()"><CODE>getBounds()</CODE></A>, <A HREF="../../java/awt/Polygon.html#contains(java.awt.Point)"><CODE>contains(java.awt.Point)</CODE></A></DL></DD></DL><HR><A NAME="getBounds()"><!-- --></A><H3>getBounds</H3><PRE>public <A HREF="../../java/awt/Rectangle.html">Rectangle</A> <B>getBounds</B>()</PRE><DL><DD>Gets the bounding box of this <code>Polygon</code>.  The bounding box is the smallest <A HREF="../../java/awt/Rectangle.html"><CODE>Rectangle</CODE></A> whose sides are parallel to the x and y axes of the  coordinate space, and can completely contain the <code>Polygon</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Shape.html#getBounds()">getBounds</A></CODE> in interface <CODE><A HREF="../../java/awt/Shape.html">Shape</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>Rectangle</code> that defines the bounds of this  <code>Polygon</code>.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="getBoundingBox()"><!-- --></A><H3>getBoundingBox</H3><PRE>public <A HREF="../../java/awt/Rectangle.html">Rectangle</A> <B>getBoundingBox</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>As of JDK version 1.1, replaced by <code>getBounds()</code>.</I><P><DD><DL></DL></DD></DL><HR><A NAME="contains(java.awt.Point)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(<A HREF="../../java/awt/Point.html">Point</A>&nbsp;p)</PRE><DL><DD>Determines whether the specified <A HREF="../../java/awt/Point.html"><CODE>Point</CODE></A> is inside this  <code>Polygon</code>.  Uses an even-odd insideness rule (also known as an alternating rule).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - the specified <code>Point</code> to be tested<DT><B>Returns:</B><DD><code>true</code> if the <code>Polygon</code> contains the 			<code>Point</code>; <code>false</code> otherwise.</DL></DD></DL><HR>

⌨️ 快捷键说明

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