net.sourceforge.swtlayeredgraph.proxies
Class SwtGCImpl

java.lang.Object
  extended by net.sourceforge.swtlayeredgraph.proxies.SwtGCImpl
All Implemented Interfaces:
SwtGC

public class SwtGCImpl
extends java.lang.Object
implements SwtGC

This class is provided as a proxy implementation of a SWT GC class. This allows for ease of unit testing classes that use the GC.

Author:
davija

Field Summary
 
Fields inherited from interface net.sourceforge.swtlayeredgraph.proxies.SwtGC
BACKGROUND, BACKGROUND_BG, DRAW, DRAW_OFFSET, FILL, FONT, FOREGROUND, LINE_CAP, LINE_DASH, LINE_DASH_ZERO, LINE_DASHDOT, LINE_DASHDOT_ZERO, LINE_DASHDOTDOT, LINE_DASHDOTDOT_ZERO, LINE_DOT, LINE_DOT_ZERO, LINE_JOIN, LINE_MITERLIMIT, LINE_STYLE, LINE_WIDTH
 
Constructor Summary
SwtGCImpl(org.eclipse.swt.graphics.Drawable drawable)
          Constructs a new instance of this class which has been configured to draw on the specified drawable.
SwtGCImpl(org.eclipse.swt.graphics.Drawable drawable, int style)
          Constructs a new instance of this class which has been configured to draw on the specified drawable.
