public class DrawPictureShape extends DrawSimpleShape
Drawable.DrawableHint
BUFFERED_IMAGE, CURRENT_SLIDE, DRAW_FACTORY, FONT_FALLBACK, FONT_HANDLER, FONT_MAP, GRADIENT_SHAPE, GRESTORE, GROUP_TRANSFORM, GSAVE, IMAGE_RENDERER, PRESET_GEOMETRY_CACHE, TEXT_AS_CHARACTERS, TEXT_AS_SHAPES, TEXT_RENDERING_MODE
Constructor and Description |
---|
DrawPictureShape(PictureShape<?,?> shape) |
Modifier and Type | Method and Description |
---|---|
void |
drawContent(java.awt.Graphics2D graphics)
draw any content within this shape (image, text, etc.).
|
protected java.awt.Paint |
getFillPaint(java.awt.Graphics2D graphics) |
static ImageRenderer |
getImageRenderer(java.awt.Graphics2D graphics,
java.lang.String contentType)
Returns an ImageRenderer for the PictureData
|
protected PictureShape<?,?> |
getShape() |
void |
resize()
Resize this picture to the default size.
|
void |
resize(java.awt.geom.Rectangle2D target)
Fit picture shape into the target rectangle, maintaining the aspect ratio
and repositioning within the target rectangle with a centered alignment.
|
void |
resize(java.awt.geom.Rectangle2D target,
RectAlign align)
Fit picture shape into the target rectangle, maintaining the aspect ratio
and repositioning within the target rectangle based on the specified
alignment (gravity).
|
computeOutlines, draw, drawDecoration, drawShadow, getHeadDecoration, getLinePaint, getStroke, getTailDecoration
applyTransform, getAnchor, getAnchor, getStroke
public DrawPictureShape(PictureShape<?,?> shape)
public void drawContent(java.awt.Graphics2D graphics)
Drawable
drawContent
in interface Drawable
drawContent
in class DrawShape
graphics
- the graphics to draw intopublic static ImageRenderer getImageRenderer(java.awt.Graphics2D graphics, java.lang.String contentType)
graphics
- the graphics contextprotected java.awt.Paint getFillPaint(java.awt.Graphics2D graphics)
getFillPaint
in class DrawSimpleShape
protected PictureShape<?,?> getShape()
getShape
in class DrawSimpleShape
public void resize()
public void resize(java.awt.geom.Rectangle2D target)
target
- The target rectanglepublic void resize(java.awt.geom.Rectangle2D target, RectAlign align)
target
- The target rectanglealign
- The alignment within the target rectangle when resizing.
A null value corresponds to RectAlign.CENTERCopyright 2020 The Apache Software Foundation or its licensors, as applicable.