Class CwtSwtGraphicsContext

    • Constructor Summary

      Constructors 
      Constructor Description
      CwtSwtGraphicsContext​(org.eclipse.swt.graphics.GC paramGC, org.eclipse.swt.graphics.Device paramDevice)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void applyAlphaBackground()  
      protected void applyAlphaForeground()  
      protected void applyClip()  
      protected void applyTransform()  
      void clip​(java.awt.Shape shape)
      Clip the subsequent drawing operations to the shape.
      protected org.eclipse.swt.graphics.Path createPath​(java.awt.Shape s)  
      void dispose()
      Dispose the current context and all its resources.
      void draw​(java.awt.Shape s)
      Draw s using the current graphics context state.
      void drawImage​(IImage image, float x, float y)
      Draw image image at coordinates x, y.
      void drawString​(java.lang.String s, float x, float y)
      Draw a plain text string in the graphics.
      void fill​(java.awt.Shape s)
      Fill s using the current graphics context state.
      java.awt.Color getBackgroundColor()
      The current background color.
      BlendMode getBlendMode()  
      java.awt.Shape getClip()
      The current clip.
      org.eclipse.swt.graphics.Device getDevice()  
      java.awt.Font getFont()  
      java.awt.font.FontRenderContext getFontRenderContext()  
      java.awt.Color getForegroundColor()
      The current foregroumd color.
      org.eclipse.swt.graphics.GC getGc()  
      IGraphicsEnvironment getGraphicsEnvironment()
      The associated IGraphicsEnvironment
      java.awt.RenderingHints getRenderingHints()
      The current RenderingHints
      java.awt.geom.AffineTransform getTransform()
      The transformatiom currentlz active.
      protected float[] getTransformationValues​(java.awt.geom.AffineTransform tx)  
      void resetAdvanced()  
      void rotate​(float theta)
      Rotate the currently active transformation by theta.
      void scale​(float x, float y)
      Scale the currently active transformation by x, y
      void setBackgroundColor​(java.awt.Color color)
      Assign a new background color.
      void setBackgroundColor​(org.eclipse.swt.graphics.Color resource)  
      void setBackgroundPaint​(IPaint paint)
      Assign a new background IPaint.
      void setBackgroundPattern​(org.eclipse.swt.graphics.Pattern resource)  
      void setBlendMode​(BlendMode blendMode)  
      void setClip​(java.awt.Shape shape)
      Assign the new shape as the clipping shape.
      void setFont​(java.awt.Font awtFont)
      Set the current font for writing plain text in the graphics.
      void setForegroundColor​(java.awt.Color color)
      Assign a new foreground color.
      void setForegroundColor​(org.eclipse.swt.graphics.Color resource)  
      void setForegroundPaint​(IPaint paint)
      Assign a new foreground IPaint
      void setForegroundPattern​(org.eclipse.swt.graphics.Pattern resource)  
      void setRenderingHint​(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)
      Set a specific rendering hint.
      void setRenderingHints​(java.util.Map hints)
      Assign the currently active rendering hints.
      void setStroke​(java.awt.Stroke s)
      Assign the currently active Stroke
      void setTransform​(java.awt.geom.AffineTransform pTransform)
      Set the currently active AffineTransform
      java.awt.Point textExtent​(java.lang.String s)  
      static org.eclipse.swt.graphics.Path toPath​(org.eclipse.swt.graphics.Device device, java.awt.geom.PathIterator pathIterator)  
      static java.awt.geom.Rectangle2D toRectangle2D​(org.eclipse.swt.graphics.Rectangle rect)  
      static org.eclipse.swt.graphics.Transform toTransform​(org.eclipse.swt.graphics.Device device, java.awt.geom.AffineTransform at)
      This methods intentionally duplicated to avoid compile time dependency..
      static org.eclipse.swt.graphics.Transform toTransform​(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.Transform st, java.awt.geom.AffineTransform at)
      This methods intentionally duplicated to avoid compile time dependency..
      void transform​(java.awt.geom.AffineTransform deltaTransform)
      Transform the IGraphicsEnvironment by transform
      void translate​(float x, float y)
      translate the currently active transformation by x, y
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CwtSwtGraphicsContext

        public CwtSwtGraphicsContext​(org.eclipse.swt.graphics.GC paramGC,
                                     org.eclipse.swt.graphics.Device paramDevice)
    • Method Detail

      • toPath

        public static org.eclipse.swt.graphics.Path toPath​(org.eclipse.swt.graphics.Device device,
                                                           java.awt.geom.PathIterator pathIterator)
      • toRectangle2D

        public static java.awt.geom.Rectangle2D toRectangle2D​(org.eclipse.swt.graphics.Rectangle rect)
      • toTransform

        public static org.eclipse.swt.graphics.Transform toTransform​(org.eclipse.swt.graphics.Device device,
                                                                     java.awt.geom.AffineTransform at)
        This methods intentionally duplicated to avoid compile time dependency..
      • toTransform

        public static org.eclipse.swt.graphics.Transform toTransform​(org.eclipse.swt.graphics.Device device,
                                                                     org.eclipse.swt.graphics.Transform st,
                                                                     java.awt.geom.AffineTransform at)
        This methods intentionally duplicated to avoid compile time dependency..
      • applyAlphaBackground

        protected void applyAlphaBackground()
      • applyAlphaForeground

        protected void applyAlphaForeground()
      • applyClip

        protected void applyClip()
      • applyTransform

        protected void applyTransform()
      • clip

        public void clip​(java.awt.Shape shape)
        Description copied from interface: IGraphicsContext
        Clip the subsequent drawing operations to the shape. This adds the new clip shape to the existing one.
        Specified by:
        clip in interface IGraphicsContext
      • createPath

        protected org.eclipse.swt.graphics.Path createPath​(java.awt.Shape s)
      • draw

        public void draw​(java.awt.Shape s)
        Description copied from interface: IGraphicsContext
        Draw s using the current graphics context state.
        Specified by:
        draw in interface IGraphicsContext
      • drawString

        public void drawString​(java.lang.String s,
                               float x,
                               float y)
        Description copied from interface: IGraphicsContext
        Draw a plain text string in the graphics.
        Specified by:
        drawString in interface IGraphicsContext
      • fill

        public void fill​(java.awt.Shape s)
        Description copied from interface: IGraphicsContext
        Fill s using the current graphics context state.
        Specified by:
        fill in interface IGraphicsContext
      • getBlendMode

        public BlendMode getBlendMode()
      • getDevice

        public org.eclipse.swt.graphics.Device getDevice()
      • getFont

        public java.awt.Font getFont()
      • getFontRenderContext

        public java.awt.font.FontRenderContext getFontRenderContext()
      • getGc

        public org.eclipse.swt.graphics.GC getGc()
      • getTransform

        public java.awt.geom.AffineTransform getTransform()
        Description copied from interface: IGraphicsContext
        The transformatiom currentlz active.
        Specified by:
        getTransform in interface IGraphicsContext
        Returns:
      • getTransformationValues

        protected float[] getTransformationValues​(java.awt.geom.AffineTransform tx)
      • resetAdvanced

        public void resetAdvanced()
      • rotate

        public void rotate​(float theta)
        Description copied from interface: IGraphicsContext
        Rotate the currently active transformation by theta.
        Specified by:
        rotate in interface IGraphicsContext
      • scale

        public void scale​(float x,
                          float y)
        Description copied from interface: IGraphicsContext
        Scale the currently active transformation by x, y
        Specified by:
        scale in interface IGraphicsContext
      • setBackgroundColor

        public void setBackgroundColor​(org.eclipse.swt.graphics.Color resource)
      • setBackgroundPattern

        public void setBackgroundPattern​(org.eclipse.swt.graphics.Pattern resource)
      • setBlendMode

        public void setBlendMode​(BlendMode blendMode)
      • setClip

        public void setClip​(java.awt.Shape shape)
        Description copied from interface: IGraphicsContext
        Assign the new shape as the clipping shape.
        Specified by:
        setClip in interface IGraphicsContext
      • setFont

        public void setFont​(java.awt.Font awtFont)
        Description copied from interface: IGraphicsContext
        Set the current font for writing plain text in the graphics.
        Specified by:
        setFont in interface IGraphicsContext
      • setForegroundColor

        public void setForegroundColor​(org.eclipse.swt.graphics.Color resource)
      • setForegroundPattern

        public void setForegroundPattern​(org.eclipse.swt.graphics.Pattern resource)
      • setRenderingHint

        public void setRenderingHint​(java.awt.RenderingHints.Key hintKey,
                                     java.lang.Object hintValue)
        Description copied from interface: IGraphicsContext
        Set a specific rendering hint.
        Specified by:
        setRenderingHint in interface IGraphicsContext
      • setTransform

        public void setTransform​(java.awt.geom.AffineTransform pTransform)
        Description copied from interface: IGraphicsContext
        Set the currently active AffineTransform
        Specified by:
        setTransform in interface IGraphicsContext
      • textExtent

        public java.awt.Point textExtent​(java.lang.String s)
      • translate

        public void translate​(float x,
                              float y)
        Description copied from interface: IGraphicsContext
        translate the currently active transformation by x, y
        Specified by:
        translate in interface IGraphicsContext