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 SummaryConstructors
- 
Method SummaryModifier 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- 
RMShapePainterJ2DCreates a new RMShapePainterJ2D.
 
- 
- 
Method Details- 
getBoundsReturns the painting bounds (can be null).
- 
setBoundsSets the painting bounds (can be null).
- 
setBoundspublic void setBounds(double x, double y, double w, double h) Sets the painting bounds.
- 
getAlignmentXpublic float getAlignmentX()Returns the horizontal alignment.
- 
setAlignmentXpublic void setAlignmentX(float aValue) Sets the horizontal alignment.
- 
getAlignmentYpublic float getAlignmentY()Returns the vertical alignment.
- 
setAlignmentYpublic void setAlignmentY(float aValue) Sets the vertical alignment.
- 
getScalepublic float getScale()Returns the default scale.
- 
setScalepublic void setScale(float aValue) Sets the default scale.
- 
isGrowToFitpublic boolean isGrowToFit()Returns whether painter should scale painting of shape up to fit bounds
- 
setGrowToFitpublic void setGrowToFit(boolean aValue) Returns whether painter should scale painting of shape up to fit bounds
- 
isShrinkToFitpublic boolean isShrinkToFit()Returns whether painter should scale painting of shape down to fit bounds
- 
setShrinkToFitpublic void setShrinkToFit(boolean aValue) Returns whether painter should scale painting of shape down to fit bounds
- 
isPrintingpublic boolean isPrinting()Returns whether shape painting is really printing.- Specified by:
- isPrintingin interface- RMPainter
 
- 
setPrintingpublic void setPrinting(boolean aValue) Sets whether shape painting is really printing.
- 
paintShapePaints a simple shape.- Specified by:
- paintShapein interface- RMShapePainter
 
- 
sendPaintShapePaints a child shape.- Specified by:
- sendPaintShapein interface- RMShapePainter
 
- 
isEditingpublic boolean isEditing()Returns whether painting is for editor.- Specified by:
- isEditingin interface- RMShapePainter
 
- 
isSelectedReturns whether given shape is selected.- Specified by:
- isSelectedin interface- RMShapePainter
 
- 
isSuperSelectedReturns whether given shape is super selected.- Specified by:
- isSuperSelectedin interface- RMShapePainter
 
- 
isSuperSelectedShapeReturns whether given shape is THE super selected shape.- Specified by:
- isSuperSelectedShapein interface- RMShapePainter
 
- 
getColor
- 
setColor
- 
getFont
- 
setFont
- 
getPaint
- 
setPaint
- 
getStroke
- 
setStroke
- 
getOpacitypublic double getOpacity()Returns the opacity.- Specified by:
- getOpacityin interface- RMPainter
 
- 
setOpacitypublic void setOpacity(double aValue) Sets the opacity.- Specified by:
- setOpacityin interface- RMPainter
 
- 
draw
- 
fill
- 
drawLinepublic void drawLine(double x1, double y1, double x2, double y2) 
- 
fillRectpublic void fillRect(double x, double y, double w, double h) 
- 
drawRectpublic void drawRect(double x, double y, double w, double h) 
- 
fill3DRectpublic void fill3DRect(double x, double y, double w, double h, boolean raised) - Specified by:
- fill3DRectin interface- RMPainter
 
- 
drawButtonDraws a button for the given rect with an option for pressed.- Specified by:
- drawButtonin interface- RMPainter
 
- 
drawButtonpublic 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 interface- RMPainter
 
- 
drawImage
- 
drawImage
- 
drawString- Specified by:
- drawStringin interface- RMPainter
 
- 
drawGlyphVector- Specified by:
- drawGlyphVectorin interface- RMPainter
 
- 
translatepublic void translate(double tx, double ty) 
- 
rotatepublic void rotate(double theta) 
- 
scalepublic void scale(double sx, double sy) 
- 
transform
- 
getStringBoundsReturns the string bounds for current font.- Specified by:
- getStringBoundsin interface- RMPainter
 
- 
getFontAscentpublic double getFontAscent()Returns the ascender for the current font.- Specified by:
- getFontAscentin interface- RMPainter
 
- 
getClipBounds- Specified by:
- getClipBoundsin interface- RMPainter
 
- 
getClip
- 
setClip
- 
clip
- 
disposepublic void dispose()
- 
setAntialiasingpublic boolean setAntialiasing(boolean aValue) Sets whether antialiasing.- Specified by:
- setAntialiasingin interface- RMPainter
 
- 
getGraphicsReturns the graphics.- Specified by:
- getGraphicsin interface- RMPainter
 
- 
cloneStandard clone implementation.
- 
toStringStandard toString implementation.
 
-