basicstroke.html

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

HTML
679
字号
<DL><DD>Joins path segments by rounding off the corner at a radius of half the line width.</DL><HR><A NAME="JOIN_BEVEL"><!-- --></A><H3>JOIN_BEVEL</H3><PRE>public static final int <B>JOIN_BEVEL</B></PRE><DL><DD>Joins path segments by connecting the outer corners of their wide outlines with a straight segment.</DL><HR><A NAME="CAP_BUTT"><!-- --></A><H3>CAP_BUTT</H3><PRE>public static final int <B>CAP_BUTT</B></PRE><DL><DD>Ends unclosed subpaths and dash segments with no added decoration.</DL><HR><A NAME="CAP_ROUND"><!-- --></A><H3>CAP_ROUND</H3><PRE>public static final int <B>CAP_ROUND</B></PRE><DL><DD>Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.</DL><HR><A NAME="CAP_SQUARE"><!-- --></A><H3>CAP_SQUARE</H3><PRE>public static final int <B>CAP_SQUARE</B></PRE><DL><DD>Ends unclosed subpaths and dash segments with a square projection that extends beyond the end of the segment to a distance equal to half of the line width.</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="BasicStroke(float, int, int, float, float[], float)"><!-- --></A><H3>BasicStroke</H3><PRE>public <B>BasicStroke</B>(float&nbsp;width,                   int&nbsp;cap,                   int&nbsp;join,                   float&nbsp;miterlimit,                   float[]&nbsp;dash,                   float&nbsp;dash_phase)</PRE><DL><DD>Constructs a new <code>BasicStroke</code> with the specified attributes.<DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the width of the <code>BasicStroke</code><DD><CODE>cap</CODE> - the decoration of the ends of a <code>BasicStroke</code><DD><CODE>join</CODE> - the decoration applied where path segments meet<DD><CODE>miterlimit</CODE> - the limit to trim the miter join<DD><CODE>dash</CODE> - the array representing the dashing pattern<DD><CODE>dash_phase</CODE> - the offset to start the dashing pattern<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>width</code> is negative<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>cap</code> is not either         CAP_BUTT, CAP_ROUND or CAP_SQUARE<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>miterlimit</code> is less         than 1 and <code>join</code> is JOIN_MITER<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>join</code> is not         either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>dash_phase</code>         is negative and <code>dash</code> is not <code>null</code><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the length of         <code>dash</code> is zero<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if dash lengths are all zero.</DL></DD></DL><HR><A NAME="BasicStroke(float, int, int, float)"><!-- --></A><H3>BasicStroke</H3><PRE>public <B>BasicStroke</B>(float&nbsp;width,                   int&nbsp;cap,                   int&nbsp;join,                   float&nbsp;miterlimit)</PRE><DL><DD>Constructs a solid <code>BasicStroke</code> with the specified  attributes.<DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the width of the <code>BasicStroke</code><DD><CODE>cap</CODE> - the decoration of the ends of a <code>BasicStroke</code><DD><CODE>join</CODE> - the decoration applied where path segments meet<DD><CODE>miterlimit</CODE> - the limit to trim the miter join<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>width</code> is negative<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>cap</code> is not either         CAP_BUTT, CAP_ROUND or CAP_SQUARE<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>miterlimit</code> is less         than 1 and <code>join</code> is JOIN_MITER<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>join</code> is not         either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER</DL></DD></DL><HR><A NAME="BasicStroke(float, int, int)"><!-- --></A><H3>BasicStroke</H3><PRE>public <B>BasicStroke</B>(float&nbsp;width,                   int&nbsp;cap,                   int&nbsp;join)</PRE><DL><DD>Constructs a solid <code>BasicStroke</code> with the specified  attributes.  The <code>miterlimit</code> parameter is  unnecessary in cases where the default is allowable or the  line joins are not specified as JOIN_MITER.<DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the width of the <code>BasicStroke</code><DD><CODE>cap</CODE> - the decoration of the ends of a <code>BasicStroke</code><DD><CODE>join</CODE> - the decoration applied where path segments meet<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>width</code> is negative<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>cap</code> is not either         CAP_BUTT, CAP_ROUND or CAP_SQUARE<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>join</code> is not         either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER</DL></DD></DL><HR><A NAME="BasicStroke(float)"><!-- --></A><H3>BasicStroke</H3><PRE>public <B>BasicStroke</B>(float&nbsp;width)</PRE><DL><DD>Constructs a solid <code>BasicStroke</code> with the specified  line width and with default values for the cap and join  styles.<DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the width of the <code>BasicStroke</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>width</code> is negative</DL></DD></DL><HR><A NAME="BasicStroke()"><!-- --></A><H3>BasicStroke</H3><PRE>public <B>BasicStroke</B>()</PRE><DL><DD>Constructs a new <code>BasicStroke</code> with defaults for all  attributes. The default attributes are a solid line of width 1.0, CAP_SQUARE, JOIN_MITER, a miter limit of 10.0.</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="createStrokedShape(java.awt.Shape)"><!-- --></A><H3>createStrokedShape</H3><PRE>public <A HREF="../../java/awt/Shape.html">Shape</A> <B>createStrokedShape</B>(<A HREF="../../java/awt/Shape.html">Shape</A>&nbsp;s)</PRE><DL><DD>Returns a <code>Shape</code> whose interior defines the  stroked outline of a specified <code>Shape</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Stroke.html#createStrokedShape(java.awt.Shape)">createStrokedShape</A></CODE> in interface <CODE><A HREF="../../java/awt/Stroke.html">Stroke</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the <code>Shape</code> boundary be stroked<DT><B>Returns:</B><DD>the <code>Shape</code> of the stroked outline.</DL></DD></DL><HR><A NAME="getLineWidth()"><!-- --></A><H3>getLineWidth</H3><PRE>public float <B>getLineWidth</B>()</PRE><DL><DD>Returns the line width.  Line width is represented in user space.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the line width of this <code>BasicStroke</code>.</DL></DD></DL><HR><A NAME="getEndCap()"><!-- --></A><H3>getEndCap</H3><PRE>public int <B>getEndCap</B>()</PRE><DL><DD>Returns the end cap style.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the end cap style of this <code>BasicStroke</code> as one of the static <code>int</code> values that define possible end cap styles.</DL></DD></DL><HR><A NAME="getLineJoin()"><!-- --></A><H3>getLineJoin</H3><PRE>public int <B>getLineJoin</B>()</PRE><DL><DD>Returns the line join style.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the line join style of the <code>BasicStroke</code> as one of the static <code>int</code> values that define possible line join styles.</DL></DD></DL><HR><A NAME="getMiterLimit()"><!-- --></A><H3>getMiterLimit</H3><PRE>public float <B>getMiterLimit</B>()</PRE><DL><DD>Returns the limit of miter joins.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the limit of miter joins of the <code>BasicStroke</code>.</DL></DD></DL><HR><A NAME="getDashArray()"><!-- --></A><H3>getDashArray</H3><PRE>public float[] <B>getDashArray</B>()</PRE><DL><DD>Returns the array representing the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes. As the pen moves along the outline of the <code>Shape</code> to be stroked, the user space distance that the pen travels is accumulated.  The distance value is used to index into the dash array. The pen is opaque when its current cumulative distance maps to an even element of the dash array and transparent otherwise.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the dash array.</DL></DD></DL><HR><A NAME="getDashPhase()"><!-- --></A><H3>getDashPhase</H3><PRE>public float <B>getDashPhase</B>()</PRE><DL><DD>Returns the current dash phase. The dash phase is a distance specified in user coordinates that  represents an offset into the dashing pattern. In other words, the dash  phase defines the point in the dashing pattern that will correspond to  the beginning of the stroke.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the dash phase as a <code>float</code> value.</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Returns the hashcode for this stroke.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a hash code for this stroke.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Tests if a specified object is equal to this <code>BasicStroke</code> by first testing if it is a <code>BasicStroke</code> and then comparing  its width, join, cap, miter limit, dash, and dash phase attributes with  those of this <code>BasicStroke</code>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the specified object to compare to this               <code>BasicStroke</code><DT><B>Returns:</B><DD><code>true</code> if the width, join, cap, miter limit, dash, and            dash phase are the same for both objects;            <code>false</code> otherwise.</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/BasicStroke.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/AWTPermission.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/awt/BorderLayout.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="BasicStroke.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&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 + -
显示快捷键?