Interface IGraphicsContext

  • All Known Implementing Classes:
    CwtAwtGraphicsContext, CwtSwtGraphicsContext

    public interface IGraphicsContext
    A platform independent (SWT, AWT) description of a graphics context.

    The primary goal of this one is derived from the requirements enforced by processing a PDF context stream.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clip​(java.awt.Shape shape)
      Clip the subsequent drawing operations to the shape.
      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 text, 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.
      java.awt.Shape getClip()
      The current clip.
      java.awt.Color getForegroundColor()
      The current foregroumd color.
      IGraphicsEnvironment getGraphicsEnvironment()
      The associated IGraphicsEnvironment
      java.awt.RenderingHints getRenderingHints()
      The current RenderingHints
      java.awt.geom.AffineTransform getTransform()
      The transformatiom currentlz active.
      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 setBackgroundPaint​(IPaint paint)
      Assign a new background IPaint.
      void setClip​(java.awt.Shape shape)
      Assign the new shape as the clipping shape.
      void setFont​(java.awt.Font font)
      Set the current font for writing plain text in the graphics.
      void setForegroundColor​(java.awt.Color c)
      Assign a new foreground color.
      void setForegroundPaint​(IPaint paint)
      Assign a new foreground IPaint
      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 Tx)
      Set the currently active AffineTransform
      void transform​(java.awt.geom.AffineTransform transform)
      Transform the IGraphicsEnvironment by transform
      void translate​(float x, float y)
      translate the currently active transformation by x, y
    • Method Detail

      • clip

        void clip​(java.awt.Shape shape)
        Clip the subsequent drawing operations to the shape. This adds the new clip shape to the existing one.
        Parameters:
        shape -
      • dispose

        void dispose()
        Dispose the current context and all its resources.
      • draw

        void draw​(java.awt.Shape s)
        Draw s using the current graphics context state.
        Parameters:
        s -
      • drawImage

        void drawImage​(IImage image,
                       float x,
                       float y)
        Draw image image at coordinates x, y.
        Parameters:
        image -
        x -
        y -
      • drawString

        void drawString​(java.lang.String text,
                        float x,
                        float y)
        Draw a plain text string in the graphics.
        Parameters:
        text -
        x -
        y -
      • fill

        void fill​(java.awt.Shape s)
        Fill s using the current graphics context state.
        Parameters:
        s -
      • getBackgroundColor

        java.awt.Color getBackgroundColor()
        The current background color.
        Returns:
      • getClip

        java.awt.Shape getClip()
        The current clip.
        Returns:
      • getForegroundColor

        java.awt.Color getForegroundColor()
        The current foregroumd color.
        Returns:
      • getRenderingHints

        java.awt.RenderingHints getRenderingHints()
        The current RenderingHints
        Returns:
      • getTransform

        java.awt.geom.AffineTransform getTransform()
        The transformatiom currentlz active.
        Returns:
      • rotate

        void rotate​(float theta)
        Rotate the currently active transformation by theta.
        Parameters:
        theta -
      • scale

        void scale​(float x,
                   float y)
        Scale the currently active transformation by x, y
        Parameters:
        theta -
      • setBackgroundColor

        void setBackgroundColor​(java.awt.Color color)
        Assign a new background color.
        Parameters:
        color -
      • setBackgroundPaint

        void setBackgroundPaint​(IPaint paint)
        Assign a new background IPaint.
        Parameters:
        paint -
      • setClip

        void setClip​(java.awt.Shape shape)
        Assign the new shape as the clipping shape.
        Parameters:
        shape -
      • setFont

        void setFont​(java.awt.Font font)
        Set the current font for writing plain text in the graphics.
        Parameters:
        font -
      • setForegroundColor

        void setForegroundColor​(java.awt.Color c)
        Assign a new foreground color.
        Parameters:
        c -
      • setForegroundPaint

        void setForegroundPaint​(IPaint paint)
        Assign a new foreground IPaint
        Parameters:
        paint -
      • setRenderingHint

        void setRenderingHint​(java.awt.RenderingHints.Key hintKey,
                              java.lang.Object hintValue)
        Set a specific rendering hint.
        Parameters:
        hintKey -
        hintValue -
      • setRenderingHints

        void setRenderingHints​(java.util.Map hints)
        Assign the currently active rendering hints.
        Parameters:
        hints -
      • setStroke

        void setStroke​(java.awt.Stroke s)
        Assign the currently active Stroke
        Parameters:
        s -
      • setTransform

        void setTransform​(java.awt.geom.AffineTransform Tx)
        Set the currently active AffineTransform
        Parameters:
        Tx -
      • transform

        void transform​(java.awt.geom.AffineTransform transform)
        Transform the IGraphicsEnvironment by transform
        Parameters:
        transform -
      • translate

        void translate​(float x,
                       float y)
        translate the currently active transformation by x, y
        Parameters:
        theta -