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 TypeMethodDescriptionvoidclone()Standard clone implementation.voiddispose()voidvoiddrawButton(double x, double y, double w, double h, boolean isPressed) Draws a button for the given rect with an option for pressed.voiddrawButton(RMRect aRect, boolean isPressed) Draws a button for the given rect with an option for pressed.voiddrawGlyphVector(GlyphVector g, float x, float y) booleanbooleandrawImage(Image img, AffineTransform xform) voiddrawLine(double x1, double y1, double x2, double y2) voiddrawRect(double x, double y, double w, double h) voiddrawString(String str, double x, double y) voidvoidfill3DRect(double x, double y, double w, double h, boolean raised) voidfillRect(double x, double y, double w, double h) floatReturns the horizontal alignment.floatReturns the vertical alignment.Returns the painting bounds (can be null).getClip()getColor()getFont()doubleReturns the ascender for the current font.Returns the graphics.doubleReturns the opacity.getPaint()floatgetScale()Returns the default scale.getStringBounds(String aString) Returns the string bounds for current font.booleanReturns whether painting is for editor.booleanReturns whether painter should scale painting of shape up to fit boundsbooleanReturns whether shape painting is really printing.booleanisSelected(RMShape aShape) Returns whether given shape is selected.booleanReturns whether painter should scale painting of shape down to fit boundsbooleanisSuperSelected(RMShape aShape) Returns whether given shape is super selected.booleanisSuperSelectedShape(RMShape aShape) Returns whether given shape is THE super selected shape.voidpaintShape(RMShape aShape) Paints a simple shape.voidrotate(double theta) voidscale(double sx, double sy) voidsendPaintShape(RMShape aShape) Paints a child shape.voidsetAlignmentX(float aValue) Sets the horizontal alignment.voidsetAlignmentY(float aValue) Sets the vertical alignment.booleansetAntialiasing(boolean aValue) Sets whether antialiasing.voidsetBounds(double x, double y, double w, double h) Sets the painting bounds.voidsetBounds(Rectangle2D aRect) Sets the painting bounds (can be null).voidvoidvoidvoidsetGrowToFit(boolean aValue) Returns whether painter should scale painting of shape up to fit boundsvoidsetOpacity(double aValue) Sets the opacity.voidvoidsetPrinting(boolean aValue) Sets whether shape painting is really printing.voidsetScale(float aValue) Sets the default scale.voidsetShrinkToFit(boolean aValue) Returns whether painter should scale painting of shape down to fit boundsvoidtoString()Standard toString implementation.voidvoidtranslate(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:
isPrintingin interfaceRMPainter
-
setPrinting
public void setPrinting(boolean aValue) Sets whether shape painting is really printing. -
paintShape
Paints a simple shape.- Specified by:
paintShapein interfaceRMShapePainter
-
sendPaintShape
Paints a child shape.- Specified by:
sendPaintShapein interfaceRMShapePainter
-
isEditing
public boolean isEditing()Returns whether painting is for editor.- Specified by:
isEditingin interfaceRMShapePainter
-
isSelected
Returns whether given shape is selected.- Specified by:
isSelectedin interfaceRMShapePainter
-
isSuperSelected
Returns whether given shape is super selected.- Specified by:
isSuperSelectedin interfaceRMShapePainter
-
isSuperSelectedShape
Returns whether given shape is THE super selected shape.- Specified by:
isSuperSelectedShapein interfaceRMShapePainter
-
getColor
-
setColor
-
getFont
-
setFont
-
getPaint
-
setPaint
-
getStroke
-
setStroke
-
getOpacity
public double getOpacity()Returns the opacity.- Specified by:
getOpacityin interfaceRMPainter
-
setOpacity
public void setOpacity(double aValue) Sets the opacity.- Specified by:
setOpacityin 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:
fill3DRectin interfaceRMPainter
-
drawButton
Draws a button for the given rect with an option for pressed.- Specified by:
drawButtonin 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:
drawButtonin interfaceRMPainter
-
drawImage
-
drawImage
-
drawString
- Specified by:
drawStringin interfaceRMPainter
-
drawGlyphVector
- Specified by:
drawGlyphVectorin 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:
getStringBoundsin interfaceRMPainter
-
getFontAscent
public double getFontAscent()Returns the ascender for the current font.- Specified by:
getFontAscentin interfaceRMPainter
-
getClipBounds
- Specified by:
getClipBoundsin interfaceRMPainter
-
getClip
-
setClip
-
clip
-
dispose
public void dispose() -
setAntialiasing
public boolean setAntialiasing(boolean aValue) Sets whether antialiasing.- Specified by:
setAntialiasingin interfaceRMPainter
-
getGraphics
Returns the graphics.- Specified by:
getGraphicsin interfaceRMPainter
-
clone
Standard clone implementation. -
toString
Standard toString implementation.
-