Package de.intarsys.cwt.environment
Interface IGraphicsContext
-
- All Known Implementing Classes:
CwtAwtGraphicsContext,CwtSwtGraphicsContext
public interface IGraphicsContextA 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 voidclip(java.awt.Shape shape)Clip the subsequent drawing operations to the shape.voiddispose()Dispose the current context and all its resources.voiddraw(java.awt.Shape s)Drawsusing the current graphics context state.voiddrawImage(IImage image, float x, float y)Draw imageimageat coordinatesx,y.voiddrawString(java.lang.String text, float x, float y)Draw a plain text string in the graphics.voidfill(java.awt.Shape s)Fillsusing the current graphics context state.java.awt.ColorgetBackgroundColor()The current background color.java.awt.ShapegetClip()The current clip.java.awt.ColorgetForegroundColor()The current foregroumd color.IGraphicsEnvironmentgetGraphicsEnvironment()The associatedIGraphicsEnvironmentjava.awt.RenderingHintsgetRenderingHints()The currentRenderingHintsjava.awt.geom.AffineTransformgetTransform()The transformatiom currentlz active.voidrotate(float theta)Rotate the currently active transformation bytheta.voidscale(float x, float y)Scale the currently active transformation byx,yvoidsetBackgroundColor(java.awt.Color color)Assign a new background color.voidsetBackgroundPaint(IPaint paint)Assign a new backgroundIPaint.voidsetClip(java.awt.Shape shape)Assign the newshapeas the clipping shape.voidsetFont(java.awt.Font font)Set the current font for writing plain text in the graphics.voidsetForegroundColor(java.awt.Color c)Assign a new foreground color.voidsetForegroundPaint(IPaint paint)Assign a new foregroundIPaintvoidsetRenderingHint(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)Set a specific rendering hint.voidsetRenderingHints(java.util.Map hints)Assign the currently active rendering hints.voidsetStroke(java.awt.Stroke s)Assign the currently activeStrokevoidsetTransform(java.awt.geom.AffineTransform Tx)Set the currently activeAffineTransformvoidtransform(java.awt.geom.AffineTransform transform)Transform theIGraphicsEnvironmentbytransformvoidtranslate(float x, float y)translate the currently active transformation byx,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)
Drawsusing the current graphics context state.- Parameters:
s-
-
drawImage
void drawImage(IImage image, float x, float y)
Draw imageimageat coordinatesx,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)
Fillsusing 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:
-
getGraphicsEnvironment
IGraphicsEnvironment getGraphicsEnvironment()
The associatedIGraphicsEnvironment- Returns:
-
getRenderingHints
java.awt.RenderingHints getRenderingHints()
The currentRenderingHints- Returns:
-
getTransform
java.awt.geom.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
void setBackgroundColor(java.awt.Color color)
Assign a new background color.- Parameters:
color-
-
setBackgroundPaint
void setBackgroundPaint(IPaint paint)
Assign a new backgroundIPaint.- Parameters:
paint-
-
setClip
void setClip(java.awt.Shape shape)
Assign the newshapeas 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 foregroundIPaint- 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 activeStroke- Parameters:
s-
-
setTransform
void setTransform(java.awt.geom.AffineTransform Tx)
Set the currently activeAffineTransform- Parameters:
Tx-
-
transform
void transform(java.awt.geom.AffineTransform transform)
Transform theIGraphicsEnvironmentbytransform- Parameters:
transform-
-
translate
void translate(float x, float y)translate the currently active transformation byx,y- Parameters:
theta-
-
-