public class BufferedImageBackgroundPainterStrategy extends ImageBackgroundPainterStrategy
RTextAreaBase
as an image. The image is always stretched to completely fill the
RTextAreaBase.
A java.awt.image.BufferedImage is used for rendering;
theoretically, for performance you should use
java.awt.image.VolatileImage; see
org.fife.ui.RTextArea.VolatileImageBackgroundPainterStrategy
for this.
You can set the scaling hint used when stretching/skewing the image
to fit in the RTextAreaBase's background via the
setScalingHint method, but keep in mind the more
accurate the scaling hint, the less responsive your application will
be when stretching the window (as that's the only time the image's
size is recalculated).
tracker| Constructor and Description |
|---|
BufferedImageBackgroundPainterStrategy(RTextAreaBase ta)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
paintImage(java.awt.Graphics g,
int x,
int y)
Paints the image at the specified location.
|
protected void |
rescaleImage(int width,
int height,
int hint)
Rescales the displayed image to be the specified size.
|
getMasterImage, getRTextAreaBase, getScalingHint, paint, setImage, setImage, setScalingHintpublic BufferedImageBackgroundPainterStrategy(RTextAreaBase ta)
ta - The text area whose background we'll be painting.protected void paintImage(java.awt.Graphics g,
int x,
int y)
paintImage in class ImageBackgroundPainterStrategyg - The graphics context.x - The x-coordinate at which to paint.y - The y-coordinate at which to paint.protected void rescaleImage(int width,
int height,
int hint)
rescaleImage in class ImageBackgroundPainterStrategywidth - The new width of the image.height - The new height of the image.hint - The scaling hint to use.