GC

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

<p> 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. </p>

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

<p> Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified. </p>

@see org.eclipse.swt.events.PaintEvent @see <a href="http://www.eclipse.org/swt/snippets/#gc">GC snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: GraphicsExample, PaintExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

final
class GC : Resource {
Drawable drawable;
GCData data;
int FOREGROUND;
int BACKGROUND;
int FONT;
int LINE_STYLE;
int LINE_CAP;
int LINE_JOIN;
int LINE_WIDTH;
int LINE_MITERLIMIT;
int BACKGROUND_BG;
int DRAW_OFFSET;
int DRAW;
int FILL;
float[] LINE_DOT;
float[] LINE_DASH;
float[] LINE_DASHDOT;
float[] LINE_DASHDOTDOT;
float[] LINE_DOT_ZERO;
float[] LINE_DASH_ZERO;
float[] LINE_DASHDOT_ZERO;
float[] LINE_DASHDOTDOT_ZERO;
}

Constructors

this
this(Drawable drawable)

Constructs a new instance of this class which has been configured to draw on the specified drawable. Sets the foreground color, background color and font in the GC to match those in the drawable. <p> You must dispose the graphics context when it is no longer required. </p> @param drawable the drawable to draw on @exception IllegalArgumentException <ul> <li>ERROR_NULL_ARGUMENT - if the drawable is null</li> <li>ERROR_NULL_ARGUMENT - if there is no current device</li> <li>ERROR_INVALID_ARGUMENT - if the drawable is an image that is not a bitmap or an icon - if the drawable is an image or printer that is already selected into another graphics context</li> </ul> @exception SWTError <ul> <li>ERROR_NO_HANDLES if a handle could not be obtained for GC creation</li> <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li> </ul>

this
this(Drawable drawable, int style)

Constructs a new instance of this class which has been configured to draw on the specified drawable. Sets the foreground color, background color and font in the GC to match those in the drawable. <p> You must dispose the graphics context when it is no longer required. </p>

Members

Functions

copyArea
void copyArea(Image image, int x, int y)

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

copyArea
void copyArea(int srcX, int srcY, int width, int height, int destX, int destY)

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

copyArea
void copyArea(int srcX, int srcY, int width, int height, int destX, int destY, bool paint)

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

drawArc
void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)

Draws the outline of a circular or elliptical arc within the specified rectangular area. <p> The resulting arc begins at <code>startAngle</code> and extends for <code>arcAngle</code> degrees, using the current color. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation. </p><p> The center of the arc is the center of the rectangle whose origin is (<code>x</code>, <code>y</code>) and whose size is specified by the <code>width</code> and <code>height</code> arguments. </p><p> The resulting arc covers an area <code>width + 1</code> pixels wide by <code>height + 1</code> pixels tall. </p>

drawFocus
void drawFocus(int x, int y, int width, int height)

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

drawImage
void drawImage(Image image, int x, int y)

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

drawImage
void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)

Copies a rectangular area from the source image into a (potentially different sized) rectangular area in the receiver. If the source and destination areas are of differing sizes, then the source area will be stretched or shrunk to fit the destination area as it is copied. The copy fails if any part of the source rectangle lies outside the bounds of the source image, or if any of the width or height arguments are negative.

drawLine
void drawLine(int x1, int y1, int x2, int y2)

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

drawOval
void drawOval(int x, int y, int width, int height)

Draws the outline of an oval, using the foreground color, within the specified rectangular area. <p> The result is a circle or ellipse that fits within the rectangle specified by the <code>x</code>, <code>y</code>, <code>width</code>, and <code>height</code> arguments. </p><p> The oval covers an area that is <code>width + 1</code> pixels wide and <code>height + 1</code> pixels tall. </p>

drawPath
void drawPath(Path path)

Draws the path described by the parameter. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

drawPoint
void drawPoint(int x, int y)

Draws a pixel, using the foreground color, at the specified point (<code>x</code>, <code>y</code>). <p> Note that the receiver's line attributes do not affect this operation. </p>

