Top Description Fields Constructors Methods
org.eclipse.swt.graphics

public final Class GC

extends Resource
Class Inheritance
Imports
java.util.*, org.eclipse.swt.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.cairo.*, org.eclipse.swt.internal.gtk.*

Class GC is where all of the drawing capabilities that are supported by SWT are located. Instances are used to draw on either an Image, a Control, or directly on a Display.
Styles:
LEFT_TO_RIGHT, RIGHT_TO_LEFT

The SWT drawing coordinate system is the two-dimensional space with the origin (0,0) at the top left corner of the drawing area and with (x,y) values increasing to the right and downward respectively.

The result of drawing on an image that was created with an indexed palette using a color that is not in the palette is platform specific. Some platforms will match to the nearest color while other will draw the color itself. This happens because the allocated image might use a direct palette on platforms that do not support indexed palette.

Application code must explicitly invoke the GC.dispose() method to release the operating system resources managed by each instance when those instances are no longer required. This is particularly important on Windows95 and Windows98 where the operating system has a limited number of device contexts available.

Note

Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified.

See Also
org.eclipse.swt.events.PaintEvent, GC snippets, SWT Examples: GraphicsExample, PaintExample, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
private double[]
cairoTransformationMatrix

The current Cairo matrix, which positions widgets in the shell.

private Rectangle
clipping

Original clipping set on this GC

private double[]
currentTransform

Tracks the last transformation with which setTransform(Transform) was called, so that we can answer clients of getTransform(Transform).

pack-priv GCData
pack-priv static final int
pack-priv static final int
pack-priv Drawable
pack-priv static final int
pack-priv static final int
pack-priv static final int
public long
handle

the handle to the OS device context (Warning: This field is platform dependent)

Important Note

This field is not part of the SWT public API.

pack-priv static final int
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final float[]
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
Inherited from org.eclipse.swt.graphics.Resource:
device

Constructor Summary

AccessConstructor and Description
pack-priv
GC()

public
GC(Drawable
the drawable to draw on
drawable
)

Constructs a new instance of this class which has been configured to draw on the specified drawable.

public
GC(Drawable
the drawable to draw on
drawable
,
int
the style of GC to construct
style
)

Constructs a new instance of this class which has been configured to draw on the specified drawable.

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
addCairoString(long cairo, String string, float x, float y, Font font)

pack-priv void
cairoClipRegion(long
the cairo context to apply the region to
cairo
)

Convenience method that applies a region to the Control using cairo_clip.

pack-priv void
checkGC(int mask)

pack-priv int

Returns:

If only one style is specified, it is return unmodified. If both styles are specified, returns LEFT_TO_RIGHT
checkStyle
(int
the SWT style bit string
style
)

Ensure that the style specified is either LEFT_TO_RIGHT or RIGHT_TO_LEFT.

pack-priv void
pack-priv long
convertRgn(long rgn, double[] matrix)

public void
copyArea(Image
the image to copy into
image
,
int
the x coordinate in the receiver of the area to be copied
x
,
int
the y coordinate in the receiver of the area to be copied
y
)

Copies a rectangular area of the receiver at the specified position into the image, which must be of type SWT.BITMAP.

public void
copyArea(int
the x coordinate in the receiver of the area to be copied
srcX
,
int
the y coordinate in the receiver of the area to be copied
srcY
,
int
the width of the area to copy
width
,
int
the height of the area to copy
height
,
int
the x coordinate in the receiver of the area to copy to
destX
,
int
the y coordinate in the receiver of the area to copy to
destY
)

Copies a rectangular area of the receiver at the source position onto the receiver at the destination position.

public void
copyArea(int
the x coordinate in the receiver of the area to be copied
srcX
,
int
the y coordinate in the receiver of the area to be copied
srcY
,
int
the width of the area to copy
width
,
int
the height of the area to copy
height
,
int
the x coordinate in the receiver of the area to copy to
destX
,
int
the y coordinate in the receiver of the area to copy to
destY
,
boolean
if true paint events will be generated for old and obscured areas
paint
)

Copies a rectangular area of the receiver at the source position onto the receiver at the destination position.

pack-priv void
copyAreaInPixels(Image image, int x, int y)

