Package 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
Modifier and TypeMethodDescriptionvoid
Clip the subsequent drawing operations to the shape.void
dispose()
Dispose the current context and all its resources.void
Draws
using the current graphics context state.void
Draw imageimage
at coordinatesx
,y
.void
drawString
(String text, float x, float y) Draw a plain text string in the graphics.void
Fills
using the current graphics context state.The current background color.getClip()
The current clip.The current foregroumd color.The associatedIGraphicsEnvironment
The currentRenderingHints
The transformatiom currentlz active.void
rotate
(float theta) Rotate the currently active transformation bytheta
.void
scale
(float x, float y) Scale the currently active transformation byx
,y
void
setBackgroundColor
(Color color) Assign a new background color.void
setBackgroundPaint
(IPaint paint) Assign a new backgroundIPaint
.void
Assign the newshape
as the clipping shape.void
Set the current font for writing plain text in the graphics.void
Assign a new foreground color.void
setForegroundPaint
(IPaint paint) Assign a new foregroundIPaint
void
setRenderingHint
(RenderingHints.Key hintKey, Object hintValue) Set a specific rendering hint.void
setRenderingHints
(Map hints) Assign the currently active rendering hints.void
Assign the currently activeStroke
void
Set the currently activeAffineTransform
void
transform
(AffineTransform transform) Transform theIGraphicsEnvironment
bytransform
void
translate
(float x, float y) translate the currently active transformation byx
,y
-
Method Details
-
clip
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
Draws
using the current graphics context state.- Parameters:
s
-
-
drawImage
Draw imageimage
at coordinatesx
,y
.- Parameters:
image
-x
-y
-
-
drawString
Draw a plain text string in the graphics.- Parameters:
text
-x
-y
-
-
fill
Fills
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 associatedIGraphicsEnvironment
- Returns:
-
getRenderingHints
RenderingHints getRenderingHints()The currentRenderingHints
- Returns:
-
getTransform
AffineTransform getTransform()The transformatiom currentlz active.- Returns:
-
rotate
void rotate(float theta) Rotate the currently active transformation bytheta
.- Parameters:
theta
-
-
scale
void scale(float x, float y) Scale the currently active transformation byx
,y
- Parameters:
theta
-
-
setBackgroundColor
Assign a new background color.- Parameters:
color
-
-
setBackgroundPaint
Assign a new backgroundIPaint
.- Parameters:
paint
-
-
setClip
Assign the newshape
as the clipping shape.- Parameters:
shape
-
-
setFont
Set the current font for writing plain text in the graphics.- Parameters:
font
-
-
setForegroundColor
Assign a new foreground color.- Parameters:
c
-
-
setForegroundPaint
Assign a new foregroundIPaint
- Parameters:
paint
-
-
setRenderingHint
Set a specific rendering hint.- Parameters:
hintKey
-hintValue
-
-
setRenderingHints
Assign the currently active rendering hints.- Parameters:
hints
-
-
setStroke
Assign the currently activeStroke
- Parameters:
s
-
-
setTransform
Set the currently activeAffineTransform
- Parameters:
Tx
-
-
transform
Transform theIGraphicsEnvironment
bytransform
- Parameters:
transform
-
-
translate
void translate(float x, float y) translate the currently active transformation byx
,y
- Parameters:
theta
-
-