drawPolygon
void drawPolygon(int[] pointArray)

Draws the closed polygon which is defined by the specified array of integer coordinates, using the receiver's foreground color. The array contains alternating x and y values which are considered to represent points which are the vertices of the polygon. Lines are drawn between each consecutive pair, and between the first pair and last pair in the array.

drawPolyline
void drawPolyline(int[] pointArray)

Draws the polyline which is defined by the specified array of integer coordinates, using the receiver's foreground color. The array contains alternating x and y values which are considered to represent points which are the corners of the polyline. Lines are drawn between each consecutive pair, but not between the first pair and last pair in the array.

drawRectangle
void drawRectangle(int x, int y, int width, int height)

Draws the outline of the rectangle specified by the arguments, using the receiver's foreground color. The left and right edges of the rectangle are at <code>x</code> and <code>x + width</code>. The top and bottom edges are at <code>y</code> and <code>y + height</code>.

drawRectangle
void drawRectangle(Rectangle rect)

Draws the outline of the specified rectangle, using the receiver's foreground color. The left and right edges of the rectangle are at <code>rect.x</code> and <code>rect.x + rect.width</code>. The top and bottom edges are at <code>rect.y</code> and <code>rect.y + rect.height</code>.

drawRoundRectangle
void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight)

Draws the outline of the round-cornered rectangle specified by the arguments, using the receiver's foreground color. The left and right edges of the rectangle are at <code>x</code> and <code>x + width</code>. The top and bottom edges are at <code>y</code> and <code>y + height</code>. The <em>roundness</em> of the corners is specified by the <code>arcWidth</code> and <code>arcHeight</code> arguments, which are respectively the width and height of the ellipse used to draw the corners.

drawString
void drawString(String str, int x, int y)

Draws the given str, using the receiver's current font and foreground color. No tab expansion or carriage return processing will be performed. The background of the rectangular area where the str is being drawn will be filled with the receiver's background color.

drawString
void drawString(String str, int x, int y, bool isTransparent)

Draws the given str, using the receiver's current font and foreground color. No tab expansion or carriage return processing will be performed. If <code>isTransparent</code> is <code>true</code>, then the background of the rectangular area where the str is being drawn will not be modified, otherwise it will be filled with the receiver's background color.

drawText
void drawText(String str, int x, int y)

Draws the given str, using the receiver's current font and foreground color. Tab expansion and carriage return processing are performed. The background of the rectangular area where the text is being drawn will be filled with the receiver's background color.

drawText
void drawText(String str, int x, int y, bool isTransparent)

Draws the given str, using the receiver's current font and foreground color. Tab expansion and carriage return processing are performed. If <code>isTransparent</code> is <code>true</code>, then the background of the rectangular area where the text is being drawn will not be modified, otherwise it will be filled with the receiver's background color.

drawText
void drawText(String str, int x, int y, int flags)

Draws the given str, using the receiver's current font and foreground color. Tab expansion, line delimiter and mnemonic processing are performed according to the specified flags. If <code>flags</code> includes <code>DRAW_TRANSPARENT</code>, then the background of the rectangular area where the text is being drawn will not be modified, otherwise it will be filled with the receiver's background color. <p> The parameter <code>flags</code> may be a combination of: <dl> <dt><b>DRAW_DELIMITER</b></dt> <dd>draw multiple lines</dd> <dt><b>DRAW_TAB</b></dt> <dd>expand tabs</dd> <dt><b>DRAW_MNEMONIC</b></dt> <dd>underline the mnemonic character</dd> <dt><b>DRAW_TRANSPARENT</b></dt> <dd>transparent background</dd> </dl> </p>

fillArc
void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)

Fills the interior of a circular or elliptical arc within the specified rectangular area, with the receiver's background color. <p> The resulting arc begins at <code>startAngle</code> and extends for <code>arcAngle</code> degrees, using the current color. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation. </p><p> The center of the arc is the center of the rectangle whose origin is (<code>x</code>, <code>y</code>) and whose size is specified by the <code>width</code> and <code>height</code> arguments. </p><p> The resulting arc covers an area <code>width + 1</code> pixels wide by <code>height + 1</code> pixels tall. </p>

