generalpath.html

来自「API資料大全」· HTML 代码 · 共 1,030 行 · 第 1/4 页

HTML
1,030
字号
<DL><DD>Constructs a new <code>GeneralPath</code> object from an arbitrary  <A HREF="../../../java/awt/Shape.html"><CODE>Shape</CODE></A> object. All of the initial geometry and the winding rule for this path are taken from the specified <code>Shape</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the specified <code>Shape</code> object</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="moveTo(float, float)"><!-- --></A><H3>moveTo</H3><PRE>public void <B>moveTo</B>(float&nbsp;x,                   float&nbsp;y)</PRE><DL><DD>Adds a point to the path by moving to the specified coordinates.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x,&nbsp;y</CODE> - the specified coordinates</DL></DD></DL><HR><A NAME="lineTo(float, float)"><!-- --></A><H3>lineTo</H3><PRE>public void <B>lineTo</B>(float&nbsp;x,                   float&nbsp;y)</PRE><DL><DD>Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x,&nbsp;y</CODE> - the specified coordinates</DL></DD></DL><HR><A NAME="quadTo(float, float, float, float)"><!-- --></A><H3>quadTo</H3><PRE>public void <B>quadTo</B>(float&nbsp;x1,                   float&nbsp;y1,                   float&nbsp;x2,                   float&nbsp;y2)</PRE><DL><DD>Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the coordinates (x2,&nbsp;y2), using the  specified point (x1,&nbsp;y1) as a quadratic parametric control point.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x1,&nbsp;y1</CODE> - the coordinates of the first quadratic control		point<DD><CODE>x2,&nbsp;y2</CODE> - the coordinates of the final endpoint</DL></DD></DL><HR><A NAME="curveTo(float, float, float, float, float, float)"><!-- --></A><H3>curveTo</H3><PRE>public void <B>curveTo</B>(float&nbsp;x1,                    float&nbsp;y1,                    float&nbsp;x2,                    float&nbsp;y2,                    float&nbsp;x3,                    float&nbsp;y3)</PRE><DL><DD>Adds a curved segment, defined by three new points, to the path by drawing a B&eacute;zier curve that intersects both the current coordinates and the coordinates (x3,&nbsp;y3), using the     specified points (x1,&nbsp;y1) and (x2,&nbsp;y2) as B&eacute;zier control points.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x1,&nbsp;y1</CODE> - the coordinates of the first B&eacute;ezier		control point<DD><CODE>x2,&nbsp;y2</CODE> - the coordinates of the second B&eacute;zier		control point<DD><CODE>x3,&nbsp;y3</CODE> - the coordinates of the final endpoint</DL></DD></DL><HR><A NAME="closePath()"><!-- --></A><H3>closePath</H3><PRE>public void <B>closePath</B>()</PRE><DL><DD>Closes the current subpath by drawing a straight line back to the coordinates of the last <code>moveTo</code>.  If the path is already closed then this method has no effect.<DD><DL></DL></DD></DL><HR><A NAME="append(java.awt.Shape, boolean)"><!-- --></A><H3>append</H3><PRE>public void <B>append</B>(<A HREF="../../../java/awt/Shape.html">Shape</A>&nbsp;s,                   boolean&nbsp;connect)</PRE><DL><DD>Appends the geometry of the specified <code>Shape</code> object to the path, possibly connecting the new geometry to the existing path segments with a line segment. If the <code>connect</code> parameter is <code>true</code> and the  path is not empty then any initial <code>moveTo</code> in the geometry of the appended <code>Shape</code> is turned into a <code>lineTo</code> segment. If the destination coordinates of such a connecting <code>lineTo</code> segment match the ending coordinates of a currently open subpath then the segment is omitted as superfluous. The winding rule of the specified <code>Shape</code> is ignored and the appended geometry is governed by the winding rule specified for this path.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the <code>Shape</code> whose geometry is appended  to this path<DD><CODE>connect</CODE> - a boolean to control whether or not to turn an initial <code>moveTo</code> segment into a <code>lineTo</code> segment to connect the new geometry to the existing path</DL></DD></DL><HR><A NAME="append(java.awt.geom.PathIterator, boolean)"><!-- --></A><H3>append</H3><PRE>public void <B>append</B>(<A HREF="../../../java/awt/geom/PathIterator.html">PathIterator</A>&nbsp;pi,                   boolean&nbsp;connect)</PRE><DL><DD>Appends the geometry of the specified <A HREF="../../../java/awt/geom/PathIterator.html"><CODE>PathIterator</CODE></A> object  to the path, possibly connecting the new geometry to the existing path segments with a line segment. If the <code>connect</code> parameter is <code>true</code> and the  path is not empty then any initial <code>moveTo</code> in the geometry of the appended <code>Shape</code> is turned into a <code>lineTo</code> segment. If the destination coordinates of such a connecting <code>lineTo</code> segment match the ending coordinates of a currently open subpath then the segment is omitted as superfluous. The winding rule of the specified <code>Shape</code> is ignored and the appended geometry is governed by the winding rule specified for this path.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pi</CODE> - the <code>PathIterator</code> whose geometry is appended to  this path<DD><CODE>connect</CODE> - a boolean to control whether or not to turn an initial <code>moveTo</code> segment into a <code>lineTo</code> segment to connect the new geometry to the existing path</DL></DD></DL><HR><A NAME="getWindingRule()"><!-- --></A><H3>getWindingRule</H3><PRE>public int <B>getWindingRule</B>()</PRE><DL><DD>Returns the fill style winding rule.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an integer representing the current winding rule.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/geom/GeneralPath.html#WIND_EVEN_ODD"><CODE>WIND_EVEN_ODD</CODE></A>, <A HREF="../../../java/awt/geom/GeneralPath.html#WIND_NON_ZERO"><CODE>WIND_NON_ZERO</CODE></A></DL></DD></DL><HR><A NAME="setWindingRule(int)"><!-- --></A><H3>setWindingRule</H3><PRE>public void <B>setWindingRule</B>(int&nbsp;rule)</PRE><DL><DD>Sets the winding rule for this path to the specified value.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rule</CODE> - an integer representing the specified  winding rule<DT><B>Throws:</B><DD><CODE><code>IllegalArgumentException</code></CODE> - if 		<code>rule</code> is not either 		<code>WIND_EVEN_ODD</code> or		<code>WIND_NON_ZERO</code><DT><B>See Also: </B><DD><A HREF="../../../java/awt/geom/GeneralPath.html#WIND_EVEN_ODD"><CODE>WIND_EVEN_ODD</CODE></A>, <A HREF="../../../java/awt/geom/GeneralPath.html#WIND_NON_ZERO"><CODE>WIND_NON_ZERO</CODE></A></DL></DD></DL><HR><A NAME="getCurrentPoint()"><!-- --></A><H3>getCurrentPoint</H3><PRE>public <A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> <B>getCurrentPoint</B>()</PRE><DL><DD>Returns the coordinates most recently added to the end of the path as a <A HREF="../../../java/awt/geom/Point2D.html"><CODE>Point2D</CODE></A> object.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>Point2D</code> object containing the ending  coordinates of the path or <code>null</code> if there are no points in the path.</DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>public void <B>reset</B>()</PRE><DL><DD>Resets the path to empty.  The append position is set back to the beginning of the path and all coordinates and point types are forgotten.<DD><DL></DL></DD></DL><HR><A NAME="transform(java.awt.geom.AffineTransform)"><!-- --></A><H3>transform</H3><PRE>public void <B>transform</B>(<A HREF="../../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;at)</PRE><DL><DD>Transforms the geometry of this path using the specified  <A HREF="../../../java/awt/geom/AffineTransform.html"><CODE>AffineTransform</CODE></A>. The geometry is transformed in place, which permanently changes the boundary defined by this object.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>at</CODE> - the <code>AffineTransform</code> used to transform the area</DL></DD></DL><HR><A NAME="createTransformedShape(java.awt.geom.AffineTransform)"><!-- --></A><H3>createTransformedShape</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A> <B>createTransformedShape</B>(<A HREF="../../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;at)</PRE><DL>

⌨️ 快捷键说明

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