T - The type of the painted objectspublic final class TransformedObjectPainter<T> extends java.lang.Object implements ObjectPainter<T>
ObjectPainter that delegates the painting
to another ObjectPainter, and allows setting an additional
transform.| Constructor and Description |
|---|
TransformedObjectPainter(ObjectPainter<T> delegatePainter)
Creates a new transformed object painter
|
TransformedObjectPainter(ObjectPainter<T> delegatePainter,
java.util.function.BiConsumer<T,java.awt.geom.AffineTransform> transformUpdate)
Creates a new transformed object painter
|
| Modifier and Type | Method and Description |
|---|---|
void |
paint(java.awt.Graphics2D g,
java.awt.geom.AffineTransform worldToScreen,
double w,
double h,
T object)
Perform the painting operations for the given object on the given
Graphics.
|
void |
setTransform(java.awt.geom.AffineTransform transform)
Set the transform that this painter should apply to be the same
as the given one.
|
public TransformedObjectPainter(ObjectPainter<T> delegatePainter)
delegatePainter - The delegatepublic TransformedObjectPainter(ObjectPainter<T> delegatePainter, java.util.function.BiConsumer<T,java.awt.geom.AffineTransform> transformUpdate)
delegatePainter - The delegatetransformUpdate - The optional transform updatepublic void setTransform(java.awt.geom.AffineTransform transform)
null, then this transform will
be ignored.transform - The transformpublic void paint(java.awt.Graphics2D g,
java.awt.geom.AffineTransform worldToScreen,
double w,
double h,
T object)
ObjectPainterPainter.paint(Graphics2D, AffineTransform, double, double)
for more information about how the Graphics object is handled among
painters.paint in interface ObjectPainter<T>g - The Graphics used for paintingworldToScreen - The world-to-screen transform. This transform
encapsulates the translation, rotation and scaling of the viewer
to which this painter belongs.w - The width of the area, in screen coordinates, in which
this painter operates. This is the screen size of the viewer to
which this painter belongs.h - The height of the area, in screen coordinates, in which
this painter operates. This is the screen size of the viewer to
which this painter belongs.object - The object to paint. One has to assume that
this object may be null, in which case the
painting operation will usually be skipped.Copyright © 2019. All Rights Reserved.