pack-priv void
copyAreaInPixels(int srcX, int srcY, int width, int height, int destX, int destY)

pack-priv void
copyAreaInPixels(int srcX, int srcY, int width, int height, int destX, int destY, boolean paint)

pack-priv void
pack-priv void
pack-priv void
public void
drawArc(int
the x coordinate of the upper-left corner of the arc to be drawn
x
,
int
the y coordinate of the upper-left corner of the arc to be drawn
y
,
int
the width of the arc to be drawn
width
,
int
the height of the arc to be drawn
height
,
int
the beginning angle
startAngle
,
int
the angular extent of the arc, relative to the start angle
arcAngle
)

Draws the outline of a circular or elliptical arc within the specified rectangular area.

pack-priv void
drawArcInPixels(int x, int y, int width, int height, int startAngle, int arcAngle)

public void
drawFocus(int
the x coordinate of the rectangle
x
,
int
the y coordinate of the rectangle
y
,
int
the width of the rectangle
width
,
int
the height of the rectangle
height
)

Draws a rectangle, based on the specified arguments, which has the appearance of the platform's focus rectangle if the platform supports such a notion, and otherwise draws a simple rectangle in the receiver's foreground color.

pack-priv void
drawFocusInPixels(int x, int y, int width, int height)

public void
drawImage(Image
the image to draw
image
,
int
the x coordinate of where to draw
x
,
int
the y coordinate of where to draw
y
)

Draws the given image in the receiver at the specified coordinates.

public void
drawImage(Image
the source image
image
,
int
the x coordinate in the source image to copy from
srcX
,
int
the y coordinate in the source image to copy from
srcY
,
int
the width in points to copy from the source
srcWidth
,
int
the height in points to copy from the source
srcHeight
,
int
the x coordinate in the destination to copy to
destX
,
int
the y coordinate in the destination to copy to
destY
,
int
the width in points of the destination rectangle
destWidth
,
int
the height in points of the destination rectangle
destHeight
)

Copies a rectangular area from the source image into a (potentially different sized) rectangular area in the receiver.

pack-priv void
drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple)

pack-priv void
drawImageInPixels(Image image, int x, int y)

public void
drawLine(int
the first point's x coordinate
x1
,
int
the first point's y coordinate
y1
,
int
the second point's x coordinate
x2
,
int
the second point's y coordinate
y2
)

Draws a line, using the foreground color, between the points (x1, y1) and (x2, y2).

pack-priv void
drawLineInPixels(int x1, int y1, int x2, int y2)

public void
drawOval(int
the x coordinate of the upper left corner of the oval to be drawn
x
,
int
the y coordinate of the upper left corner of the oval to be drawn
y
,
int
the width of the oval to be drawn
width
,
int
the height of the oval to be drawn
height
)

Draws the outline of an oval, using the foreground color, within the specified rectangular area.

pack-priv void
drawOvalInPixels(int x, int y, int width, int height)

public void
drawPath(Path
the path to draw
path
)

Draws the path described by the parameter.

public void
drawPoint(int
the point's x coordinate
x
,
int
the point's y coordinate
y
)

Draws an SWT logical point, using the foreground color, at the specified point (x, y).

pack-priv void
drawPointInPixels(int x, int y)

public void
drawPolygon(int[]
an array of alternating x and y values which are the vertices of the polygon
pointArray
)

Draws the closed polygon which is defined by the specified array of integer coordinates, using the receiver's foreground color.

pack-priv void
drawPolygonInPixels(int[] pointArray)

public void
drawPolyline(int[]
an array of alternating x and y values which are the corners of the polyline
pointArray
)

Draws the polyline which is defined by the specified array of integer coordinates, using the receiver's foreground color.

pack-priv void
drawPolyline(long cairo, int[] pointArray, boolean close)

pack-priv void
drawPolylineInPixels(int[] pointArray)

public void
drawRectangle(int
the x coordinate of the rectangle to be drawn
x
,
int
the y coordinate of the rectangle to be drawn
y
,
int
the width of the rectangle to be drawn
width
,
int
the height of the rectangle to be drawn
height
)

Draws the outline of the rectangle specified by the arguments, using the receiver's foreground color.

public void
drawRectangle(Rectangle
the rectangle to draw
rect
)

