Package org.eclipse.draw2d
Class SWTGraphics
java.lang.Object
org.eclipse.draw2d.Graphics
org.eclipse.draw2d.SWTGraphics
A concrete implementation of 
Graphics using an SWT
 GC. There are 2 states contained in this graphics class -- the
 applied state which is the actual state of the GC and the current state which
 is the current state of this graphics object. Certain properties can be
 changed multiple times and the GC won't be updated until it's actually used.
 WARNING: This class is not intended to be subclassed.
- 
Field SummaryFields inherited from class org.eclipse.draw2d.GraphicsLINE_CUSTOM, LINE_DASH, LINE_DASHDOT, LINE_DASHDOTDOT, LINE_DOT, LINE_SOLID
- 
Constructor SummaryConstructorsConstructorDescriptionSWTGraphics(GC gc) Constructs a new SWTGraphics that draws to the Canvas using the given GC.
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidIf the background color has changed, this change will be pushed to the GC.protected final voidcheckGC()If the rendering hints or the clip region has changed, these changes will be pushed to the GC.protected final voidIf the line width, line style, foreground or background colors have changed, these changes will be pushed to the GC.protected final voidIf the font has changed, this change will be pushed to the GC.voidSimple implementation of clipping a Path within the context of current clipping rectangle for now (not region) Note that this method wipes out the clipping rectangle area, hence if clients need to reset it callrestoreState()voidSets the clip region to the given rectangle.static LineAttributesclone(LineAttributes src) Countermeasure against LineAttributes class not having its own clone() method.static voidcopyLineAttributes(LineAttributes dest, LineAttributes src) Countermeasure against LineAttributes class not having a copy by value function.voiddispose()Disposes this object, releasing any resources.voiddrawArc(int x, int y, int width, int height, int offset, int length) Draws the outline of an arc located at (x,y) with width w and height h.voiddrawFocus(int x, int y, int w, int h) Draws a focus rectangle.voidDraws the given Image at the location (x,y).voidDraws a rectangular section of the given Image to the specified rectangular reagion on the canvas.voiddrawLine(int x1, int y1, int x2, int y2) Draws a line between the points(x1,y1)and(x2,y2)using the foreground color.voiddrawOval(int x, int y, int width, int height) Draws the outline of an ellipse that fits inside the rectangle with the given properties using the foreground color.voidThis method requires advanced graphics support.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.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.voiddrawPolyline(PointList points) Draws a polyline defined by the givenPointListcontaining the vertices.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.voiddrawRoundRectangle(Rectangle r, int arcWidth, int arcHeight) Draws a rectangle with rounded corners using the foreground color.voiddrawString(String s, int x, int y) Draws the given string using the current font and foreground color.voidDraws the given string using the current font and foreground color.voiddrawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) voidfillArc(int x, int y, int width, int height, int offset, int length) Fills the interior of an arc located at (x,y) with width w and height h.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.voidfillOval(int x, int y, int width, int height) Fills an ellipse that fits inside the rectangle with the given properties using the background color.voidThis method requires advanced graphics support.voidfillPolygon(int[] points) Fills a closed polygon defined by the given Integer array containing the vertices in x,y order.voidfillPolygon(PointList points) Fills a closed polygon defined by the givenPointListcontaining the vertices.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.voidfillRoundRectangle(Rectangle r, int arcWidth, int arcHeight) Fills a rectangle with rounded corners using the background color.voidfillString(String s, int x, int y) Draws the given string using the current font and foreground color.voidDraws the given string using the current font and foreground color.booleanintgetAlpha()Returns the current alpha value of the graphics.intReturns the anti-aliasing setting value, which will be one ofSWT.DEFAULT,SWT.OFForSWT.ON.Returns the background color used for filling.Modifies 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.getFont()Returns the font used to draw and fill text.Returns the font metrics for the current font.Returns the foreground color used to draw lines and text.intReturns the interpolation setting.voidgetLineAttributes(LineAttributes lineAttributes) intReturns the current line cap style.float[]floatintReturns the line join style.floatReturns the line miter limit.intReturns the line style.intReturns the current line width.floatReturns the current line width.intReturns the textual anti-aliasing setting value, which will be one ofSWT.DEFAULT,SWT.OFForSWT.ON.booleanReturnstrueif this graphics object should use XOR mode with painting.protected voidinit()Called by constructor, initializes all State information for currentStatevoidpopState()Pops the previous state of this graphics object off the stack (ifGraphics.pushState()has previously been called) and restores the current state to that popped state.voidPushes the current state of this graphics object onto a stack.voidRestores the previous state of this graphics object.protected voidrestoreState(org.eclipse.draw2d.SWTGraphics.State s) Sets all State information to that of the given State, called by restoreState()voidrotate(float degrees) This method requires advanced graphics support.voidscale(double factor) Scales this graphics object by the given amount.voidscale(float horizontal, float vertical) This method requires advanced graphics support.voidsetAdvanced(boolean value) Turns advanced graphics mode on or off.voidsetAlpha(int alpha) This method requires advanced graphics support.voidsetAntialias(int value) This method requires advanced graphics support.voidsetBackgroundColor(Color color) Sets the background color.voidsetBackgroundPattern(Pattern pattern) Sets the pattern used for fill-type graphics operations.voidSets the clip rectangle.voidThis method requires advanced graphics support.voidsetFillRule(int rule) Sets the fill rule to the given value, which must be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.voidSets the font.voidsetForegroundColor(Color color) Sets the foreground color.voidsetForegroundPattern(Pattern pattern) Sets the foreground pattern for draw and text operations.voidsetInterpolation(int interpolation) This method requires advanced graphics support.voidsetLineAttributes(LineAttributes lineAttributes) Sets all line attributes togethervoidsetLineCap(int value) 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[] dashes) Sets the dash pattern when the custom line style is in use.voidsetLineDashOffset(float value) Sets the line dash offset.voidsetLineJoin(int value) Sets the line join style to the argument, which must be one of the constantsSWT.JOIN_MITER,SWT.JOIN_ROUND, orSWT.JOIN_BEVEL.voidsetLineMiterLimit(float value) voidsetLineStyle(int value) 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.voidsetLineWidth(int width) Sets the line width.voidsetLineWidthFloat(float value) Sets the line width.voidsetTextAntialias(int value) This method requires advanced graphics support.voidsetXORMode(boolean xor) Sets the XOR mode.voidshear(float horz, float vert) This method requires advanced graphics support.voidtranslate(float dx, float dy) This method requires advanced graphics support.voidtranslate(int dx, int dy) This method may require advanced graphics support if using a transform, in this case, a check should be made to ensure advanced graphics is supported in the user's environment before calling this method.Methods inherited from class org.eclipse.draw2d.GraphicsdrawArc, drawFocus, drawImage, drawImage, drawLine, drawOval, drawRectangle, drawString, drawText, drawText, drawText, drawTextLayout, fillArc, fillGradient, fillOval, fillRectangle, fillString, fillText, getAbsoluteScale, getLineAttributes, translate
- 
Constructor Details- 
SWTGraphicsConstructs a new SWTGraphics that draws to the Canvas using the given GC.- Parameters:
- gc- the GC
 
 
- 
- 
Method Details- 
checkFillprotected final void checkFill()If the background color has changed, this change will be pushed to the GC. Also callscheckGC().
- 
checkGCprotected final void checkGC()If the rendering hints or the clip region has changed, these changes will be pushed to the GC. Rendering hints include anti-alias, xor, join, cap, line style, fill rule, interpolation, and other settings.
- 
checkPaintprotected final void checkPaint()If the line width, line style, foreground or background colors have changed, these changes will be pushed to the GC. Also callscheckGC().
- 
checkTextprotected final void checkText()If the font has changed, this change will be pushed to the GC. Also callscheckPaint()andcheckFill().
- 
clipRectDescription copied from class:GraphicsSets the clip region to the given rectangle. Anything outside this rectangle will not be drawn.
- 
disposepublic void dispose()Description copied from class:GraphicsDisposes this object, releasing any resources.
- 
drawArcpublic void drawArc(int x, int y, int width, int height, int offset, int length) Description copied from class:GraphicsDraws 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).
- 
drawFocuspublic void drawFocus(int x, int y, int w, int h) Description copied from class:GraphicsDraws a focus rectangle.
- 
drawImageDescription copied from class:GraphicsDraws the given Image at the location (x,y).
- 
drawImagepublic void drawImage(Image srcImage, int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) Description copied from class:GraphicsDraws 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.- Specified by:
- drawImagein class- Graphics
- 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
- See Also:
 
- 
drawLinepublic void drawLine(int x1, int y1, int x2, int y2) Description copied from class:GraphicsDraws a line between the points(x1,y1)and(x2,y2)using the foreground color.
- 
drawOvalpublic void drawOval(int x, int y, int width, int height) Description copied from class:GraphicsDraws the outline of an ellipse that fits inside the rectangle with the given properties using the foreground color.
- 
drawPathThis method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
drawPointpublic void drawPoint(int x, int y) Description copied from class:GraphicsDraws a pixel, using the foreground color, at the specified point (x,y).Note that the current line attributes do not affect this operation. 
- 
drawPolygonpublic void drawPolygon(int[] points) Description copied from class:GraphicsDraws 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.- Overrides:
- drawPolygonin class- Graphics
- Parameters:
- points- the vertices
- See Also:
 
- 
drawPolygonDescription copied from class:GraphicsDraws a closed polygon defined by the givenPointListcontaining the vertices. The first and last points in the list will be connected.- Specified by:
- drawPolygonin class- Graphics
- Parameters:
- points- the vertices
- See Also:
 
- 
drawPolylinepublic void drawPolyline(int[] points) Description copied from class:GraphicsDraws 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.- Overrides:
- drawPolylinein class- Graphics
- Parameters:
- points- the vertices
- See Also:
 
- 
drawPolylineDescription copied from class:GraphicsDraws a polyline defined by the givenPointListcontaining the vertices. The first and last points in the list will not be connected.- Specified by:
- drawPolylinein class- Graphics
- Parameters:
- points- the vertices
- See Also:
 
- 
drawRectanglepublic void drawRectangle(int x, int y, int width, int height) Description copied from class:GraphicsDraws a rectangle whose top-left corner is located at the point (x,y) with the given width and height.- Specified by:
- drawRectanglein class- Graphics
- Parameters:
- x- the x coordinate
- y- the y coordinate
- width- the width
- height- the height
- See Also:
 
- 
drawRoundRectangleDescription copied from class:GraphicsDraws a rectangle with rounded corners using the foreground color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.- Specified by:
- drawRoundRectanglein class- Graphics
- Parameters:
- r- the rectangle
- arcWidth- the arc width
- arcHeight- the arc height
- See Also:
 
- 
drawStringDescription copied from class:GraphicsDraws 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.- Specified by:
- drawStringin class- Graphics
- Parameters:
- s- the string
- x- the x coordinate
- y- the y coordinate
- See Also:
 
- 
drawTextDescription copied from class:GraphicsDraws 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.
- 
drawTextLayoutpublic void drawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) - Overrides:
- drawTextLayoutin class- Graphics
- 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 void fillArc(int x, int y, int width, int height, int offset, int length) Description copied from class:GraphicsFills 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).
- 
fillGradientpublic void fillGradient(int x, int y, int w, int h, boolean vertical) Description copied from class:GraphicsFills 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.- Specified by:
- fillGradientin class- Graphics
- Parameters:
- x- the x coordinate
- y- the y coordinate
- w- the width
- h- the height
- vertical- whether the gradient should be vertical
- See Also:
 
- 
fillOvalpublic void fillOval(int x, int y, int width, int height) Description copied from class:GraphicsFills an ellipse that fits inside the rectangle with the given properties using the background color.
- 
fillPathThis method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
fillPolygonpublic void fillPolygon(int[] points) Description copied from class:GraphicsFills 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.- Overrides:
- fillPolygonin class- Graphics
- Parameters:
- points- the vertices
- See Also:
 
- 
fillPolygonDescription copied from class:GraphicsFills a closed polygon defined by the givenPointListcontaining the vertices. The first and last points in the list will be connected.- Specified by:
- fillPolygonin class- Graphics
- Parameters:
- points- the vertices
- See Also:
 
- 
fillRectanglepublic void fillRectangle(int x, int y, int width, int height) Description copied from class:GraphicsFills a rectangle whose top-left corner is located at the point (x,y) with the given width and height.- Specified by:
- fillRectanglein class- Graphics
- Parameters:
- x- the x coordinate
- y- the y coordinate
- width- the width
- height- the height
- See Also:
 
- 
fillRoundRectangleDescription copied from class:GraphicsFills a rectangle with rounded corners using the background color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.- Specified by:
- fillRoundRectanglein class- Graphics
- Parameters:
- r- the rectangle
- arcWidth- the arc width
- arcHeight- the arc height
- See Also:
 
- 
fillStringDescription copied from class:GraphicsDraws 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.- Specified by:
- fillStringin class- Graphics
- Parameters:
- s- the string
- x- the x coordinate
- y- the y coordinate
- See Also:
 
- 
fillTextDescription copied from class:GraphicsDraws 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.
- 
getAlphapublic int getAlpha()Description copied from class:GraphicsReturns the current alpha value of the graphics.
- 
getAntialiaspublic int getAntialias()Description copied from class:GraphicsReturns 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.- Overrides:
- getAntialiasin class- Graphics
- Returns:
- the anti-alias setting
- See Also:
 
- 
getAdvancedpublic boolean getAdvanced()- Overrides:
- getAdvancedin class- Graphics
- Returns:
- true if the underlying graphics device is using advanced graphics mode.
 
- 
getBackgroundColorDescription copied from class:GraphicsReturns the background color used for filling.- Specified by:
- getBackgroundColorin class- Graphics
- Returns:
- the background color
- See Also:
 
- 
getClipDescription copied from class:GraphicsModifies the given rectangle to match the clip region and returns that rectangle.
- 
getFillRulepublic int getFillRule()Description copied from class:GraphicsReturns the fill rule, which will be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.- Overrides:
- getFillRulein class- Graphics
- Returns:
- the fill rule
- See Also:
 
- 
getFontDescription copied from class:GraphicsReturns the font used to draw and fill text.
- 
getFontMetricsDescription copied from class:GraphicsReturns the font metrics for the current font.- Specified by:
- getFontMetricsin class- Graphics
- Returns:
- the font metrics
- See Also:
 
- 
getForegroundColorDescription copied from class:GraphicsReturns the foreground color used to draw lines and text.- Specified by:
- getForegroundColorin class- Graphics
- Returns:
- the foreground color
- See Also:
 
- 
getInterpolationpublic int getInterpolation()Description copied from class:GraphicsReturns the interpolation setting.- Overrides:
- getInterpolationin class- Graphics
- Returns:
- the interpolation setting
- See Also:
 
- 
getLineAttributes- Since:
- 3.5
 
- 
getLineCappublic int getLineCap()Description copied from class:GraphicsReturns the current line cap style.- Overrides:
- getLineCapin class- Graphics
- Returns:
- the cap style used for drawing lines
- See Also:
 
- 
getLineJoinpublic int getLineJoin()Description copied from class:GraphicsReturns the line join style.- Overrides:
- getLineJoinin class- Graphics
- Returns:
- the join style used for drawing lines
- See Also:
 
- 
getLineStylepublic int getLineStyle()Description copied from class:GraphicsReturns the line style.- Specified by:
- getLineStylein class- Graphics
- Returns:
- the line style
- See Also:
 
- 
getLineWidthpublic int getLineWidth()Description copied from class:GraphicsReturns the current line width.- Specified by:
- getLineWidthin class- Graphics
- Returns:
- the line width
- See Also:
 
- 
getLineWidthFloatpublic float getLineWidthFloat()Description copied from class:GraphicsReturns the current line width.- Specified by:
- getLineWidthFloatin class- Graphics
- Returns:
- the line width
- See Also:
 
- 
getLineMiterLimitpublic float getLineMiterLimit()Description copied from class:GraphicsReturns the line miter limit.- Overrides:
- getLineMiterLimitin class- Graphics
- Returns:
- miter limit
- See Also:
 
- 
getLineDashpublic float[] getLineDash()- Since:
- 3.5
 
- 
getLineDashOffsetpublic float getLineDashOffset()- Since:
- 3.5
 
- 
getTextAntialiaspublic int getTextAntialias()Description copied from class:GraphicsReturns 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.- Overrides:
- getTextAntialiasin class- Graphics
- Returns:
- the anti-aliasing setting
- See Also:
 
- 
getXORModepublic boolean getXORMode()Description copied from class:GraphicsReturnstrueif this graphics object should use XOR mode with painting.- Specified by:
- getXORModein class- Graphics
- Returns:
- whether XOR mode is turned on
- See Also:
 
- 
initprotected void init()Called by constructor, initializes all State information for currentState
- 
popStatepublic void popState()Description copied from class:GraphicsPops the previous state of this graphics object off the stack (ifGraphics.pushState()has previously been called) and restores the current state to that popped state.
- 
pushStatepublic void pushState()Description copied from class:GraphicsPushes the current state of this graphics object onto a stack.
- 
restoreStatepublic void restoreState()Description copied from class:GraphicsRestores the previous state of this graphics object.- Specified by:
- restoreStatein class- Graphics
- See Also:
 
- 
restoreStateprotected void restoreState(org.eclipse.draw2d.SWTGraphics.State s) Sets all State information to that of the given State, called by restoreState()- Parameters:
- s- the State
 
- 
rotatepublic void rotate(float degrees) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
scalepublic void scale(double factor) Description copied from class:GraphicsScales this graphics object by the given amount.
- 
scalepublic void scale(float horizontal, float vertical) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
setAlphapublic void setAlpha(int alpha) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
setAntialiaspublic void setAntialias(int value) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().- Overrides:
- setAntialiasin class- Graphics
- Parameters:
- value- the anti-alias value
- See Also:
 
- 
setAdvancedpublic void setAdvanced(boolean value) Description copied from class:GraphicsTurns advanced graphics mode on or off.- Overrides:
- setAdvancedin class- Graphics
- Parameters:
- value-
 
- 
setBackgroundColorDescription copied from class:GraphicsSets the background color.- Specified by:
- setBackgroundColorin class- Graphics
- Parameters:
- color- the new background color
- See Also:
 
- 
setBackgroundPatternDescription copied from class:GraphicsSets the pattern used for fill-type graphics operations. The pattern must not be disposed while it is being used by the graphics.- Overrides:
- setBackgroundPatternin class- Graphics
- Parameters:
- pattern- the background pattern
- See Also:
 
- 
setClipThis method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
clipPathSimple implementation of clipping a Path within the context of current clipping rectangle for now (not region)- Note that this method wipes out the clipping rectangle area, hence if
 clients need to reset it call restoreState()
 
- Note that this method wipes out the clipping rectangle area, hence if
 clients need to reset it call 
- 
setClipDescription copied from class:GraphicsSets the clip rectangle. Painting will not occur outside this area.
- 
setFillRulepublic void setFillRule(int rule) Description copied from class:GraphicsSets the fill rule to the given value, which must be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.- Overrides:
- setFillRulein class- Graphics
- Parameters:
- rule- the fill rule
- See Also:
 
- 
setFontDescription copied from class:GraphicsSets the font.
- 
setForegroundColorDescription copied from class:GraphicsSets the foreground color.- Specified by:
- setForegroundColorin class- Graphics
- Parameters:
- color- the new foreground color
- See Also:
 
- 
setForegroundPatternDescription copied from class:GraphicsSets the foreground pattern for draw and text operations. The pattern must not be disposed while it is being referenced by the graphics.- Overrides:
- setForegroundPatternin class- Graphics
- Parameters:
- pattern- the foreground pattern
- See Also:
 
- 
setInterpolationpublic void setInterpolation(int interpolation) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().- Overrides:
- setInterpolationin class- Graphics
- Parameters:
- interpolation- the interpolation
- See Also:
 
- 
setLineAttributesDescription copied from class:GraphicsSets all line attributes together- Overrides:
- setLineAttributesin class- Graphics
- Parameters:
- lineAttributes- the line attributes
 
- 
setLineCappublic void setLineCap(int value) Description copied from class:GraphicsSets the line cap style to the argument, which must be one of the constantsSWT.CAP_FLAT,SWT.CAP_ROUND, orSWT.CAP_SQUARE.- Overrides:
- setLineCapin class- Graphics
- Parameters:
- value- the line cap
- See Also:
 
- 
setLineDashpublic void setLineDash(int[] dashes) Description copied from class:GraphicsSets 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 callingGraphics.pushState()andGraphics.popState().- Overrides:
- setLineDashin class- Graphics
- Parameters:
- dashes- the pixel pattern
- See Also:
 
- 
setLineDashpublic void setLineDash(float[] value) Description copied from class:GraphicsSets the dash pattern when the custom line style is in use.- Overrides:
- setLineDashin class- Graphics
- Parameters:
- value-
- Since:
- 3.5
 
- 
setLineDashOffsetpublic void setLineDashOffset(float value) Description copied from class:GraphicsSets the line dash offset.- Overrides:
- setLineDashOffsetin class- Graphics
- Parameters:
- value-
- Since:
- 3.5
 
- 
setLineJoinpublic void setLineJoin(int value) Description copied from class:GraphicsSets the line join style to the argument, which must be one of the constantsSWT.JOIN_MITER,SWT.JOIN_ROUND, orSWT.JOIN_BEVEL.- Overrides:
- setLineJoinin class- Graphics
- Parameters:
- value- the join type
- See Also:
 
- 
setLineStylepublic void setLineStyle(int value) Description copied from class:GraphicsSets 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.- Specified by:
- setLineStylein class- Graphics
- Parameters:
- value- the new style
- See Also:
 
- 
setLineWidthpublic void setLineWidth(int width) Description copied from class:GraphicsSets the line width.- Specified by:
- setLineWidthin class- Graphics
- Parameters:
- width- the new width
- See Also:
 
- 
setLineWidthFloatpublic void setLineWidthFloat(float value) Description copied from class:GraphicsSets the line width.- Specified by:
- setLineWidthFloatin class- Graphics
- Parameters:
- value- the new width
 
- 
setLineMiterLimitpublic void setLineMiterLimit(float value) - Specified by:
- setLineMiterLimitin class- Graphics
- Parameters:
- value-
 
- 
setTextAntialiaspublic void setTextAntialias(int value) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().- Overrides:
- setTextAntialiasin class- Graphics
- Parameters:
- value- the textual anti-alias setting
- See Also:
 
- 
setXORModepublic void setXORMode(boolean xor) Description copied from class:GraphicsSets the XOR mode.- Specified by:
- setXORModein class- Graphics
- Parameters:
- xor- the new XOR mode
- See Also:
 
- 
shearpublic void shear(float horz, float vert) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
translatepublic void translate(int dx, int dy) This method may require advanced graphics support if using a transform, in this case, a check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
translatepublic void translate(float dx, float dy) This method requires advanced graphics support. A check should be made to ensure advanced graphics is supported in the user's environment before calling this method. SeeGC.getAdvanced().
- 
cloneCountermeasure against LineAttributes class not having its own clone() method.- Since:
- 3.6
 
- 
copyLineAttributesCountermeasure against LineAttributes class not having a copy by value function.- Since:
- 3.6
 
 
-