gradientpaint.html

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

HTML
515
字号
<TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="GradientPaint(float, float, java.awt.Color, float, float, java.awt.Color)"><!-- --></A><H3>GradientPaint</H3><PRE>public <B>GradientPaint</B>(float&nbsp;x1,                     float&nbsp;y1,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color1,                     float&nbsp;x2,                     float&nbsp;y2,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color2)</PRE><DL><DD>Constructs a simple acyclic <code>GradientPaint</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>x1,&nbsp;y1</CODE> - coordinates of the first specified <code>Point</code> in user space<DD><CODE>color1</CODE> - <code>Color</code> at the first specified  <code>Point</code><DD><CODE>x2,&nbsp;y2</CODE> - coordinates of the second specified <code>Point</code> in user space<DD><CODE>color2</CODE> - <code>Color</code> at the second specified  <code>Point</code></DL></DD></DL><HR><A NAME="GradientPaint(java.awt.geom.Point2D, java.awt.Color, java.awt.geom.Point2D, java.awt.Color)"><!-- --></A><H3>GradientPaint</H3><PRE>public <B>GradientPaint</B>(<A HREF="../../java/awt/geom/Point2D.html">Point2D</A>&nbsp;pt1,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color1,                     <A HREF="../../java/awt/geom/Point2D.html">Point2D</A>&nbsp;pt2,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color2)</PRE><DL><DD>Constructs a simple acyclic <code>GradientPaint</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>pt1</CODE> - the first specified <code>Point</code> in user space<DD><CODE>color1</CODE> - <code>Color</code> at the first specified  <code>Point</code><DD><CODE>pt2</CODE> - the second specified <code>Point</code> in user space<DD><CODE>color2</CODE> - <code>Color</code> at the second specified  <code>Point</code></DL></DD></DL><HR><A NAME="GradientPaint(float, float, java.awt.Color, float, float, java.awt.Color, boolean)"><!-- --></A><H3>GradientPaint</H3><PRE>public <B>GradientPaint</B>(float&nbsp;x1,                     float&nbsp;y1,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color1,                     float&nbsp;x2,                     float&nbsp;y2,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color2,                     boolean&nbsp;cyclic)</PRE><DL><DD>Constructs either a cyclic or acyclic <code>GradientPaint</code> object depending on the <code>boolean</code> parameter.<DD><DL><DT><B>Parameters:</B><DD><CODE>x1,&nbsp;y1</CODE> - coordinates of the first specified <code>Point</code> in user space<DD><CODE>color1</CODE> - <code>Color</code> at the first specified  <code>Point</code><DD><CODE>x2,&nbsp;y2</CODE> - coordinates of the second specified <code>Point</code> in user space<DD><CODE>color2</CODE> - <code>Color</code> at the second specified  <code>Point</code><DD><CODE>cyclic</CODE> - <code>true</code> if the gradient pattern should cycle repeatedly between the two colors; <code>false</code> otherwise</DL></DD></DL><HR><A NAME="GradientPaint(java.awt.geom.Point2D, java.awt.Color, java.awt.geom.Point2D, java.awt.Color, boolean)"><!-- --></A><H3>GradientPaint</H3><PRE>public <B>GradientPaint</B>(<A HREF="../../java/awt/geom/Point2D.html">Point2D</A>&nbsp;pt1,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color1,                     <A HREF="../../java/awt/geom/Point2D.html">Point2D</A>&nbsp;pt2,                     <A HREF="../../java/awt/Color.html">Color</A>&nbsp;color2,                     boolean&nbsp;cyclic)</PRE><DL><DD>Constructs either a cyclic or acyclic <code>GradientPaint</code> object depending on the <code>boolean</code> parameter.<DD><DL><DT><B>Parameters:</B><DD><CODE>pt1</CODE> - the first specified <code>Point</code>  in user space<DD><CODE>color1</CODE> - <code>Color</code> at the first specified  <code>Point</code><DD><CODE>pt2</CODE> - the second specified <code>Point</code>  in user space<DD><CODE>color2</CODE> - <code>Color</code> at the second specified  <code>Point</code><DD><CODE>cyclic</CODE> - <code>true</code> if the gradient pattern should cycle repeatedly between the two colors; <code>false</code> otherwise</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="getPoint1()"><!-- --></A><H3>getPoint1</H3><PRE>public <A HREF="../../java/awt/geom/Point2D.html">Point2D</A> <B>getPoint1</B>()</PRE><DL><DD>Returns a copy of the point P1 that anchors the first color.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <A HREF="../../java/awt/geom/Point2D.html"><CODE>Point2D</CODE></A> object that is a copy of the point that anchors the first color of this  <code>GradientPaint</code>.</DL></DD></DL><HR><A NAME="getColor1()"><!-- --></A><H3>getColor1</H3><PRE>public <A HREF="../../java/awt/Color.html">Color</A> <B>getColor1</B>()</PRE><DL><DD>Returns the color C1 anchored by the point P1.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>Color</code> object that is the color anchored by P1.</DL></DD></DL><HR><A NAME="getPoint2()"><!-- --></A><H3>getPoint2</H3><PRE>public <A HREF="../../java/awt/geom/Point2D.html">Point2D</A> <B>getPoint2</B>()</PRE><DL><DD>Returns a copy of the point P2 which anchors the second color.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <A HREF="../../java/awt/geom/Point2D.html"><CODE>Point2D</CODE></A> object that is a copy of the point that anchors the second color of this <code>GradientPaint</code>.</DL></DD></DL><HR><A NAME="getColor2()"><!-- --></A><H3>getColor2</H3><PRE>public <A HREF="../../java/awt/Color.html">Color</A> <B>getColor2</B>()</PRE><DL><DD>Returns the color C2 anchored by the point P2.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>Color</code> object that is the color anchored by P2.</DL></DD></DL><HR><A NAME="isCyclic()"><!-- --></A><H3>isCyclic</H3><PRE>public boolean <B>isCyclic</B>()</PRE><DL><DD>Returns <code>true</code> if the gradient cycles repeatedly between the two colors C1 and C2.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if the gradient cycles repeatedly between the two colors; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="createContext(java.awt.image.ColorModel, java.awt.Rectangle, java.awt.geom.Rectangle2D, java.awt.geom.AffineTransform, java.awt.RenderingHints)"><!-- --></A><H3>createContext</H3><PRE>public <A HREF="../../java/awt/PaintContext.html">PaintContext</A> <B>createContext</B>(<A HREF="../../java/awt/image/ColorModel.html">ColorModel</A>&nbsp;cm,                                  <A HREF="../../java/awt/Rectangle.html">Rectangle</A>&nbsp;deviceBounds,                                  <A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;userBounds,                                  <A HREF="../../java/awt/geom/AffineTransform.html">AffineTransform</A>&nbsp;xform,                                  <A HREF="../../java/awt/RenderingHints.html">RenderingHints</A>&nbsp;hints)</PRE><DL><DD>Creates and returns a context used to generate the color pattern.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Paint.html#createContext(java.awt.image.ColorModel, java.awt.Rectangle, java.awt.geom.Rectangle2D, java.awt.geom.AffineTransform, java.awt.RenderingHints)">createContext</A></CODE> in interface <CODE><A HREF="../../java/awt/Paint.html">Paint</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>cm</CODE> - <A HREF="../../java/awt/image/ColorModel.html"><CODE>ColorModel</CODE></A> that receives the <code>Paint</code> data. This is used only as a hint.<DD><CODE>deviceBounds</CODE> - the device space bounding box of the  graphics primitive being rendered<DD><CODE>userBounds</CODE> - the user space bounding box of the  graphics primitive being rendered<DD><CODE>xform</CODE> - the <A HREF="../../java/awt/geom/AffineTransform.html"><CODE>AffineTransform</CODE></A> from user     space into device space<DD><CODE>hints</CODE> - the hints that the context object uses to choose between rendering alternatives<DT><B>Returns:</B><DD>the <A HREF="../../java/awt/PaintContext.html"><CODE>PaintContext</CODE></A> that generates color patterns.<DT><B>See Also: </B><DD><A HREF="../../java/awt/PaintContext.html"><CODE>PaintContext</CODE></A></DL></DD></DL><HR><A NAME="getTransparency()"><!-- --></A><H3>getTransparency</H3><PRE>public int <B>getTransparency</B>()</PRE><DL><DD>Returns the transparency mode for this <code>GradientPaint</code>.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/awt/Transparency.html#getTransparency()">getTransparency</A></CODE> in interface <CODE><A HREF="../../java/awt/Transparency.html">Transparency</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an integer value representing this <code>GradientPaint</code> object's transparency mode.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Transparency.html"><CODE>Transparency</CODE></A></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/GradientPaint.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/Frame.AccessibleAWTFrame.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/awt/Graphics.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="GradientPaint.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;FIELD&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;FIELD&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 + -
显示快捷键?