Package de.intarsys.cwt.swt.environment
Class CwtSwtGraphicsContext
java.lang.Object
de.intarsys.cwt.swt.environment.CwtSwtGraphicsContext
- All Implemented Interfaces:
IGraphicsContext
An
IGraphicsContext mapping to SWT.
It is currently not safe to use this IGraphicsContext concurrently.
-
Constructor Summary
ConstructorsConstructorDescriptionCwtSwtGraphicsContext(org.eclipse.swt.graphics.GC paramGC, org.eclipse.swt.graphics.Device paramDevice) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprotected voidvoidClip the subsequent drawing operations to the shape.protected org.eclipse.swt.graphics.PathcreatePath(Shape s) voiddispose()Dispose the current context and all its resources.voidDrawsusing the current graphics context state.voidDraw imageimageat coordinatesx,y.voiddrawString(String s, float x, float y) Draw a plain text string in the graphics.voidFillsusing the current graphics context state.The current background color.getClip()The current clip.org.eclipse.swt.graphics.DevicegetFont()The current foregroumd color.org.eclipse.swt.graphics.GCgetGc()The associatedIGraphicsEnvironmentThe currentRenderingHintsThe transformatiom currentlz active.protected float[]voidvoidrotate(float theta) Rotate the currently active transformation bytheta.voidscale(float x, float y) Scale the currently active transformation byx,yvoidsetBackgroundColor(Color color) Assign a new background color.voidsetBackgroundColor(org.eclipse.swt.graphics.Color resource) voidsetBackgroundPaint(IPaint paint) Assign a new backgroundIPaint.voidsetBackgroundPattern(org.eclipse.swt.graphics.Pattern resource) voidsetBlendMode(BlendMode blendMode) voidAssign the newshapeas the clipping shape.voidSet the current font for writing plain text in the graphics.voidsetForegroundColor(Color color) Assign a new foreground color.voidsetForegroundColor(org.eclipse.swt.graphics.Color resource) voidsetForegroundPaint(IPaint paint) Assign a new foregroundIPaintvoidsetForegroundPattern(org.eclipse.swt.graphics.Pattern resource) voidsetRenderingHint(RenderingHints.Key hintKey, Object hintValue) Set a specific rendering hint.voidsetRenderingHints(Map hints) Assign the currently active rendering hints.voidAssign the currently activeStrokevoidsetTransform(AffineTransform pTransform) Set the currently activeAffineTransformtextExtent(String s) static org.eclipse.swt.graphics.PathtoPath(org.eclipse.swt.graphics.Device device, PathIterator pathIterator) static Rectangle2DtoRectangle2D(org.eclipse.swt.graphics.Rectangle rect) static org.eclipse.swt.graphics.TransformtoTransform(org.eclipse.swt.graphics.Device device, AffineTransform at) This methods intentionally duplicated to avoid compile time dependency..static org.eclipse.swt.graphics.TransformtoTransform(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.Transform st, AffineTransform at) This methods intentionally duplicated to avoid compile time dependency..voidtransform(AffineTransform deltaTransform) Transform theIGraphicsEnvironmentbytransformvoidtranslate(float x, float y) translate the currently active transformation byx,y
-
Constructor Details
-
CwtSwtGraphicsContext
public CwtSwtGraphicsContext(org.eclipse.swt.graphics.GC paramGC, org.eclipse.swt.graphics.Device paramDevice)
-
-
Method Details
-
toPath
public static org.eclipse.swt.graphics.Path toPath(org.eclipse.swt.graphics.Device device, PathIterator pathIterator) -
toRectangle2D
-
toTransform
public static org.eclipse.swt.graphics.Transform toTransform(org.eclipse.swt.graphics.Device device, AffineTransform at) This methods intentionally duplicated to avoid compile time dependency.. -
toTransform
public static org.eclipse.swt.graphics.Transform toTransform(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.Transform st, AffineTransform at) This methods intentionally duplicated to avoid compile time dependency.. -
applyAlphaBackground
protected void applyAlphaBackground() -
applyAlphaForeground
protected void applyAlphaForeground() -
applyClip
protected void applyClip() -
applyTransform
protected void applyTransform() -
clip
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- Parameters:
shape-
-
createPath
-
dispose
public void dispose()Description copied from interface:IGraphicsContextDispose the current context and all its resources.- Specified by:
disposein interfaceIGraphicsContext
-
draw
Description copied from interface:IGraphicsContextDrawsusing the current graphics context state.- Specified by:
drawin interfaceIGraphicsContext- Parameters:
s-
-
drawImage
Description copied from interface:IGraphicsContextDraw imageimageat coordinatesx,y.- Specified by:
drawImagein interfaceIGraphicsContext- Parameters:
image-x-y-
-
drawString
Description copied from interface:IGraphicsContextDraw a plain text string in the graphics.- Specified by:
drawStringin interfaceIGraphicsContext- Parameters:
s-x-y-
-
fill
Description copied from interface:IGraphicsContextFillsusing the current graphics context state.- Specified by:
fillin interfaceIGraphicsContext- Parameters:
s-
-
getBackgroundColor
Description copied from interface:IGraphicsContextThe current background color.- Specified by:
getBackgroundColorin interfaceIGraphicsContext- Returns:
-
getBlendMode
-
getClip
Description copied from interface:IGraphicsContextThe current clip.- Specified by:
getClipin interfaceIGraphicsContext- Returns:
-
getDevice
public org.eclipse.swt.graphics.Device getDevice() -
getFont
-
getFontRenderContext
-
getForegroundColor
Description copied from interface:IGraphicsContextThe current foregroumd color.- Specified by:
getForegroundColorin interfaceIGraphicsContext- Returns:
-
getGc
public org.eclipse.swt.graphics.GC getGc() -
getGraphicsEnvironment
Description copied from interface:IGraphicsContextThe associatedIGraphicsEnvironment- Specified by:
getGraphicsEnvironmentin interfaceIGraphicsContext- Returns:
-
getRenderingHints
Description copied from interface:IGraphicsContextThe currentRenderingHints- Specified by:
getRenderingHintsin interfaceIGraphicsContext- Returns:
-
getTransform
Description copied from interface:IGraphicsContextThe transformatiom currentlz active.- Specified by:
getTransformin interfaceIGraphicsContext- Returns:
-
getTransformationValues
-
resetAdvanced
public void resetAdvanced() -
rotate
public void rotate(float theta) Description copied from interface:IGraphicsContextRotate the currently active transformation bytheta.- Specified by:
rotatein interfaceIGraphicsContext- Parameters:
theta-
-
scale
public void scale(float x, float y) Description copied from interface:IGraphicsContextScale the currently active transformation byx,y- Specified by:
scalein interfaceIGraphicsContext
-
setBackgroundColor
Description copied from interface:IGraphicsContextAssign a new background color.- Specified by:
setBackgroundColorin interfaceIGraphicsContext- Parameters:
color-
-
setBackgroundColor
public void setBackgroundColor(org.eclipse.swt.graphics.Color resource) -
setBackgroundPaint
Description copied from interface:IGraphicsContextAssign a new backgroundIPaint.- Specified by:
setBackgroundPaintin interfaceIGraphicsContext- Parameters:
paint-
-
setBackgroundPattern
public void setBackgroundPattern(org.eclipse.swt.graphics.Pattern resource) -
setBlendMode
-
setClip
Description copied from interface:IGraphicsContextAssign the newshapeas the clipping shape.- Specified by:
setClipin interfaceIGraphicsContext- Parameters:
shape-
-
setFont
Description copied from interface:IGraphicsContextSet the current font for writing plain text in the graphics.- Specified by:
setFontin interfaceIGraphicsContext- Parameters:
awtFont-
-
setForegroundColor
Description copied from interface:IGraphicsContextAssign a new foreground color.- Specified by:
setForegroundColorin interfaceIGraphicsContext- Parameters:
color-
-
setForegroundColor
public void setForegroundColor(org.eclipse.swt.graphics.Color resource) -
setForegroundPaint
Description copied from interface:IGraphicsContextAssign a new foregroundIPaint- Specified by:
setForegroundPaintin interfaceIGraphicsContext- Parameters:
paint-
-
setForegroundPattern
public void setForegroundPattern(org.eclipse.swt.graphics.Pattern resource) -
setRenderingHint
Description copied from interface:IGraphicsContextSet a specific rendering hint.- Specified by:
setRenderingHintin interfaceIGraphicsContext- Parameters:
hintKey-hintValue-
-
setRenderingHints
Description copied from interface:IGraphicsContextAssign the currently active rendering hints.- Specified by:
setRenderingHintsin interfaceIGraphicsContext- Parameters:
hints-
-
setStroke
Description copied from interface:IGraphicsContextAssign the currently activeStroke- Specified by:
setStrokein interfaceIGraphicsContext- Parameters:
s-
-
setTransform
Description copied from interface:IGraphicsContextSet the currently activeAffineTransform- Specified by:
setTransformin interfaceIGraphicsContext- Parameters:
pTransform-
-
textExtent
-
transform
Description copied from interface:IGraphicsContextTransform theIGraphicsEnvironmentbytransform- Specified by:
transformin interfaceIGraphicsContext- Parameters:
deltaTransform-
-
translate
public void translate(float x, float y) Description copied from interface:IGraphicsContexttranslate the currently active transformation byx,y- Specified by:
translatein interfaceIGraphicsContext
-