Package com.inductiveautomation.rm.shape
Class RMShapePainterJ2D
- java.lang.Object
- 
- com.inductiveautomation.rm.shape.RMShapePainterJ2D
 
- 
- All Implemented Interfaces:
- RMPainter,- RMShapePainter,- java.lang.Cloneable
 - Direct Known Subclasses:
- RMEditorShapePainter
 
 public class RMShapePainterJ2D extends java.lang.Object implements RMShapePainter This class manages the painting of shapes to a Java2D graphics object.
- 
- 
Constructor SummaryConstructors Constructor Description RMShapePainterJ2D(java.awt.Graphics2D aGr)Creates a new RMShapePainterJ2D.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclip(java.awt.Shape s)RMShapePainterclone()Standard clone implementation.voiddispose()voiddraw(java.awt.Shape s)voiddrawButton(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(java.awt.font.GlyphVector g, float x, float y)booleandrawImage(java.awt.Image img, int x, int y, int w, int h)booleandrawImage(java.awt.Image img, java.awt.geom.AffineTransform xform)voiddrawLine(double x1, double y1, double x2, double y2)voiddrawRect(double x, double y, double w, double h)voiddrawString(java.lang.String str, double x, double y)voidfill(java.awt.Shape s)voidfill3DRect(double x, double y, double w, double h, boolean raised)voidfillRect(double x, double y, double w, double h)floatgetAlignmentX()Returns the horizontal alignment.floatgetAlignmentY()Returns the vertical alignment.java.awt.geom.Rectangle2DgetBounds()Returns the painting bounds (can be null).java.awt.ShapegetClip()java.awt.RectanglegetClipBounds()java.awt.ColorgetColor()java.awt.FontgetFont()doublegetFontAscent()Returns the ascender for the current font.java.awt.Graphics2DgetGraphics()Returns the graphics.doublegetOpacity()Returns the opacity.java.awt.PaintgetPaint()floatgetScale()Returns the default scale.java.awt.geom.Rectangle2DgetStringBounds(java.lang.String aString)Returns the string bounds for current font.java.awt.StrokegetStroke()booleanisEditing()Returns whether painting is for editor.booleanisGrowToFit()Returns whether painter should scale painting of shape up to fit boundsbooleanisPrinting()Returns whether shape painting is really printing.booleanisSelected(RMShape aShape)Returns whether given shape is selected.booleanisShrinkToFit()Returns 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(java.awt.geom.Rectangle2D aRect)Sets the painting bounds (can be null).voidsetClip(java.awt.Shape clip)voidsetColor(java.awt.Color c)voidsetFont(java.awt.Font font)voidsetGrowToFit(boolean aValue)Returns whether painter should scale painting of shape up to fit boundsvoidsetOpacity(double aValue)Sets the opacity.voidsetPaint(java.awt.Paint paint)voidsetPrinting(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 boundsvoidsetStroke(java.awt.Stroke s)java.lang.StringtoString()Standard toString implementation.voidtransform(java.awt.geom.AffineTransform Tx)voidtranslate(double tx, double ty)
 
- 
- 
- 
Method Detail- 
getBoundspublic java.awt.geom.Rectangle2D getBounds() Returns the painting bounds (can be null).
 - 
setBoundspublic void setBounds(java.awt.geom.Rectangle2D aRect) Sets 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.
 - 
paintShapepublic void paintShape(RMShape aShape) Paints a simple shape.- Specified by:
- paintShapein interface- RMShapePainter
 
 - 
sendPaintShapepublic void sendPaintShape(RMShape aShape) Paints a child shape.- Specified by:
- sendPaintShapein interface- RMShapePainter
 
 - 
isEditingpublic boolean isEditing() Returns whether painting is for editor.- Specified by:
- isEditingin interface- RMShapePainter
 
 - 
isSelectedpublic boolean isSelected(RMShape aShape) Returns whether given shape is selected.- Specified by:
- isSelectedin interface- RMShapePainter
 
 - 
isSuperSelectedpublic boolean isSuperSelected(RMShape aShape) Returns whether given shape is super selected.- Specified by:
- isSuperSelectedin interface- RMShapePainter
 
 - 
isSuperSelectedShapepublic boolean isSuperSelectedShape(RMShape aShape) Returns whether given shape is THE super selected shape.- Specified by:
- isSuperSelectedShapein interface- RMShapePainter
 
 - 
getOpacitypublic double getOpacity() Returns the opacity.- Specified by:
- getOpacityin interface- RMPainter
 
 - 
setOpacitypublic void setOpacity(double aValue) Sets the opacity.- Specified by:
- setOpacityin interface- RMPainter
 
 - 
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
 
 - 
drawButtonpublic void drawButton(RMRect aRect, boolean isPressed) Draws 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
 
 - 
drawImagepublic boolean drawImage(java.awt.Image img, java.awt.geom.AffineTransform xform)
 - 
drawImagepublic boolean drawImage(java.awt.Image img, int x, int y, int w, int h)
 - 
drawStringpublic void drawString(java.lang.String str, double x, double y)- Specified by:
- drawStringin interface- RMPainter
 
 - 
drawGlyphVectorpublic void drawGlyphVector(java.awt.font.GlyphVector g, float x, float y)- Specified by:
- drawGlyphVectorin interface- RMPainter
 
 - 
translatepublic void translate(double tx, double ty)
 - 
transformpublic void transform(java.awt.geom.AffineTransform Tx) 
 - 
getStringBoundspublic java.awt.geom.Rectangle2D getStringBounds(java.lang.String aString) Returns 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
 
 - 
getClipBoundspublic java.awt.Rectangle getClipBounds() - Specified by:
- getClipBoundsin interface- RMPainter
 
 - 
setAntialiasingpublic boolean setAntialiasing(boolean aValue) Sets whether antialiasing.- Specified by:
- setAntialiasingin interface- RMPainter
 
 - 
getGraphicspublic java.awt.Graphics2D getGraphics() Returns the graphics.- Specified by:
- getGraphicsin interface- RMPainter
 
 - 
clonepublic RMShapePainter clone() Standard clone implementation.- Specified by:
- clonein interface- RMPainter
- Specified by:
- clonein interface- RMShapePainter
- Overrides:
- clonein class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() Standard toString implementation.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-