< prev index next >
src/java.desktop/share/classes/sun/print/ProxyGraphics.java
Print this page
*** 61,102 ****
Graphics getGraphics() {
return g;
}
/**
! * Creates a new <code>Graphics</code> object that is
! * a copy of this <code>Graphics</code> object.
* @return a new graphics context that is a copy of
* this graphics context.
*/
public Graphics create() {
return new ProxyGraphics(g.create());
}
/**
! * Creates a new <code>Graphics</code> object based on this
! * <code>Graphics</code> object, but with a new translation and clip area.
! * The new <code>Graphics</code> object has its origin
* translated to the specified point (<i>x</i>, <i>y</i>).
* Its clip area is determined by the intersection of the original
* clip area with the specified rectangle. The arguments are all
* interpreted in the coordinate system of the original
! * <code>Graphics</code> object. The new graphics context is
* identical to the original, except in two respects:
* <p>
* <ul>
* <li>
* The new graphics context is translated by (<i>x</i>, <i>y</i>).
! * That is to say, the point (<code>0</code>, <code>0</code>) in the
* new graphics context is the same as (<i>x</i>, <i>y</i>) in
* the original graphics context.
* <li>
* The new graphics context has an additional clipping rectangle, in
* addition to whatever (translated) clipping rectangle it inherited
* from the original graphics context. The origin of the new clipping
! * rectangle is at (<code>0</code>, <code>0</code>), and its size
! * is specified by the <code>width</code> and <code>height</code>
* arguments.
* </ul>
* <p>
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
--- 61,102 ----
Graphics getGraphics() {
return g;
}
/**
! * Creates a new {@code Graphics} object that is
! * a copy of this {@code Graphics} object.
* @return a new graphics context that is a copy of
* this graphics context.
*/
public Graphics create() {
return new ProxyGraphics(g.create());
}
/**
! * Creates a new {@code Graphics} object based on this
! * {@code Graphics} object, but with a new translation and clip area.
! * The new {@code Graphics} object has its origin
* translated to the specified point (<i>x</i>, <i>y</i>).
* Its clip area is determined by the intersection of the original
* clip area with the specified rectangle. The arguments are all
* interpreted in the coordinate system of the original
! * {@code Graphics} object. The new graphics context is
* identical to the original, except in two respects:
* <p>
* <ul>
* <li>
* The new graphics context is translated by (<i>x</i>, <i>y</i>).
! * That is to say, the point ({@code 0}, {@code 0}) in the
* new graphics context is the same as (<i>x</i>, <i>y</i>) in
* the original graphics context.
* <li>
* The new graphics context has an additional clipping rectangle, in
* addition to whatever (translated) clipping rectangle it inherited
* from the original graphics context. The origin of the new clipping
! * rectangle is at ({@code 0}, {@code 0}), and its size
! * is specified by the {@code width} and {@code height}
* arguments.
* </ul>
* <p>
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
*** 229,244 ****
/**
* Returns the bounding rectangle of the current clipping area.
* This method refers to the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* If no clip has previously been set, or if the clip has been
! * cleared using <code>setClip(null)</code>, this method returns
! * <code>null</code>.
* The coordinates in the rectangle are relative to the coordinate
* system origin of this graphics context.
* @return the bounding rectangle of the current clipping area,
! * or <code>null</code> if no clip is set.
* @see java.awt.Graphics#getClip
* @see java.awt.Graphics#clipRect
* @see java.awt.Graphics#setClip(int, int, int, int)
* @see java.awt.Graphics#setClip(Shape)
* @since 1.1
--- 229,244 ----
/**
* Returns the bounding rectangle of the current clipping area.
* This method refers to the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* If no clip has previously been set, or if the clip has been
! * cleared using {@code setClip(null)}, this method returns
! * {@code null}.
* The coordinates in the rectangle are relative to the coordinate
* system origin of this graphics context.
* @return the bounding rectangle of the current clipping area,
! * or {@code null} if no clip is set.
* @see java.awt.Graphics#getClip
* @see java.awt.Graphics#clipRect
* @see java.awt.Graphics#setClip(int, int, int, int)
* @see java.awt.Graphics#setClip(Shape)
* @since 1.1
*** 250,260 ****
/**
* Intersects the current clip with the specified rectangle.
* The resulting clipping area is the intersection of the current
* clipping area and the specified rectangle. If there is no
* current clipping area, either because the clip has never been
! * set, or the clip has been cleared using <code>setClip(null)</code>,
* the specified rectangle becomes the new clip.
* This method sets the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* This method can only be used to make the current clip smaller.
* To set the current clip larger, use any of the setClip methods.
--- 250,260 ----
/**
* Intersects the current clip with the specified rectangle.
* The resulting clipping area is the intersection of the current
* clipping area and the specified rectangle. If there is no
* current clipping area, either because the clip has never been
! * set, or the clip has been cleared using {@code setClip(null)},
* the specified rectangle becomes the new clip.
* This method sets the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* This method can only be used to make the current clip smaller.
* To set the current clip larger, use any of the setClip methods.
*** 291,304 ****
/**
* Gets the current clipping area.
* This method returns the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* If no clip has previously been set, or if the clip has been
! * cleared using <code>setClip(null)</code>, this method returns
! * <code>null</code>.
! * @return a <code>Shape</code> object representing the
! * current clipping area, or <code>null</code> if
* no clip is set.
* @see java.awt.Graphics#getClipBounds
* @see java.awt.Graphics#clipRect
* @see java.awt.Graphics#setClip(int, int, int, int)
* @see java.awt.Graphics#setClip(Shape)
--- 291,304 ----
/**
* Gets the current clipping area.
* This method returns the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* If no clip has previously been set, or if the clip has been
! * cleared using {@code setClip(null)}, this method returns
! * {@code null}.
! * @return a {@code Shape} object representing the
! * current clipping area, or {@code null} if
* no clip is set.
* @see java.awt.Graphics#getClipBounds
* @see java.awt.Graphics#clipRect
* @see java.awt.Graphics#setClip(int, int, int, int)
* @see java.awt.Graphics#setClip(Shape)
*** 308,326 ****
return g.getClip();
}
/**
* Sets the current clipping area to an arbitrary clip shape.
! * Not all objects that implement the <code>Shape</code>
* interface can be used to set the clip. The only
! * <code>Shape</code> objects that are guaranteed to be
! * supported are <code>Shape</code> objects that are
! * obtained via the <code>getClip</code> method and via
! * <code>Rectangle</code> objects. This method sets the
* user clip, which is independent of the clipping associated
* with device bounds and window visibility.
! * @param clip the <code>Shape</code> to use to set the clip
* @see java.awt.Graphics#getClip()
* @see java.awt.Graphics#clipRect
* @see java.awt.Graphics#setClip(int, int, int, int)
* @since 1.1
*/
--- 308,326 ----
return g.getClip();
}
/**
* Sets the current clipping area to an arbitrary clip shape.
! * Not all objects that implement the {@code Shape}
* interface can be used to set the clip. The only
! * {@code Shape} objects that are guaranteed to be
! * supported are {@code Shape} objects that are
! * obtained via the {@code getClip} method and via
! * {@code Rectangle} objects. This method sets the
* user clip, which is independent of the clipping associated
* with device bounds and window visibility.
! * @param clip the {@code Shape} to use to set the clip
* @see java.awt.Graphics#getClip()
* @see java.awt.Graphics#clipRect
* @see java.awt.Graphics#setClip(int, int, int, int)
* @since 1.1
*/
*** 328,347 ****
g.setClip(clip);
}
/**
* Copies an area of the component by a distance specified by
! * <code>dx</code> and <code>dy</code>. From the point specified
! * by <code>x</code> and <code>y</code>, this method
* copies downwards and to the right. To copy an area of the
* component to the left or upwards, specify a negative value for
! * <code>dx</code> or <code>dy</code>.
* If a portion of the source rectangle lies outside the bounds
* of the component, or is obscured by another window or component,
! * <code>copyArea</code> will be unable to copy the associated
* pixels. The area that is omitted can be refreshed by calling
! * the component's <code>paint</code> method.
* @param x the <i>x</i> coordinate of the source rectangle.
* @param y the <i>y</i> coordinate of the source rectangle.
* @param width the width of the source rectangle.
* @param height the height of the source rectangle.
* @param dx the horizontal distance to copy the pixels.
--- 328,347 ----
g.setClip(clip);
}
/**
* Copies an area of the component by a distance specified by
! * {@code dx} and {@code dy}. From the point specified
! * by {@code x} and {@code y}, this method
* copies downwards and to the right. To copy an area of the
* component to the left or upwards, specify a negative value for
! * {@code dx} or {@code dy}.
* If a portion of the source rectangle lies outside the bounds
* of the component, or is obscured by another window or component,
! * {@code copyArea} will be unable to copy the associated
* pixels. The area that is omitted can be refreshed by calling
! * the component's {@code paint} method.
* @param x the <i>x</i> coordinate of the source rectangle.
* @param y the <i>y</i> coordinate of the source rectangle.
* @param width the width of the source rectangle.
* @param height the height of the source rectangle.
* @param dx the horizontal distance to copy the pixels.
*** 366,381 ****
}
/**
* Fills the specified rectangle.
* The left and right edges of the rectangle are at
! * <code>x</code> and <code>x + width - 1</code>.
* The top and bottom edges are at
! * <code>y</code> and <code>y + height - 1</code>.
* The resulting rectangle covers an area
! * <code>width</code> pixels wide by
! * <code>height</code> pixels tall.
* The rectangle is filled using the graphics context's current color.
* @param x the <i>x</i> coordinate
* of the rectangle to be filled.
* @param y the <i>y</i> coordinate
* of the rectangle to be filled.
--- 366,381 ----
}
/**
* Fills the specified rectangle.
* The left and right edges of the rectangle are at
! * {@code x} and <code>x + width - 1</code>.
* The top and bottom edges are at
! * {@code y} and <code>y + height - 1</code>.
* The resulting rectangle covers an area
! * {@code width} pixels wide by
! * {@code height} pixels tall.
* The rectangle is filled using the graphics context's current color.
* @param x the <i>x</i> coordinate
* of the rectangle to be filled.
* @param y the <i>y</i> coordinate
* of the rectangle to be filled.
*** 389,401 ****
}
/**
* Draws the outline of the specified rectangle.
* The left and right edges of the rectangle are at
! * <code>x</code> and <code>x + width</code>.
* The top and bottom edges are at
! * <code>y</code> and <code>y + height</code>.
* The rectangle is drawn using the graphics context's current color.
* @param x the <i>x</i> coordinate
* of the rectangle to be drawn.
* @param y the <i>y</i> coordinate
* of the rectangle to be drawn.
--- 389,401 ----
}
/**
* Draws the outline of the specified rectangle.
* The left and right edges of the rectangle are at
! * {@code x} and <code>x + width</code>.
* The top and bottom edges are at
! * {@code y} and <code>y + height</code>.
* The rectangle is drawn using the graphics context's current color.
* @param x the <i>x</i> coordinate
* of the rectangle to be drawn.
* @param y the <i>y</i> coordinate
* of the rectangle to be drawn.
*** 413,423 ****
* color of the current drawing surface. This operation does not
* use the current paint mode.
* <p>
* Beginning with Java 1.1, the background color
* of offscreen images may be system dependent. Applications should
! * use <code>setColor</code> followed by <code>fillRect</code> to
* ensure that an offscreen image is cleared to a specific color.
* @param x the <i>x</i> coordinate of the rectangle to clear.
* @param y the <i>y</i> coordinate of the rectangle to clear.
* @param width the width of the rectangle to clear.
* @param height the height of the rectangle to clear.
--- 413,423 ----
* color of the current drawing surface. This operation does not
* use the current paint mode.
* <p>
* Beginning with Java 1.1, the background color
* of offscreen images may be system dependent. Applications should
! * use {@code setColor} followed by {@code fillRect} to
* ensure that an offscreen image is cleared to a specific color.
* @param x the <i>x</i> coordinate of the rectangle to clear.
* @param y the <i>y</i> coordinate of the rectangle to clear.
* @param width the width of the rectangle to clear.
* @param height the height of the rectangle to clear.
*** 432,444 ****
}
/**
* Draws an outlined round-cornered rectangle using this graphics
* context's current color. The left and right edges of the rectangle
! * are at <code>x</code> and <code>x + width</code>,
* respectively. The top and bottom edges of the rectangle are at
! * <code>y</code> and <code>y + height</code>.
* @param x the <i>x</i> coordinate of the rectangle to be drawn.
* @param y the <i>y</i> coordinate of the rectangle to be drawn.
* @param width the width of the rectangle to be drawn.
* @param height the height of the rectangle to be drawn.
* @param arcWidth the horizontal diameter of the arc
--- 432,444 ----
}
/**
* Draws an outlined round-cornered rectangle using this graphics
* context's current color. The left and right edges of the rectangle
! * are at {@code x} and <code>x + width</code>,
* respectively. The top and bottom edges of the rectangle are at
! * {@code y} and <code>y + height</code>.
* @param x the <i>x</i> coordinate of the rectangle to be drawn.
* @param y the <i>y</i> coordinate of the rectangle to be drawn.
* @param width the width of the rectangle to be drawn.
* @param height the height of the rectangle to be drawn.
* @param arcWidth the horizontal diameter of the arc
*** 453,465 ****
}
/**
* Fills the specified rounded corner rectangle with the current color.
* The left and right edges of the rectangle
! * are at <code>x</code> and <code>x + width - 1</code>,
* respectively. The top and bottom edges of the rectangle are at
! * <code>y</code> and <code>y + height - 1</code>.
* @param x the <i>x</i> coordinate of the rectangle to be filled.
* @param y the <i>y</i> coordinate of the rectangle to be filled.
* @param width the width of the rectangle to be filled.
* @param height the height of the rectangle to be filled.
* @param arcWidth the horizontal diameter
--- 453,465 ----
}
/**
* Fills the specified rounded corner rectangle with the current color.
* The left and right edges of the rectangle
! * are at {@code x} and <code>x + width - 1</code>,
* respectively. The top and bottom edges of the rectangle are at
! * {@code y} and <code>y + height - 1</code>.
* @param x the <i>x</i> coordinate of the rectangle to be filled.
* @param y the <i>y</i> coordinate of the rectangle to be filled.
* @param width the width of the rectangle to be filled.
* @param height the height of the rectangle to be filled.
* @param arcWidth the horizontal diameter
*** 518,529 ****
}
/**
* Draws the outline of an oval.
* The result is a circle or ellipse that fits within the
! * rectangle specified by the <code>x</code>, <code>y</code>,
! * <code>width</code>, and <code>height</code> arguments.
* <p>
* The oval covers an area that is
* <code>width + 1</code> pixels wide
* and <code>height + 1</code> pixels tall.
* @param x the <i>x</i> coordinate of the upper left
--- 518,529 ----
}
/**
* Draws the outline of an oval.
* The result is a circle or ellipse that fits within the
! * rectangle specified by the {@code x}, {@code y},
! * {@code width}, and {@code height} arguments.
* <p>
* The oval covers an area that is
* <code>width + 1</code> pixels wide
* and <code>height + 1</code> pixels tall.
* @param x the <i>x</i> coordinate of the upper left
*** 555,574 ****
/**
* Draws the outline of a circular or elliptical arc
* covering the specified rectangle.
* <p>
! * The resulting arc begins at <code>startAngle</code> and extends
! * for <code>arcAngle</code> degrees, using the current color.
* Angles are interpreted such that 0 degrees
* is at the 3 o'clock position.
* A positive value indicates a counter-clockwise rotation
* while a negative value indicates a clockwise rotation.
* <p>
* The center of the arc is the center of the rectangle whose origin
* is (<i>x</i>, <i>y</i>) and whose size is specified by the
! * <code>width</code> and <code>height</code> arguments.
* <p>
* The resulting arc covers an area
* <code>width + 1</code> pixels wide
* by <code>height + 1</code> pixels tall.
* <p>
--- 555,574 ----
/**
* Draws the outline of a circular or elliptical arc
* covering the specified rectangle.
* <p>
! * The resulting arc begins at {@code startAngle} and extends
! * for {@code arcAngle} degrees, using the current color.
* Angles are interpreted such that 0 degrees
* is at the 3 o'clock position.
* A positive value indicates a counter-clockwise rotation
* while a negative value indicates a clockwise rotation.
* <p>
* The center of the arc is the center of the rectangle whose origin
* is (<i>x</i>, <i>y</i>) and whose size is specified by the
! * {@code width} and {@code height} arguments.
* <p>
* The resulting arc covers an area
* <code>width + 1</code> pixels wide
* by <code>height + 1</code> pixels tall.
* <p>
*** 596,615 ****
}
/**
* Fills a circular or elliptical arc covering the specified rectangle.
* <p>
! * The resulting arc begins at <code>startAngle</code> and extends
! * for <code>arcAngle</code> degrees.
* Angles are interpreted such that 0 degrees
* is at the 3 o'clock position.
* A positive value indicates a counter-clockwise rotation
* while a negative value indicates a clockwise rotation.
* <p>
* The center of the arc is the center of the rectangle whose origin
* is (<i>x</i>, <i>y</i>) and whose size is specified by the
! * <code>width</code> and <code>height</code> arguments.
* <p>
* The resulting arc covers an area
* <code>width + 1</code> pixels wide
* by <code>height + 1</code> pixels tall.
* <p>
--- 596,615 ----
}
/**
* Fills a circular or elliptical arc covering the specified rectangle.
* <p>
! * The resulting arc begins at {@code startAngle} and extends
! * for {@code arcAngle} degrees.
* Angles are interpreted such that 0 degrees
* is at the 3 o'clock position.
* A positive value indicates a counter-clockwise rotation
* while a negative value indicates a clockwise rotation.
* <p>
* The center of the arc is the center of the rectangle whose origin
* is (<i>x</i>, <i>y</i>) and whose size is specified by the
! * {@code width} and {@code height} arguments.
* <p>
* The resulting arc covers an area
* <code>width + 1</code> pixels wide
* by <code>height + 1</code> pixels tall.
* <p>
*** 657,676 ****
/**
* Draws a closed polygon defined by
* arrays of <i>x</i> and <i>y</i> coordinates.
* Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point.
* <p>
! * This method draws the polygon defined by <code>nPoint</code> line
* segments, where the first <code>nPoint - 1</code>
* line segments are line segments from
* <code>(xPoints[i - 1], yPoints[i - 1])</code>
* to <code>(xPoints[i], yPoints[i])</code>, for
! * 1 ≤ <i>i</i> ≤ <code>nPoints</code>.
* The figure is automatically closed by drawing a line connecting
* the final point to the first point, if those points are different.
! * @param xPoints a an array of <code>x</code> coordinates.
! * @param yPoints a an array of <code>y</code> coordinates.
* @param nPoints a the total number of points.
* @see java.awt.Graphics#fillPolygon
* @see java.awt.Graphics#drawPolyline
*/
public void drawPolygon(int xPoints[], int yPoints[],
--- 657,676 ----
/**
* Draws a closed polygon defined by
* arrays of <i>x</i> and <i>y</i> coordinates.
* Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point.
* <p>
! * This method draws the polygon defined by {@code nPoint} line
* segments, where the first <code>nPoint - 1</code>
* line segments are line segments from
* <code>(xPoints[i - 1], yPoints[i - 1])</code>
* to <code>(xPoints[i], yPoints[i])</code>, for
! * 1 ≤ <i>i</i> ≤ {@code nPoints}.
* The figure is automatically closed by drawing a line connecting
* the final point to the first point, if those points are different.
! * @param xPoints a an array of {@code x} coordinates.
! * @param yPoints a an array of {@code y} coordinates.
* @param nPoints a the total number of points.
* @see java.awt.Graphics#fillPolygon
* @see java.awt.Graphics#drawPolyline
*/
public void drawPolygon(int xPoints[], int yPoints[],
*** 678,688 ****
g.drawPolygon(xPoints, yPoints, nPoints);
}
/**
* Draws the outline of a polygon defined by the specified
! * <code>Polygon</code> object.
* @param p the polygon to draw.
* @see java.awt.Graphics#fillPolygon
* @see java.awt.Graphics#drawPolyline
*/
public void drawPolygon(Polygon p) {
--- 678,688 ----
g.drawPolygon(xPoints, yPoints, nPoints);
}
/**
* Draws the outline of a polygon defined by the specified
! * {@code Polygon} object.
* @param p the polygon to draw.
* @see java.awt.Graphics#fillPolygon
* @see java.awt.Graphics#drawPolyline
*/
public void drawPolygon(Polygon p) {
*** 691,713 ****
/**
* Fills a closed polygon defined by
* arrays of <i>x</i> and <i>y</i> coordinates.
* <p>
! * This method draws the polygon defined by <code>nPoint</code> line
* segments, where the first <code>nPoint - 1</code>
* line segments are line segments from
* <code>(xPoints[i - 1], yPoints[i - 1])</code>
* to <code>(xPoints[i], yPoints[i])</code>, for
! * 1 ≤ <i>i</i> ≤ <code>nPoints</code>.
* The figure is automatically closed by drawing a line connecting
* the final point to the first point, if those points are different.
* <p>
* The area inside the polygon is defined using an
* even-odd fill rule, also known as the alternating rule.
! * @param xPoints a an array of <code>x</code> coordinates.
! * @param yPoints a an array of <code>y</code> coordinates.
* @param nPoints a the total number of points.
* @see java.awt.Graphics#drawPolygon(int[], int[], int)
*/
public void fillPolygon(int xPoints[], int yPoints[],
int nPoints) {
--- 691,713 ----
/**
* Fills a closed polygon defined by
* arrays of <i>x</i> and <i>y</i> coordinates.
* <p>
! * This method draws the polygon defined by {@code nPoint} line
* segments, where the first <code>nPoint - 1</code>
* line segments are line segments from
* <code>(xPoints[i - 1], yPoints[i - 1])</code>
* to <code>(xPoints[i], yPoints[i])</code>, for
! * 1 ≤ <i>i</i> ≤ {@code nPoints}.
* The figure is automatically closed by drawing a line connecting
* the final point to the first point, if those points are different.
* <p>
* The area inside the polygon is defined using an
* even-odd fill rule, also known as the alternating rule.
! * @param xPoints a an array of {@code x} coordinates.
! * @param yPoints a an array of {@code y} coordinates.
* @param nPoints a the total number of points.
* @see java.awt.Graphics#drawPolygon(int[], int[], int)
*/
public void fillPolygon(int xPoints[], int yPoints[],
int nPoints) {
*** 803,813 ****
* This method returns immediately in all cases, even if the
* complete image has not yet been loaded, and it has not been dithered
* and converted for the current output device.
* <p>
* If the image has not yet been completely loaded, then
! * <code>drawImage</code> returns <code>false</code>. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* @param img the specified image to be drawn.
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
--- 803,813 ----
* This method returns immediately in all cases, even if the
* complete image has not yet been loaded, and it has not been dithered
* and converted for the current output device.
* <p>
* If the image has not yet been completely loaded, then
! * {@code drawImage} returns {@code false}. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* @param img the specified image to be drawn.
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
*** 833,845 ****
* <p>
* This method returns immediately in all cases, even if the
* entire image has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete, then
! * <code>drawImage</code> returns <code>false</code>. As more of
* the image becomes available, the process that draws the image notifies
! * the image observer by calling its <code>imageUpdate</code> method.
* <p>
* A scaled version of an image will not necessarily be
* available immediately just because an unscaled version of the
* image has been constructed for this output device. Each size of
* the image may be cached separately and generated from the original
--- 833,845 ----
* <p>
* This method returns immediately in all cases, even if the
* entire image has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete, then
! * {@code drawImage} returns {@code false}. As more of
* the image becomes available, the process that draws the image notifies
! * the image observer by calling its {@code imageUpdate} method.
* <p>
* A scaled version of an image will not necessarily be
* available immediately just because an unscaled version of the
* image has been constructed for this output device. Each size of
* the image may be cached separately and generated from the original
*** 875,885 ****
* This method returns immediately in all cases, even if the
* complete image has not yet been loaded, and it has not been dithered
* and converted for the current output device.
* <p>
* If the image has not yet been completely loaded, then
! * <code>drawImage</code> returns <code>false</code>. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* @param img the specified image to be drawn.
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
--- 875,885 ----
* This method returns immediately in all cases, even if the
* complete image has not yet been loaded, and it has not been dithered
* and converted for the current output device.
* <p>
* If the image has not yet been completely loaded, then
! * {@code drawImage} returns {@code false}. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* @param img the specified image to be drawn.
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
*** 911,921 ****
* <p>
* This method returns immediately in all cases, even if the
* entire image has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete then
! * <code>drawImage</code> returns <code>false</code>. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* <p>
* A scaled version of an image will not necessarily be
* available immediately just because an unscaled version of the
--- 911,921 ----
* <p>
* This method returns immediately in all cases, even if the
* entire image has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete then
! * {@code drawImage} returns {@code false}. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* <p>
* A scaled version of an image will not necessarily be
* available immediately just because an unscaled version of the
*** 951,961 ****
* <p>
* This method returns immediately in all cases, even if the
* image area to be drawn has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete then
! * <code>drawImage</code> returns <code>false</code>. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* <p>
* This method always uses the unscaled version of the image
* to render the scaled rectangle and performs the required
--- 951,961 ----
* <p>
* This method returns immediately in all cases, even if the
* image area to be drawn has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete then
! * {@code drawImage} returns {@code false}. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* <p>
* This method always uses the unscaled version of the image
* to render the scaled rectangle and performs the required
*** 1012,1022 ****
* <p>
* This method returns immediately in all cases, even if the
* image area to be drawn has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete then
! * <code>drawImage</code> returns <code>false</code>. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* <p>
* This method always uses the unscaled version of the image
* to render the scaled rectangle and performs the required
--- 1012,1022 ----
* <p>
* This method returns immediately in all cases, even if the
* image area to be drawn has not yet been scaled, dithered, and converted
* for the current output device.
* If the current output representation is not yet complete then
! * {@code drawImage} returns {@code false}. As more of
* the image becomes available, the process that draws the image notifies
* the specified image observer.
* <p>
* This method always uses the unscaled version of the image
* to render the scaled rectangle and performs the required
*** 1066,1093 ****
}
/**
* Disposes of this graphics context and releases
* any system resources that it is using.
! * A <code>Graphics</code> object cannot be used after
! * <code>dispose</code>has been called.
* <p>
! * When a Java program runs, a large number of <code>Graphics</code>
* objects can be created within a short time frame.
* Although the finalization process of the garbage collector
* also disposes of the same system resources, it is preferable
* to manually free the associated resources by calling this
* method rather than to rely on a finalization process which
* may not run to completion for a long period of time.
* <p>
* Graphics objects which are provided as arguments to the
! * <code>paint</code> and <code>update</code> methods
* of components are automatically released by the system when
* those methods return. For efficiency, programmers should
! * call <code>dispose</code> when finished using
! * a <code>Graphics</code> object only if it was created
! * directly from a component or another <code>Graphics</code> object.
* @see java.awt.Graphics#finalize
* @see java.awt.Component#paint
* @see java.awt.Component#update
* @see java.awt.Component#getGraphics
* @see java.awt.Graphics#create
--- 1066,1093 ----
}
/**
* Disposes of this graphics context and releases
* any system resources that it is using.
! * A {@code Graphics} object cannot be used after
! * {@code dispose} has been called.
* <p>
! * When a Java program runs, a large number of {@code Graphics}
* objects can be created within a short time frame.
* Although the finalization process of the garbage collector
* also disposes of the same system resources, it is preferable
* to manually free the associated resources by calling this
* method rather than to rely on a finalization process which
* may not run to completion for a long period of time.
* <p>
* Graphics objects which are provided as arguments to the
! * {@code paint} and {@code update} methods
* of components are automatically released by the system when
* those methods return. For efficiency, programmers should
! * call {@code dispose} when finished using
! * a {@code Graphics} object only if it was created
! * directly from a component or another {@code Graphics} object.
* @see java.awt.Graphics#finalize
* @see java.awt.Component#paint
* @see java.awt.Component#update
* @see java.awt.Component#getGraphics
* @see java.awt.Graphics#create
*** 1101,1121 ****
*/
public void finalize() {
}
/**
! * Returns a <code>String</code> object representing this
! * <code>Graphics</code> object's value.
* @return a string representation of this graphics context.
*/
public String toString() {
return getClass().getName() + "[font=" + getFont() + ",color=" + getColor() + "]";
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by <code>getClipBounds()</code>.
*/
@Deprecated
public Rectangle getClipRect() {
return g.getClipRect();
}
--- 1101,1121 ----
*/
public void finalize() {
}
/**
! * Returns a {@code String} object representing this
! * {@code Graphics} object's value.
* @return a string representation of this graphics context.
*/
public String toString() {
return getClass().getName() + "[font=" + getFont() + ",color=" + getColor() + "]";
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by {@code getClipBounds()}.
*/
@Deprecated
public Rectangle getClipRect() {
return g.getClipRect();
}
*** 1142,1153 ****
* from {@link #getClipBounds() getClipBounds} in that an existing
* rectangle is used instead of allocating a new one.
* This method refers to the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* If no clip has previously been set, or if the clip has been
! * cleared using <code>setClip(null)</code>, this method returns the
! * specified <code>Rectangle</code>.
* @param r the rectangle where the current clipping area is
* copied to. Any current values in this rectangle are
* overwritten.
* @return the bounding rectangle of the current clipping area.
*/
--- 1142,1153 ----
* from {@link #getClipBounds() getClipBounds} in that an existing
* rectangle is used instead of allocating a new one.
* This method refers to the user clip, which is independent of the
* clipping associated with device bounds and window visibility.
* If no clip has previously been set, or if the clip has been
! * cleared using {@code setClip(null)}, this method returns the
! * specified {@code Rectangle}.
* @param r the rectangle where the current clipping area is
* copied to. Any current values in this rectangle are
* overwritten.
* @return the bounding rectangle of the current clipping area.
*/
< prev index next >