Package com.inductiveautomation.rm.shape
Class RMShapePainterJ2D
java.lang.Object
com.inductiveautomation.rm.shape.RMShapePainterJ2D
- All Implemented Interfaces:
RMPainter
,RMShapePainter
,Cloneable
- Direct Known Subclasses:
RMEditorShapePainter
This class manages the painting of shapes to a Java2D graphics object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clone()
Standard clone implementation.void
dispose()
void
void
drawButton
(double x, double y, double w, double h, boolean isPressed) Draws a button for the given rect with an option for pressed.void
drawButton
(RMRect aRect, boolean isPressed) Draws a button for the given rect with an option for pressed.void
drawGlyphVector
(GlyphVector g, float x, float y) boolean
boolean
drawImage
(Image img, AffineTransform xform) void
drawLine
(double x1, double y1, double x2, double y2) void
drawRect
(double x, double y, double w, double h) void
drawString
(String str, double x, double y) void
void
fill3DRect
(double x, double y, double w, double h, boolean raised) void
fillRect
(double x, double y, double w, double h) float
Returns the horizontal alignment.float
Returns the vertical alignment.Returns the painting bounds (can be null).getClip()
getColor()
getFont()
double
Returns the ascender for the current font.Returns the graphics.double
Returns the opacity.getPaint()
float
getScale()
Returns the default scale.getStringBounds
(String aString) Returns the string bounds for current font.boolean
Returns whether painting is for editor.boolean
Returns whether painter should scale painting of shape up to fit boundsboolean
Returns whether shape painting is really printing.boolean
isSelected
(RMShape aShape) Returns whether given shape is selected.boolean
Returns whether painter should scale painting of shape down to fit boundsboolean
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) Paints a simple shape.void
rotate
(double theta) void
scale
(double sx, double sy) void
sendPaintShape
(RMShape aShape) Paints a child shape.void
setAlignmentX
(float aValue) Sets the horizontal alignment.void
setAlignmentY
(float aValue) Sets the vertical alignment.boolean
setAntialiasing
(boolean aValue) Sets whether antialiasing.void
setBounds
(double x, double y, double w, double h) Sets the painting bounds.void
setBounds
(Rectangle2D aRect) Sets the painting bounds (can be null).void
void
void
void
setGrowToFit
(boolean aValue) Returns whether painter should scale painting of shape up to fit boundsvoid
setOpacity
(double aValue) Sets the opacity.void
void
setPrinting
(boolean aValue) Sets whether shape painting is really printing.void
setScale
(float aValue) Sets the default scale.void
setShrinkToFit
(boolean aValue) Returns whether painter should scale painting of shape down to fit boundsvoid
toString()
Standard toString implementation.void
void
translate
(double tx, double ty)
-
Constructor Details
-
RMShapePainterJ2D
Creates a new RMShapePainterJ2D.
-
-
Method Details
-
getBounds
Returns the painting bounds (can be null). -
setBounds
Sets the painting bounds (can be null). -
setBounds
public void setBounds(double x, double y, double w, double h) Sets the painting bounds. -
getAlignmentX
public float getAlignmentX()Returns the horizontal alignment. -
setAlignmentX
public void setAlignmentX(float aValue) Sets the horizontal alignment. -
getAlignmentY
public float getAlignmentY()Returns the vertical alignment. -
setAlignmentY
public void setAlignmentY(float aValue) Sets the vertical alignment. -
getScale
public float getScale()Returns the default scale. -
setScale
public void setScale(float aValue) Sets the default scale. -
isGrowToFit
public boolean isGrowToFit()Returns whether painter should scale painting of shape up to fit bounds -
setGrowToFit
public void setGrowToFit(boolean aValue) Returns whether painter should scale painting of shape up to fit bounds -
isShrinkToFit
public boolean isShrinkToFit()Returns whether painter should scale painting of shape down to fit bounds -
setShrinkToFit
public void setShrinkToFit(boolean aValue) Returns whether painter should scale painting of shape down to fit bounds -
isPrinting
public boolean isPrinting()Returns whether shape painting is really printing.- Specified by:
isPrinting
in interfaceRMPainter
-
setPrinting
public void setPrinting(boolean aValue) Sets whether shape painting is really printing. -
paintShape
Paints a simple shape.- Specified by:
paintShape
in interfaceRMShapePainter
-
sendPaintShape
Paints a child shape.- Specified by:
sendPaintShape
in interfaceRMShapePainter
-
isEditing
public boolean isEditing()Returns whether painting is for editor.- Specified by:
isEditing
in interfaceRMShapePainter
-
isSelected
Returns whether given shape is selected.- Specified by:
isSelected
in interfaceRMShapePainter
-
isSuperSelected
Returns whether given shape is super selected.- Specified by:
isSuperSelected
in interfaceRMShapePainter
-
isSuperSelectedShape
Returns whether given shape is THE super selected shape.- Specified by:
isSuperSelectedShape
in interfaceRMShapePainter
-
getColor
-
setColor
-
getFont
-
setFont
-
getPaint
-
setPaint
-
getStroke
-
setStroke
-
getOpacity
public double getOpacity()Returns the opacity.- Specified by:
getOpacity
in interfaceRMPainter
-
setOpacity
public void setOpacity(double aValue) Sets the opacity.- Specified by:
setOpacity
in interfaceRMPainter
-
draw
-
fill
-
drawLine
public void drawLine(double x1, double y1, double x2, double y2) -
fillRect
public void fillRect(double x, double y, double w, double h) -
drawRect
public void drawRect(double x, double y, double w, double h) -
fill3DRect
public void fill3DRect(double x, double y, double w, double h, boolean raised) - Specified by:
fill3DRect
in interfaceRMPainter
-
drawButton
Draws a button for the given rect with an option for pressed.- Specified by:
drawButton
in interfaceRMPainter
-
drawButton
public void drawButton(double x, double y, double w, double h, boolean isPressed) Draws a button for the given rect with an option for pressed.- Specified by:
drawButton
in interfaceRMPainter
-
drawImage
-
drawImage
-
drawString
- Specified by:
drawString
in interfaceRMPainter
-
drawGlyphVector
- Specified by:
drawGlyphVector
in interfaceRMPainter
-
translate
public void translate(double tx, double ty) -
rotate
public void rotate(double theta) -
scale
public void scale(double sx, double sy) -
transform
-
getStringBounds
Returns the string bounds for current font.- Specified by:
getStringBounds
in interfaceRMPainter
-
getFontAscent
public double getFontAscent()Returns the ascender for the current font.- Specified by:
getFontAscent
in interfaceRMPainter
-
getClipBounds
- Specified by:
getClipBounds
in interfaceRMPainter
-
getClip
-
setClip
-
clip
-
dispose
public void dispose() -
setAntialiasing
public boolean setAntialiasing(boolean aValue) Sets whether antialiasing.- Specified by:
setAntialiasing
in interfaceRMPainter
-
getGraphics
Returns the graphics.- Specified by:
getGraphics
in interfaceRMPainter
-
clone
Standard clone implementation. -
toString
Standard toString implementation.
-