Package com.treemap.swing.crossplatform

# Class SwingTGraphics

java.lang.Object
com.treemap.crossplatform.AbstractTGraphics<Color,Font>
com.treemap.swing.crossplatform.SwingTGraphics

All Implemented Interfaces:
  `TGraphics<Color,Font>`

public class SwingTGraphics extends AbstractTGraphics<Color,Font>
ToDo: <Color,Font,Shape,Image>

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Graphics2D`
  `gc`

  ### Fields inherited from class com.treemap.crossplatform.AbstractTGraphics

  `MINIMUM_FONT_SIZE_TO_DISPLAY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SwingTGraphics(Graphics2D gc)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearRect(int x, int y, int width, int height)`
  `void`
  `clip(com.macrofocus.geom.Shape s)`
  `BufferedImage`
  `createImage(int width, int height)`
  `void`
  `draw3DRect(int x, int y, int width, int height, boolean raised)`
  `void`
  `drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)`
  `boolean`
  `drawClippedImage(com.macrofocus.igraphics.CPImage img, int x, int y, int w, int h, int width, int height, com.macrofocus.geom.Rectangle bounds, com.macrofocus.geom.Shape shape)`
  `boolean`
  `drawImage(com.macrofocus.igraphics.CPImage img, int x, int y)`
  `boolean`
  `drawImage(com.macrofocus.igraphics.CPImage img, int x, int y, int width, int height)`
  `boolean`
  `drawNativeImage(Image img, int x, int y)`
  `void`
  `drawOval(int x, int y, int width, int height)`
  `void`
  `drawPolygon(int[] xPoints, int[] yPoints, int nPoints)`
  `void`
  `drawPolygon(com.macrofocus.geom.Polygon p)`
  `void`
  `drawPolyline(int[] xPoints, int[] yPoints, int nPoints)`
  `void`
  `drawRect(int x, int y, int width, int height)`
  `void`
  `fill(com.macrofocus.geom.Shape s)`
  `void`
  `fill3DRect(int x, int y, int width, int height, boolean raised)`
  `void`
  `fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)`
  `void`
  `fillOval(int x, int y, int width, int height)`
  `void`
  `fillPolygon(int[] xPoints, int[] yPoints, int nPoints)`
  `void`
  `fillPolygon(com.macrofocus.geom.Polygon p)`
  `void`
  `fillRect(double x, double y, double width, double height)`
  `void`
  `fillRect(int x, int y, int width, int height)`
  `void`
  `fillRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)`
  `void`
  `fillText(String str, float x, float y)`
  `void`
  `fillText(String str, int x, int y)`
  `void`
  `finalize()`
  `Color`
  `getBackground()`
  `com.macrofocus.geom.Rectangle`
  `getClipBounds(com.macrofocus.geom.Rectangle r)`
  `com.macrofocus.geom.Rectangle`
  `getClipRect()`
  Deprecated.
  `com.macrofocus.igraphics.CPColorFactory<Color>`
  `getColorFactory()`
  `Font`
  `getFont()`
  `com.macrofocus.igraphics.IGraphics<Color,Font>`
  `getIGraphics()`
  `Object`
  `getNativeGraphics()`
  `double`
  `getStringWidth(String text)`
  `com.macrofocus.geom.AffineTransform`
  `getTransform()`
  `boolean`
  `hitClip(int x, int y, int width, int height)`
  `boolean`
  `hitClip(com.macrofocus.geom.Rectangle bounds)`
  `boolean`
  `isAntialias()`
  `boolean`
  `isInterpolationBilinear()`
  `boolean`
  `isPaintingForPrint()`
  `boolean`
  `isTextAntialias()`
  `void`
  `paintLabel(com.macrofocus.labeling.EnhancedLabel<Color,Font> l, int x, int y, int w, int h)`
  `void`
  `restore()`
  `void`
  `rotate(double theta)`
  `void`
  `rotate(double theta, double x, double y)`
  `void`
  `save()`
  `void`
  `scale(double sx, double sy)`
  `void`
  `setAntialias(boolean antialias)`
  `void`
  `setBackground(com.macrofocus.igraphics.CPColor<Color> color)`
  `void`
  `setColor(com.macrofocus.igraphics.CPColor<Color> c)`
  `void`
  `setFill(com.macrofocus.igraphics.CPColor<Color> c)`
  `void`
  `setFont(Font font)`
  `void`
  `setGlobalAlpha(double alpha)`
  `void`
  `setInterpolationBilinear(boolean bilinear)`
  `void`
  `setLineDash(double[] dashPattern)`
  `void`
  `setLineWidth(double lw)`
  `void`
  `setPaint(Paint paint)`
  `void`
  `setPaintingForPrint(boolean paintingForPrint)`
  `void`
  `setRadialGradient()`
  `void`
  `setStroke(com.macrofocus.igraphics.CPColor<Color> c)`
  `void`
  `setTextAntialias(boolean antialias)`
  `void`
  `setTransform(com.macrofocus.geom.AffineTransform Tx)`
  `void`
  `shear(double shx, double shy)`
  `PreferredSize`
  `sizeLabel(com.macrofocus.labeling.EnhancedLabel<Color,Font> l, int w, int h)`
  `void`
  `softClip(com.macrofocus.geom.Shape shape)`
  `void`
  `stroke(com.macrofocus.geom.Shape s)`
  `void`
  `strokeLine(int x1, int y1, int x2, int y2)`
  `void`
  `strokeRect(double x, double y, double width, double height)`
  `void`
  `strokeRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)`
  `String`
  `toString()`
  `void`
  `transform(com.macrofocus.geom.AffineTransform Tx)`
  `void`
  `translate(double tx, double ty)`
  `void`
  `translate(int x, int y)`

  ### Methods inherited from class com.treemap.crossplatform.AbstractTGraphics

  `findMaxFontSize, fitTextInsideRectangle`

  ### Methods inherited from class java.lang.Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### gc

    public Graphics2D gc

- ## Constructor Details

  - ### SwingTGraphics

    public SwingTGraphics(Graphics2D gc)

- ## Method Details

  - ### getColorFactory

    public com.macrofocus.igraphics.CPColorFactory<Color> getColorFactory()

  - ### paintLabel

    public void paintLabel(com.macrofocus.labeling.EnhancedLabel<Color,Font> l, int x, int y, int w, int h)

  - ### sizeLabel

    public PreferredSize sizeLabel(com.macrofocus.labeling.EnhancedLabel<Color,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(com.macrofocus.geom.Shape s)

  - ### fillText

    public void fillText(String str, int x, int y)

  - ### fillText

    public void fillText(String str, float x, float y)

  - ### fill

    public void fill(com.macrofocus.geom.Shape s)

  - ### setPaint

    public void setPaint(Paint paint)

  - ### setLineWidth

    public void setLineWidth(double lw)

  - ### setLineDash

    public void setLineDash(double[] dashPattern)

  - ### isInterpolationBilinear

    public boolean isInterpolationBilinear()

  - ### setInterpolationBilinear

    public void setInterpolationBilinear(boolean bilinear)

  - ### isAntialias

    public boolean isAntialias()

  - ### setAntialias

    public void setAntialias(boolean antialias)

  - ### isTextAntialias

    public boolean isTextAntialias()

  - ### setTextAntialias

    public void setTextAntialias(boolean antialias)

  - ### 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(com.macrofocus.geom.AffineTransform Tx)

  - ### setTransform

    public void setTransform(com.macrofocus.geom.AffineTransform Tx)

  - ### getTransform

    public com.macrofocus.geom.AffineTransform getTransform()

  - ### setGlobalAlpha

    public void setGlobalAlpha(double alpha)

  - ### setBackground

    public void setBackground(com.macrofocus.igraphics.CPColor<Color> color)

  - ### getBackground

    public Color getBackground()

  - ### clip

    public void clip(com.macrofocus.geom.Shape s)

  - ### setFill

    public void setFill(com.macrofocus.igraphics.CPColor<Color> c)

  - ### setStroke

    public void setStroke(com.macrofocus.igraphics.CPColor<Color> c)

  - ### setColor

    public void setColor(com.macrofocus.igraphics.CPColor<Color> c)

  - ### setRadialGradient

    public void setRadialGradient()

  - ### isPaintingForPrint

    public boolean isPaintingForPrint()

  - ### setPaintingForPrint

    public void setPaintingForPrint(boolean paintingForPrint)

  - ### getNativeGraphics

    public Object getNativeGraphics()

  - ### getIGraphics

    public com.macrofocus.igraphics.IGraphics<Color,Font> getIGraphics()

  - ### getFont

    public Font getFont()

  - ### setFont

    public void setFont(Font font)

  - ### getStringWidth

    public double getStringWidth(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(com.macrofocus.geom.Polygon p)

  - ### fillPolygon

    public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)

  - ### fillPolygon

    public void fillPolygon(com.macrofocus.geom.Polygon p)

  - ### createImage

    public BufferedImage createImage(int width, int height)

  - ### drawNativeImage

    public boolean drawNativeImage(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:
      `finalize` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getClipRect

    @Deprecated public com.macrofocus.geom.Rectangle getClipRect()
    Deprecated.

  - ### hitClip

    public boolean hitClip(int x, int y, int width, int height)

  - ### getClipBounds

    public com.macrofocus.geom.Rectangle getClipBounds(com.macrofocus.geom.Rectangle r)

  - ### drawClippedImage

    public boolean drawClippedImage(com.macrofocus.igraphics.CPImage img, int x, int y, int w, int h, int width, int height, com.macrofocus.geom.Rectangle bounds, com.macrofocus.geom.Shape shape)
    Specified by:
      `drawClippedImage` in interface `TGraphics<Color,Font>`
    Overrides:
      `drawClippedImage` in class `AbstractTGraphics<Color,Font>`

  - ### softClip

    public void softClip(com.macrofocus.geom.Shape shape)
    Specified by:
      `softClip` in interface `TGraphics<Color,Font>`
    Overrides:
      `softClip` in class `AbstractTGraphics<Color,Font>`

  - ### hitClip

    public boolean hitClip(com.macrofocus.geom.Rectangle bounds)
    Specified by:
      `hitClip` in interface `TGraphics<Color,Font>`
    Overrides:
      `hitClip` in class `AbstractTGraphics<Color,Font>`