Class SwingTGraphics
- java.lang.Object
-
- com.macrofocus.treemap.crossplatform.AbstractTGraphics<java.awt.Color,java.awt.Font>
-
- com.macrofocus.treemap.crossplatform.SwingTGraphics
-
- All Implemented Interfaces:
TGraphics<java.awt.Color,java.awt.Font>
public class SwingTGraphics extends AbstractTGraphics<java.awt.Color,java.awt.Font>
ToDo: <Color,Font,Shape,Image>
-
-
Field Summary
Fields Modifier and Type Field Description java.awt.Graphics2Dgc-
Fields inherited from class com.macrofocus.treemap.crossplatform.AbstractTGraphics
MINIMUM_FONT_SIZE_TO_DISPLAY
-
-
Constructor Summary
Constructors Constructor Description SwingTGraphics(java.awt.Graphics2D gc)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclearRect(int x, int y, int width, int height)voidclip(java.awt.Shape s)java.awt.image.BufferedImagecreateImage(int width, int height)voiddraw3DRect(int x, int y, int width, int height, boolean raised)voiddrawArc(int x, int y, int width, int height, int startAngle, int arcAngle)booleandrawClippedImage(com.macrofocus.igraphics.CPImage img, int x, int y, int w, int h, int width, int height, java.awt.Rectangle bounds, java.awt.Shape shape)booleandrawImage(com.macrofocus.igraphics.CPImage img, int x, int y)booleandrawImage(com.macrofocus.igraphics.CPImage img, int x, int y, int width, int height)booleandrawNativeImage(java.awt.Image img, int x, int y)voiddrawOval(int x, int y, int width, int height)voiddrawPolygon(int[] xPoints, int[] yPoints, int nPoints)voiddrawPolygon(java.awt.Polygon p)voiddrawPolyline(int[] xPoints, int[] yPoints, int nPoints)voiddrawRect(int x, int y, int width, int height)voidfill(java.awt.Shape s)voidfill3DRect(int x, int y, int width, int height, boolean raised)voidfillArc(int x, int y, int width, int height, int startAngle, int arcAngle)voidfillOval(int x, int y, int width, int height)voidfillPolygon(int[] xPoints, int[] yPoints, int nPoints)voidfillPolygon(java.awt.Polygon p)voidfillRect(double x, double y, double width, double height)voidfillRect(int x, int y, int width, int height)voidfillRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)voidfillText(java.lang.String str, float x, float y)voidfillText(java.lang.String str, int x, int y)voidfinalize()java.awt.ColorgetBackground()java.awt.RectanglegetClipBounds(java.awt.Rectangle r)java.awt.RectanglegetClipRect()Deprecated.com.macrofocus.igraphics.CPColorFactory<java.awt.Color>getColorFactory()java.awt.FontgetFont()com.macrofocus.igraphics.IGraphics<java.awt.Color,java.awt.Font>getIGraphics()java.lang.ObjectgetNativeGraphics()java.lang.ObjectgetRenderingHint(java.awt.RenderingHints.Key hintKey)doublegetStringWidth(java.lang.String text)java.awt.geom.AffineTransformgetTransform()booleanhitClip(int x, int y, int width, int height)booleanhitClip(java.awt.Rectangle bounds)booleanisPaintingForPrint()voidpaintLabel(com.macrofocus.labeling.EnhancedLabel<java.awt.Color,java.awt.Font> l, int x, int y, int w, int h)voidrestore()voidrotate(double theta)voidrotate(double theta, double x, double y)voidsave()voidscale(double sx, double sy)voidsetBackground(com.macrofocus.igraphics.CPColor<java.awt.Color> color)voidsetColor(com.macrofocus.igraphics.CPColor<java.awt.Color> c)voidsetFill(com.macrofocus.igraphics.CPColor<java.awt.Color> c)voidsetFont(java.awt.Font font)voidsetGlobalAlpha(double alpha)voidsetLineDash(double[] dashPattern)voidsetLineWidth(double lw)voidsetPaint(java.awt.Paint paint)voidsetPaintingForPrint(boolean paintingForPrint)voidsetRadialGradient()voidsetRenderingHint(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)voidsetStroke(com.macrofocus.igraphics.CPColor<java.awt.Color> c)voidsetTransform(java.awt.geom.AffineTransform Tx)voidshear(double shx, double shy)PreferredSizesizeLabel(com.macrofocus.labeling.EnhancedLabel<java.awt.Color,java.awt.Font> l, int w, int h)voidsoftClip(java.awt.Shape shape)voidstroke(java.awt.Shape s)voidstrokeLine(int x1, int y1, int x2, int y2)voidstrokeRect(double x, double y, double width, double height)voidstrokeRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)java.lang.StringtoString()voidtransform(java.awt.geom.AffineTransform Tx)voidtranslate(double tx, double ty)voidtranslate(int x, int y)-
Methods inherited from class com.macrofocus.treemap.crossplatform.AbstractTGraphics
findMaxFontSize, fitTextInsideRectangle
-
-
-
-
Method Detail
-
getColorFactory
public com.macrofocus.igraphics.CPColorFactory<java.awt.Color> getColorFactory()
-
paintLabel
public void paintLabel(com.macrofocus.labeling.EnhancedLabel<java.awt.Color,java.awt.Font> l, int x, int y, int w, int h)
-
sizeLabel
public PreferredSize sizeLabel(com.macrofocus.labeling.EnhancedLabel<java.awt.Color,java.awt.Font> l, int w, int h)
-
save
public void save()
-
restore
public void restore()
-
draw3DRect
public void draw3DRect(int x, int y, int width, int height, boolean raised)
-
fill3DRect
public void fill3DRect(int x, int y, int width, int height, boolean raised)
-
stroke
public void stroke(java.awt.Shape s)
-
fillText
public void fillText(java.lang.String str, int x, int y)
-
fillText
public void fillText(java.lang.String str, float x, float y)
-
fill
public void fill(java.awt.Shape s)
-
setPaint
public void setPaint(java.awt.Paint paint)
-
setLineWidth
public void setLineWidth(double lw)
-
setLineDash
public void setLineDash(double[] dashPattern)
-
setRenderingHint
public void setRenderingHint(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)
-
getRenderingHint
public java.lang.Object getRenderingHint(java.awt.RenderingHints.Key hintKey)
-
translate
public void translate(int x, int y)
-
translate
public void translate(double tx, double ty)
-
rotate
public void rotate(double theta)
-
rotate
public void rotate(double theta, double x, double y)
-
scale
public void scale(double sx, double sy)
-
shear
public void shear(double shx, double shy)
-
transform
public void transform(java.awt.geom.AffineTransform Tx)
-
setTransform
public void setTransform(java.awt.geom.AffineTransform Tx)
-
getTransform
public java.awt.geom.AffineTransform getTransform()
-
setGlobalAlpha
public void setGlobalAlpha(double alpha)
-
setBackground
public void setBackground(com.macrofocus.igraphics.CPColor<java.awt.Color> color)
-
getBackground
public java.awt.Color getBackground()
-
clip
public void clip(java.awt.Shape s)
-
setFill
public void setFill(com.macrofocus.igraphics.CPColor<java.awt.Color> c)
-
setStroke
public void setStroke(com.macrofocus.igraphics.CPColor<java.awt.Color> c)
-
setColor
public void setColor(com.macrofocus.igraphics.CPColor<java.awt.Color> c)
-
setRadialGradient
public void setRadialGradient()
-
isPaintingForPrint
public boolean isPaintingForPrint()
-
setPaintingForPrint
public void setPaintingForPrint(boolean paintingForPrint)
-
getNativeGraphics
public java.lang.Object getNativeGraphics()
-
getIGraphics
public com.macrofocus.igraphics.IGraphics<java.awt.Color,java.awt.Font> getIGraphics()
-
getFont
public java.awt.Font getFont()
-
setFont
public void setFont(java.awt.Font font)
-
getStringWidth
public double getStringWidth(java.lang.String text)
-
strokeLine
public void strokeLine(int x1, int y1, int x2, int y2)
-
fillRect
public void fillRect(int x, int y, int width, int height)
-
drawRect
public void drawRect(int x, int y, int width, int height)
-
clearRect
public void clearRect(int x, int y, int width, int height)
-
strokeRect
public void strokeRect(double x, double y, double width, double height)
-
fillRect
public void fillRect(double x, double y, double width, double height)
-
strokeRoundRect
public void strokeRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
-
fillRoundRect
public void fillRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
-
drawOval
public void drawOval(int x, int y, int width, int height)
-
fillOval
public void fillOval(int x, int y, int width, int height)
-
drawArc
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
-
fillArc
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
-
drawPolyline
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
-
drawPolygon
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
-
drawPolygon
public void drawPolygon(java.awt.Polygon p)
-
fillPolygon
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
-
fillPolygon
public void fillPolygon(java.awt.Polygon p)
-
createImage
public java.awt.image.BufferedImage createImage(int width, int height)
-
drawNativeImage
public boolean drawNativeImage(java.awt.Image img, int x, int y)
-
drawImage
public boolean drawImage(com.macrofocus.igraphics.CPImage img, int x, int y)
-
drawImage
public boolean drawImage(com.macrofocus.igraphics.CPImage img, int x, int y, int width, int height)
-
finalize
public void finalize()
- Overrides:
finalizein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getClipRect
@Deprecated public java.awt.Rectangle getClipRect()
Deprecated.
-
hitClip
public boolean hitClip(int x, int y, int width, int height)
-
getClipBounds
public java.awt.Rectangle getClipBounds(java.awt.Rectangle r)
-
drawClippedImage
public boolean drawClippedImage(com.macrofocus.igraphics.CPImage img, int x, int y, int w, int h, int width, int height, java.awt.Rectangle bounds, java.awt.Shape shape)- Specified by:
drawClippedImagein interfaceTGraphics<java.awt.Color,java.awt.Font>- Overrides:
drawClippedImagein classAbstractTGraphics<java.awt.Color,java.awt.Font>
-
softClip
public void softClip(java.awt.Shape shape)
- Specified by:
softClipin interfaceTGraphics<java.awt.Color,java.awt.Font>- Overrides:
softClipin classAbstractTGraphics<java.awt.Color,java.awt.Font>
-
hitClip
public boolean hitClip(java.awt.Rectangle bounds)
- Specified by:
hitClipin interfaceTGraphics<java.awt.Color,java.awt.Font>- Overrides:
hitClipin classAbstractTGraphics<java.awt.Color,java.awt.Font>
-
-