intarsys CWT library

de.intarsys.cwt.environment
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
 void clip(Shape shape)
          Clip the subsequent drawing operations to the shape.
 void dispose()
          Dispose the current context and all its resources.
 void draw(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(String text, float x, float y)
          Draw a plain text string in the graphics.
 void fill(Shape s)
          Fill s using the current graphics context state.
 Color getBackgroundColor()
          The current background color.
 Shape getClip()
          The current clip.
 Color getForegroundColor()
          The current foregroumd color.
 IGraphicsEnvironment getGraphicsEnvironment()
          The associated IGraphicsEnvironment
 RenderingHints getRenderingHints()
          The current RenderingHints
 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(Color color)
          Assign a new background color.
 void setBackgroundPaint(IPaint paint)
          Assign a new background IPaint.
 void setClip(Shape shape)
          Assign the new shape as the clipping shape.
 void setFont(Font font)
          Set the current font for writing plain text in the graphics.
 void setForegroundColor(Color c)
          Assign a new foreground color.
 void setForegroundPaint(IPaint paint)
          Assign a new foreground IPaint
 void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
          Set a specific rendering hint.
 void setRenderingHints(Map hints)
          Assign the currently active rendering hints.
 void setStroke(Stroke s)
          Assign the currently active Stroke
 void setTransform(AffineTransform Tx)
          Set the currently active AffineTransform
 void transform(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(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(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(String text,
                float x,
                float y)
Draw a plain text string in the graphics.

Parameters:
text -
x -
y -

fill

void fill(Shape s)
Fill s using the current graphics context state.

Parameters:
s -

getBackgroundColor

Color getBackgroundColor()
The current background color.

Returns:

getClip

Shape getClip()
The current clip.

Returns:

getForegroundColor

Color getForegroundColor()
The current foregroumd color.

Returns:

getGraphicsEnvironment

IGraphicsEnvironment getGraphicsEnvironment()
The associated IGraphicsEnvironment

Returns:

getRenderingHints

RenderingHints getRenderingHints()
The current RenderingHints

Returns:

getTransform

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(Color color)
Assign a new background color.

Parameters:
color -

setBackgroundPaint

void setBackgroundPaint(IPaint paint)
Assign a new background IPaint.

Parameters:
paint -

setClip

void setClip(Shape shape)
Assign the new shape as the clipping shape.

Parameters:
shape -

setFont

void setFont(Font font)
Set the current font for writing plain text in the graphics.

Parameters:
font -

setForegroundColor

void setForegroundColor(Color c)
Assign a new foreground color.

Parameters:
c -

setForegroundPaint

void setForegroundPaint(IPaint paint)
Assign a new foreground IPaint

Parameters:
paint -

setRenderingHint

void setRenderingHint(RenderingHints.Key hintKey,
                      Object hintValue)
Set a specific rendering hint.

Parameters:
hintKey -
hintValue -

setRenderingHints

void setRenderingHints(Map hints)
Assign the currently active rendering hints.

Parameters:
hints -

setStroke

void setStroke(Stroke s)
Assign the currently active Stroke

Parameters:
s -

setTransform

void setTransform(AffineTransform Tx)
Set the currently active AffineTransform

Parameters:
Tx -

transform

void transform(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 -

intarsys CWT library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.