fillGradientRectangle
void fillGradientRectangle(int x, int y, int width, int height, bool 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.

fillOval
void fillOval(int x, int y, int width, int height)

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

fillPath
void fillPath(Path path)

Fills the path described by the parameter. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

fillPolygon
void fillPolygon(int[] pointArray)

Fills the interior of the closed polygon which is defined by the specified array of integer coordinates, using the receiver's background color. The array contains alternating x and y values which are considered to represent points which are the vertices of the polygon. Lines are drawn between each consecutive pair, and between the first pair and last pair in the array.

fillRectangle
void fillRectangle(int x, int y, int width, int height)

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

fillRectangle
void fillRectangle(Rectangle rect)

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

fillRoundRectangle
void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight)

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

getAdvanceWidth
int getAdvanceWidth(char ch)

Returns the <em>advance width</em> of the specified character in the font which is currently selected into the receiver. <p> The advance width is defined as the horizontal distance the cursor should move after printing the character in the selected font. </p>

getAdvanced
bool getAdvanced()

Returns <code>true</code> if receiver is using the operating system's advanced graphics subsystem. Otherwise, <code>false</code> is returned to indicate that normal graphics are in use. <p> Advanced graphics may not be installed for the operating system. In this case, <code>false</code> is always returned. Some operating system have only one graphics subsystem. If this subsystem supports advanced graphics, then <code>true</code> is always returned. If any graphics operation such as alpha, antialias, patterns, interpolation, paths, clipping or transformation has caused the receiver to switch from regular to advanced graphics mode, <code>true</code> is returned. If the receiver has been explicitly switched to advanced mode and this mode is supported, <code>true</code> is returned. </p>

getAlpha
int getAlpha()

Returns the receiver's alpha value. The alpha value is between 0 (transparent) and 255 (opaque).

getAntialias
int getAntialias()

Returns the receiver's anti-aliasing setting value, which will be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or <code>SWT.ON</code>. Note that this controls anti-aliasing for all <em>non-text drawing</em> operations.

getBackground
Color getBackground()

Returns the background color.

getBackgroundPattern
Pattern getBackgroundPattern()

Returns the background pattern. The default value is <code>null</code>.

getCharWidth
int getCharWidth(char ch)

Returns the width of the specified character in the font selected into the receiver. <p> The width is defined as the space taken up by the actual character, not including the leading and tailing whitespace or overhang. </p>

getClipping
Rectangle getClipping()

Returns the bounding rectangle of the receiver's clipping region. If no clipping region is set, the return value will be a rectangle which covers the entire bounds of the object the receiver is drawing on.

getClipping
void getClipping(Region region)

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

getFillRule
int getFillRule()

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

getFont
Font getFont()

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

getFontMetrics
FontMetrics getFontMetrics()

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

getForeground
Color getForeground()

Returns the receiver's foreground color.

getForegroundPattern
Pattern getForegroundPattern()

Returns the foreground pattern. The default value is <code>null</code>.

getGCData
GCData getGCData()

Returns the GCData. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>GC</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

getInterpolation
int getInterpolation()

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

getLineAttributes
LineAttributes getLineAttributes()

Returns the receiver's line attributes.

getLineCap
int getLineCap()

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

getLineDash
int[] getLineDash()

Returns the receiver's line dash style. The default value is <code>null</code>.

getLineJoin
int getLineJoin()

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

getLineStyle
int getLineStyle()

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

getLineWidth
int getLineWidth()

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

getStyle
int getStyle()

Returns the receiver's style information. <p> Note that the value which is returned by this method <em>may not match</em> the value which was provided to the constructor when the receiver was created. This can occur when the underlying operating system does not support a particular combination of requested styles. </p>

