public class RMShapePainter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RMShapePainter.SizeToFitMode |
Constructor and Description |
---|
RMShapePainter()
Creates a new shape painter.
|
RMShapePainter(java.lang.Object aCanvas)
Creates a new shape painter.
|
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
createImage(RMShape aShape)
Returns an image for the given shape, with given background color (null for clear) and scale.
|
float |
getAlignmentX()
Returns the horizontal alignment.
|
float |
getAlignmentY()
Returns the vertical alignment.
|
RMFill |
getBackgroundFill()
Returns the background fill.
|
java.awt.geom.Rectangle2D |
getBounds()
Returns the painting bounds (can be null).
|
java.awt.geom.Rectangle2D |
getBoundsInset()
Returns the bounds constrained to insets.
|
boolean |
getClipToBounds()
Returns whether to clip to bounds.
|
static RMShapePainter |
getCurrentPainter()
The current shape painter.
|
java.awt.Image |
getDefaultImage()
Returns a default image to be used in case a shape image fill returns bogus null image.
|
java.awt.RenderingHints |
getDefaultRenderingHints()
Returns the map of default rendering hints.
|
static java.awt.image.BufferedImage |
getImageForShape(RMShape aShape,
boolean alpha,
float scale)
Returns an image for the given shape (with an option to include transparency and/or scale image).
|
static java.awt.image.BufferedImage |
getImageForShape(RMShape aShape,
java.awt.Color aColor,
float aScale)
Returns an image for the given shape, with given background color (null for clear) and scale.
|
java.awt.Insets |
getInsets()
Returns the painting insets.
|
java.awt.RenderingHints |
getRenderingHints()
Returns the map of rendering hints for this instance.
|
float |
getScale()
Returns the default scale.
|
RMShapePainter.SizeToFitMode |
getSizeToFitMode()
Returns the size to fit mode, which is whether or how the shape is sized to fit the painter's bounds.
|
RMViewer |
getViewer()
Returns the canvas as an RMViewer if appropriate (otherwise null).
|
boolean |
isEditing()
Returns whether painting is for editor.
|
boolean |
isPrinting()
Returns whether shape painting is really printing.
|
boolean |
isSelected(RMShape aShape)
Returns whether given shape is selected.
|
boolean |
isSuperSelected(RMShape aShape)
Returns whether given shape is super selected.
|
boolean |
isSuperSelectedShape(RMShape aShape)
Returns whether given shape is THE super selected shape.
|
void |
paintShape(RMShape aShape,
java.awt.Graphics aGraphics)
Paints a simple shape.
|
void |
paintText(RMTextShape aText,
java.awt.Graphics2D aGraphics)
Paints text - special case because uses editor.
|
void |
setAlignmentX(float aValue)
Sets the horizontal alignment.
|
void |
setAlignmentY(float aValue)
Sets the vertical alignment.
|
void |
setBackgroundColor(java.awt.Color aColor)
Sets the background fill as a color.
|
void |
setBackgroundFill(RMFill aFill)
Sets the background fill.
|
void |
setBounds(double x,
double y,
double w,
double h)
Sets the painting bounds.
|
void |
setBounds(java.awt.geom.Rectangle2D aRect)
Sets the painting bounds (can be null).
|
void |
setClipToBounds(boolean aValue)
Sets whether to clip to bounds.
|
static RMShapePainter |
setCurrentPainter(RMShapePainter aShapePainter)
The current shape painter.
|
void |
setInsets(java.awt.Insets theInsets)
Sets the painting insets.
|
void |
setInsets(int top,
int left,
int bottom,
int right)
Sets the painting insets.
|
void |
setPrinting(boolean aValue)
Sets whether shape painting is really printing.
|
void |
setScale(float aValue)
Sets the default scale.
|
void |
setSizeToFitMode(RMShapePainter.SizeToFitMode aMode)
Sets the size to fit mode, which is whether or how the shape is sized to fit the painter's bounds.
|
public RMShapePainter()
public RMShapePainter(java.lang.Object aCanvas)
public static RMShapePainter getCurrentPainter()
public static RMShapePainter setCurrentPainter(RMShapePainter aShapePainter)
public RMViewer getViewer()
public RMFill getBackgroundFill()
public void setBackgroundFill(RMFill aFill)
public void setBackgroundColor(java.awt.Color aColor)
public java.awt.geom.Rectangle2D getBounds()
public void setBounds(java.awt.geom.Rectangle2D aRect)
public void setBounds(double x, double y, double w, double h)
public java.awt.Insets getInsets()
public void setInsets(java.awt.Insets theInsets)
public void setInsets(int top, int left, int bottom, int right)
public float getAlignmentX()
public void setAlignmentX(float aValue)
public float getAlignmentY()
public void setAlignmentY(float aValue)
public float getScale()
public void setScale(float aValue)
public RMShapePainter.SizeToFitMode getSizeToFitMode()
public void setSizeToFitMode(RMShapePainter.SizeToFitMode aMode)
public boolean getClipToBounds()
public void setClipToBounds(boolean aValue)
public boolean isPrinting()
public void setPrinting(boolean aValue)
public java.awt.RenderingHints getRenderingHints()
public java.awt.RenderingHints getDefaultRenderingHints()
public java.awt.geom.Rectangle2D getBoundsInset()
public void paintShape(RMShape aShape, java.awt.Graphics aGraphics)
public java.awt.image.BufferedImage createImage(RMShape aShape)
public void paintText(RMTextShape aText, java.awt.Graphics2D aGraphics)
public boolean isEditing()
public boolean isSelected(RMShape aShape)
public boolean isSuperSelected(RMShape aShape)
public boolean isSuperSelectedShape(RMShape aShape)
public java.awt.Image getDefaultImage()
public static java.awt.image.BufferedImage getImageForShape(RMShape aShape, boolean alpha, float scale)
public static java.awt.image.BufferedImage getImageForShape(RMShape aShape, java.awt.Color aColor, float aScale)