Package org.eclipse.draw2d
Class Graphics
java.lang.Object
org.eclipse.draw2d.Graphics
- Direct Known Subclasses:
ScaledGraphics
,SWTGraphics
The Graphics class allows you to draw to a surface. The drawXxx() methods
that pertain to shapes draw an outline of the shape, whereas the fillXxx()
methods fill in the shape. Also provides for drawing text, lines and images.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the clip region to the given rectangle.abstract void
Sets the clip region to the given rectangle.abstract void
dispose()
Disposes this object, releasing any resources.abstract void
drawArc
(int x, int y, int w, int h, int offset, int length) Draws the outline of an arc located at (x,y) with width w and height h.final void
abstract void
drawFocus
(int x, int y, int w, int h) Draws a focus rectangle.final void
abstract void
Draws the given Image at the location (x,y).abstract void
Draws a rectangular section of the given Image to the specified rectangular reagion on the canvas.final void
Draws the given image at a point.final void
abstract void
drawLine
(int x1, int y1, int x2, int y2) Draws a line between the points(x1,y1)
and(x2,y2)
using the foreground color.final void
abstract void
drawOval
(int x, int y, int w, int h) Draws the outline of an ellipse that fits inside the rectangle with the given properties using the foreground color.final void
Draws an oval inside the given rectangle using the current foreground color.void
Draws the given path.void
drawPoint
(int x, int y) Draws a pixel, using the foreground color, at the specified point (x
,y
).void
drawPolygon
(int[] points) Draws a closed polygon defined by the given Integer array containing the vertices in x,y order.abstract void
drawPolygon
(PointList points) Draws a closed polygon defined by the givenPointList
containing the vertices.void
drawPolyline
(int[] points) Draws a polyline defined by the given Integer array containing the vertices in x,y order.abstract void
drawPolyline
(PointList points) Draws a polyline defined by the givenPointList
containing the vertices.abstract void
drawRectangle
(int x, int y, int width, int height) Draws a rectangle whose top-left corner is located at the point (x,y) with the given width and height.final void
Draws the given rectangle using the current foreground color.abstract void
drawRoundRectangle
(Rectangle r, int arcWidth, int arcHeight) Draws a rectangle with rounded corners using the foreground color.abstract void
drawString
(String s, int x, int y) Draws the given string using the current font and foreground color.final void
drawString
(String s, Point p) abstract void
Draws the given string using the current font and foreground color.void
Draws a string using the specified styles.final void
final void
Draws a string using the specified styles.final void
drawTextLayout
(TextLayout layout, int x, int y) Renders the specified TextLayout to this Graphics.void
drawTextLayout
(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) abstract void
fillArc
(int x, int y, int w, int h, int offset, int length) Fills the interior of an arc located at (x,y) with width w and height h.final void
abstract void
fillGradient
(int x, int y, int w, int h, boolean vertical) Fills the the given rectangle with a gradient from the foreground color to the background color.final void
fillGradient
(Rectangle r, boolean vertical) abstract void
fillOval
(int x, int y, int w, int h) Fills an ellipse that fits inside the rectangle with the given properties using the background color.final void
void
Fills the given path.void
fillPolygon
(int[] points) Fills a closed polygon defined by the given Integer array containing the vertices in x,y order.abstract void
fillPolygon
(PointList points) Fills a closed polygon defined by the givenPointList
containing the vertices.abstract void
fillRectangle
(int x, int y, int width, int height) Fills a rectangle whose top-left corner is located at the point (x,y) with the given width and height.final void
Fills the given rectangle using the current background color.abstract void
fillRoundRectangle
(Rectangle r, int arcWidth, int arcHeight) Fills a rectangle with rounded corners using the background color.abstract void
fillString
(String s, int x, int y) Draws the given string using the current font and foreground color.final void
fillString
(String s, Point p) abstract void
Draws the given string using the current font and foreground color.final void
double
Returns the current absolute scaling which will be applied to the underlying Device when painting to this Graphics.boolean
int
getAlpha()
Returns the current alpha value of the graphics.int
Returns the anti-aliasing setting value, which will be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
.abstract Color
Returns the background color used for filling.abstract Rectangle
Modifies the given rectangle to match the clip region and returns that rectangle.int
Returns the fill rule, which will be one ofSWT.FILL_EVEN_ODD
orSWT.FILL_WINDING
.abstract Font
getFont()
Returns the font used to draw and fill text.abstract FontMetrics
Returns the font metrics for the current font.abstract Color
Returns the foreground color used to draw lines and text.int
Returns the interpolation setting.Returns the current collection of line attributes.int
Returns the current line cap style.int
Returns the line join style.float
Returns the line miter limit.abstract int
Returns the line style.abstract int
Returns the current line width.abstract float
Returns the current line width.int
Returns the textual anti-aliasing setting value, which will be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
.abstract boolean
Returnstrue
if this graphics object should use XOR mode with painting.abstract void
popState()
Pops the previous state of this graphics object off the stack (ifpushState()
has previously been called) and restores the current state to that popped state.abstract void
Pushes the current state of this graphics object onto a stack.abstract void
Restores the previous state of this graphics object.void
rotate
(float degrees) Rotates the coordinates by the given counter-clockwise angle.abstract void
scale
(double amount) Scales this graphics object by the given amount.void
scale
(float horizontal, float vertical) Scales the graphics by the given horizontal and vertical components.void
setAdvanced
(boolean advanced) Turns advanced graphics mode on or off.void
setAlpha
(int alpha) Sets the alpha to the given value.void
setAntialias
(int value) Sets the anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
.abstract void
setBackgroundColor
(Color rgb) Sets the background color.void
setBackgroundPattern
(Pattern pattern) Sets the pattern used for fill-type graphics operations.abstract void
Sets the clip rectangle.void
Sets the area which can be affected by drawing operations to the specifiedPath
.void
setFillRule
(int rule) Sets the fill rule to the given value, which must be one ofSWT.FILL_EVEN_ODD
orSWT.FILL_WINDING
.abstract void
Sets the font.abstract void
setForegroundColor
(Color rgb) Sets the foreground color.void
setForegroundPattern
(Pattern pattern) Sets the foreground pattern for draw and text operations.void
setInterpolation
(int interpolation) Sets the interpolation setting to the given value, which must be one ofSWT.DEFAULT
,SWT.NONE
,SWT.LOW
orSWT.HIGH
.void
setLineAttributes
(LineAttributes attributes) Sets all line attributes togethervoid
setLineCap
(int cap) Sets the line cap style to the argument, which must be one of the constantsSWT.CAP_FLAT
,SWT.CAP_ROUND
, orSWT.CAP_SQUARE
.void
setLineDash
(float[] value) Sets the dash pattern when the custom line style is in use.void
setLineDash
(int[] dash) Sets the dash pattern when the custom line style is in use.void
setLineDashOffset
(float value) Sets the line dash offset.void
setLineJoin
(int join) Sets the line join style to the argument, which must be one of the constantsSWT.JOIN_MITER
,SWT.JOIN_ROUND
, orSWT.JOIN_BEVEL
.abstract void
setLineMiterLimit
(float miterLimit) abstract void
setLineStyle
(int style) Sets the line style to the argument, which must be one of the constantsSWT.LINE_SOLID
,SWT.LINE_DASH
,SWT.LINE_DOT
,SWT.LINE_DASHDOT
orSWT.LINE_DASHDOTDOT
.abstract void
setLineWidth
(int width) Sets the line width.abstract void
setLineWidthFloat
(float width) Sets the line width.void
setTextAntialias
(int value) Sets the textual anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
.abstract void
setXORMode
(boolean b) Sets the XOR mode.void
shear
(float horz, float vert) Modifies the current transformation by shearing the graphics in the specified horizontal and vertical amounts.void
translate
(float dx, float dy) Modifies the current transform by translating the given x and y amounts.abstract void
translate
(int dx, int dy) Translates the receiver's coordinates by the specified x and y amounts.final void
-
Field Details
-
LINE_CUSTOM
public static final int LINE_CUSTOM- See Also:
-
LINE_DASH
public static final int LINE_DASH- See Also:
-
LINE_DASHDOT
public static final int LINE_DASHDOT- See Also:
-
LINE_DASHDOTDOT
public static final int LINE_DASHDOTDOT- See Also:
-
LINE_DOT
public static final int LINE_DOT- See Also:
-
LINE_SOLID
public static final int LINE_SOLID- See Also:
-
-
Constructor Details
-
Graphics
public Graphics()
-
-
Method Details
-
clipRect
Sets the clip region to the given rectangle. Anything outside this rectangle will not be drawn.- Parameters:
r
- the clip rectangle
-
clipPath
Sets the clip region to the given rectangle. Anything outside this rectangle will not be drawn. Takes into account current clipping area set on the graphics.- Parameters:
path
- the clip path- Since:
- 3.6
-
dispose
public abstract void dispose()Disposes this object, releasing any resources. -
drawArc
public abstract void drawArc(int x, int y, int w, int h, int offset, int length) Draws the outline of an arc located at (x,y) with width w and height h. The starting angle of the arc (specified in degrees) is offset and length is the arc's angle (specified in degrees).- Parameters:
x
- the x coordinatey
- the y coordinatew
- the widthh
- the heightoffset
- the start anglelength
- the length of the arc
-
drawArc
- See Also:
-
drawFocus
public abstract void drawFocus(int x, int y, int w, int h) Draws a focus rectangle.- Parameters:
x
- the x coordinatey
- the y coordinatew
- the widthh
- the height
-
drawFocus
- See Also:
-
drawImage
Draws the given Image at the location (x,y).- Parameters:
srcImage
- the Imagex
- the x coordinatey
- the y coordinate
-
drawImage
public abstract void drawImage(Image srcImage, int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) Draws a rectangular section of the given Image to the specified rectangular reagion on the canvas. The section of the image bounded by the rectangle (x1,y1,w1,h1) is copied to the section of the canvas bounded by the rectangle (x2,y2,w2,h2). If these two sizes are different, scaling will occur.- Parameters:
srcImage
- the imagex1
- the x coordinate of the sourcey1
- the y coordinate of the sourcew1
- the width of the sourceh1
- the height of the sourcex2
- the x coordinate of the destinationy2
- the y coordinate of the destinationw2
- the width of the destinationh2
- the height of the destination
-
drawImage
Draws the given image at a point.- Parameters:
image
- the image to drawp
- where to draw the image- See Also:
-
drawImage
-
drawLine
public abstract void drawLine(int x1, int y1, int x2, int y2) Draws a line between the points(x1,y1)
and(x2,y2)
using the foreground color.- Parameters:
x1
- the x coordinate for the first pointy1
- the y coordinate for the first pointx2
- the x coordinate for the second pointy2
- the y coordinate for the second point
-
drawLine
- See Also:
-
drawOval
public abstract void drawOval(int x, int y, int w, int h) Draws the outline of an ellipse that fits inside the rectangle with the given properties using the foreground color.- Parameters:
x
- the x coordinatey
- the y coordinatew
- the widthh
- the height
-
drawOval
Draws an oval inside the given rectangle using the current foreground color.- Parameters:
r
- the rectangle circumscribing the oval to be drawn- See Also:
-
drawPath
Draws the given path.- Parameters:
path
- the path to draw- Since:
- 3.1
-
drawPoint
public void drawPoint(int x, int y) Draws a pixel, using the foreground color, at the specified point (x
,y
).Note that the current line attributes do not affect this operation.
- Parameters:
x
- the point's x coordinatey
- the point's y coordinate
-
drawPolygon
public void drawPolygon(int[] points) Draws a closed polygon defined by the given Integer array containing the vertices in x,y order. The first and last points in the list will be connected.- Parameters:
points
- the vertices
-
drawPolygon
Draws a closed polygon defined by the givenPointList
containing the vertices. The first and last points in the list will be connected.- Parameters:
points
- the vertices
-
drawPolyline
public void drawPolyline(int[] points) Draws a polyline defined by the given Integer array containing the vertices in x,y order. The first and last points in the list will not be connected.- Parameters:
points
- the vertices
-
drawPolyline
Draws a polyline defined by the givenPointList
containing the vertices. The first and last points in the list will not be connected.- Parameters:
points
- the vertices
-
drawRectangle
public abstract void drawRectangle(int x, int y, int width, int height) Draws a rectangle whose top-left corner is located at the point (x,y) with the given width and height.- Parameters:
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the height
-
drawRectangle
Draws the given rectangle using the current foreground color.- Parameters:
r
- the rectangle to draw- See Also:
-
drawRoundRectangle
Draws a rectangle with rounded corners using the foreground color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.- Parameters:
r
- the rectanglearcWidth
- the arc widtharcHeight
- the arc height
-
drawString
Draws the given string using the current font and foreground color. No tab expansion or carriage return processing will be performed. The background of the string will be transparent.- Parameters:
s
- the stringx
- the x coordinatey
- the y coordinate
-
drawString
- See Also:
-
drawText
Draws the given string using the current font and foreground color. Tab expansion and carriage return processing are performed. The background of the text will be transparent.- Parameters:
s
- the textx
- the x coordinatey
- the y coordinate
-
drawText
Draws a string using the specified styles. The styles are defined byGC.drawText(String, int, int, int)
.- Parameters:
s
- the String to drawx
- the x locationy
- the y locationstyle
- the styles used to render the string- Since:
- 3.0
-
drawText
- See Also:
-
drawText
Draws a string using the specified styles. The styles are defined byGC.drawText(String, int, int, int)
.- Parameters:
s
- the String to drawp
- the point at which to draw the stringstyle
- the styles used to render the string- Since:
- 3.0
-
drawTextLayout
Renders the specified TextLayout to this Graphics.- Parameters:
layout
- the TextLayoutx
- the x coordinatey
- the y coordinate- Since:
- 3.0
-
drawTextLayout
public void drawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) - Parameters:
x
- the x locationy
- the y locationlayout
- the TextLayout being renderedselectionStart
- the start of selectionselectionEnd
- the end of selectionselectionForeground
- the foreground selection colorselectionBackground
- the background selection color- See Also:
-
fillArc
public abstract void fillArc(int x, int y, int w, int h, int offset, int length) Fills the interior of an arc located at (x,y) with width w and height h. The starting angle of the arc (specified in degrees) is offset and length is the arc's angle (specified in degrees).- Parameters:
x
- the x coordinatey
- the y coordinatew
- the widthh
- the heightoffset
- the start anglelength
- the length of the arc
-
fillArc
- See Also:
-
fillGradient
public abstract void fillGradient(int x, int y, int w, int h, boolean vertical) Fills the the given rectangle with a gradient from the foreground color to the background color. If vertical istrue
, the gradient will go from top to bottom. Otherwise, it will go from left to right. background color.- Parameters:
x
- the x coordinatey
- the y coordinatew
- the widthh
- the heightvertical
- whether the gradient should be vertical
-
fillGradient
-
fillOval
public abstract void fillOval(int x, int y, int w, int h) Fills an ellipse that fits inside the rectangle with the given properties using the background color.- Parameters:
x
- the x coordinatey
- the y coordinatew
- the widthh
- the height
-
fillOval
- See Also:
-
fillPath
Fills the given path.- Parameters:
path
- the path to fill- Since:
- 3.1
-
fillPolygon
public void fillPolygon(int[] points) Fills a closed polygon defined by the given Integer array containing the vertices in x,y order. The first and last points in the list will be connected.- Parameters:
points
- the vertices
-
fillPolygon
Fills a closed polygon defined by the givenPointList
containing the vertices. The first and last points in the list will be connected.- Parameters:
points
- the vertices
-
fillRectangle
public abstract void fillRectangle(int x, int y, int width, int height) Fills a rectangle whose top-left corner is located at the point (x,y) with the given width and height.- Parameters:
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the height
-
fillRectangle
Fills the given rectangle using the current background color.- Parameters:
r
- the rectangle to fill- See Also:
-
fillRoundRectangle
Fills a rectangle with rounded corners using the background color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.- Parameters:
r
- the rectanglearcWidth
- the arc widtharcHeight
- the arc height
-
fillString
Draws the given string using the current font and foreground color. No tab expansion or carriage return processing will be performed. The background of the string will be filled with the current background color.- Parameters:
s
- the stringx
- the x coordinatey
- the y coordinate
-
fillString
- See Also:
-
fillText
Draws the given string using the current font and foreground color. Tab expansion and carriage return processing are performed. The background of the text will be filled with the current background color.- Parameters:
s
- the textx
- the x coordinatey
- the y coordinate
-
fillText
- See Also:
-
getAbsoluteScale
public double getAbsoluteScale()Returns the current absolute scaling which will be applied to the underlying Device when painting to this Graphics. The default value is 1.0.- Returns:
- the effective absolute scaling factor
- Since:
- 3.0
-
getAdvanced
public boolean getAdvanced()- Returns:
- true if the underlying graphics device is using advanced graphics mode.
- Since:
- 3.5
-
getAlpha
public int getAlpha()Returns the current alpha value of the graphics.- Returns:
- the alpha value
- Since:
- 3.1
-
getAntialias
public int getAntialias()Returns the anti-aliasing setting value, which will be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
. Note that this controls anti-aliasing for all non-text drawing operations.- Returns:
- the anti-alias setting
- Since:
- 3.1
- See Also:
-
getBackgroundColor
Returns the background color used for filling.- Returns:
- the background color
-
getClip
Modifies the given rectangle to match the clip region and returns that rectangle.- Parameters:
rect
- the rectangle to hold the clip region- Returns:
- the clip rectangle
-
getFillRule
public int getFillRule()Returns the fill rule, which will be one ofSWT.FILL_EVEN_ODD
orSWT.FILL_WINDING
.- Returns:
- the fill rule
- Since:
- 3.1
-
getFont
Returns the font used to draw and fill text.- Returns:
- the font
-
getFontMetrics
Returns the font metrics for the current font.- Returns:
- the font metrics
-
getForegroundColor
Returns the foreground color used to draw lines and text.- Returns:
- the foreground color
-
getInterpolation
public int getInterpolation()Returns the interpolation setting.- Returns:
- the interpolation setting
- Since:
- 3.1
- See Also:
-
getLineAttributes
Returns the current collection of line attributes.- Returns:
- all attributes used for line drawing
- Since:
- 3.5
- See Also:
-
getLineCap
public int getLineCap()Returns the current line cap style.- Returns:
- the cap style used for drawing lines
- Since:
- 3.1
- See Also:
-
getLineJoin
public int getLineJoin()Returns the line join style.- Returns:
- the join style used for drawing lines
- Since:
- 3.1
- See Also:
-
getLineMiterLimit
public float getLineMiterLimit()Returns the line miter limit.- Returns:
- miter limit
- Since:
- 3.5
- See Also:
-
getLineStyle
public abstract int getLineStyle()Returns the line style.- Returns:
- the line style
- See Also:
-
getLineWidth
public abstract int getLineWidth()Returns the current line width.- Returns:
- the line width
-
getLineWidthFloat
public abstract float getLineWidthFloat()Returns the current line width.- Returns:
- the line width
- Since:
- 3.5
- See Also:
-
getTextAntialias
public int getTextAntialias()Returns the textual anti-aliasing setting value, which will be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
. Note that this controls anti-aliasing only for text drawing operations.- Returns:
- the anti-aliasing setting
- Since:
- 3.1
- See Also:
-
getXORMode
public abstract boolean getXORMode()Returnstrue
if this graphics object should use XOR mode with painting.- Returns:
- whether XOR mode is turned on
-
popState
public abstract void popState()Pops the previous state of this graphics object off the stack (ifpushState()
has previously been called) and restores the current state to that popped state. -
pushState
public abstract void pushState()Pushes the current state of this graphics object onto a stack. -
restoreState
public abstract void restoreState()Restores the previous state of this graphics object. -
rotate
public void rotate(float degrees) Rotates the coordinates by the given counter-clockwise angle. All subsequent painting will be performed in the resulting coordinates. Some functions are illegal when a rotated coordinates system is in use. To restore access to those functions, it is necessary to call restore or pop to return to a non rotated state.- Parameters:
degrees
- the degrees to rotate- Since:
- 3.1
-
scale
public abstract void scale(double amount) Scales this graphics object by the given amount.- Parameters:
amount
- the scale factor
-
scale
public void scale(float horizontal, float vertical) Scales the graphics by the given horizontal and vertical components.- Parameters:
horizontal
- the horizontal scaling factorvertical
- the vertical scaling factor- Since:
- 3.1
-
setAlpha
public void setAlpha(int alpha) Sets the alpha to the given value. Values may range from 0 to 255. A value of 0 is completely transparent.- Parameters:
alpha
- an alpha value (0-255)- Since:
- 3.1
-
setAdvanced
public void setAdvanced(boolean advanced) Turns advanced graphics mode on or off.- Parameters:
advanced
-- Since:
- 3.5
-
setAntialias
public void setAntialias(int value) Sets the anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
. Note that this controls anti-aliasing for all non-text drawing operations.- Parameters:
value
- the anti-alias value
-
setBackgroundColor
Sets the background color.- Parameters:
rgb
- the new background color
-
setBackgroundPattern
Sets the pattern used for fill-type graphics operations. The pattern must not be disposed while it is being used by the graphics.- Parameters:
pattern
- the background pattern- Since:
- 3.1
-
setClip
Sets the area which can be affected by drawing operations to the specifiedPath
.- Parameters:
path
- the clipping path- Since:
- 3.1
-
setClip
Sets the clip rectangle. Painting will not occur outside this area.- Parameters:
r
- the new clip rectangle
-
setFillRule
public void setFillRule(int rule) Sets the fill rule to the given value, which must be one ofSWT.FILL_EVEN_ODD
orSWT.FILL_WINDING
.- Parameters:
rule
- the fill rule- Since:
- 3.1
-
setFont
Sets the font.- Parameters:
f
- the new font
-
setForegroundColor
Sets the foreground color.- Parameters:
rgb
- the new foreground color
-
setForegroundPattern
Sets the foreground pattern for draw and text operations. The pattern must not be disposed while it is being referenced by the graphics.- Parameters:
pattern
- the foreground pattern- Since:
- 3.1
-
setInterpolation
public void setInterpolation(int interpolation) Sets the interpolation setting to the given value, which must be one ofSWT.DEFAULT
,SWT.NONE
,SWT.LOW
orSWT.HIGH
. This setting is relevant when working with Images.- Parameters:
interpolation
- the interpolation- Since:
- 3.1
-
setLineAttributes
Sets all line attributes together- Parameters:
attributes
- the line attributes- Since:
- 3.5
-
setLineCap
public void setLineCap(int cap) Sets the line cap style to the argument, which must be one of the constantsSWT.CAP_FLAT
,SWT.CAP_ROUND
, orSWT.CAP_SQUARE
.- Parameters:
cap
- the line cap- Since:
- 3.1
-
setLineDash
public void setLineDash(int[] dash) Sets the dash pattern when the custom line style is in use. Because this feature is rarely used, the dash pattern may not be preserved when callingpushState()
andpopState()
.- Parameters:
dash
- the pixel pattern- Since:
- 3.1
-
setLineDash
public void setLineDash(float[] value) Sets the dash pattern when the custom line style is in use.- Parameters:
value
- the pixel pattern.- Since:
- 3.5
-
setLineDashOffset
public void setLineDashOffset(float value) Sets the line dash offset.- Parameters:
value
-- Since:
- 3.8
-
setLineJoin
public void setLineJoin(int join) Sets the line join style to the argument, which must be one of the constantsSWT.JOIN_MITER
,SWT.JOIN_ROUND
, orSWT.JOIN_BEVEL
.- Parameters:
join
- the join type- Since:
- 3.1
-
setLineStyle
public abstract void setLineStyle(int style) Sets the line style to the argument, which must be one of the constantsSWT.LINE_SOLID
,SWT.LINE_DASH
,SWT.LINE_DOT
,SWT.LINE_DASHDOT
orSWT.LINE_DASHDOTDOT
.- Parameters:
style
- the new style
-
setLineWidth
public abstract void setLineWidth(int width) Sets the line width.- Parameters:
width
- the new width
-
setLineWidthFloat
public abstract void setLineWidthFloat(float width) Sets the line width.- Parameters:
width
- the new width- Since:
- 3.5
-
setLineMiterLimit
public abstract void setLineMiterLimit(float miterLimit) - Parameters:
miterLimit
-- Since:
- 3.5
-
setTextAntialias
public void setTextAntialias(int value) Sets the textual anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT
,SWT.OFF
orSWT.ON
. Note that this controls anti-aliasing only for all text drawing operations.- Parameters:
value
- the textual anti-alias setting- Since:
- 3.1
-
shear
public void shear(float horz, float vert) Modifies the current transformation by shearing the graphics in the specified horizontal and vertical amounts. Shearing can be used to produce effects like Italic fonts.- Parameters:
horz
- the horizontal shearing amountvert
- the vertical shearing amount- Since:
- 3.1
-
setXORMode
public abstract void setXORMode(boolean b) Sets the XOR mode.- Parameters:
b
- the new XOR mode
-
translate
public abstract void translate(int dx, int dy) Translates the receiver's coordinates by the specified x and y amounts. All subsequent painting will be performed in the resulting coordinate system. Integer translation used by itself does not require or start the use of the advanced graphics system in SWT. It is emulated until advanced graphics are triggered.- Parameters:
dx
- the horizontal offsetdy
- the vertical offset
-
translate
public void translate(float dx, float dy) Modifies the current transform by translating the given x and y amounts. All subsequent painting will be performed in the resulting coordinate system.- Parameters:
dx
- the horizontal offsetdy
- the vertical offset
-
translate
- See Also:
-