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 voidclip(java.awt.Shape shape)Clip the subsequent drawing operations to the shape.voiddispose()Dispose the current context and all its resources.voiddisposeClip(java.lang.Object clip)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 s, 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.BlendModegetBlendMode()java.awt.ShapegetClip()The current clip.java.awt.FontgetFont()java.awt.font.FontRenderContextgetFontRenderContext()java.awt.ColorgetForegroundColor()The current foregroumd color.java.awt.Graphics2DgetGraphics()IGraphicsEnvironmentgetGraphicsEnvironment()The associatedIGraphicsEnvironmentjava.awt.RenderingHintsgetRenderingHints()The currentRenderingHintsjava.awt.geom.AffineTransformgetTransform()The transformatiom currentlz active.voidresetAdvanced()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.voidsetBackgroundPaint(java.awt.Paint paint)voidsetBlendMode(BlendMode blendMode)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 foregroundIPaintvoidsetForegroundPaint(java.awt.Paint paint)voidsetRenderingHint(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 Tx)Transform theIGraphicsEnvironmentbytransformvoidtranslate(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:IGraphicsContextClip the subsequent drawing operations to the shape. This adds the new clip shape to the existing one.- Specified by:
clipin interfaceIGraphicsContext
-
dispose
public void dispose()
Description copied from interface:IGraphicsContextDispose the current context and all its resources.- Specified by:
disposein interfaceIGraphicsContext
-
disposeClip
public void disposeClip(java.lang.Object clip)
-
draw
public void draw(java.awt.Shape s)
Description copied from interface:IGraphicsContextDrawsusing the current graphics context state.- Specified by:
drawin interfaceIGraphicsContext
-
drawImage
public void drawImage(IImage image, float x, float y)
Description copied from interface:IGraphicsContextDraw imageimageat coordinatesx,y.- Specified by:
drawImagein interfaceIGraphicsContext
-
drawString
public void drawString(java.lang.String s, float x, float y)Description copied from interface:IGraphicsContextDraw a plain text string in the graphics.- Specified by:
drawStringin interfaceIGraphicsContext
-
fill
public void fill(java.awt.Shape s)
Description copied from interface:IGraphicsContextFillsusing the current graphics context state.- Specified by:
fillin interfaceIGraphicsContext
-
getBackgroundColor
public java.awt.Color getBackgroundColor()
Description copied from interface:IGraphicsContextThe current background color.- Specified by:
getBackgroundColorin interfaceIGraphicsContext- Returns:
-
getBlendMode
public BlendMode getBlendMode()
-
getClip
public java.awt.Shape getClip()
Description copied from interface:IGraphicsContextThe current clip.- Specified by:
getClipin 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:IGraphicsContextThe current foregroumd color.- Specified by:
getForegroundColorin interfaceIGraphicsContext- Returns:
-
getGraphics
public java.awt.Graphics2D getGraphics()
-
getGraphicsEnvironment
public IGraphicsEnvironment getGraphicsEnvironment()
Description copied from interface:IGraphicsContextThe associatedIGraphicsEnvironment- Specified by:
getGraphicsEnvironmentin interfaceIGraphicsContext- Returns:
-
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
Description copied from interface:IGraphicsContextThe currentRenderingHints- Specified by:
getRenderingHintsin interfaceIGraphicsContext- Returns:
-
getTransform
public java.awt.geom.AffineTransform getTransform()
Description copied from interface:IGraphicsContextThe transformatiom currentlz active.- Specified by:
getTransformin interfaceIGraphicsContext- Returns:
-
resetAdvanced
public void resetAdvanced()
-
rotate
public void rotate(float theta)
Description copied from interface:IGraphicsContextRotate the currently active transformation bytheta.- Specified by:
rotatein interfaceIGraphicsContext
-
scale
public void scale(float x, float y)Description copied from interface:IGraphicsContextScale the currently active transformation byx,y- Specified by:
scalein interfaceIGraphicsContext
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Description copied from interface:IGraphicsContextAssign a new background color.- Specified by:
setBackgroundColorin interfaceIGraphicsContext
-
setBackgroundPaint
public void setBackgroundPaint(IPaint paint)
Description copied from interface:IGraphicsContextAssign a new backgroundIPaint.- Specified by:
setBackgroundPaintin 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:IGraphicsContextAssign the newshapeas the clipping shape.- Specified by:
setClipin interfaceIGraphicsContext
-
setFont
public void setFont(java.awt.Font font)
Description copied from interface:IGraphicsContextSet the current font for writing plain text in the graphics.- Specified by:
setFontin interfaceIGraphicsContext
-
setForegroundColor
public void setForegroundColor(java.awt.Color c)
Description copied from interface:IGraphicsContextAssign a new foreground color.- Specified by:
setForegroundColorin interfaceIGraphicsContext
-
setForegroundPaint
public void setForegroundPaint(IPaint paint)
Description copied from interface:IGraphicsContextAssign a new foregroundIPaint- Specified by:
setForegroundPaintin 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:IGraphicsContextSet a specific rendering hint.- Specified by:
setRenderingHintin interfaceIGraphicsContext
-
setRenderingHints
public void setRenderingHints(java.util.Map hints)
Description copied from interface:IGraphicsContextAssign the currently active rendering hints.- Specified by:
setRenderingHintsin interfaceIGraphicsContext
-
setStroke
public void setStroke(java.awt.Stroke s)
Description copied from interface:IGraphicsContextAssign the currently activeStroke- Specified by:
setStrokein interfaceIGraphicsContext
-
setTransform
public void setTransform(java.awt.geom.AffineTransform Tx)
Description copied from interface:IGraphicsContextSet the currently activeAffineTransform- Specified by:
setTransformin interfaceIGraphicsContext
-
transform
public void transform(java.awt.geom.AffineTransform Tx)
Description copied from interface:IGraphicsContextTransform theIGraphicsEnvironmentbytransform- Specified by:
transformin interfaceIGraphicsContext
-
translate
public void translate(float x, float y)Description copied from interface:IGraphicsContexttranslate the currently active transformation byx,y- Specified by:
translatein interfaceIGraphicsContext
-
-