Class 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>
    • 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
      void clearRect​(int x, int y, int width, int height)  
      void clip​(java.awt.Shape s)  
      java.awt.image.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, java.awt.Rectangle bounds, java.awt.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​(java.awt.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​(java.awt.Polygon p)  
      void drawPolyline​(int[] xPoints, int[] yPoints, int nPoints)  
      void drawRect​(int x, int y, int width, int height)  
      void fill​(java.awt.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​(java.awt.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​(java.lang.String str, float x, float y)  
      void fillText​(java.lang.String str, int x, int y)  
      void finalize()  
      java.awt.Color getBackground()  
      java.awt.Rectangle getClipBounds​(java.awt.Rectangle r)  
      java.awt.Rectangle getClipRect()
      Deprecated.
      com.macrofocus.igraphics.CPColorFactory<java.awt.Color> getColorFactory()  
      java.awt.Font getFont()  
      com.macrofocus.igraphics.IGraphics<java.awt.Color,​java.awt.Font> getIGraphics()  
      java.lang.Object getNativeGraphics()  
      java.lang.Object getRenderingHint​(java.awt.RenderingHints.Key hintKey)  
      double getStringWidth​(java.lang.String text)  
      java.awt.geom.AffineTransform getTransform()  
      boolean hitClip​(int x, int y, int width, int height)  
      boolean hitClip​(java.awt.Rectangle bounds)  
      boolean isPaintingForPrint()  
      void paintLabel​(com.macrofocus.labeling.EnhancedLabel<java.awt.Color,​java.awt.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 setBackground​(com.macrofocus.igraphics.CPColor<java.awt.Color> color)  
      void setColor​(com.macrofocus.igraphics.CPColor<java.awt.Color> c)  
      void setFill​(com.macrofocus.igraphics.CPColor<java.awt.Color> c)  
      void setFont​(java.awt.Font font)  
      void setGlobalAlpha​(double alpha)  
      void setLineDash​(double[] dashPattern)  
      void setLineWidth​(double lw)  
      void setPaint​(java.awt.Paint paint)  
      void setPaintingForPrint​(boolean paintingForPrint)  
      void setRadialGradient()  
      void setRenderingHint​(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)  
      void setStroke​(com.macrofocus.igraphics.CPColor<java.awt.Color> c)  
      void setTransform​(java.awt.geom.AffineTransform Tx)  
      void shear​(double shx, double shy)  
      PreferredSize sizeLabel​(com.macrofocus.labeling.EnhancedLabel<java.awt.Color,​java.awt.Font> l, int w, int h)  
      void softClip​(java.awt.Shape shape)  
      void stroke​(java.awt.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)  
      java.lang.String toString()  
      void transform​(java.awt.geom.AffineTransform Tx)  
      void translate​(double tx, double ty)  
      void translate​(int x, int y)  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • gc

        public java.awt.Graphics2D gc
    • Constructor Detail

      • SwingTGraphics

        public SwingTGraphics​(java.awt.Graphics2D gc)
    • 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:
        finalize in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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:
        drawClippedImage in interface TGraphics<java.awt.Color,​java.awt.Font>
        Overrides:
        drawClippedImage in class AbstractTGraphics<java.awt.Color,​java.awt.Font>
      • softClip

        public void softClip​(java.awt.Shape shape)
        Specified by:
        softClip in interface TGraphics<java.awt.Color,​java.awt.Font>
        Overrides:
        softClip in class AbstractTGraphics<java.awt.Color,​java.awt.Font>
      • hitClip

        public boolean hitClip​(java.awt.Rectangle bounds)
        Specified by:
        hitClip in interface TGraphics<java.awt.Color,​java.awt.Font>
        Overrides:
        hitClip in class AbstractTGraphics<java.awt.Color,​java.awt.Font>