Draws the outline of the specified rectangle, using the receiver's foreground color.

pack-priv void
drawRectangleInPixels(int x, int y, int width, int height)

pack-priv void
public void
drawRoundRectangle(int
the x coordinate of the rectangle to be drawn
x
,
int
the y coordinate of the rectangle to be drawn
y
,
int
the width of the rectangle to be drawn
width
,
int
the height of the rectangle to be drawn
height
,
int
the width of the arc
arcWidth
,
int
the height of the arc
arcHeight
)

Draws the outline of the round-cornered rectangle specified by the arguments, using the receiver's foreground color.

pack-priv void
drawRoundRectangleInPixels(int x, int y, int width, int height, int arcWidth, int arcHeight)

public void
drawString(String
the string to be drawn
string
,
int
the x coordinate of the top left corner of the rectangular area where the string is to be drawn
x
,
int
the y coordinate of the top left corner of the rectangular area where the string is to be drawn
y
)

Draws the given string, using the receiver's current font and foreground color.

public void
drawString(String
the string to be drawn
string
,
int
the x coordinate of the top left corner of the rectangular area where the string is to be drawn
x
,
int
the y coordinate of the top left corner of the rectangular area where the string is to be drawn
y
,
boolean
if true the background will be transparent, otherwise it will be opaque
isTransparent
)

Draws the given string, using the receiver's current font and foreground color.

pack-priv void
drawStringInPixels(String string, int x, int y)

pack-priv void
drawStringInPixels(String string, int x, int y, boolean isTransparent)

public void
drawText(String
the string to be drawn
string
,
int
the x coordinate of the top left corner of the rectangular area where the text is to be drawn
x
,
int
the y coordinate of the top left corner of the rectangular area where the text is to be drawn
y
)

Draws the given string, using the receiver's current font and foreground color.

public void
drawText(String
the string to be drawn
string
,
int
the x coordinate of the top left corner of the rectangular area where the text is to be drawn
x
,
int
the y coordinate of the top left corner of the rectangular area where the text is to be drawn
y
,
boolean
if true the background will be transparent, otherwise it will be opaque
isTransparent
)

Draws the given string, using the receiver's current font and foreground color.

public void
drawText(String
the string to be drawn
string
,
int
the x coordinate of the top left corner of the rectangular area where the text is to be drawn
x
,
int
the y coordinate of the top left corner of the rectangular area where the text is to be drawn
y
,
int
the flags specifying how to process the text
flags
)

Draws the given string, using the receiver's current font and foreground color.

pack-priv void
drawTextInPixels(String string, int x, int y)

pack-priv void
drawTextInPixels(String string, int x, int y, boolean isTransparent)

pack-priv void
drawTextInPixels(String string, int x, int y, int flags)

public boolean

Returns:

true if the object is the same as this object and false otherwise
equals
(Object
the object to compare with this object
object
)

Overrides java.lang.Object.equals.

Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
public void
fillArc(int
the x coordinate of the upper-left corner of the arc to be filled
x
,
int
the y coordinate of the upper-left corner of the arc to be filled
y
,
int
the width of the arc to be filled
width
,
int
the height of the arc to be filled
height
,
int
the beginning angle
startAngle
,
int
the angular extent of the arc, relative to the start angle
arcAngle
)

Fills the interior of a circular or elliptical arc within the specified rectangular area, with the receiver's background color.

pack-priv void
fillArcInPixels(int x, int y, int width, int height, int startAngle, int arcAngle)

public void
fillGradientRectangle(int
the x coordinate of the rectangle to be filled
x
,
int
the y coordinate of the rectangle to be filled
y
,
int
the width of the rectangle to be filled, may be negative (inverts direction of gradient if horizontal)
width
,
int
the height of the rectangle to be filled, may be negative (inverts direction of gradient if vertical)
height
,
boolean
if true sweeps from top to bottom, else sweeps from left to right
vertical
)

Fills the interior of the specified rectangle with a gradient sweeping from left to right or top to bottom progressing from the receiver's foreground color to its background color.

pack-priv void
fillGradientRectangleInPixels(int x, int y, int width, int height, boolean vertical)

