rectangle.html
来自「API資料大全」· HTML 代码 · 共 1,466 行 · 第 1/5 页
HTML
1,466 行
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Rectangle.html#translate(int, int)">translate</A></B>(int x, int y)</CODE><BR> Translates this <code>Rectangle</code> the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.</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/Rectangle.html#union(java.awt.Rectangle)">union</A></B>(<A HREF="../../java/awt/Rectangle.html">Rectangle</A> r)</CODE><BR> Computes the union of this <code>Rectangle</code> with the specified <code>Rectangle</code>.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.geom.Rectangle2D"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.awt.geom.<A HREF="../../java/awt/geom/Rectangle2D.html">Rectangle2D</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/awt/geom/Rectangle2D.html#add(double, double)">add</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#add(java.awt.geom.Point2D)">add</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#add(java.awt.geom.Rectangle2D)">add</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#contains(double, double)">contains</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#contains(double, double, double, double)">contains</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#getPathIterator(java.awt.geom.AffineTransform)">getPathIterator</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#getPathIterator(java.awt.geom.AffineTransform, double)">getPathIterator</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#hashCode()">hashCode</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#intersect(java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D)">intersect</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#intersects(double, double, double, double)">intersects</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#intersectsLine(double, double, double, double)">intersectsLine</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#intersectsLine(java.awt.geom.Line2D)">intersectsLine</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#outcode(java.awt.geom.Point2D)">outcode</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#setFrame(double, double, double, double)">setFrame</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#setRect(java.awt.geom.Rectangle2D)">setRect</A>, <A HREF="../../java/awt/geom/Rectangle2D.html#union(java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D)">union</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.geom.RectangularShape"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.awt.geom.<A HREF="../../java/awt/geom/RectangularShape.html">RectangularShape</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/awt/geom/RectangularShape.html#clone()">clone</A>, <A HREF="../../java/awt/geom/RectangularShape.html#contains(java.awt.geom.Point2D)">contains</A>, <A HREF="../../java/awt/geom/RectangularShape.html#contains(java.awt.geom.Rectangle2D)">contains</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getCenterX()">getCenterX</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getCenterY()">getCenterY</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getFrame()">getFrame</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getMaxX()">getMaxX</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getMaxY()">getMaxY</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getMinX()">getMinX</A>, <A HREF="../../java/awt/geom/RectangularShape.html#getMinY()">getMinY</A>, <A HREF="../../java/awt/geom/RectangularShape.html#intersects(java.awt.geom.Rectangle2D)">intersects</A>, <A HREF="../../java/awt/geom/RectangularShape.html#setFrame(java.awt.geom.Point2D, java.awt.geom.Dimension2D)">setFrame</A>, <A HREF="../../java/awt/geom/RectangularShape.html#setFrame(java.awt.geom.Rectangle2D)">setFrame</A>, <A HREF="../../java/awt/geom/RectangularShape.html#setFrameFromCenter(double, double, double, double)">setFrameFromCenter</A>, <A HREF="../../java/awt/geom/RectangularShape.html#setFrameFromCenter(java.awt.geom.Point2D, java.awt.geom.Point2D)">setFrameFromCenter</A>, <A HREF="../../java/awt/geom/RectangularShape.html#setFrameFromDiagonal(double, double, double, double)">setFrameFromDiagonal</A>, <A HREF="../../java/awt/geom/RectangularShape.html#setFrameFromDiagonal(java.awt.geom.Point2D, java.awt.geom.Point2D)">setFrameFromDiagonal</A></CODE></TD></TR></TABLE> <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#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</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#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> <A NAME="methods_inherited_from_class_java.awt.Shape"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface java.awt.<A HREF="../../java/awt/Shape.html">Shape</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/awt/Shape.html#contains(double, double)">contains</A>, <A HREF="../../java/awt/Shape.html#contains(double, double, double, double)">contains</A>, <A HREF="../../java/awt/Shape.html#contains(java.awt.geom.Point2D)">contains</A>, <A HREF="../../java/awt/Shape.html#contains(java.awt.geom.Rectangle2D)">contains</A>, <A HREF="../../java/awt/Shape.html#getPathIterator(java.awt.geom.AffineTransform)">getPathIterator</A>, <A HREF="../../java/awt/Shape.html#getPathIterator(java.awt.geom.AffineTransform, double)">getPathIterator</A>, <A HREF="../../java/awt/Shape.html#intersects(double, double, double, double)">intersects</A>, <A HREF="../../java/awt/Shape.html#intersects(java.awt.geom.Rectangle2D)">intersects</A></CODE></TD></TR></TABLE> <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="x"><!-- --></A><H3>x</H3><PRE>public int <B>x</B></PRE><DL><DD>The <i>x</i> coordinate of the <code>Rectangle</code>.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Rectangle.html#setLocation(int, int)"><CODE>setLocation(int, int)</CODE></A>, <A HREF="../../java/awt/Rectangle.html#getLocation()"><CODE>getLocation()</CODE></A></DL></DD></DL><HR><A NAME="y"><!-- --></A><H3>y</H3><PRE>public int <B>y</B></PRE><DL><DD>The <i>y</i> coordinate of the <code>Rectangle</code>.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Rectangle.html#setLocation(int, int)"><CODE>setLocation(int, int)</CODE></A>, <A HREF="../../java/awt/Rectangle.html#getLocation()"><CODE>getLocation()</CODE></A></DL></DD></DL><HR><A NAME="width"><!-- --></A><H3>width</H3><PRE>public int <B>width</B></PRE><DL><DD>The width of the <code>Rectangle</code>.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Rectangle.html#setSize(int, int)"><CODE>setSize(int, int)</CODE></A>, <A HREF="../../java/awt/Rectangle.html#getSize()"><CODE>getSize()</CODE></A><DT><B>Since: </B><DD>JDK1.0.</DD></DL></DD></DL><HR><A NAME="height"><!-- --></A><H3>height</H3><PRE>public int <B>height</B></PRE><DL><DD>The height of the <code>Rectangle</code>.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Rectangle.html#setSize(int, int)"><CODE>setSize(int, int)</CODE></A>, <A HREF="../../java/awt/Rectangle.html#getSize()"><CODE>getSize()</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="Rectangle()"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>()</PRE><DL><DD>Constructs a new <code>Rectangle</code> whose top-left corner is at (0, 0) in the coordinate space, and whose width and height are both zero.</DL><HR><A NAME="Rectangle(java.awt.Rectangle)"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>(<A HREF="../../java/awt/Rectangle.html">Rectangle</A> r)</PRE><DL><DD>Constructs a new <code>Rectangle</code>, initialized to match the values of the specificed <code>Rectangle</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the <code>Rectangle</code> from which to copy initial values to a newly constructed <code>Rectangle</code><DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="Rectangle(int, int, int, int)"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>(int x, int y, int width, int height)</PRE><DL><DD>Constructs a new <code>Rectangle</code> whose top-left corner is specified as (<code>x</code>, <code>y</code>) and whose width and height are specified by the arguments of the same name.<DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the specified coordinates<DD><CODE>width</CODE> - the width of the <code>Rectangle</code><DD><CODE>height</CODE> - the height of the <code>Rectangle</code></DL></DD></DL><HR><A NAME="Rectangle(int, int)"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>(int width, int height)</PRE><DL><DD>Constructs a new <code>Rectangle</code> whose top-left corner is at (0, 0) in the coordinate space, and whose width and height are specified by the arguments of the same name.<DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the width of the <code>Rectangle</code><DD><CODE>height</CODE> - the height of the <code>Rectangle</code></DL></DD></DL><HR><A NAME="Rectangle(java.awt.Point, java.awt.Dimension)"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>(<A HREF="../../java/awt/Point.html">Point</A> p, <A HREF="../../java/awt/Dimension.html">Dimension</A> d)</PRE><DL><DD>Constructs a new <code>Rectangle</code> whose top-left corner is specified by the <A HREF="../../java/awt/Point.html"><CODE>Point</CODE></A> argument, and whose width and height are specified by the <A HREF="../../java/awt/Dimension.html"><CODE>Dimension</CODE></A> argument.<DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - a <code>Point</code> that is the top-left corner of the <code>Rectangle</code><DD><CODE>d</CODE> - a <code>Dimension</code>, representing the width and height of the <code>Rectangle</code></DL></DD></DL><HR><A NAME="Rectangle(java.awt.Point)"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>(<A HREF="../../java/awt/Point.html">Point</A> p)</PRE><DL><DD>Constructs a new <code>Rectangle</code> whose top-left corner is the specified <code>Point</code>, and whose width and height are both zero.<DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - a <code>Point</code> that is the top left corner of the <code>Rectangle</code></DL></DD></DL><HR><A NAME="Rectangle(java.awt.Dimension)"><!-- --></A><H3>Rectangle</H3><PRE>public <B>Rectangle</B>(<A HREF="../../java/awt/Dimension.html">Dimension</A> d)</PRE><DL><DD>Constructs a new <code>Rectangle</code> whose top left corner is (0, 0) and whose width and height are specified by the <code>Dimension</code> argument.<DD><DL><DT><B>Parameters:</B><DD><CODE>d</CODE> - a <code>Dimension</code>, specifying width and height</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="getX()"><!-- --></A><H3>getX</H3><PRE>public double <B>getX</B>()</PRE><DL><DD>Returns the X coordinate of the bounding <code>Rectangle</code> in <code>double</code> precision.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/geom/RectangularShape.html#getX()">getX</A></CODE> in class <CODE><A HREF="../../java/awt/geom/RectangularShape.html">RectangularShape</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the x coordinate of the bounding <code>Rectangle</code>.</DL></DD></DL><HR><A NAME="getY()"><!-- --></A><H3>getY</H3><PRE>public double <B>getY</B>()</PRE><DL><DD>Returns the Y coordinate of the bounding <code>Rectangle</code> in <code>double</code> precision.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/geom/RectangularShape.html#getY()">getY</A></CODE> in class <CODE><A HREF="../../java/awt/geom/RectangularShape.html">RectangularShape</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the y coordinate of the bounding <code>Rectangle</code>.</DL></DD></DL><HR><A NAME="getWidth()"><!-- --></A><H3>getWidth</H3><PRE>public double <B>getWidth</B>()</PRE><DL><DD>Returns the width of the bounding <code>Rectangle</code> in <code>double</code> precision.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/geom/RectangularShape.html#getWidth()">getWidth</A></CODE> in class <CODE><A HREF="../../java/awt/geom/RectangularShape.html">RectangularShape</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the width of the bounding <code>Rectangle</code>.</DL></DD></DL><HR><A NAME="getHeight()"><!-- --></A><H3>getHeight</H3><PRE>public double <B>getHeight</B>()</PRE><DL><DD>Returns the height of the bounding <code>Rectangle</code> in <code>double</code> precision.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/geom/RectangularShape.html#getHeight()">getHeight</A></CODE> in class <CODE><A HREF="../../java/awt/geom/RectangularShape.html">RectangularShape</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the height of the bounding <code>Rectangle</code>.</DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?