getTextAntialias
int getTextAntialias()

Returns the receiver's text drawing anti-aliasing setting value, which will be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or <code>SWT.ON</code>. Note that this controls anti-aliasing <em>only</em> for text drawing operations.

getTransform
void getTransform(Transform transform)

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

getXORMode
bool getXORMode()

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

isClipped
bool isClipped()

Returns <code>true</code> if the receiver has a clipping region set into it, and <code>false</code> otherwise. If this method returns false, the receiver will draw on all available space in the destination. If it returns true, it will draw only in the area that is covered by the region that can be accessed with <code>getClipping(region)</code>.

isDisposed
bool isDisposed()

Returns <code>true</code> if the GC has been disposed, and <code>false</code> otherwise. <p> This method gets the dispose state for the GC. When a GC has been disposed, it is an error to invoke any other method using the GC.

opEquals
equals_t opEquals(Object object)

Compares the argument to the receiver, and returns true if they represent the <em>same</em> object using a class specific comparison.

setAdvanced
void setAdvanced(bool advanced)

Sets the receiver to always use the operating system's advanced graphics subsystem for all graphics operations if the argument is <code>true</code>. If the argument is <code>false</code>, the advanced graphics subsystem is no longer used, advanced graphics state is cleared and the normal graphics subsystem is used from now on. <p> Normally, the advanced graphics subsystem is invoked automatically when any one of the alpha, antialias, patterns, interpolation, paths, clipping or transformation operations in the receiver is requested. When the receiver is switched into advanced mode, the advanced graphics subsystem performs both advanced and normal graphics operations. Because the two subsystems are different, their output may differ. Switching to advanced graphics before any graphics operations are performed ensures that the output is consistent. </p><p> Advanced graphics may not be installed for the operating system. In this case, this operation does nothing. Some operating system have only one graphics subsystem, so switching from normal to advanced graphics does nothing. However, switching from advanced to normal graphics will always clear the advanced graphics state, even for operating systems that have only one graphics subsystem. </p>

setAlpha
void setAlpha(int alpha)

Sets the receiver's alpha value which must be between 0 (transparent) and 255 (opaque). <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p> @param alpha the alpha value

setAntialias
void setAntialias(int antialias)

Sets the receiver's anti-aliasing value to the parameter, which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or <code>SWT.ON</code>. Note that this controls anti-aliasing for all <em>non-text drawing</em> operations. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

setBackground
void setBackground(Color color)

Sets the background color. The background color is used for fill operations and as the background color when text is drawn.

setBackgroundPattern
void setBackgroundPattern(Pattern pattern)

Sets the background pattern. The default value is <code>null</code>. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

setClipping
void setClipping(int x, int y, int width, int height)

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

setClipping
void setClipping(Path path)

Sets the area of the receiver which can be changed by drawing operations to the path specified by the argument. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

setClipping
void setClipping(Rectangle rect)

Sets the area of the receiver which can be changed by drawing operations to the rectangular area specified by the argument. Specifying <code>null</code> for the rectangle reverts the receiver's clipping area to its original value.

setClipping
void setClipping(Region region)

Sets the area of the receiver which can be changed by drawing operations to the region specified by the argument. Specifying <code>null</code> for the region reverts the receiver's clipping area to its original value.

setFillRule
void setFillRule(int rule)

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

setFont
void setFont(Font font)

Sets the font which will be used by the receiver to draw and measure text to the argument. If the argument is null, then a default font appropriate for the platform will be used instead.

setForeground
void setForeground(Color color)

Sets the foreground color. The foreground color is used for drawing operations including when text is drawn.

setForegroundPattern
void setForegroundPattern(Pattern pattern)

Sets the foreground pattern. The default value is <code>null</code>. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p> @param pattern the new foreground pattern

setInterpolation
void setInterpolation(int interpolation)

Sets the receiver's interpolation setting to the parameter, which must be one of <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>, <code>SWT.LOW</code> or <code>SWT.HIGH</code>. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