public void
fillOval(int
the x coordinate of the upper left corner of the oval to be filled
x
,
int
the y coordinate of the upper left corner of the oval to be filled
y
,
int
the width of the oval to be filled
width
,
int
the height of the oval to be filled
height
)

Fills the interior of an oval, within the specified rectangular area, with the receiver's background color.

pack-priv void
fillOvalInPixels(int x, int y, int width, int height)

public void
fillPath(Path
the path to fill
path
)

Fills the path described by the parameter.

public void
fillPolygon(int[]
an array of alternating x and y values which are the vertices of the polygon
pointArray
)

Fills the interior of the closed polygon which is defined by the specified array of integer coordinates, using the receiver's background color.

pack-priv void
fillPolygonInPixels(int[] pointArray)

public void
fillRectangle(int
the x coordinate of the rectangle to be filled
x
,
int
the y coordinate of the rectangle to be filled
y
,
int
the width of the rectangle to be filled
width
,
int
the height of the rectangle to be filled
height
)

Fills the interior of the rectangle specified by the arguments, using the receiver's background color.

public void
fillRectangle(Rectangle
the rectangle to be filled
rect
)

Fills the interior of the specified rectangle, using the receiver's background color.

pack-priv void
fillRectangleInPixels(int x, int y, int width, int height)

pack-priv void
public void
fillRoundRectangle(int
the x coordinate of the rectangle to be filled
x
,
int
the y coordinate of the rectangle to be filled
y
,
int
the width of the rectangle to be filled
width
,
int
the height of the rectangle to be filled
height
,
int
the width of the arc
arcWidth
,
int
the height of the arc
arcHeight
)

Fills the interior of the round-cornered rectangle specified by the arguments, using the receiver's background color.

pack-priv void
fillRoundRectangleInPixels(int x, int y, int width, int height, int arcWidth, int arcHeight)

pack-priv int
fixMnemonic(char[] buffer)

public boolean

Returns:

the advanced value
getAdvanced
()

Returns true if receiver is using the operating system's advanced graphics subsystem.

public int

Returns:

the distance in the x direction to move past the character before painting the next
getAdvanceWidth
(char
the character to measure
ch
)

Returns the advance width of the specified character in the font which is currently selected into the receiver.

public int

Returns:

the alpha value
getAlpha
()

Returns the receiver's alpha value.

public int

Returns:

the anti-aliasing setting
getAntialias
()

Returns the receiver's anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON.

public Color

Returns:

the receiver's background color
getBackground
()

Returns the background color.

public Pattern

Returns:

the receiver's background pattern
getBackgroundPattern
()

Returns the background pattern.

public int

Returns:

the width of the character
getCharWidth
(char
the character to measure
ch
)

Returns the width of the specified character in the font selected into the receiver.

public Rectangle

Returns:

the bounding rectangle of the clipping region
getClipping
()

Returns the bounding rectangle of the receiver's clipping region.

public void
getClipping(Region
the region to fill with the clipping region
region
)

Sets the region managed by the argument to the current clipping region of the receiver.

pack-priv Rectangle
public int

Returns:

the receiver's fill rule
getFillRule
()

Returns the receiver's fill rule, which will be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.

public Font

Returns:

the receiver's font
getFont
()

Returns the font currently being used by the receiver to draw and measure text.

public FontMetrics

Returns:

font metrics for the receiver's font
getFontMetrics
()

Returns a FontMetrics which contains information about the font currently being used by the receiver to draw and measure text.

public Color

Returns:

the color used for drawing foreground things
getForeground
()

Returns the receiver's foreground color.

public Pattern

Returns:

the receiver's foreground pattern
getForegroundPattern
()

Returns the foreground pattern.

public GCData

Returns:

the receiver's GCData
getGCData
()

Returns the GCData.

public int

Returns:

the receiver's interpolation setting
getInterpolation
()

Returns the receiver's interpolation setting, which will be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.

public LineAttributes

Returns:

the line attributes used for drawing lines
getLineAttributes
()

Returns the receiver's line attributes.

pack-priv LineAttributes
public int

Returns:

the cap style used for drawing lines
getLineCap
()

Returns the receiver's line cap style, which will be one of the constants SWT.CAP_FLAT, SWT.CAP_ROUND, or SWT.CAP_SQUARE.