SwtGCImpl(org.eclipse.swt.graphics.GC gc)
           
 
Method Summary
 void copyArea(org.eclipse.swt.graphics.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 SWT.BITMAP.
 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.
 void copyArea(int srcX, int srcY, int width, int height, int destX, int destY, boolean paint)
          Copies a rectangular area of the receiver at the source position onto the receiver at the destination position.
 void dispose()
          Disposes of the operating system resources associated with this resource.
 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.
 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 focus rectangle if the platform supports such a notion, and otherwise draws a simple rectangle in the receiver's foreground color.
 void drawImage(org.eclipse.swt.graphics.Image image, int x, int y)
          Draws the given image in the receiver at the specified coordinates.
 void drawImage(org.eclipse.swt.graphics.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.
 void drawLine(int x1, int y1, int x2, int y2)
          Draws a line, using the foreground color, between the points ( x1, y1) and (x2, y2).
 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.
 void drawPath(org.eclipse.swt.graphics.Path path)
          Draws the path described by the parameter.
 void drawPoint(int x, int y)
          Draws a pixel, using the foreground color, at the specified point ( x, y).
 void drawPolygon(int[] pointArray)
          Draws the closed polygon which is defined by the specified array of integer coordinates, using the receiver's foreground color.
 void drawPolyline(int[] pointArray)
          Draws the polyline which is defined by the specified array of integer coordinates, using the receiver's foreground color.
 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.
 void drawRectangle(org.eclipse.swt.graphics.Rectangle rect)
          Draws the outline of the specified rectangle, using the receiver's foreground color.
 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.
 void drawString(java.lang.String string, int x, int y)
          Draws the given string, using the receiver's current font and foreground color.
 void drawString(java.lang.String string, int x, int y, boolean isTransparent)
          Draws the given string, using the receiver's current font and foreground color.
 void drawText(java.lang.String string, int x, int y)
          Draws the given string, using the receiver's current font and foreground color.
 void drawText(java.lang.String string, int x, int y, boolean isTransparent)
          Draws the given string, using the receiver's current font and foreground color.
 void drawText(java.lang.String string, int x, int y, int flags)
          Draws the given string, using the receiver's current font and foreground color.
 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.
 void fillGradientRectangle(int x, int y, int width, int height, boolean 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.
 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.
 void fillPath(org.eclipse.swt.graphics.Path path)
          Fills the path described by the parameter.
 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.
 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.
 void fillRectangle(org.eclipse.swt.graphics.Rectangle rect)
          Fills the interior of the specified rectangle, using the receiver's background color.
 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.
 boolean getAdvanced()
          Returns true if receiver is using the operating system's advanced graphics subsystem.
 int getAdvanceWidth(char ch)
          Returns the advance width of the specified character in the font which is currently selected into the receiver.
 int getAlpha()
          Returns the receiver's alpha value.
 int getAntialias()
          Returns the receiver's anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON.
 org.eclipse.swt.graphics.Color getBackground()
          Returns the background color.
 org.eclipse.swt.graphics.Pattern getBackgroundPattern()
          Returns the background pattern.
 int getCharWidth(char ch)
          Returns the width of the specified character in the font selected into the receiver.
 org.eclipse.swt.graphics.Rectangle getClipping()
          Returns the bounding rectangle of the receiver's clipping region.
 void getClipping(org.eclipse.swt.graphics.Region region)
          Sets the region managed by the argument to the current clipping region of the receiver.
 org.eclipse.swt.graphics.Device getDevice()
          Returns the Device where this resource was created.
 int getFillRule()
          Returns the receiver's fill rule, which will be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.
 org.eclipse.swt.graphics.Font getFont()
          Returns the font currently being used by the receiver to draw and measure text.
 org.eclipse.swt.graphics.FontMetrics getFontMetrics()
          Returns a FontMetrics which contains information about the font currently being used by the receiver to draw and measure text.
 org.eclipse.swt.graphics.Color getForeground()
          Returns the receiver's foreground color.
 org.eclipse.swt.graphics.Pattern getForegroundPattern()
          Returns the foreground pattern.
 org.eclipse.swt.graphics.GCData getGCData()
          Returns the GCData.
 int getInterpolation()
          Returns the receiver's interpolation setting, which will be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.
 org.eclipse.swt.graphics.LineAttributes getLineAttributes()
          Returns the receiver's line attributes.
 int 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.
 int[] getLineDash()
          Returns the receiver's line dash style.
 int 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.
 int 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.
 int 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.
 int getStyle()
          Returns the receiver's style information.
 int getTextAntialias()
          Returns the receiver's text drawing anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON.
 void getTransform(org.eclipse.swt.graphics.Transform transform)
          Sets the parameter to the transform that is currently being used by the receiver.
 boolean 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.
 boolean isClipped()
          Returns true if the receiver has a clipping region set into it, and false otherwise.
 boolean isDisposed()
          Returns true if the GC has been disposed, and false otherwise.
 void setAdvanced(boolean advanced)
          Sets the receiver to always use the operating system's advanced graphics subsystem for all graphics operations if the argument is true.
 void setAlpha(int alpha)
          Sets the receiver's alpha value which must be between 0 (transparent) and 255 (opaque).
 void setAntialias(int antialias)
          Sets the receiver's anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON.
 void setBackground(org.eclipse.swt.graphics.Color color)
          Sets the background color.
 void setBackgroundPattern(org.eclipse.swt.graphics.Pattern pattern)
          Sets the background pattern.
 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.
 void setClipping(org.eclipse.swt.graphics.Path path)
          Sets the area of the receiver which can be changed by drawing operations to the path specified by the argument.
 void setClipping(org.eclipse.swt.graphics.Rectangle rect)
          Sets the area of the receiver which can be changed by drawing operations to the rectangular area specified by the argument.
 void setClipping(org.eclipse.swt.graphics.Region region)
          Sets the area of the receiver which can be changed by drawing operations to the region specified by the argument.
 void setFillRule(int rule)
          Sets the receiver's fill rule to the parameter, which must be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.
 void setFont(org.eclipse.swt.graphics.Font font)
          Sets the font which will be used by the receiver to draw and measure text to the argument.
 void setForeground(org.eclipse.swt.graphics.Color color)
          Sets the foreground color.
 void setForegroundPattern(org.eclipse.swt.graphics.Pattern pattern)
          Sets the foreground pattern.
 void setInterpolation(int interpolation)
          Sets the receiver's interpolation setting to the parameter, which must be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.
 void setLineAttributes(org.eclipse.swt.graphics.LineAttributes attributes)
          Sets the receiver's line attributes.
 void setLineCap(int 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.
 void setLineDash(int[] dashes)
          Sets the receiver's line dash style to the argument.
 void setLineJoin(int 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.
 void setLineStyle(int 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.
 void setLineWidth(int 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.
 void setTextAntialias(int antialias)
          Sets the receiver's text anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON.
 void setTransform(org.eclipse.swt.graphics.Transform transform)
          Sets the transform that is currently being used by the receiver.
 void setXORMode(boolean xor)
          Deprecated. 
 org.eclipse.swt.graphics.Point stringExtent(java.lang.String string)
          Returns the extent of the given string.
 org.eclipse.swt.graphics.Point textExtent(java.lang.String string)
          Returns the extent of the given string.
 org.eclipse.swt.graphics.Point textExtent(java.lang.String string, int flags)
          Returns the extent of the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.swtlayeredgraph.proxies.SwtGC
equals, hashCode, toString
 

Constructor Detail

SwtGCImpl

public SwtGCImpl(org.eclipse.swt.graphics.GC gc)

SwtGCImpl

public SwtGCImpl(org.eclipse.swt.graphics.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.

You must dispose the graphics context when it is no longer required.

Parameters:
drawable - the drawable to draw on
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the drawable is null
  • ERROR_NULL_ARGUMENT - if there is no current device
  • 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
org.eclipse.swt.SWTError -
  • ERROR_NO_HANDLES if a handle could not be obtained for GC creation
  • ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable

SwtGCImpl

public SwtGCImpl(org.eclipse.swt.graphics.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.

You must dispose the graphics context when it is no longer required.

Parameters:
drawable - the drawable to draw on
style - the style of GC to construct
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the drawable is null
  • ERROR_NULL_ARGUMENT - if there is no current device
  • 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
org.eclipse.swt.SWTError -
  • ERROR_NO_HANDLES if a handle could not be obtained for GC creation
  • ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable
Since:
2.1.2
Method Detail

copyArea

public void copyArea(org.eclipse.swt.graphics.Image image,
                     int x,
                     int y)
Description copied from interface: SwtGC
Copies a rectangular area of the receiver at the specified position into the image, which must be of type SWT.BITMAP.

Specified by:
copyArea in interface SwtGC
Parameters:
image - the image to copy into
x - the x coordinate in the receiver of the area to be copied
y - the y coordinate in the receiver of the area to be copied

copyArea

public void copyArea(int srcX,
                     int srcY,
                     int width,
                     int height,
                     int destX,
                     int destY)
Description copied from interface: SwtGC
Copies a rectangular area of the receiver at the source position onto the receiver at the destination position.

Specified by:
copyArea in interface SwtGC
Parameters:
srcX - the x coordinate in the receiver of the area to be copied
srcY - the y coordinate in the receiver of the area to be copied
width - the width of the area to copy
height - the height of the area to copy
destX - the x coordinate in the receiver of the area to copy to
destY - the y coordinate in the receiver of the area to copy to

copyArea

public void copyArea(int srcX,
                     int srcY,
                     int width,
                     int height,
                     int destX,
                     int destY,
                     boolean paint)
Description copied from interface: SwtGC
Copies a rectangular area of the receiver at the source position onto the receiver at the destination position.

Specified by:
copyArea in interface SwtGC
Parameters:
srcX - the x coordinate in the receiver of the area to be copied
srcY - the y coordinate in the receiver of the area to be copied
width - the width of the area to copy
height - the height of the area to copy
destX - the x coordinate in the receiver of the area to copy to
destY - the y coordinate in the receiver of the area to copy to
paint - if true paint events will be generated for old and obscured areas

drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Description copied from interface: SwtGC
Draws the outline of a circular or elliptical arc within the specified rectangular area.

The resulting arc begins at startAngle and extends for arcAngle 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.

The center of the arc is the center of the rectangle whose origin is ( x, y) and whose size is specified by the width and height arguments.

The resulting arc covers an area width + 1 pixels wide by height + 1 pixels tall.

Specified by:
drawArc in interface SwtGC
Parameters:
x - the x coordinate of the upper-left corner of the arc to be drawn
y - the y coordinate of the upper-left corner of the arc to be drawn
width - the width of the arc to be drawn
height - the height of the arc to be drawn
startAngle - the beginning angle
arcAngle - the angular extent of the arc, relative to the start angle

drawFocus

public void drawFocus(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: SwtGC
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.

Specified by:
drawFocus in interface SwtGC
Parameters:
x - the x coordinate of the rectangle
y - the y coordinate of the rectangle
width - the width of the rectangle
height - the height of the rectangle
See Also:
SwtGC.drawRectangle(int, int, int, int)

drawImage

public void drawImage(org.eclipse.swt.graphics.Image image,
                      int x,
                      int y)
Description copied from interface: SwtGC
Draws the given image in the receiver at the specified coordinates.

Specified by:
drawImage in interface SwtGC
Parameters:
image - the image to draw
x - the x coordinate of where to draw
y - the y coordinate of where to draw

drawImage

public void drawImage(org.eclipse.swt.graphics.Image image,
                      int srcX,
                      int srcY,
                      int srcWidth,
                      int srcHeight,
                      int destX,
                      int destY,
                      int destWidth,
                      int destHeight)
Description copied from interface: SwtGC
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.

Specified by:
drawImage in interface SwtGC
Parameters:
image - the source image
srcX - the x coordinate in the source image to copy from
srcY - the y coordinate in the source image to copy from
srcWidth - the width in pixels to copy from the source
srcHeight - the height in pixels to copy from the source
destX - the x coordinate in the destination to copy to
destY - the y coordinate in the destination to copy to
destWidth - the width in pixels of the destination rectangle
destHeight - the height in pixels of the destination rectangle

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Description copied from interface: SwtGC
Draws a line, using the foreground color, between the points ( x1, y1) and (x2, y2).

Specified by:
drawLine in interface SwtGC
Parameters:
x1 - the first point's x coordinate
y1 - the first point's y coordinate
x2 - the second point's x coordinate
y2 - the second point's y coordinate

drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: SwtGC
Draws the outline of an oval, using the foreground color, within the specified rectangular area.

The result is a circle or ellipse that fits within the rectangle specified by the x, y, width, and height arguments.

The oval covers an area that is width + 1 pixels wide and height + 1 pixels tall.

Specified by:
drawOval in interface SwtGC
Parameters:
x - the x coordinate of the upper left corner of the oval to be drawn
y - the y coordinate of the upper left corner of the oval to be drawn
width - the width of the oval to be drawn
height - the height of the oval to be drawn

drawPath

public void drawPath(org.eclipse.swt.graphics.Path path)
Description copied from interface: SwtGC
Draws the path described by the parameter.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
drawPath in interface SwtGC
Parameters:
path - the path to draw
See Also:
Path

drawPoint

public void drawPoint(int x,
                      int y)
Description copied from interface: SwtGC
Draws a pixel, using the foreground color, at the specified point ( x, y).

Note that the receiver's line attributes do not affect this operation.

Specified by:
drawPoint in interface SwtGC
Parameters:
x - the point's x coordinate
y - the point's y coordinate

drawPolygon

public void drawPolygon(int[] pointArray)
Description copied from interface: SwtGC
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.

Specified by:
drawPolygon in interface SwtGC
Parameters:
pointArray - an array of alternating x and y values which are the vertices of the polygon

drawPolyline

public void drawPolyline(int[] pointArray)
Description copied from interface: SwtGC
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.

Specified by:
drawPolyline in interface SwtGC
Parameters:
pointArray - an array of alternating x and y values which are the corners of the polyline

drawRectangle

public void drawRectangle(int x,
                          int y,
                          int width,
                          int height)
Description copied from interface: SwtGC
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 x and x + width. The top and bottom edges are at y and y + height.

Specified by:
drawRectangle in interface SwtGC
Parameters:
x - the x coordinate of the rectangle to be drawn
y - the y coordinate of the rectangle to be drawn
width - the width of the rectangle to be drawn
height - the height of the rectangle to be drawn

drawRectangle

public void drawRectangle(org.eclipse.swt.graphics.Rectangle rect)
Description copied from interface: SwtGC
Draws the outline of the specified rectangle, using the receiver's foreground color. The left and right edges of the rectangle are at rect.x and rect.x + rect.width. The top and bottom edges are at rect.y and rect.y + rect.height.

Specified by:
drawRectangle in interface SwtGC
Parameters:
rect - the rectangle to draw

drawRoundRectangle

public void drawRoundRectangle(int x,
                               int y,
                               int width,
                               int height,
                               int arcWidth,
                               int arcHeight)
Description copied from interface: SwtGC
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 x and x + width. The top and bottom edges are at y and y + height. The roundness of the corners is specified by the arcWidth and arcHeight arguments, which are respectively the width and height of the ellipse used to draw the corners.

Specified by:
drawRoundRectangle in interface SwtGC
Parameters:
x - the x coordinate of the rectangle to be drawn
y - the y coordinate of the rectangle to be drawn
width - the width of the rectangle to be drawn
height - the height of the rectangle to be drawn
arcWidth - the width of the arc
arcHeight - the height of the arc

drawString

public void drawString(java.lang.String string,
                       int x,
                       int y)
Description copied from interface: SwtGC
Draws the given string, 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 string is being drawn will be filled with the receiver's background color.

Specified by:
drawString in interface SwtGC
Parameters:
string - the string to be drawn
x - the x coordinate of the top left corner of the rectangular area where the string is to be drawn
y - the y coordinate of the top left corner of the rectangular area where the string is to be drawn

drawString

public void drawString(java.lang.String string,
                       int x,
                       int y,
                       boolean isTransparent)
Description copied from interface: SwtGC
Draws the given string, using the receiver's current font and foreground color. No tab expansion or carriage return processing will be performed. If isTransparent is true, then the background of the rectangular area where the string is being drawn will not be modified, otherwise it will be filled with the receiver's background color.

Specified by:
drawString in interface SwtGC
Parameters:
string - the string to be drawn
x - the x coordinate of the top left corner of the rectangular area where the string is to be drawn
y - the y coordinate of the top left corner of the rectangular area where the string is to be drawn
isTransparent - if true the background will be transparent, otherwise it will be opaque

drawText

public void drawText(java.lang.String string,
                     int x,
                     int y)
Description copied from interface: SwtGC
Draws the given string, 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.

Specified by:
drawText in interface SwtGC
Parameters:
string - the string to be drawn
x - the x coordinate of the top left corner of the rectangular area where the text is to be drawn
y - the y coordinate of the top left corner of the rectangular area where the text is to be drawn

drawText

public void drawText(java.lang.String string,
                     int x,
                     int y,
                     boolean isTransparent)
Description copied from interface: SwtGC
Draws the given string, using the receiver's current font and foreground color. Tab expansion and carriage return processing are performed. If isTransparent is true, 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.

Specified by:
drawText in interface SwtGC
Parameters:
string - the string to be drawn
x - the x coordinate of the top left corner of the rectangular area where the text is to be drawn
y - the y coordinate of the top left corner of the rectangular area where the text is to be drawn
isTransparent - if true the background will be transparent, otherwise it will be opaque

drawText

public void drawText(java.lang.String string,
                     int x,
                     int y,
                     int flags)
Description copied from interface: SwtGC
Draws the given string, using the receiver's current font and foreground color. Tab expansion, line delimiter and mnemonic processing are performed according to the specified flags. If flags includes DRAW_TRANSPARENT, 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.

The parameter flags may be a combination of:

DRAW_DELIMITER
draw multiple lines
DRAW_TAB
expand tabs
DRAW_MNEMONIC
underline the mnemonic character
DRAW_TRANSPARENT
transparent background

Specified by:
drawText in interface SwtGC
Parameters:
string - the string to be drawn
x - the x coordinate of the top left corner of the rectangular area where the text is to be drawn
y - the y coordinate of the top left corner of the rectangular area where the text is to be drawn
flags - the flags specifying how to process the text

fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Description copied from interface: SwtGC
Fills the interior of a circular or elliptical arc within the specified rectangular area, with the receiver's background color.

The resulting arc begins at startAngle and extends for arcAngle 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.

The center of the arc is the center of the rectangle whose origin is ( x, y) and whose size is specified by the width and height arguments.

The resulting arc covers an area width + 1 pixels wide by height + 1 pixels tall.

Specified by:
fillArc in interface SwtGC
Parameters:
x - the x coordinate of the upper-left corner of the arc to be filled
y - the y coordinate of the upper-left corner of the arc to be filled
width - the width of the arc to be filled
height - the height of the arc to be filled
startAngle - the beginning angle
arcAngle - the angular extent of the arc, relative to the start angle
See Also:
SwtGC.drawArc(int, int, int, int, int, int)

fillGradientRectangle

public void fillGradientRectangle(int x,
                                  int y,
                                  int width,
                                  int height,
                                  boolean vertical)
Description copied from interface: SwtGC
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.

Specified by:
fillGradientRectangle in interface SwtGC
Parameters:
x - the x coordinate of the rectangle to be filled
y - the y coordinate of the rectangle to be filled
width - the width of the rectangle to be filled, may be negative (inverts direction of gradient if horizontal)
height - the height of the rectangle to be filled, may be negative (inverts direction of gradient if vertical)
vertical - if true sweeps from top to bottom, else sweeps from left to right
See Also:
SwtGC.drawRectangle(int, int, int, int)

fillOval

public void fillOval(int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: SwtGC
Fills the interior of an oval, within the specified rectangular area, with the receiver's background color.

Specified by:
fillOval in interface SwtGC
Parameters:
x - the x coordinate of the upper left corner of the oval to be filled
y - the y coordinate of the upper left corner of the oval to be filled
width - the width of the oval to be filled
height - the height of the oval to be filled
See Also:
SwtGC.drawOval(int, int, int, int)

fillPath

public void fillPath(org.eclipse.swt.graphics.Path path)
Description copied from interface: SwtGC
Fills the path described by the parameter.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
fillPath in interface SwtGC
Parameters:
path - the path to fill
See Also:
Path

fillPolygon

public void fillPolygon(int[] pointArray)
Description copied from interface: SwtGC
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.

Specified by:
fillPolygon in interface SwtGC
Parameters:
pointArray - an array of alternating x and y values which are the vertices of the polygon
See Also:
SwtGC.drawPolygon(int[])

fillRectangle

public void fillRectangle(int x,
                          int y,
                          int width,
                          int height)
Description copied from interface: SwtGC
Fills the interior of the rectangle specified by the arguments, using the receiver's background color.

Specified by:
fillRectangle in interface SwtGC
Parameters:
x - the x coordinate of the rectangle to be filled
y - the y coordinate of the rectangle to be filled
width - the width of the rectangle to be filled
height - the height of the rectangle to be filled
See Also:
SwtGC.drawRectangle(int, int, int, int)

fillRectangle

public void fillRectangle(org.eclipse.swt.graphics.Rectangle rect)
Description copied from interface: SwtGC
Fills the interior of the specified rectangle, using the receiver's background color.

Specified by:
fillRectangle in interface SwtGC
Parameters:
rect - the rectangle to be filled
See Also:
SwtGC.drawRectangle(int, int, int, int)

fillRoundRectangle

public void fillRoundRectangle(int x,
                               int y,
                               int width,
                               int height,
                               int arcWidth,
                               int arcHeight)
Description copied from interface: SwtGC
Fills the interior of the round-cornered rectangle specified by the arguments, using the receiver's background color.

Specified by:
fillRoundRectangle in interface SwtGC
Parameters:
x - the x coordinate of the rectangle to be filled
y - the y coordinate of the rectangle to be filled
width - the width of the rectangle to be filled
height - the height of the rectangle to be filled
arcWidth - the width of the arc
arcHeight - the height of the arc
See Also:
SwtGC.drawRoundRectangle(int, int, int, int, int, int)

getAdvanceWidth

public int getAdvanceWidth(char ch)
Description copied from interface: SwtGC
Returns the advance width of the specified character in the font which is currently selected into the receiver.

The advance width is defined as the horizontal distance the cursor should move after printing the character in the selected font.

Specified by:
getAdvanceWidth in interface SwtGC
Parameters:
ch - the character to measure
Returns:
the distance in the x direction to move past the character before painting the next

getAdvanced

public boolean getAdvanced()
Description copied from interface: SwtGC
Returns true if receiver is using the operating system's advanced graphics subsystem. Otherwise, false is returned to indicate that normal graphics are in use.

Advanced graphics may not be installed for the operating system. In this case, false is always returned. Some operating system have only one graphics subsystem. If this subsystem supports advanced graphics, then true 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, true is returned. If the receiver has been explicitly switched to advanced mode and this mode is supported, true is returned.

Specified by:
getAdvanced in interface SwtGC
Returns:
the advanced value
See Also:
SwtGC.setAdvanced(boolean)

getAlpha

public int getAlpha()
Description copied from interface: SwtGC
Returns the receiver's alpha value. The alpha value is between 0 (transparent) and 255 (opaque).

Specified by:
getAlpha in interface SwtGC
Returns:
the alpha value

getAntialias

public int getAntialias()
Description copied from interface: SwtGC
Returns the receiver's anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.

Specified by:
getAntialias in interface SwtGC
Returns:
the anti-aliasing setting
See Also:
SwtGC.getTextAntialias()

getBackground

public org.eclipse.swt.graphics.Color getBackground()
Description copied from interface: SwtGC
Returns the background color.

Specified by:
getBackground in interface SwtGC
Returns:
the receiver's background color

getBackgroundPattern

public org.eclipse.swt.graphics.Pattern getBackgroundPattern()
Description copied from interface: SwtGC
Returns the background pattern. The default value is null.

Specified by:
getBackgroundPattern in interface SwtGC
Returns:
the receiver's background pattern
See Also:
Pattern

getCharWidth

public int getCharWidth(char ch)
Description copied from interface: SwtGC
Returns the width of the specified character in the font selected into the receiver.

The width is defined as the space taken up by the actual character, not including the leading and tailing whitespace or overhang.

Specified by:
getCharWidth in interface SwtGC
Parameters:
ch - the character to measure
Returns:
the width of the character

getClipping

public org.eclipse.swt.graphics.Rectangle getClipping()
Description copied from interface: SwtGC
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.

Specified by:
getClipping in interface SwtGC
Returns:
the bounding rectangle of the clipping region

getClipping

public void getClipping(org.eclipse.swt.graphics.Region region)
Description copied from interface: SwtGC
Sets the region managed by the argument to the current clipping region of the receiver.

Specified by:
getClipping in interface SwtGC
Parameters:
region - the region to fill with the clipping region

getFillRule

public int getFillRule()
Description copied from interface: SwtGC
Returns the receiver's fill rule, which will be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.

Specified by:
getFillRule in interface SwtGC
Returns:
the receiver's fill rule

getFont

public org.eclipse.swt.graphics.Font getFont()
Description copied from interface: SwtGC
Returns the font currently being used by the receiver to draw and measure text.

Specified by:
getFont in interface SwtGC
Returns:
the receiver's font

getFontMetrics

public org.eclipse.swt.graphics.FontMetrics getFontMetrics()
Description copied from interface: SwtGC
Returns a FontMetrics which contains information about the font currently being used by the receiver to draw and measure text.

Specified by:
getFontMetrics in interface SwtGC
Returns:
font metrics for the receiver's font

getForeground

public org.eclipse.swt.graphics.Color getForeground()
Description copied from interface: SwtGC
Returns the receiver's foreground color.

Specified by:
getForeground in interface SwtGC
Returns:
the color used for drawing foreground things

getForegroundPattern

public org.eclipse.swt.graphics.Pattern getForegroundPattern()
Description copied from interface: SwtGC
Returns the foreground pattern. The default value is null.

Specified by:
getForegroundPattern in interface SwtGC
Returns:
the receiver's foreground pattern
See Also:
Pattern

getGCData

public org.eclipse.swt.graphics.GCData getGCData()
Description copied from interface: SwtGC
Returns the GCData.

IMPORTANT: This method is not part of the public API for GC. 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.

Specified by:
getGCData in interface SwtGC
Returns:
the receiver's GCData
See Also:
GCData

getInterpolation

public int getInterpolation()
Description copied from interface: SwtGC
Returns the receiver's interpolation setting, which will be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.

Specified by:
getInterpolation in interface SwtGC
Returns:
the receiver's interpolation setting

getLineAttributes

public org.eclipse.swt.graphics.LineAttributes getLineAttributes()
Description copied from interface: SwtGC
Returns the receiver's line attributes.

Specified by:
getLineAttributes in interface SwtGC
Returns:
the line attributes used for drawing lines

getLineCap

public int getLineCap()
Description copied from interface: SwtGC
Returns the receiver's line cap style, which will be one of the constants SWT.CAP_FLAT, SWT.CAP_ROUND, or SWT.CAP_SQUARE.

Specified by:
getLineCap in interface SwtGC
Returns:
the cap style used for drawing lines

getLineDash

public int[] getLineDash()
Description copied from interface: SwtGC
Returns the receiver's line dash style. The default value is null.

Specified by:
getLineDash in interface SwtGC
Returns:
the line dash style used for drawing lines

getLineJoin

public int getLineJoin()
Description copied from interface: SwtGC
Returns the receiver's line join style, which will be one of the constants SWT.JOIN_MITER, SWT.JOIN_ROUND, or SWT.JOIN_BEVEL.

Specified by:
getLineJoin in interface SwtGC
Returns:
the join style used for drawing lines

getLineStyle

public int getLineStyle()
Description copied from interface: SwtGC
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.

Specified by:
getLineStyle in interface SwtGC
Returns:
the style used for drawing lines

getLineWidth

public int getLineWidth()
Description copied from interface: SwtGC
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.

Specified by:
getLineWidth in interface SwtGC
Returns:
the receiver's line width

getStyle

public int getStyle()
Description copied from interface: SwtGC
Returns the receiver's style information.

Note that the value which is returned by this method may not match 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.

Specified by:
getStyle in interface SwtGC
Returns:
the style bits

getTextAntialias

public int getTextAntialias()
Description copied from interface: SwtGC
Returns the receiver's text drawing anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing only for text drawing operations.

Specified by:
getTextAntialias in interface SwtGC
Returns:
the anti-aliasing setting
See Also:
SwtGC.getAntialias()

getTransform

public void getTransform(org.eclipse.swt.graphics.Transform transform)
Description copied from interface: SwtGC
Sets the parameter to the transform that is currently being used by the receiver.

Specified by:
getTransform in interface SwtGC
Parameters:
transform - the destination to copy the transform into
See Also:
Transform

getXORMode

public boolean getXORMode()
Description copied from interface: SwtGC
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.

Specified by:
getXORMode in interface SwtGC
Returns:
true true if the receiver is in XOR mode, and false otherwise

isClipped

public boolean isClipped()
Description copied from interface: SwtGC
Returns true if the receiver has a clipping region set into it, and false 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 getClipping(region).

Specified by:
isClipped in interface SwtGC
Returns:
true if the GC has a clipping region, and false otherwise

isDisposed

public boolean isDisposed()
Description copied from interface: SwtGC
Returns true if the GC has been disposed, and false otherwise.

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.

Specified by:
isDisposed in interface SwtGC
Returns:
true when the GC is disposed and false otherwise

setAdvanced

public void setAdvanced(boolean advanced)
Description copied from interface: SwtGC
Sets the receiver to always use the operating system's advanced graphics subsystem for all graphics operations if the argument is true. If the argument is false, the advanced graphics subsystem is no longer used, advanced graphics state is cleared and the normal graphics subsystem is used from now on.

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.

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.

Specified by:
setAdvanced in interface SwtGC
Parameters:
advanced - the new advanced graphics state
See Also:
SwtGC.setAlpha(int), SwtGC.setAntialias(int), SwtGC.setBackgroundPattern(org.eclipse.swt.graphics.Pattern), SwtGC.setClipping(Path), SwtGC.setForegroundPattern(org.eclipse.swt.graphics.Pattern), SwtGC.setLineAttributes(org.eclipse.swt.graphics.LineAttributes), SwtGC.setInterpolation(int), SwtGC.setTextAntialias(int), SwtGC.setTransform(org.eclipse.swt.graphics.Transform), SwtGC.getAdvanced()

setAlpha

public void setAlpha(int alpha)
Description copied from interface: SwtGC
Sets the receiver's alpha value which must be between 0 (transparent) and 255 (opaque).

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setAlpha in interface SwtGC
Parameters:
alpha - the alpha value
See Also:
SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setAntialias

public void setAntialias(int antialias)
Description copied from interface: SwtGC
Sets the receiver's anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setAntialias in interface SwtGC
Parameters:
antialias - the anti-aliasing setting
See Also:
SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean), SwtGC.setTextAntialias(int)

setBackground

public void setBackground(org.eclipse.swt.graphics.Color color)
Description copied from interface: SwtGC
Sets the background color. The background color is used for fill operations and as the background color when text is drawn.

Specified by:
setBackground in interface SwtGC
Parameters:
color - the new background color for the receiver

setBackgroundPattern

public void setBackgroundPattern(org.eclipse.swt.graphics.Pattern pattern)
Description copied from interface: SwtGC
Sets the background pattern. The default value is null.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setBackgroundPattern in interface SwtGC
Parameters:
pattern - the new background pattern
See Also:
Pattern, SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setClipping

public void setClipping(int x,
                        int y,
                        int width,
                        int height)
Description copied from interface: SwtGC
Sets the area of the receiver which can be changed by drawing operations to the rectangular area specified by the arguments.

Specified by:
setClipping in interface SwtGC
Parameters:
x - the x coordinate of the clipping rectangle
y - the y coordinate of the clipping rectangle
width - the width of the clipping rectangle
height - the height of the clipping rectangle

setClipping

public void setClipping(org.eclipse.swt.graphics.Path path)
Description copied from interface: SwtGC
Sets the area of the receiver which can be changed by drawing operations to the path specified by the argument.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setClipping in interface SwtGC
Parameters:
path - the clipping path.
See Also:
Path, SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setClipping

public void setClipping(org.eclipse.swt.graphics.Rectangle rect)
Description copied from interface: SwtGC
Sets the area of the receiver which can be changed by drawing operations to the rectangular area specified by the argument. Specifying null for the rectangle reverts the receiver's clipping area to its original value.

Specified by:
setClipping in interface SwtGC
Parameters:
rect - the clipping rectangle or null

setClipping

public void setClipping(org.eclipse.swt.graphics.Region region)
Description copied from interface: SwtGC
Sets the area of the receiver which can be changed by drawing operations to the region specified by the argument. Specifying null for the region reverts the receiver's clipping area to its original value.

Specified by:
setClipping in interface SwtGC
Parameters:
region - the clipping region or null

setFillRule

public void setFillRule(int rule)
Description copied from interface: SwtGC
Sets the receiver's fill rule to the parameter, which must be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.

Specified by:
setFillRule in interface SwtGC
Parameters:
rule - the new fill rule

setFont

public void setFont(org.eclipse.swt.graphics.Font font)
Description copied from interface: SwtGC
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.

Specified by:
setFont in interface SwtGC
Parameters:
font - the new font for the receiver, or null to indicate a default font

setForeground

public void setForeground(org.eclipse.swt.graphics.Color color)
Description copied from interface: SwtGC
Sets the foreground color. The foreground color is used for drawing operations including when text is drawn.

Specified by:
setForeground in interface SwtGC
Parameters:
color - the new foreground color for the receiver

setForegroundPattern

public void setForegroundPattern(org.eclipse.swt.graphics.Pattern pattern)
Description copied from interface: SwtGC
Sets the foreground pattern. The default value is null.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setForegroundPattern in interface SwtGC
Parameters:
pattern - the new foreground pattern
See Also:
Pattern, SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setInterpolation

public void setInterpolation(int interpolation)
Description copied from interface: SwtGC
Sets the receiver's interpolation setting to the parameter, which must be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setInterpolation in interface SwtGC
Parameters:
interpolation - the new interpolation setting
See Also:
SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setLineAttributes

public void setLineAttributes(org.eclipse.swt.graphics.LineAttributes attributes)
Description copied from interface: SwtGC
Sets the receiver's line attributes.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setLineAttributes in interface SwtGC
Parameters:
attributes - the line attributes
See Also:
LineAttributes, SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setLineCap

public void setLineCap(int cap)
Description copied from interface: SwtGC
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.

Specified by:
setLineCap in interface SwtGC
Parameters:
cap - the cap style to be used for drawing lines

setLineDash

public void setLineDash(int[] dashes)
Description copied from interface: SwtGC
Sets the receiver's line dash style to the argument. The default value is null. If the argument is not null, the receiver's line style is set to SWT.LINE_CUSTOM, otherwise it is set to SWT.LINE_SOLID.

Specified by:
setLineDash in interface SwtGC
Parameters:
dashes - the dash style to be used for drawing lines

setLineJoin

public void setLineJoin(int join)
Description copied from interface: SwtGC
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.

Specified by:
setLineJoin in interface SwtGC
Parameters:
join - the join style to be used for drawing lines

setLineStyle

public void setLineStyle(int lineStyle)
Description copied from interface: SwtGC
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.

Specified by:
setLineStyle in interface SwtGC
Parameters:
lineStyle - the style to be used for drawing lines

setLineWidth

public void setLineWidth(int lineWidth)
Description copied from interface: SwtGC
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.

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.

Specified by:
setLineWidth in interface SwtGC
Parameters:
lineWidth - the width of a line

setTextAntialias

public void setTextAntialias(int antialias)
Description copied from interface: SwtGC
Sets the receiver's text anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing only for all text drawing operations.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setTextAntialias in interface SwtGC
Parameters:
antialias - the anti-aliasing setting
See Also:
SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean), SwtGC.setAntialias(int)

setTransform

public void setTransform(org.eclipse.swt.graphics.Transform transform)
Description copied from interface: SwtGC
Sets the transform that is currently being used by the receiver. If the argument is null, the current transform is set to the identity transform.

This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.

Specified by:
setTransform in interface SwtGC
Parameters:
transform - the transform to set
See Also:
Transform, SwtGC.getAdvanced(), SwtGC.setAdvanced(boolean)

setXORMode

@Deprecated
public void setXORMode(boolean xor)
Deprecated. 

Description copied from interface: SwtGC
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.

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.

Specified by:
setXORMode in interface SwtGC
Parameters:
xor - if true, then xor mode is used, otherwise source copy mode is used

stringExtent

public org.eclipse.swt.graphics.Point stringExtent(java.lang.String string)
Description copied from interface: SwtGC
Returns the extent of the given string. No tab expansion or carriage return processing will be performed.

The extent of a string 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).

Specified by:
stringExtent in interface SwtGC
Parameters:
string - the string to measure
Returns:
a point containing the extent of the string

textExtent

public org.eclipse.swt.graphics.Point textExtent(java.lang.String string)
Description copied from interface: SwtGC
Returns the extent of the given string. Tab expansion and carriage return processing are performed.

The extent of a string 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).

Specified by:
textExtent in interface SwtGC
Parameters:
string - the string to measure
Returns:
a point containing the extent of the string

textExtent

public org.eclipse.swt.graphics.Point textExtent(java.lang.String string,
                                                 int flags)
Description copied from interface: SwtGC
Returns the extent of the given string. Tab expansion, line delimiter and mnemonic processing are performed according to the specified flags, which can be a combination of:
DRAW_DELIMITER
draw multiple lines
DRAW_TAB
expand tabs
DRAW_MNEMONIC
underline the mnemonic character
DRAW_TRANSPARENT
transparent background

The extent of a string 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).

Specified by:
textExtent in interface SwtGC
Parameters:
string - the string to measure
flags - the flags specifying how to process the text
Returns:
a point containing the extent of the string

dispose

public void dispose()
Description copied from interface: SwtGC
Disposes of the operating system resources associated with this resource. Applications must dispose of all resources which they allocate.

Specified by:
dispose in interface SwtGC

getDevice

public org.eclipse.swt.graphics.Device getDevice()
Description copied from interface: SwtGC
Returns the Device where this resource was created.

Specified by:
getDevice in interface SwtGC
Returns:
Device the device of the receiver


Copyright © 2009. All Rights Reserved.