Package de.intarsys.cwt.awt.environment
Class CwtAwtGraphicsContext
- java.lang.Object
-
- de.intarsys.cwt.awt.environment.CwtAwtGraphicsContext
-
- All Implemented Interfaces:
IGraphicsContext
public class CwtAwtGraphicsContext extends java.lang.Object implements IGraphicsContext
The AWT implementation ofIGraphicsContext
-
-
Constructor Summary
Constructors Constructor Description CwtAwtGraphicsContext(java.awt.Graphics2D paramGraphics)
-
Method Summary
All Methods Instance Methods Concrete 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
disposeClip(java.lang.Object clip)
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 s, 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.BlendMode
getBlendMode()
java.awt.Shape
getClip()
The current clip.java.awt.Font
getFont()
java.awt.font.FontRenderContext
getFontRenderContext()
java.awt.Color
getForegroundColor()
The current foregroumd color.java.awt.Graphics2D
getGraphics()
IGraphicsEnvironment
getGraphicsEnvironment()
The associatedIGraphicsEnvironment
java.awt.RenderingHints
getRenderingHints()
The currentRenderingHints
java.awt.geom.AffineTransform
getTransform()
The transformatiom currentlz active.void
resetAdvanced()
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
setBackgroundPaint(java.awt.Paint paint)
void
setBlendMode(BlendMode blendMode)
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
setForegroundPaint(java.awt.Paint paint)
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 Tx)
Transform theIGraphicsEnvironment
bytransform
void
translate(float x, float y)
translate the currently active transformation byx
,y
-
-
-
Method Detail
-
clip
public void clip(java.awt.Shape shape)
Description copied from interface:IGraphicsContext
Clip the subsequent drawing operations to the shape. This adds the new clip shape to the existing one.- Specified by:
clip
in interfaceIGraphicsContext
-
dispose
public void dispose()
Description copied from interface:IGraphicsContext
Dispose the current context and all its resources.- Specified by:
dispose
in interfaceIGraphicsContext
-
disposeClip
public void disposeClip(java.lang.Object clip)
-
draw
public void draw(java.awt.Shape s)
Description copied from interface:IGraphicsContext
Draws
using the current graphics context state.- Specified by:
draw
in interfaceIGraphicsContext
-
drawImage
public void drawImage(IImage image, float x, float y)
Description copied from interface:IGraphicsContext
Draw imageimage
at coordinatesx
,y
.- Specified by:
drawImage
in interfaceIGraphicsContext
-
drawString
public void drawString(java.lang.String s, float x, float y)
Description copied from interface:IGraphicsContext
Draw a plain text string in the graphics.- Specified by:
drawString
in interfaceIGraphicsContext
-
fill
public void fill(java.awt.Shape s)
Description copied from interface:IGraphicsContext
Fills
using the current graphics context state.- Specified by:
fill
in interfaceIGraphicsContext
-
getBackgroundColor
public java.awt.Color getBackgroundColor()
Description copied from interface:IGraphicsContext
The current background color.- Specified by:
getBackgroundColor
in interfaceIGraphicsContext
- Returns:
-
getBlendMode
public BlendMode getBlendMode()
-
getClip
public java.awt.Shape getClip()
Description copied from interface:IGraphicsContext
The current clip.- Specified by:
getClip
in interfaceIGraphicsContext
- Returns:
-
getFont
public java.awt.Font getFont()
-
getFontRenderContext
public java.awt.font.FontRenderContext getFontRenderContext()
-
getForegroundColor
public java.awt.Color getForegroundColor()
Description copied from interface:IGraphicsContext
The current foregroumd color.- Specified by:
getForegroundColor
in interfaceIGraphicsContext
- Returns:
-
getGraphics
public java.awt.Graphics2D getGraphics()
-
getGraphicsEnvironment
public IGraphicsEnvironment getGraphicsEnvironment()
Description copied from interface:IGraphicsContext
The associatedIGraphicsEnvironment
- Specified by:
getGraphicsEnvironment
in interfaceIGraphicsContext
- Returns:
-
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
Description copied from interface:IGraphicsContext
The currentRenderingHints
- Specified by:
getRenderingHints
in interfaceIGraphicsContext
- Returns:
-
getTransform
public java.awt.geom.AffineTransform getTransform()
Description copied from interface:IGraphicsContext
The transformatiom currentlz active.- Specified by:
getTransform
in interfaceIGraphicsContext
- Returns:
-
resetAdvanced
public void resetAdvanced()
-
rotate
public void rotate(float theta)
Description copied from interface:IGraphicsContext
Rotate the currently active transformation bytheta
.- Specified by:
rotate
in interfaceIGraphicsContext
-
scale
public void scale(float x, float y)
Description copied from interface:IGraphicsContext
Scale the currently active transformation byx
,y
- Specified by:
scale
in interfaceIGraphicsContext
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Description copied from interface:IGraphicsContext
Assign a new background color.- Specified by:
setBackgroundColor
in interfaceIGraphicsContext
-
setBackgroundPaint
public void setBackgroundPaint(IPaint paint)
Description copied from interface:IGraphicsContext
Assign a new backgroundIPaint
.- Specified by:
setBackgroundPaint
in interfaceIGraphicsContext
-
setBackgroundPaint
public void setBackgroundPaint(java.awt.Paint paint)
-
setBlendMode
public void setBlendMode(BlendMode blendMode)
-
setClip
public void setClip(java.awt.Shape shape)
Description copied from interface:IGraphicsContext
Assign the newshape
as the clipping shape.- Specified by:
setClip
in interfaceIGraphicsContext
-
setFont
public void setFont(java.awt.Font font)
Description copied from interface:IGraphicsContext
Set the current font for writing plain text in the graphics.- Specified by:
setFont
in interfaceIGraphicsContext
-
setForegroundColor
public void setForegroundColor(java.awt.Color c)
Description copied from interface:IGraphicsContext
Assign a new foreground color.- Specified by:
setForegroundColor
in interfaceIGraphicsContext
-
setForegroundPaint
public void setForegroundPaint(IPaint paint)
Description copied from interface:IGraphicsContext
Assign a new foregroundIPaint
- Specified by:
setForegroundPaint
in interfaceIGraphicsContext
-
setForegroundPaint
public void setForegroundPaint(java.awt.Paint paint)
-
setRenderingHint
public void setRenderingHint(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)
Description copied from interface:IGraphicsContext
Set a specific rendering hint.- Specified by:
setRenderingHint
in interfaceIGraphicsContext
-
setRenderingHints
public void setRenderingHints(java.util.Map hints)
Description copied from interface:IGraphicsContext
Assign the currently active rendering hints.- Specified by:
setRenderingHints
in interfaceIGraphicsContext
-
setStroke
public void setStroke(java.awt.Stroke s)
Description copied from interface:IGraphicsContext
Assign the currently activeStroke
- Specified by:
setStroke
in interfaceIGraphicsContext
-
setTransform
public void setTransform(java.awt.geom.AffineTransform Tx)
Description copied from interface:IGraphicsContext
Set the currently activeAffineTransform
- Specified by:
setTransform
in interfaceIGraphicsContext
-
transform
public void transform(java.awt.geom.AffineTransform Tx)
Description copied from interface:IGraphicsContext
Transform theIGraphicsEnvironment
bytransform
- Specified by:
transform
in interfaceIGraphicsContext
-
translate
public void translate(float x, float y)
Description copied from interface:IGraphicsContext
translate the currently active transformation byx
,y
- Specified by:
translate
in interfaceIGraphicsContext
-
-