|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidadinternal.image.painter.AbstractPainter
org.apache.myfaces.trinidadinternal.image.painter.AbstractWrappingPainter
org.apache.myfaces.trinidadinternal.image.painter.OffscreenWrappingPainter
public class OffscreenWrappingPainter
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.
Field Summary |
---|
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
OffscreenWrappingPainter(Painter wrappedPainter)
|
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 org.apache.myfaces.trinidadinternal.image.painter.AbstractWrappingPainter |
---|
getMinimumSize, getWrappedPainter |
Methods inherited from class org.apache.myfaces.trinidadinternal.image.painter.AbstractPainter |
---|
getData, getDataKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OffscreenWrappingPainter(Painter wrappedPainter)
Method Detail |
---|
public void paint(PaintContext context, java.awt.Graphics g, int x, int y, int width, int height)
AbstractWrappingPainter
paint
in interface Painter
paint
in class AbstractWrappingPainter
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.public java.awt.Dimension getPreferredSize(PaintContext context)
AbstractWrappingPainter
getPreferredSize
in interface Painter
getPreferredSize
in class AbstractWrappingPainter
context
- Context for determining the preferred size.
public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |