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.
- @noextend
- This class is not intended to be subclassed by clients.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidSets the clip region to the given rectangle.abstract voidSets the clip region to the given rectangle.abstract voiddispose()Disposes this object, releasing any resources.abstract voiddrawArc(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 voidabstract voiddrawFocus(int x, int y, int w, int h) Draws a focus rectangle.final voidabstract voidDraws the given Image at the location (x,y).abstract voidDraws a rectangular section of the given Image to the specified rectangular reagion on the canvas.final voidDraws the given image at a point.final voidabstract voiddrawLine(int x1, int y1, int x2, int y2) Draws a line between the points(x1,y1)and(x2,y2)using the foreground color.final voidabstract voiddrawOval(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 voidDraws an oval inside the given rectangle using the current foreground color.voidDraws the given path.voiddrawPoint(int x, int y) Draws a pixel, using the foreground color, at the specified point (x,y).voiddrawPolygon(int[] points) Draws a closed polygon defined by the given Integer array containing the vertices in x,y order.abstract voiddrawPolygon(PointList points) Draws a closed polygon defined by the givenPointListcontaining the vertices.voiddrawPolyline(int[] points) Draws a polyline defined by the given Integer array containing the vertices in x,y order.abstract voiddrawPolyline(PointList points) Draws a polyline defined by the givenPointListcontaining the vertices.abstract voiddrawRectangle(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 voidDraws the given rectangle using the current foreground color.abstract voiddrawRoundRectangle(Rectangle r, int arcWidth, int arcHeight) Draws a rectangle with rounded corners using the foreground color.abstract voiddrawString(String s, int x, int y) Draws the given string using the current font and foreground color.final voiddrawString(String s, Point p) abstract voidDraws the given string using the current font and foreground color.voidDraws a string using the specified styles.final voidfinal voidDraws a string using the specified styles.final voiddrawTextLayout(TextLayout layout, int x, int y) Renders the specified TextLayout to this Graphics.voiddrawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) abstract voidfillArc(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 voidabstract voidfillGradient(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 voidfillGradient(Rectangle r, boolean vertical) abstract voidfillOval(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 voidvoidFills the given path.voidfillPolygon(int[] points) Fills a closed polygon defined by the given Integer array containing the vertices in x,y order.abstract voidfillPolygon(PointList points) Fills a closed polygon defined by the givenPointListcontaining the vertices.abstract voidfillRectangle(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 voidFills the given rectangle using the current background color.abstract voidfillRoundRectangle(Rectangle r, int arcWidth, int arcHeight) Fills a rectangle with rounded corners using the background color.abstract voidfillString(String s, int x, int y) Draws the given string using the current font and foreground color.final voidfillString(String s, Point p) abstract voidDraws the given string using the current font and foreground color.final voiddoubleReturns the current absolute scaling which will be applied to the underlying Device when painting to this Graphics.booleanintgetAlpha()Returns the current alpha value of the graphics.intReturns the anti-aliasing setting value, which will be one ofSWT.DEFAULT,SWT.OFForSWT.ON.abstract ColorReturns the background color used for filling.abstract RectangleModifies the given rectangle to match the clip region and returns that rectangle.intReturns the fill rule, which will be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.abstract FontgetFont()Returns the font used to draw and fill text.abstract FontMetricsReturns the font metrics for the current font.abstract ColorReturns the foreground color used to draw lines and text.intReturns the interpolation setting.Returns the current collection of line attributes.intReturns the current line cap style.intReturns the line join style.floatReturns the line miter limit.abstract intReturns the line style.abstract intReturns the current line width.abstract floatReturns the current line width.intReturns the textual anti-aliasing setting value, which will be one ofSWT.DEFAULT,SWT.OFForSWT.ON.abstract booleanReturnstrueif this graphics object should use XOR mode with painting.abstract voidpopState()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 voidPushes the current state of this graphics object onto a stack.abstract voidRestores the previous state of this graphics object.voidrotate(float degrees) Rotates the coordinates by the given counter-clockwise angle.abstract voidscale(double amount) Scales this graphics object by the given amount.voidscale(float horizontal, float vertical) Scales the graphics by the given horizontal and vertical components.voidsetAdvanced(boolean advanced) Turns advanced graphics mode on or off.voidsetAlpha(int alpha) Sets the alpha to the given value.voidsetAntialias(int value) Sets the anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT,SWT.OFForSWT.ON.abstract voidsetBackgroundColor(Color rgb) Sets the background color.voidsetBackgroundPattern(Pattern pattern) Sets the pattern used for fill-type graphics operations.abstract voidSets the clip rectangle.voidSets the area which can be affected by drawing operations to the specifiedPath.voidsetFillRule(int rule) Sets the fill rule to the given value, which must be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.abstract voidSets the font.abstract voidsetForegroundColor(Color rgb) Sets the foreground color.voidsetForegroundPattern(Pattern pattern) Sets the foreground pattern for draw and text operations.voidsetInterpolation(int interpolation) Sets the interpolation setting to the given value, which must be one ofSWT.DEFAULT,SWT.NONE,SWT.LOWorSWT.HIGH.voidsetLineAttributes(LineAttributes attributes) Sets all line attributes togethervoidsetLineCap(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.voidsetLineDash(float[] value) Sets the dash pattern when the custom line style is in use.voidsetLineDash(int[] dash) Sets the dash pattern when the custom line style is in use.voidsetLineDashOffset(float value) Sets the line dash offset.voidsetLineJoin(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 voidsetLineMiterLimit(float miterLimit) abstract voidsetLineStyle(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_DASHDOTorSWT.LINE_DASHDOTDOT.abstract voidsetLineWidth(int width) Sets the line width.abstract voidsetLineWidthFloat(float width) Sets the line width.voidsetTextAntialias(int value) Sets the textual anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT,SWT.OFForSWT.ON.abstract voidsetXORMode(boolean b) Sets the XOR mode.voidshear(float horz, float vert) Modifies the current transformation by shearing the graphics in the specified horizontal and vertical amounts.voidtranslate(float dx, float dy) Modifies the current transform by translating the given x and y amounts.abstract voidtranslate(int dx, int dy) Translates the receiver's coordinates by the specified x and y amounts.final void
- 
Field Details- 
LINE_CUSTOMpublic static final int LINE_CUSTOM- See Also:
 
- 
LINE_DASHpublic static final int LINE_DASH- See Also:
 
- 
LINE_DASHDOTpublic static final int LINE_DASHDOT- See Also:
 
- 
LINE_DASHDOTDOTpublic static final int LINE_DASHDOTDOT- See Also:
 
- 
LINE_DOTpublic static final int LINE_DOT- See Also:
 
- 
LINE_SOLIDpublic static final int LINE_SOLID- See Also:
 
 
- 
- 
Constructor Details- 
Graphicspublic Graphics()
 
- 
- 
Method Details- 
clipRectSets the clip region to the given rectangle. Anything outside this rectangle will not be drawn.- Parameters:
- r- the clip rectangle
 
- 
clipPathSets 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
 
- 
disposepublic abstract void dispose()Disposes this object, releasing any resources.
- 
drawArcpublic 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 coordinate
- y- the y coordinate
- w- the width
- h- the height
- offset- the start angle
- length- the length of the arc
 
- 
drawArc- See Also:
 
- 
drawFocuspublic abstract void drawFocus(int x, int y, int w, int h) Draws a focus rectangle.- Parameters:
- x- the x coordinate
- y- the y coordinate
- w- the width
- h- the height
 
- 
drawFocus- See Also:
 
- 
drawImageDraws the given Image at the location (x,y).- Parameters:
- srcImage- the Image
- x- the x coordinate
- y- the y coordinate
 
- 
drawImagepublic 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 image
- x1- the x coordinate of the source
- y1- the y coordinate of the source
- w1- the width of the source
- h1- the height of the source
- x2- the x coordinate of the destination
- y2- the y coordinate of the destination
- w2- the width of the destination
- h2- the height of the destination
 
- 
drawImageDraws the given image at a point.- Parameters:
- image- the image to draw
- p- where to draw the image
- See Also:
 
- 
drawImage- See Also:
 
- 
drawLinepublic 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 point
- y1- the y coordinate for the first point
- x2- the x coordinate for the second point
- y2- the y coordinate for the second point
 
- 
drawLine- See Also:
 
- 
drawOvalpublic 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 coordinate
- y- the y coordinate
- w- the width
- h- the height
 
- 
drawOvalDraws an oval inside the given rectangle using the current foreground color.- Parameters:
- r- the rectangle circumscribing the oval to be drawn
- See Also:
 
- 
drawPathDraws the given path.- Parameters:
- path- the path to draw
- Since:
- 3.1
 
- 
drawPointpublic 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 coordinate
- y- the point's y coordinate
 
- 
drawPolygonpublic 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
 
- 
drawPolygonDraws a closed polygon defined by the givenPointListcontaining the vertices. The first and last points in the list will be connected.- Parameters:
- points- the vertices
 
- 
drawPolylinepublic 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
 
- 
drawPolylineDraws a polyline defined by the givenPointListcontaining the vertices. The first and last points in the list will not be connected.- Parameters:
- points- the vertices
 
- 
drawRectanglepublic 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 coordinate
- y- the y coordinate
- width- the width
- height- the height
 
- 
drawRectangleDraws the given rectangle using the current foreground color.- Parameters:
- r- the rectangle to draw
- See Also:
 
- 
drawRoundRectangleDraws a rectangle with rounded corners using the foreground color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.- Parameters:
- r- the rectangle
- arcWidth- the arc width
- arcHeight- the arc height
 
- 
drawStringDraws 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 string
- x- the x coordinate
- y- the y coordinate
 
- 
drawString- See Also:
 
- 
drawTextDraws 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 text
- x- the x coordinate
- y- the y coordinate
 
- 
drawTextDraws a string using the specified styles. The styles are defined byGC.drawText(String, int, int, int).- Parameters:
- s- the String to draw
- x- the x location
- y- the y location
- style- the styles used to render the string
- Since:
- 3.0
 
- 
drawText- See Also:
 
- 
drawTextDraws a string using the specified styles. The styles are defined byGC.drawText(String, int, int, int).- Parameters:
- s- the String to draw
- p- the point at which to draw the string
- style- the styles used to render the string
- Since:
- 3.0
 
- 
drawTextLayoutRenders the specified TextLayout to this Graphics.- Parameters:
- layout- the TextLayout
- x- the x coordinate
- y- the y coordinate
- Since:
- 3.0
 
- 
drawTextLayoutpublic void drawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) - Parameters:
- layout- the TextLayout being rendered
- x- the x location
- y- the y location
- selectionStart- the start of selection
- selectionEnd- the end of selection
- selectionForeground- the foreground selection color
- selectionBackground- the background selection color
- See Also:
 
- 
fillArcpublic 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 coordinate
- y- the y coordinate
- w- the width
- h- the height
- offset- the start angle
- length- the length of the arc
 
- 
fillArc- See Also:
 
- 
fillGradientpublic 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 coordinate
- y- the y coordinate
- w- the width
- h- the height
- vertical- whether the gradient should be vertical
 
- 
fillGradient- See Also:
 
- 
fillOvalpublic 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 coordinate
- y- the y coordinate
- w- the width
- h- the height
 
- 
fillOval- See Also:
 
- 
fillPathFills the given path.- Parameters:
- path- the path to fill
- Since:
- 3.1
 
- 
fillPolygonpublic 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
 
- 
fillPolygonFills a closed polygon defined by the givenPointListcontaining the vertices. The first and last points in the list will be connected.- Parameters:
- points- the vertices
 
- 
fillRectanglepublic 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 coordinate
- y- the y coordinate
- width- the width
- height- the height
 
- 
fillRectangleFills the given rectangle using the current background color.- Parameters:
- r- the rectangle to fill
- See Also:
 
- 
fillRoundRectangleFills a rectangle with rounded corners using the background color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.- Parameters:
- r- the rectangle
- arcWidth- the arc width
- arcHeight- the arc height
 
- 
fillStringDraws 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 string
- x- the x coordinate
- y- the y coordinate
 
- 
fillString- See Also:
 
- 
fillTextDraws 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 text
- x- the x coordinate
- y- the y coordinate
 
- 
fillText- See Also:
 
- 
getAbsoluteScalepublic 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
 
- 
getAdvancedpublic boolean getAdvanced()- Returns:
- true if the underlying graphics device is using advanced graphics mode.
- Since:
- 3.5
 
- 
getAlphapublic int getAlpha()Returns the current alpha value of the graphics.- Returns:
- the alpha value
- Since:
- 3.1
 
- 
getAntialiaspublic int getAntialias()Returns the anti-aliasing setting value, which will be one ofSWT.DEFAULT,SWT.OFForSWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.- Returns:
- the anti-alias setting
- Since:
- 3.1
- See Also:
 
- 
getBackgroundColorReturns the background color used for filling.- Returns:
- the background color
 
- 
getClipModifies 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
 
- 
getFillRulepublic int getFillRule()Returns the fill rule, which will be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.- Returns:
- the fill rule
- Since:
- 3.1
 
- 
getFontReturns the font used to draw and fill text.- Returns:
- the font
 
- 
getFontMetricsReturns the font metrics for the current font.- Returns:
- the font metrics
 
- 
getForegroundColorReturns the foreground color used to draw lines and text.- Returns:
- the foreground color
 
- 
getInterpolationpublic int getInterpolation()Returns the interpolation setting.- Returns:
- the interpolation setting
- Since:
- 3.1
- See Also:
 
- 
getLineAttributesReturns the current collection of line attributes.- Returns:
- all attributes used for line drawing
- Since:
- 3.5
- See Also:
 
- 
getLineCappublic int getLineCap()Returns the current line cap style.- Returns:
- the cap style used for drawing lines
- Since:
- 3.1
- See Also:
 
- 
getLineJoinpublic int getLineJoin()Returns the line join style.- Returns:
- the join style used for drawing lines
- Since:
- 3.1
- See Also:
 
- 
getLineMiterLimitpublic float getLineMiterLimit()Returns the line miter limit.- Returns:
- miter limit
- Since:
- 3.5
- See Also:
 
- 
getLineStylepublic abstract int getLineStyle()Returns the line style.- Returns:
- the line style
- See Also:
 
- 
getLineWidthpublic abstract int getLineWidth()Returns the current line width.- Returns:
- the line width
 
- 
getLineWidthFloatpublic abstract float getLineWidthFloat()Returns the current line width.- Returns:
- the line width
- Since:
- 3.5
- See Also:
 
- 
getTextAntialiaspublic int getTextAntialias()Returns the textual anti-aliasing setting value, which will be one ofSWT.DEFAULT,SWT.OFForSWT.ON. Note that this controls anti-aliasing only for text drawing operations.- Returns:
- the anti-aliasing setting
- Since:
- 3.1
- See Also:
 
- 
getXORModepublic abstract boolean getXORMode()Returnstrueif this graphics object should use XOR mode with painting.- Returns:
- whether XOR mode is turned on
 
- 
popStatepublic 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.
- 
pushStatepublic abstract void pushState()Pushes the current state of this graphics object onto a stack.
- 
restoreStatepublic abstract void restoreState()Restores the previous state of this graphics object.
- 
rotatepublic 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
 
- 
scalepublic abstract void scale(double amount) Scales this graphics object by the given amount.- Parameters:
- amount- the scale factor
 
- 
scalepublic void scale(float horizontal, float vertical) Scales the graphics by the given horizontal and vertical components.- Parameters:
- horizontal- the horizontal scaling factor
- vertical- the vertical scaling factor
- Since:
- 3.1
 
- 
setAlphapublic 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
 
- 
setAdvancedpublic void setAdvanced(boolean advanced) Turns advanced graphics mode on or off.- Parameters:
- advanced-
- Since:
- 3.5
 
- 
setAntialiaspublic void setAntialias(int value) Sets the anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT,SWT.OFForSWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.- Parameters:
- value- the anti-alias value
 
- 
setBackgroundColorSets the background color.- Parameters:
- rgb- the new background color
 
- 
setBackgroundPatternSets 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
 
- 
setClipSets the area which can be affected by drawing operations to the specifiedPath.- Parameters:
- path- the clipping path
- Since:
- 3.1
 
- 
setClipSets the clip rectangle. Painting will not occur outside this area.- Parameters:
- r- the new clip rectangle
 
- 
setFillRulepublic void setFillRule(int rule) Sets the fill rule to the given value, which must be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.- Parameters:
- rule- the fill rule
- Since:
- 3.1
 
- 
setFontSets the font.- Parameters:
- f- the new font
 
- 
setForegroundColorSets the foreground color.- Parameters:
- rgb- the new foreground color
 
- 
setForegroundPatternSets 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
 
- 
setInterpolationpublic void setInterpolation(int interpolation) Sets the interpolation setting to the given value, which must be one ofSWT.DEFAULT,SWT.NONE,SWT.LOWorSWT.HIGH. This setting is relevant when working with Images.- Parameters:
- interpolation- the interpolation
- Since:
- 3.1
 
- 
setLineAttributesSets all line attributes together- Parameters:
- attributes- the line attributes
- Since:
- 3.5
 
- 
setLineCappublic 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
 
- 
setLineDashpublic 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
 
- 
setLineDashpublic void setLineDash(float[] value) Sets the dash pattern when the custom line style is in use.- Parameters:
- value- the pixel pattern.
- Since:
- 3.5
 
- 
setLineDashOffsetpublic void setLineDashOffset(float value) Sets the line dash offset.- Parameters:
- value-
- Since:
- 3.8
 
- 
setLineJoinpublic 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
 
- 
setLineStylepublic 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_DASHDOTorSWT.LINE_DASHDOTDOT.- Parameters:
- style- the new style
 
- 
setLineWidthpublic abstract void setLineWidth(int width) Sets the line width.- Parameters:
- width- the new width
 
- 
setLineWidthFloatpublic abstract void setLineWidthFloat(float width) Sets the line width.- Parameters:
- width- the new width
- Since:
- 3.5
 
- 
setLineMiterLimitpublic abstract void setLineMiterLimit(float miterLimit) - Parameters:
- miterLimit-
- Since:
- 3.5
 
- 
setTextAntialiaspublic void setTextAntialias(int value) Sets the textual anti-aliasing value to the parameter, which must be one ofSWT.DEFAULT,SWT.OFForSWT.ON. Note that this controls anti-aliasing only for all text drawing operations.- Parameters:
- value- the textual anti-alias setting
- Since:
- 3.1
 
- 
shearpublic 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 amount
- vert- the vertical shearing amount
- Since:
- 3.1
 
- 
setXORModepublic abstract void setXORMode(boolean b) Sets the XOR mode.- Parameters:
- b- the new XOR mode
 
- 
translatepublic 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 offset
- dy- the vertical offset
 
- 
translatepublic 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 offset
- dy- the vertical offset
 
- 
translate- See Also:
 
 
-