| Access | Constructor and Description |
|---|---|
| public | GrayscaleProxyGraphics2D(Graphics2D graphics, PrinterJob printerJob)
The new ProxyGraphics2D will forward all graphics calls to 'graphics'. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
Overrides sun. Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
| public boolean | drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
Overrides sun. Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
| public boolean | drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
Overrides sun. Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. |
| public boolean | drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
Overrides sun. Draws as much of the specified image as is currently available. |
| public boolean | drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
Overrides sun. Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. |
| public boolean | drawImage(Image img, int x, int y, ImageObserver observer)
Overrides sun. Draws as much of the specified image as is currently available. |
| public void | drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
Overrides sun. Draws a BufferedImage that is filtered with a BufferedImageOp. |
| public boolean | drawImage(Image img, AffineTransform xform, ImageObserver obs)
Overrides sun. Draws an image, applying a transform from image space into user space before drawing. |
| public void | drawRenderedImage(RenderedImage img, AffineTransform xform)
Overrides sun. Draws an image, applying a transform from image space into user space before drawing. |
| private Color | Returns: grayscale colorcolor to transform to grayscale color)Returns grayscale variant of the input Color |
| private BufferedImage | Returns: grayscale BufferedImagecolored image img)Converts Image to a grayscale |
| public void | setBackground(Color color)
Overrides sun. Sets the background color in this context used for clearing a region. |
| public void | setColor(Color c)
Overrides sun. Sets this graphics context's current color to the specified color. |
| public void | setPaint(Paint paint)
Overrides sun. Sets the Paint in the current graphics state. |
| GrayscaleProxyGraphics2D | back to summary |
|---|---|
| public GrayscaleProxyGraphics2D(Graphics2D graphics, PrinterJob printerJob) The new ProxyGraphics2D will forward all graphics calls to 'graphics'. | |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) Overrides sun. Doc from sun. Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.
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
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
| |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) Overrides sun. Doc from sun. Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels do not affect whatever pixels are already there.
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
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
| |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) Overrides sun. Doc from sun. Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. The image is drawn inside the specified rectangle of this graphics context's coordinate space, and is scaled if necessary. Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.
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
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 data in a separate image production sequence.
| |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) Overrides sun. Doc from sun. Draws as much of the specified image as is currently available. The image is drawn with its top-left corner at (x, y) in this graphics context's coordinate space. Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient. 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.
If the image has not yet been completely loaded, then
| |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) Overrides sun. Doc from sun. Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. The image is drawn inside the specified rectangle of this graphics context's coordinate space, and is scaled if necessary. Transparent pixels do not affect whatever pixels are already there.
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
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 data in a separate image production sequence.
| |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, int x, int y, ImageObserver observer) Overrides sun. Doc from sun. Draws as much of the specified image as is currently available. The image is drawn with its top-left corner at (x, y) in this graphics context's coordinate space. Transparent pixels in the image do not affect whatever pixels are already there. 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.
If the image has not yet been completely loaded, then
| |
| drawImage | back to summary |
|---|---|
| public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) Overrides sun. Doc from sun. Draws a BufferedImage that is filtered with a BufferedImageOp. The rendering attributes applied include the clip, transform and composite attributes. This is equivalent to: img1 = op.filter(img, null); drawImage(img1, new AffineTransform(1f,0f,0f,1f,x,y), null);
| |
| drawImage | back to summary |
|---|---|
| public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) Overrides sun. Doc from sun. Draws an image, applying a transform from image space into user space before drawing. The transformation from user space into device space is done with the current transform in the Graphics2D. The given transformation is applied to the image before the transform attribute in the Graphics2D state is applied. The rendering attributes applied include the clip, transform, and composite attributes. Note that the result is undefined, if the given transform is noninvertible.
| |
| drawRenderedImage | back to summary |
|---|---|
| public void drawRenderedImage(RenderedImage img, AffineTransform xform) Overrides sun. Doc from sun. Draws an image, applying a transform from image space into user space before drawing. The transformation from user space into device space is done with the current transform in the Graphics2D. The given transformation is applied to the image before the transform attribute in the Graphics2D state is applied. The rendering attributes applied include the clip, transform, and composite attributes. Note that the result is undefined, if the given transform is noninvertible.
| |
| getGrayscaleColor | back to summary |
|---|---|
| private Color getGrayscaleColor(Color color) Returns grayscale variant of the input Color | |
| getGrayscaleImage | back to summary |
|---|---|
| private BufferedImage getGrayscaleImage(Image img) Converts Image to a grayscale
| |
| setBackground | back to summary |
|---|---|
| public void setBackground(Color color) Overrides sun. Doc from sun. Sets the background color in this context used for clearing a region. When Graphics2D is constructed for a component, the background color is inherited from the component. Setting the background color in the Graphics2D context only affects the subsequent clearRect() calls and not the background color of the component. To change the background of the component, use appropriate methods of the component.
| |
| setColor | back to summary |
|---|---|
| public void setColor(Color c) Overrides sun. Doc from sun. Sets this graphics context's current color to the specified color. All subsequent graphics operations using this graphics context use this specified color.
| |
| setPaint | back to summary |
|---|---|
| public void setPaint(Paint paint) Overrides sun. Doc from sun. Sets the Paint in the current graphics state.
| |