public int[]

Returns:

the line dash style used for drawing lines
getLineDash
()

Returns the receiver's line dash style.

public int

Returns:

the join style used for drawing lines
getLineJoin
()

Returns the receiver's line join style, which will be one of the constants SWT.JOIN_MITER, SWT.JOIN_ROUND, or SWT.JOIN_BEVEL.

public int

Returns:

the style used for drawing lines
getLineStyle
()

Returns the receiver's line style, which will be one of the constants SWT.LINE_SOLID, SWT.LINE_DASH, SWT.LINE_DOT, SWT.LINE_DASHDOT or SWT.LINE_DASHDOTDOT.

public int

Returns:

the receiver's line width
getLineWidth
()

Returns the width that will be used when drawing lines for all of the figure drawing operations (that is, drawLine, drawRectangle, drawPolyline, and so forth.

pack-priv int
pack-priv void
getSize(int[] width, int[] height)

public int

Returns:

the style bits
getStyle
()

Returns the receiver's style information.

public int

Returns:

the anti-aliasing setting
getTextAntialias
()

Returns the receiver's text drawing anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON.

public void
getTransform(Transform
the destination to copy the transform into
transform
)

Sets the parameter to the transform that is currently being used by the receiver.

private static Rectangle
public boolean

Returns:

true true if the receiver is in XOR mode, and false otherwise
getXORMode
()

Returns true if this GC is drawing in the mode where the resulting color in the destination is the exclusive or of the color values in the source and the destination, and false if it is drawing in the mode where the destination color is being replaced with the source color value.

public static GC

Returns:

a new GC
gtk_new
(long
the handle to the OS device context
handle
,
GCData
the data for the receiver.
data
)

Invokes platform specific functionality to wrap a graphics context.

public static GC

Returns:

a new GC
gtk_new
(Drawable
the Drawable for the receiver.
drawable
,
GCData
the data for the receiver.
data
)

Invokes platform specific functionality to allocate a new graphics context.

public int

Returns:

the receiver's hash
hashCode
()

Overrides java.lang.Object.hashCode.

Returns an integer hash code for the receiver.
private static boolean
hasNoRotation(double[] matrix)

pack-priv double[]
pack-priv void
init(Drawable drawable, GCData data, long gdkGC)

pack-priv void
public boolean

Returns:

true if the GC has a clipping region, and false otherwise
isClipped
()

Returns true if the receiver has a clipping region set into it, and false otherwise.

public boolean

Returns:

true when the GC is disposed and false otherwise
isDisposed
()

Implements abstract org.eclipse.swt.graphics.Resource.isDisposed.

Returns true if the GC has been disposed, and false otherwise.
pack-priv boolean
isIdentity(double[] matrix)

private void
limitClipping(long gcClipping)

Intersects given clipping with original clipping of this context, so that resulting clip does not allow to paint outside of the GC bounds.

private void
public void
setAdvanced(boolean
the new advanced graphics state
advanced
)

Sets the receiver to always use the operating system's advanced graphics subsystem for all graphics operations if the argument is true.

public void
setAlpha(int
the alpha value
alpha
)

Sets the receiver's alpha value which must be between 0 (transparent) and 255 (opaque).

public void
setAntialias(int
the anti-aliasing setting
antialias
)

Sets the receiver's anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON.

public void
setBackground(Color
the new background color for the receiver
color
)

Sets the background color.

public void
setBackgroundPattern(Pattern
the new background pattern
pattern
)

Sets the background pattern.

pack-priv void
setCairoClip(long damageRgn, long clipRgn)

pack-priv static void
setCairoFont(long cairo, Font font)

pack-priv static void
setCairoFont(long cairo, long font)

pack-priv static void
setCairoPatternColor(long pattern, int offset, Color c, int alpha)

pack-priv static void
setCairoRegion(long cairo, long rgn)

pack-priv void
setClipping(long clipRgn)

public void
setClipping(int
the x coordinate of the clipping rectangle
x
,
int
the y coordinate of the clipping rectangle
y
,
int
the width of the clipping rectangle
width
,
int
the height of the clipping rectangle
height
)

Sets the area of the receiver which can be changed by drawing operations to the rectangular area specified by the arguments.

public void
setClipping(Path
the clipping path.
path
)

Sets the area of the receiver which can be changed by drawing operations to the path specified by the argument.

public void
setClipping(Rectangle
the clipping rectangle or null
rect
)

Sets the area of the receiver which can be changed by drawing operations to the rectangular area specified by the argument.

public void
setClipping(Region
the clipping region or null
region
)

Sets the area of the receiver which can be changed by drawing operations to the region specified by the argument.

pack-priv void
setClippingInPixels(int x, int y, int width, int height)

pack-priv void
public void
setFillRule(int
the new fill rule
rule
)

Sets the receiver's fill rule to the parameter, which must be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.

public void
setFont(Font
the new font for the receiver, or null to indicate a default font
font
)

Sets the font which will be used by the receiver to draw and measure text to the argument.

public void
setForeground(Color
the new foreground color for the receiver
color
)

Sets the foreground color.

public void
setForegroundPattern(Pattern
the new foreground pattern
pattern
)

Sets the foreground pattern.

public void
setInterpolation(int
the new interpolation setting
interpolation
)

Sets the receiver's interpolation setting to the parameter, which must be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.

public void
setLineAttributes(LineAttributes
the line attributes
attributes
)

Sets the receiver's line attributes.

pack-priv void
public void
setLineCap(int
the cap style to be used for drawing lines
cap
)

Sets the receiver's line cap style to the argument, which must be one of the constants SWT.CAP_FLAT, SWT.CAP_ROUND, or SWT.CAP_SQUARE.

public void
setLineDash(int[]
the dash style to be used for drawing lines
dashes
)

Sets the receiver's line dash style to the argument.

public void
setLineJoin(int
the join style to be used for drawing lines
join
)

Sets the receiver's line join style to the argument, which must be one of the constants SWT.JOIN_MITER, SWT.JOIN_ROUND, or SWT.JOIN_BEVEL.

public void
setLineStyle(int
the style to be used for drawing lines
lineStyle
)

Sets the receiver's line style to the argument, which must be one of the constants SWT.LINE_SOLID, SWT.LINE_DASH, SWT.LINE_DOT, SWT.LINE_DASHDOT or SWT.LINE_DASHDOTDOT.

public void
setLineWidth(int
the width of a line
lineWidth
)

Sets the width that will be used when drawing lines for all of the figure drawing operations (that is, drawLine, drawRectangle, drawPolyline, and so forth.

pack-priv void
setLineWidthInPixels(int lineWidth)

pack-priv void
setString(String string, int flags)

public void
setTextAntialias(int
the anti-aliasing setting
antialias
)

Sets the receiver's text anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON.

public void
setTransform(Transform
the transform to set
transform
)

Sets the transform that is currently being used by the receiver.

public void
setXORMode(boolean
if true, then xor mode is used, otherwise source copy mode is used
xor
)

If the argument is true, puts the receiver in a drawing mode where the resulting color in the destination is the exclusive or of the color values in the source and the destination, and if the argument is false, puts the receiver in a drawing mode where the destination color is replaced with the source color value.

public Point

Returns:

a point containing the extent of the string
stringExtent
(String
the string to measure
string
)

Returns the extent of the given string.

pack-priv Point
public Point

Returns:

a point containing the extent of the string
textExtent
(String
the string to measure
string
)

Returns the extent of the given string.

public Point

Returns:

a point containing the extent of the string
textExtent
(String
the string to measure
string
,
int
the flags specifying how to process the text
flags
)

Returns the extent of the given string.

pack-priv Point
pack-priv Point
textExtentInPixels(String string, int flags)

public String

Returns:

a string representation of the receiver
toString
()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.
private static int[]

Returns:

transformed x,y coordinates.
transformPoints
(double[] transformation, Point[] points)

Transforms x,y coordinate pairs with given matrix

private static int[]

Returns:

transformed rectangle corner coordinates, with x,y order of points.
transformRectangle
(double[] affineTransformation, Rectangle rectangle)

Transforms rectangle with given matrix

Inherited from org.eclipse.swt.graphics.Resource:
disposegetDeviceignoreNonDisposedinitinitNonDisposeTrackingsetNonDisposeHandler