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 Summary
Fields inherited from class org.eclipse.draw2d.Graphics
LINE_CUSTOM, LINE_DASH, LINE_DASHDOT, LINE_DASHDOTDOT, LINE_DOT, LINE_SOLID -
Constructor Summary
ConstructorsConstructorDescriptionSWTGraphics(GC gc) Constructs a new SWTGraphics that draws to the Canvas using the given GC. -
Method Summary
Modifier 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.Graphics
drawArc, drawFocus, drawImage, drawImage, drawLine, drawOval, drawRectangle, drawString, drawText, drawText, drawText, drawTextLayout, fillArc, fillGradient, fillOval, fillRectangle, fillString, fillText, getAbsoluteScale, getLineAttributes, translate
-
Constructor Details
-
SWTGraphics
Constructs a new SWTGraphics that draws to the Canvas using the given GC.- Parameters:
gc- the GC
-
-
Method Details
-
checkFill
protected final void checkFill()If the background color has changed, this change will be pushed to the GC. Also callscheckGC(). -
checkGC
protected 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. -
checkPaint
protected 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(). -
checkText
protected final void checkText()If the font has changed, this change will be pushed to the GC. Also callscheckPaint()andcheckFill(). -
clipRect
Description copied from class:GraphicsSets the clip region to the given rectangle. Anything outside this rectangle will not be drawn. -
dispose
public void dispose()Description copied from class:GraphicsDisposes this object, releasing any resources. -
drawArc
public 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). -
drawFocus
public void drawFocus(int x, int y, int w, int h) Description copied from class:GraphicsDraws a focus rectangle. -
drawImage
Description copied from class:GraphicsDraws the given Image at the location (x,y). -
drawImage
public 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 classGraphics- 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- See Also:
-
drawLine
public 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. -
drawOval
public 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. -
drawPath
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(). -
drawPoint
public 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.
-
drawPolygon
public 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 classGraphics- Parameters:
points- the vertices- See Also:
-
drawPolygon
Description 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 classGraphics- Parameters:
points- the vertices- See Also:
-
drawPolyline
public 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 classGraphics- Parameters:
points- the vertices- See Also:
-
drawPolyline
Description 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 classGraphics- Parameters:
points- the vertices- See Also:
-
drawRectangle
public 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 classGraphics- Parameters:
x- the x coordinatey- the y coordinatewidth- the widthheight- the height- See Also:
-
drawRoundRectangle
Description 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 classGraphics- Parameters:
r- the rectanglearcWidth- the arc widtharcHeight- the arc height- See Also:
-
drawString
Description 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 classGraphics- Parameters:
s- the stringx- the x coordinatey- the y coordinate- See Also:
-
drawText
Description 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. -
drawTextLayout
public void drawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) - Overrides:
drawTextLayoutin classGraphics- Parameters:
layout- the TextLayout being renderedx- the x locationy- the y locationselectionStart- the start of selectionselectionEnd- the end of selectionselectionForeground- the foreground selection colorselectionBackground- the background selection color- See Also:
-
fillArc
public 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). -
fillGradient
public 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 classGraphics- Parameters:
x- the x coordinatey- the y coordinatew- the widthh- the heightvertical- whether the gradient should be vertical- See Also:
-
fillOval
public 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. -
fillPath
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(). -
fillPolygon
public 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 classGraphics- Parameters:
points- the vertices- See Also:
-
fillPolygon
Description 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 classGraphics- Parameters:
points- the vertices- See Also:
-
fillRectangle
public 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 classGraphics- Parameters:
x- the x coordinatey- the y coordinatewidth- the widthheight- the height- See Also:
-
fillRoundRectangle
Description 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 classGraphics- Parameters:
r- the rectanglearcWidth- the arc widtharcHeight- the arc height- See Also:
-
fillString
Description 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 classGraphics- Parameters:
s- the stringx- the x coordinatey- the y coordinate- See Also:
-
fillText
Description 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. -
getAlpha
public int getAlpha()Description copied from class:GraphicsReturns the current alpha value of the graphics. -
getAntialias
public 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 classGraphics- Returns:
- the anti-alias setting
- See Also:
-
getAdvanced
public boolean getAdvanced()- Overrides:
getAdvancedin classGraphics- Returns:
- true if the underlying graphics device is using advanced graphics mode.
-
getBackgroundColor
Description copied from class:GraphicsReturns the background color used for filling.- Specified by:
getBackgroundColorin classGraphics- Returns:
- the background color
- See Also:
-
getClip
Description copied from class:GraphicsModifies the given rectangle to match the clip region and returns that rectangle. -
getFillRule
public int getFillRule()Description copied from class:GraphicsReturns the fill rule, which will be one ofSWT.FILL_EVEN_ODDorSWT.FILL_WINDING.- Overrides:
getFillRulein classGraphics- Returns:
- the fill rule
- See Also:
-
getFont
Description copied from class:GraphicsReturns the font used to draw and fill text. -
getFontMetrics
Description copied from class:GraphicsReturns the font metrics for the current font.- Specified by:
getFontMetricsin classGraphics- Returns:
- the font metrics
- See Also:
-
getForegroundColor
Description copied from class:GraphicsReturns the foreground color used to draw lines and text.- Specified by:
getForegroundColorin classGraphics- Returns:
- the foreground color
- See Also:
-
getInterpolation
public int getInterpolation()Description copied from class:GraphicsReturns the interpolation setting.- Overrides:
getInterpolationin classGraphics- Returns:
- the interpolation setting
- See Also:
-
getLineAttributes
- Since:
- 3.5
-
getLineCap
public int getLineCap()Description copied from class:GraphicsReturns the current line cap style.- Overrides:
getLineCapin classGraphics- Returns:
- the cap style used for drawing lines
- See Also:
-
getLineJoin
public int getLineJoin()Description copied from class:GraphicsReturns the line join style.- Overrides:
getLineJoinin classGraphics- Returns:
- the join style used for drawing lines
- See Also:
-
getLineStyle
public int getLineStyle()Description copied from class:GraphicsReturns the line style.- Specified by:
getLineStylein classGraphics- Returns:
- the line style
- See Also:
-
getLineWidth
public int getLineWidth()Description copied from class:GraphicsReturns the current line width.- Specified by:
getLineWidthin classGraphics- Returns:
- the line width
- See Also:
-
getLineWidthFloat
public float getLineWidthFloat()Description copied from class:GraphicsReturns the current line width.- Specified by:
getLineWidthFloatin classGraphics- Returns:
- the line width
- See Also:
-
getLineMiterLimit
public float getLineMiterLimit()Description copied from class:GraphicsReturns the line miter limit.- Overrides:
getLineMiterLimitin classGraphics- Returns:
- miter limit
- See Also:
-
getLineDash
public float[] getLineDash()- Since:
- 3.5
-
getLineDashOffset
public float getLineDashOffset()- Since:
- 3.5
-
getTextAntialias
public 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 classGraphics- Returns:
- the anti-aliasing setting
- See Also:
-
getXORMode
public boolean getXORMode()Description copied from class:GraphicsReturnstrueif this graphics object should use XOR mode with painting.- Specified by:
getXORModein classGraphics- Returns:
- whether XOR mode is turned on
- See Also:
-
init
protected void init()Called by constructor, initializes all State information for currentState -
popState
public 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. -
pushState
public void pushState()Description copied from class:GraphicsPushes the current state of this graphics object onto a stack. -
restoreState
public void restoreState()Description copied from class:GraphicsRestores the previous state of this graphics object.- Specified by:
restoreStatein classGraphics- See Also:
-
restoreState
protected 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
-
rotate
public 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(). -
scale
public void scale(double factor) Description copied from class:GraphicsScales this graphics object by the given amount. -
scale
public 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(). -
setAlpha
public 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(). -
setAntialias
public 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 classGraphics- Parameters:
value- the anti-alias value- See Also:
-
setAdvanced
public void setAdvanced(boolean value) Description copied from class:GraphicsTurns advanced graphics mode on or off.- Overrides:
setAdvancedin classGraphics- Parameters:
value-
-
setBackgroundColor
Description copied from class:GraphicsSets the background color.- Specified by:
setBackgroundColorin classGraphics- Parameters:
color- the new background color- See Also:
-
setBackgroundPattern
Description 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 classGraphics- Parameters:
pattern- the background pattern- See Also:
-
setClip
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(). -
clipPath
Simple 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
-
setClip
Description copied from class:GraphicsSets the clip rectangle. Painting will not occur outside this area. -
setFillRule
public 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 classGraphics- Parameters:
rule- the fill rule- See Also:
-
setFont
Description copied from class:GraphicsSets the font. -
setForegroundColor
Description copied from class:GraphicsSets the foreground color.- Specified by:
setForegroundColorin classGraphics- Parameters:
color- the new foreground color- See Also:
-
setForegroundPattern
Description 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 classGraphics- Parameters:
pattern- the foreground pattern- See Also:
-
setInterpolation
public 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 classGraphics- Parameters:
interpolation- the interpolation- See Also:
-
setLineAttributes
Description copied from class:GraphicsSets all line attributes together- Overrides:
setLineAttributesin classGraphics- Parameters:
lineAttributes- the line attributes
-
setLineCap
public 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 classGraphics- Parameters:
value- the line cap- See Also:
-
setLineDash
public 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 classGraphics- Parameters:
dashes- the pixel pattern- See Also:
-
setLineDash
public void setLineDash(float[] value) Description copied from class:GraphicsSets the dash pattern when the custom line style is in use.- Overrides:
setLineDashin classGraphics- Parameters:
value-- Since:
- 3.5
-
setLineDashOffset
public void setLineDashOffset(float value) Description copied from class:GraphicsSets the line dash offset.- Overrides:
setLineDashOffsetin classGraphics- Parameters:
value-- Since:
- 3.5
-
setLineJoin
public 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 classGraphics- Parameters:
value- the join type- See Also:
-
setLineStyle
public 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 classGraphics- Parameters:
value- the new style- See Also:
-
setLineWidth
public void setLineWidth(int width) Description copied from class:GraphicsSets the line width.- Specified by:
setLineWidthin classGraphics- Parameters:
width- the new width- See Also:
-
setLineWidthFloat
public void setLineWidthFloat(float value) Description copied from class:GraphicsSets the line width.- Specified by:
setLineWidthFloatin classGraphics- Parameters:
value- the new width
-
setLineMiterLimit
public void setLineMiterLimit(float value) - Specified by:
setLineMiterLimitin classGraphics- Parameters:
value-
-
setTextAntialias
public 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 classGraphics- Parameters:
value- the textual anti-alias setting- See Also:
-
setXORMode
public void setXORMode(boolean xor) Description copied from class:GraphicsSets the XOR mode.- Specified by:
setXORModein classGraphics- Parameters:
xor- the new XOR mode- See Also:
-
shear
public 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(). -
translate
public 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(). -
translate
public 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(). -
clone
Countermeasure against LineAttributes class not having its own clone() method.- Since:
- 3.6
-
copyLineAttributes
Countermeasure against LineAttributes class not having a copy by value function.- Since:
- 3.6
-