oracle.cabo.image.painter
Class OffscreenWrappingPainter
java.lang.Object
|
+--oracle.cabo.image.painter.AbstractPainter
|
+--oracle.cabo.image.painter.AbstractWrappingPainter
|
+--oracle.cabo.image.painter.OffscreenWrappingPainter
- All Implemented Interfaces:
- java.awt.image.ImageObserver, Painter
- public class OffscreenWrappingPainter
- extends AbstractWrappingPainter
- implements java.awt.image.ImageObserver
This is used to render the contents of another painter (the wrapped
painter) into an offscreen buffer before rendering to the paint
Graphics object. This is an unusual thing to do, but seems to be
the only way to workaround the funky Java2D/BufferedImage text
rendering problems. (See bug 1288470).
Java2D mucks up non-antialiased text drawn into BufferedImages.
So, when drawing non-antialiased text, we first draw it into an
offscreen buffer and then into the BufferedImage. This class
will certainly go away once the underlying Java2D bug is fixed.
Think twice about using this class - it adds overhead to the
render since any wrapped rendering is double buffered.
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Fields inherited from interface oracle.cabo.image.painter.Painter |
STATE_ACTIVE_CHANGED, STATE_ARMED_CHANGED, STATE_BACKGROUND_CHANGED, STATE_ENABLED_CHANGED, STATE_FOCUSED_CHANGED, STATE_FONT_CHANGED, STATE_FOREGROUND_CHANGED, STATE_ISDEFAULT_CHANGED, STATE_MOUSE_OVER_CHANGED, STATE_READING_DIRECTION_CHANGED, STATE_SELECTED_CHANGED, STATE_SET_CHANGED, STATE_SIZE_CHANGED, STATE_XALIGNMENT_CHANGED, STATE_YALIGNMENT_CHANGED |
Method Summary |
java.awt.Dimension |
getPreferredSize(PaintContext context)
Returns the preferred size of the wrapped painter. |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
ImageObserver implementation |
void |
paint(PaintContext context,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints the wrapped Painter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OffscreenWrappingPainter
public OffscreenWrappingPainter(Painter wrappedPainter)
paint
public void paint(PaintContext context,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
- Description copied from class:
AbstractWrappingPainter
- Paints the wrapped Painter.
- Overrides:
paint
in class AbstractWrappingPainter
- Following copied from class:
oracle.cabo.image.painter.AbstractWrappingPainter
- Parameters:
context
- Context for painting.g
- Graphics object to draw into.x
- X position to draw at.y
- Y position to draw at.width
- Width to draw into.height
- Height to draw into.
getPreferredSize
public java.awt.Dimension getPreferredSize(PaintContext context)
- Description copied from class:
AbstractWrappingPainter
- Returns the preferred size of the wrapped painter.
- Overrides:
getPreferredSize
in class AbstractWrappingPainter
- Following copied from class:
oracle.cabo.image.painter.AbstractWrappingPainter
- Parameters:
context
- Context for determining the preferred size.
- Returns:
- The preferred size of the Painter.
imageUpdate
public boolean imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
- ImageObserver implementation
- Specified by:
imageUpdate
in interface java.awt.image.ImageObserver
Copyright © 2002,2003, Oracle. All Rights Reserved.