intarsys CWT library

de.intarsys.cwt.awt.environment
Class CwtAwtGraphicsContext

java.lang.Object
  extended by de.intarsys.cwt.awt.environment.CwtAwtGraphicsContext
All Implemented Interfaces:
IGraphicsContext

public class CwtAwtGraphicsContext
extends Object
implements IGraphicsContext

The AWT implementation of IGraphicsContext


Constructor Summary
CwtAwtGraphicsContext(Graphics2D paramGraphics)
           
 
Method Summary
 void clip(Shape shape)
          Clip the subsequent drawing operations to the shape.
 void dispose()
          Dispose the current context and all its resources.
 void disposeClip(Object clip)
           
 void draw(Shape s)
          Draw s using the current graphics context state.
 void drawImage(IImage image, float x, float y)
          Draw image image at coordinates x, y.
 void drawString(String s, float x, float y)
          Draw a plain text string in the graphics.
 void fill(Shape s)
          Fill s using the current graphics context state.
 Color getBackgroundColor()
          The current background color.
 BlendMode getBlendMode()
           
 Shape getClip()
          The current clip.
 Font getFont()
           
 FontRenderContext getFontRenderContext()
           
 Color getForegroundColor()
          The current foregroumd color.
 Graphics2D getGraphics()
           
 IGraphicsEnvironment getGraphicsEnvironment()
          The associated IGraphicsEnvironment
 RenderingHints getRenderingHints()
          The current RenderingHints
 AffineTransform getTransform()
          The transformatiom currentlz active.
 void resetAdvanced()
           
 void rotate(float theta)
          Rotate the currently active transformation by theta.
 void scale(float x, float y)
          Scale the currently active transformation by x, y
 void setBackgroundColor(Color color)
          Assign a new background color.
 void setBackgroundPaint(IPaint paint)
          Assign a new background IPaint.
 void setBackgroundPaint(Paint paint)
           
 void setBlendMode(BlendMode blendMode)
           
 void setClip(Shape shape)
          Assign the new shape as the clipping shape.
 void setFont(Font font)
          Set the current font for writing plain text in the graphics.
 void setForegroundColor(Color c)
          Assign a new foreground color.
 void setForegroundPaint(IPaint paint)
          Assign a new foreground IPaint
 void setForegroundPaint(Paint paint)
           
 void setPaintMode()
           
 void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
          Set a specific rendering hint.
 void setRenderingHints(Map hints)
          Assign the currently active rendering hints.
 void setStroke(Stroke s)
          Assign the currently active Stroke
 void setTransform(AffineTransform Tx)
          Set the currently active AffineTransform
 void setXORMode(Color c1)
           
 Point textExtent(String s)
           
 void transform(AffineTransform Tx)
          Transform the IGraphicsEnvironment by transform
 void translate(float x, float y)
          translate the currently active transformation by x, y
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CwtAwtGraphicsContext

public CwtAwtGraphicsContext(Graphics2D paramGraphics)
Method Detail

clip