setLineAttributes
void setLineAttributes(LineAttributes attributes)

Sets the receiver's line attributes. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p> @param attributes the line attributes

setLineCap
void setLineCap(int cap)

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

setLineDash
void setLineDash(int[] dashes)

Sets the receiver's line dash style to the argument. The default value is <code>null</code>. If the argument is not <code>null</code>, the receiver's line style is set to <code>SWT.LINE_CUSTOM</code>, otherwise it is set to <code>SWT.LINE_SOLID</code>.

setLineJoin
void setLineJoin(int join)

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

setLineStyle
void setLineStyle(int lineStyle)

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

setLineWidth
void setLineWidth(int lineWidth)

Sets the width that will be used when drawing lines for all of the figure drawing operations (that is, <code>drawLine</code>, <code>drawRectangle</code>, <code>drawPolyline</code>, and so forth. <p> Note that line width of zero is used as a hint to indicate that the fastest possible line drawing algorithms should be used. This means that the output may be different from line width one. </p>

setTextAntialias
void setTextAntialias(int antialias)

Sets the receiver's text anti-aliasing value to the parameter, which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or <code>SWT.ON</code>. Note that this controls anti-aliasing only for all <em>text drawing</em> operations. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

setTransform
void setTransform(Transform transform)

Sets the transform that is currently being used by the receiver. If the argument is <code>null</code>, the current transform is set to the identity transform. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

setXORMode
void setXORMode(bool xor)

If the argument is <code>true</code>, puts the receiver in a drawing mode where the resulting color in the destination is the <em>exclusive or</em> of the color values in the source and the destination, and if the argument is <code>false</code>, puts the receiver in a drawing mode where the destination color is replaced with the source color value. <p> Note that this mode in fundamentally unsupportable on certain platforms, notably Carbon (Mac OS X). Clients that want their code to run on all platforms need to avoid this method. </p>

stringExtent
Point stringExtent(String str)

Returns the extent of the given str. No tab expansion or carriage return processing will be performed. <p> The <em>extent</em> of a str is the width and height of the rectangular area it would cover if drawn in a particular font (in this case, the current font in the receiver). </p>

textExtent
Point textExtent(String str)

Returns the extent of the given str. Tab expansion and carriage return processing are performed. <p> The <em>extent</em> of a str is the width and height of the rectangular area it would cover if drawn in a particular font (in this case, the current font in the receiver). </p>

textExtent
Point textExtent(String str, int flags)

Returns the extent of the given str. Tab expansion, line delimiter and mnemonic processing are performed according to the specified flags, which can be a combination of: <dl> <dt><b>DRAW_DELIMITER</b></dt> <dd>draw multiple lines</dd> <dt><b>DRAW_TAB</b></dt> <dd>expand tabs</dd> <dt><b>DRAW_MNEMONIC</b></dt> <dd>underline the mnemonic character</dd> <dt><b>DRAW_TRANSPARENT</b></dt> <dd>transparent background</dd> </dl> <p> The <em>extent</em> of a str is the width and height of the rectangular area it would cover if drawn in a particular font (in this case, the current font in the receiver). </p>

toHash
hash_t toHash()

Returns an integer hash code for the receiver. Any two objects that return <code>true</code> when passed to <code>equals</code> must return the same value for this method.

toString
String toString()

Returns a str containing a concise, human-readable description of the receiver.

Variables

handle
GdkGC* handle;

the handle to the OS device context (Warning: This field is platform dependent) <p> <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code. </p>

Inherited Members

From Resource

device
Device device;

the device where this resource was created

dispose
void dispose()

Disposes of the operating system resources associated with this resource. Applications must dispose of all resources which they allocate.

getDevice
Device getDevice()

Returns the <code>Device</code> where this resource was created.

isDisposed
bool isDisposed()

Returns <code>true</code> if the resource has been disposed, and <code>false</code> otherwise. <p> This method gets the dispose state for the resource. When a resource has been disposed, it is an error to invoke any other method using the resource.

Meta