polygon.html
来自「API資料大全」· HTML 代码 · 共 788 行 · 第 1/3 页
HTML
788 行
<!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 Thu Apr 27 23:32:56 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class Polygon</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/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><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt</FONT><BR>Class Polygon</H2><PRE><A HREF="../../java/lang/Object.html">java.lang.Object</A> | +--<B>java.awt.Polygon</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/io/Serializable.html">Serializable</A>, <A HREF="../../java/awt/Shape.html">Shape</A></DD></DL><HR><DL><DT>public class <B>Polygon</B><DT>extends <A HREF="../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../java/awt/Shape.html">Shape</A>, <A HREF="../../java/io/Serializable.html">Serializable</A></DL><P>The <code>Polygon</code> class encapsulates a description of a closed, two-dimensional region within a coordinate space. This region is bounded by an arbitrary number of line segments, each of which is one side of the polygon. Internally, a polygon comprises of a list of (<i>x</i>, <i>y</i>) coordinate pairs, where each pair defines a <i>vertex</i> of the polygon, and two successive pairs are the endpoints of a line that is a side of the polygon. The first and final pairs of (<i>x</i>, <i>y</i>) points are joined by a line segment that closes the polygon.<P><DL><DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../serialized-form.html#java.awt.Polygon">Serialized Form</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 <A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#bounds">bounds</A></B></CODE><BR> Bounds of the polygon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#npoints">npoints</A></B></CODE><BR> The total number of points.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#xpoints">xpoints</A></B></CODE><BR> The array of <i>x</i> coordinates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#ypoints">ypoints</A></B></CODE><BR> The array of <i>y</i> coordinates.</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><CODE><B><A HREF="../../java/awt/Polygon.html#Polygon()">Polygon</A></B>()</CODE><BR> Creates an empty polygon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../java/awt/Polygon.html#Polygon(int[], int[], int)">Polygon</A></B>(int[] xpoints, int[] ypoints, int npoints)</CODE><BR> Constructs and initializes a <code>Polygon</code> from the specified parameters.</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="../../java/awt/Polygon.html#addPoint(int, int)">addPoint</A></B>(int x, int y)</CODE><BR> Appends the specified coordinates to this <code>Polygon</code>.</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="../../java/awt/Polygon.html#contains(double, double)">contains</A></B>(double x, double y)</CODE><BR> Tests if the specified coordinates are inside the boundary of the <code>Shape</code>.</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="../../java/awt/Polygon.html#contains(double, double, double, double)">contains</A></B>(double x, double y, double w, double h)</CODE><BR> Tests if the interior of this <code>Polygon</code> entirely contains the specified set of rectangular coordinates.</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="../../java/awt/Polygon.html#contains(int, int)">contains</A></B>(int x, int y)</CODE><BR> Determines whether the specified coordinates are contained in this <code>Polygon</code>.</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="../../java/awt/Polygon.html#contains(java.awt.Point)">contains</A></B>(<A HREF="../../java/awt/Point.html">Point</A> p)</CODE><BR> Determines whether the specified <A HREF="../../java/awt/Point.html"><CODE>Point</CODE></A> is inside this <code>Polygon</code>.</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="../../java/awt/Polygon.html#contains(java.awt.geom.Point2D)">contains</A></B>(<A HREF="../../java/awt/geom/Point2D.html">Point2D</A> p)</CODE><BR> Tests if a specified <A HREF="../../java/awt/geom/Point2D.html"><CODE>Point2D</CODE></A> is inside the boundary of this <code>Polygon</code>.</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="../../java/awt/Polygon.html#contains(java.awt.geom.Rectangle2D)">contains</A></B>(<A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A> r)</CODE><BR> Tests if the interior of this <code>Polygon</code> entirely contains the specified <code>Rectangle2D</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#getBoundingBox()">getBoundingBox</A></B>()</CODE><BR> <B>Deprecated.</B> <I>As of JDK version 1.1, replaced by <code>getBounds()</code>.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/awt/Rectangle.html">Rectangle</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#getBounds()">getBounds</A></B>()</CODE><BR> Gets the bounding box of this <code>Polygon</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Polygon.html#getBounds2D()">getBounds2D</A></B>()</CODE><BR> Returns the high precision bounding box of the <A HREF="../../java/awt/Shape.html"><CODE>Shape</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?