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
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)
Draws
using the current graphics context state.void
drawImage(IImage image, float x, float y)
Draw imageimage
at coordinatesx
,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)
Fills
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 associatedIGraphicsEnvironment
java.awt.RenderingHints
getRenderingHints()
The currentRenderingHints
java.awt.geom.AffineTransform
getTransform()
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(java.awt.Color color)
Assign a new background color.void
setBackgroundPaint(IPaint paint)
Assign a new backgroundIPaint
.void
setClip(java.awt.Shape shape)
Assign the newshape
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 foregroundIPaint
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 activeStroke
void
setTransform(java.awt.geom.AffineTransform Tx)
Set the currently activeAffineTransform
void
transform(java.awt.geom.AffineTransform transform)
Transform theIGraphicsEnvironment
bytransform
void
translate(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)
Draws
using the current graphics context state.- Parameters:
s
-
-
drawImage
void drawImage(IImage image, float x, float y)
Draw imageimage
at 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)
Fills
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:
-
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 newshape
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 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 theIGraphicsEnvironment
bytransform
- Parameters:
transform
-
-
translate
void translate(float x, float y)
translate the currently active transformation byx
,y
- Parameters:
theta
-
-
-