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 TypeMethodDescriptionvoidClip the subsequent drawing operations to the shape.voiddispose()Dispose the current context and all its resources.voidDrawsusing the current graphics context state.voidDraw imageimageat coordinatesx,y.voiddrawString(String text, float x, float y) Draw a plain text string in the graphics.voidFillsusing the current graphics context state.The current background color.getClip()The current clip.The current foregroumd color.The associatedIGraphicsEnvironmentThe currentRenderingHintsThe transformatiom currentlz active.voidrotate(float theta) Rotate the currently active transformation bytheta.voidscale(float x, float y) Scale the currently active transformation byx,yvoidsetBackgroundColor(Color color) Assign a new background color.voidsetBackgroundPaint(IPaint paint) Assign a new backgroundIPaint.voidAssign the newshapeas the clipping shape.voidSet the current font for writing plain text in the graphics.voidAssign a new foreground color.voidsetForegroundPaint(IPaint paint) Assign a new foregroundIPaintvoidsetRenderingHint(RenderingHints.Key hintKey, Object hintValue) Set a specific rendering hint.voidsetRenderingHints(Map hints) Assign the currently active rendering hints.voidAssign the currently activeStrokevoidSet the currently activeAffineTransformvoidtransform(AffineTransform transform) Transform theIGraphicsEnvironmentbytransformvoidtranslate(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
Drawsusing the current graphics context state.- Parameters:
s-
-
drawImage
Draw imageimageat coordinatesx,y.- Parameters:
image-x-y-
-
drawString
Draw a plain text string in the graphics.- Parameters:
text-x-y-
-
fill
Fillsusing 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 newshapeas 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 theIGraphicsEnvironmentbytransform- Parameters:
transform-
-
translate
void translate(float x, float y) translate the currently active transformation byx,y- Parameters:
theta-
-