public class DrawPictureShape extends DrawSimpleShape
Drawable.DrawableHint
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 PictureShape<?,?> |
getShape() |
void |
resize()
Resize this picture to the default size.
|
void |
resize(java.awt.Rectangle 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.Rectangle 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, getCustomGeometry, getCustomGeometry, getHeadDecoration, getStroke, getTailDecoration
applyTransform, getAnchor, getAnchor
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 intoprotected PictureShape<?,?> getShape()
getShape
in class DrawSimpleShape
public void resize()
public void resize(java.awt.Rectangle target)
target
- The target rectanglepublic void resize(java.awt.Rectangle target, RectAlign align)
target
- The target rectanglealign
- The alignment within the target rectangle when resizing.
A null value corresponds to RectAlign.CENTERCopyright 2016 The Apache Software Foundation or its licensors, as applicable.