public void clip(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 interface IGraphicsContext

dispose

public void dispose()
Description copied from interface: IGraphicsContext
Dispose the current context and all its resources.

Specified by:
dispose in interface IGraphicsContext

disposeClip

public void disposeClip(Object clip)

draw

public void draw(Shape s)
Description copied from interface: IGraphicsContext
Draw s using the current graphics context state.

Specified by:
draw in interface IGraphicsContext

drawImage

public void drawImage(IImage image,
                      float x,
                      float y)
Description copied from interface: IGraphicsContext
Draw image image at coordinates x, y.

Specified by:
drawImage in interface IGraphicsContext

drawString

public void drawString(String s,
                       float x,
                       float y)
Description copied from interface: IGraphicsContext
Draw a plain text string in the graphics.

Specified by:
drawString in interface IGraphicsContext

fill

public void fill(Shape s)
Description copied from interface: IGraphicsContext
Fill s using the current graphics context state.

Specified by:
fill in interface IGraphicsContext

getBackgroundColor

public Color getBackgroundColor()
Description copied from interface: IGraphicsContext
The current background color.

Specified by:
getBackgroundColor in interface IGraphicsContext
Returns:

getBlendMode

public BlendMode getBlendMode()

getClip

public Shape getClip()
Description copied from interface: IGraphicsContext
The current clip.

Specified by:
getClip in interface IGraphicsContext
Returns:

getFont

public Font getFont()

getFontRenderContext

public FontRenderContext getFontRenderContext()

getForegroundColor

public Color getForegroundColor()
Description copied from interface: IGraphicsContext
The current foregroumd color.

Specified by:
getForegroundColor in interface IGraphicsContext
Returns:

getGraphics

public Graphics2D getGraphics()

getGraphicsEnvironment

public IGraphicsEnvironment getGraphicsEnvironment()
Description copied from interface: IGraphicsContext
The associated IGraphicsEnvironment

Specified by:
getGraphicsEnvironment in interface IGraphicsContext
Returns:

getRenderingHints

public RenderingHints getRenderingHints()
Description copied from interface: IGraphicsContext
The current RenderingHints

Specified by:
getRenderingHints in interface IGraphicsContext
Returns:

getTransform

public AffineTransform getTransform()
Description copied from interface: IGraphicsContext
The transformatiom currentlz active.

Specified by:
getTransform in interface IGraphicsContext
Returns:

resetAdvanced

public void resetAdvanced()

rotate

public void rotate(float theta)
Description copied from interface: IGraphicsContext
Rotate the currently active transformation by theta.

Specified by:
rotate in interface IGraphicsContext

scale

public void scale(float x,
                  float y)
Description copied from interface: IGraphicsContext
Scale the currently active transformation by x, y

Specified by:
scale in interface IGraphicsContext

setBackgroundColor

public void setBackgroundColor(Color color)
Description copied from interface: IGraphicsContext
Assign a new background color.

Specified by:
setBackgroundColor in interface IGraphicsContext

setBackgroundPaint

public void setBackgroundPaint(IPaint paint)
Description copied from interface: IGraphicsContext
Assign a new background IPaint.

Specified by:
setBackgroundPaint in interface IGraphicsContext

setBackgroundPaint

public void setBackgroundPaint(Paint paint)

setBlendMode

public void setBlendMode(BlendMode blendMode)

setClip

public void setClip(Shape shape)
Description copied from interface: IGraphicsContext
Assign the new shape as the clipping shape.

Specified by:
setClip in interface IGraphicsContext

setFont

public void setFont(Font font)
Description copied from interface: IGraphicsContext
Set the current font for writing plain text in the graphics.

Specified by:
setFont in interface IGraphicsContext

setForegroundColor

public void setForegroundColor(Color c)
Description copied from interface: IGraphicsContext
Assign a new foreground color.

Specified by:
setForegroundColor in interface IGraphicsContext

setForegroundPaint

public void setForegroundPaint(IPaint paint)
Description copied from interface: IGraphicsContext
Assign a new foreground IPaint

Specified by:
setForegroundPaint in interface IGraphicsContext

setForegroundPaint

public void setForegroundPaint(Paint paint)

setPaintMode

public void setPaintMode()

setRenderingHint

public void setRenderingHint(RenderingHints.Key hintKey,
                             Object hintValue)
Description copied from interface: IGraphicsContext
Set a specific rendering hint.

Specified by:
setRenderingHint in interface IGraphicsContext

setRenderingHints

public void setRenderingHints(Map hints)
Description copied from interface: IGraphicsContext
Assign the currently active rendering hints.

Specified by:
setRenderingHints in interface IGraphicsContext

setStroke

public void setStroke(Stroke s)
Description copied from interface: IGraphicsContext
Assign the currently active Stroke

Specified by:
setStroke in interface IGraphicsContext

setTransform

public void setTransform(AffineTransform Tx)
Description copied from interface: IGraphicsContext
Set the currently active AffineTransform

Specified by:
setTransform in interface IGraphicsContext

setXORMode

public void setXORMode(Color c1)

textExtent

public Point textExtent(String s)

transform

public void transform(AffineTransform Tx)
Description copied from interface: IGraphicsContext
Transform the IGraphicsEnvironment by transform

Specified by:
transform in interface IGraphicsContext

translate

public void translate(float x,
                      float y)
Description copied from interface: IGraphicsContext
translate the currently active transformation by x, y

Specified by:
translate in interface IGraphicsContext

intarsys CWT library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.