Class ScaledGraphics

java.lang.Object
org.eclipse.draw2d.Graphics
org.eclipse.draw2d.ScaledGraphics
Direct Known Subclasses:
PrinterGraphics

public class ScaledGraphics extends Graphics
A Graphics object able to scale all operations based on the current scale factor.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    The internal state of the scaled graphics.
  • Field Summary

    Fields inherited from class org.eclipse.draw2d.Graphics

    LINE_CUSTOM, LINE_DASH, LINE_DASHDOT, LINE_DASHDOTDOT, LINE_DOT, LINE_SOLID
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new ScaledGraphics based on the given Graphics object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clipPath(Path path)
    Sets the clip region to the given rectangle.
    void
    Sets the clip region to the given rectangle.
    void
    Disposes this object, releasing any resources.
    void
    drawArc(int x, int y, int w, int h, int offset, int sweep)
    Draws the outline of an arc located at (x,y) with width w and height h.
    void
    drawFocus(int x, int y, int w, int h)
    Draws a focus rectangle.
    void
    drawImage(Image srcImage, int x, int y)
    Draws the given Image at the location (x,y).
    void
    drawImage(Image srcImage, int sx, int sy, int sw, int sh, int tx, int ty, int tw, int th)
    Draws a rectangular section of the given Image to the specified rectangular reagion on the canvas.
    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.
    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.
    void
    drawPath(Path path)
    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.
    void
    Draws a closed polygon defined by the given PointList containing the vertices.
    void
    drawPolyline(int[] points)
    Draws a polyline defined by the given Integer array containing the vertices in x,y order.
    void
    Draws a polyline defined by the given PointList containing the vertices.
    void
    drawRectangle(int x, int y, int w, int h)
    Draws a rectangle whose top-left corner is located at the point (x,y) with the given width and height.
    void
    drawRoundRectangle(Rectangle r, int arcWidth, int arcHeight)
    Draws a rectangle with rounded corners using the foreground color.
    void
    drawString(String s, int x, int y)
    Draws the given string using the current font and foreground color.
    void
    drawText(String s, int x, int y)
    Draws the given string using the current font and foreground color.
    void
    drawText(String s, int x, int y, int style)
    Draws a string using the specified styles.
    void
    drawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground)
     
    void
    fillArc(int x, int y, int w, int h, int offset, int sweep)
    Fills the interior of an arc located at (x,y) with width w and height h.
    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.
    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.
    void
    fillPath(Path path)
    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.
    void
    Fills a closed polygon defined by the given PointList containing the vertices.
    void
    fillRectangle(int x, int y, int w, int h)
    Fills a rectangle whose top-left corner is located at the point (x,y) with the given width and height.
    void
    fillRoundRectangle(Rectangle r, int arcWidth, int arcHeight)
    Fills a rectangle with rounded corners using the background color.
    void
    fillString(String s, int x, int y)
    Draws the given string using the current font and foreground color.
    void
    fillText(String s, int x, int y)
    Draws the given string using the current font and foreground color.
    double
    Returns the current absolute scaling which will be applied to the underlying Device when painting to this Graphics.
    boolean
     
    int
    Returns the current alpha value of the graphics.
    int
    Returns the anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON.
    Returns the background color used for filling.
    Modifies the given rectangle to match the clip region and returns that rectangle.
    int
    Returns the fill rule, which will be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.
    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.
    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.
    int
    Returns the line style.
    int
    Returns the current line width.
    float
    Returns the current line width.
    int
    Returns the textual anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON.
    boolean
    Returns true if this graphics object should use XOR mode with painting.
    void
    Pops the previous state of this graphics object off the stack (if Graphics.pushState() has previously been called) and restores the current state to that popped state.
    void
    Pushes the current state of this graphics object onto a stack.
    void
    Restores the previous state of this graphics object.
    void
    rotate(float degrees)
    Rotates the coordinates by the given counter-clockwise angle.
    void
    scale(double amount)
    Scales this graphics object by the given amount.
    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 of SWT.DEFAULT, SWT.OFF or SWT.ON.
    void
    Sets the background color.
    void
    Sets the pattern used for fill-type graphics operations.
    void
    Sets the clip rectangle.
    void
    setClip(Path path)
    Sets the area which can be affected by drawing operations to the specified Path.
    void
    setFillRule(int rule)
    Sets the fill rule to the given value, which must be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.
    void
    Sets the font.
    void
    Sets the foreground color.
    void
    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 of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH.
    void
    Sets all line attributes together
    void
    setLineCap(int cap)
    Sets the line cap style to the argument, which must be one of the constants SWT.CAP_FLAT, SWT.CAP_ROUND, or SWT.CAP_SQUARE.
    void
    setLineDash(float[] dash)
    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 constants SWT.JOIN_MITER, SWT.JOIN_ROUND, or SWT.JOIN_BEVEL.
    void
    setLineMiterLimit(float value)
     
    void
    setLineStyle(int style)
    Sets the line style to the argument, which must be one of the constants SWT.LINE_SOLID, SWT.LINE_DASH, SWT.LINE_DOT, SWT.LINE_DASHDOT or SWT.LINE_DASHDOTDOT.
    void
    setLineWidth(int width)
    Sets the line width.
    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 of SWT.DEFAULT, SWT.OFF or SWT.ON.
    void
    setXORMode(boolean b)
    Sets the XOR mode.
    void
    translate(float dx, float dy)
    Modifies the current transform by translating the given x and y amounts.
    void
    translate(int dx, int dy)
    Translates the receiver's coordinates by the specified x and y amounts.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScaledGraphics

      public ScaledGraphics(Graphics g)
      Constructs a new ScaledGraphics based on the given Graphics object.
      Parameters:
      g - the base graphics object
  • Method Details

    • clipRect

      public void clipRect(Rectangle r)
      Description copied from class: Graphics
      Sets the clip region to the given rectangle. Anything outside this rectangle will not be drawn.
      Specified by:
      clipRect in class Graphics
      Parameters:
      r - the clip rectangle
      See Also:
    • dispose

      public void dispose()
      Description copied from class: Graphics
      Disposes this object, releasing any resources.
      Specified by:
      dispose in class Graphics
      See Also:
    • drawArc

      public void drawArc(int x, int y, int w, int h, int offset, int sweep)
      Description copied from class: Graphics
      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).
      Specified by:
      drawArc in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      offset - the start angle
      sweep - the length of the arc
      See Also:
    • drawFocus

      public void drawFocus(int x, int y, int w, int h)
      Description copied from class: Graphics
      Draws a focus rectangle.
      Specified by:
      drawFocus in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      See Also:
    • drawImage

      public void drawImage(Image srcImage, int x, int y)
      Description copied from class: Graphics
      Draws the given Image at the location (x,y).
      Specified by:
      drawImage in class Graphics
      Parameters:
      srcImage - the Image
      x - the x coordinate
      y - the y coordinate
      See Also:
    • drawImage

      public void drawImage(Image srcImage, int sx, int sy, int sw, int sh, int tx, int ty, int tw, int th)
      Description copied from class: Graphics
      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.
      Specified by:
      drawImage in class Graphics
      Parameters:
      srcImage - the image
      sx - the x coordinate of the source
      sy - the y coordinate of the source
      sw - the width of the source
      sh - the height of the source
      tx - the x coordinate of the destination
      ty - the y coordinate of the destination
      tw - the width of the destination
      th - the height of the destination
      See Also:
    • drawLine

      public void drawLine(int x1, int y1, int x2, int y2)
      Description copied from class: Graphics
      Draws a line between the points (x1,y1) and (x2,y2) using the foreground color.
      Specified by:
      drawLine in class Graphics
      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
      See Also:
    • drawOval

      public void drawOval(int x, int y, int w, int h)
      Description copied from class: Graphics
      Draws the outline of an ellipse that fits inside the rectangle with the given properties using the foreground color.
      Specified by:
      drawOval in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      See Also:
    • drawPath

      public void drawPath(Path path)
      Description copied from class: Graphics
      Draws the given path.
      Overrides:
      drawPath in class Graphics
      Parameters:
      path - the path to draw
      See Also:
    • drawPoint

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

      Note that the current line attributes do not affect this operation.

      Overrides:
      drawPoint in class Graphics
      Parameters:
      x - the point's x coordinate
      y - the point's y coordinate
      See Also:
    • drawPolygon

      public void drawPolygon(int[] points)
      Description copied from class: Graphics
      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.
      Overrides:
      drawPolygon in class Graphics
      Parameters:
      points - the vertices
      See Also:
    • drawPolygon

      public void drawPolygon(PointList points)
      Description copied from class: Graphics
      Draws a closed polygon defined by the given PointList containing the vertices. The first and last points in the list will be connected.
      Specified by:
      drawPolygon in class Graphics
      Parameters:
      points - the vertices
      See Also:
    • drawPolyline

      public void drawPolyline(int[] points)
      Description copied from class: Graphics
      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.
      Overrides:
      drawPolyline in class Graphics
      Parameters:
      points - the vertices
      See Also:
    • drawPolyline

      public void drawPolyline(PointList points)
      Description copied from class: Graphics
      Draws a polyline defined by the given PointList containing the vertices. The first and last points in the list will not be connected.
      Specified by:
      drawPolyline in class Graphics
      Parameters:
      points - the vertices
      See Also:
    • drawRectangle

      public void drawRectangle(int x, int y, int w, int h)
      Description copied from class: Graphics
      Draws a rectangle whose top-left corner is located at the point (x,y) with the given width and height.
      Specified by:
      drawRectangle in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      See Also:
    • drawRoundRectangle

      public void drawRoundRectangle(Rectangle r, int arcWidth, int arcHeight)
      Description copied from class: Graphics
      Draws a rectangle with rounded corners using the foreground color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.
      Specified by:
      drawRoundRectangle in class Graphics
      Parameters:
      r - the rectangle
      arcWidth - the arc width
      arcHeight - the arc height
      See Also:
    • drawString

      public void drawString(String s, int x, int y)
      Description copied from class: Graphics
      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.
      Specified by:
      drawString in class Graphics
      Parameters:
      s - the string
      x - the x coordinate
      y - the y coordinate
      See Also:
    • drawText

      public void drawText(String s, int x, int y)
      Description copied from class: Graphics
      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.
      Specified by:
      drawText in class Graphics
      Parameters:
      s - the text
      x - the x coordinate
      y - the y coordinate
      See Also:
    • drawText

      public void drawText(String s, int x, int y, int style)
      Description copied from class: Graphics
      Draws a string using the specified styles. The styles are defined by GC.drawText(String, int, int, int).
      Overrides:
      drawText in class Graphics
      Parameters:
      s - the String to draw
      x - the x location
      y - the y location
      style - the styles used to render the string
      See Also:
    • drawTextLayout

      public void drawTextLayout(TextLayout layout, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground)
      Overrides:
      drawTextLayout in 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:
    • fillArc

      public void fillArc(int x, int y, int w, int h, int offset, int sweep)
      Description copied from class: Graphics
      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).
      Specified by:
      fillArc in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      offset - the start angle
      sweep - the length of the arc
      See Also:
    • fillGradient

      public void fillGradient(int x, int y, int w, int h, boolean vertical)
      Description copied from class: Graphics
      Fills the the given rectangle with a gradient from the foreground color to the background color. If vertical is true, the gradient will go from top to bottom. Otherwise, it will go from left to right. background color.
      Specified by:
      fillGradient in 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:
    • fillOval

      public void fillOval(int x, int y, int w, int h)
      Description copied from class: Graphics
      Fills an ellipse that fits inside the rectangle with the given properties using the background color.
      Specified by:
      fillOval in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      See Also:
    • fillPath

      public void fillPath(Path path)
      Description copied from class: Graphics
      Fills the given path.
      Overrides:
      fillPath in class Graphics
      Parameters:
      path - the path to fill
      See Also:
    • fillPolygon

      public void fillPolygon(int[] points)
      Description copied from class: Graphics
      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.
      Overrides:
      fillPolygon in class Graphics
      Parameters:
      points - the vertices
      See Also:
    • fillPolygon

      public void fillPolygon(PointList points)
      Description copied from class: Graphics
      Fills a closed polygon defined by the given PointList containing the vertices. The first and last points in the list will be connected.
      Specified by:
      fillPolygon in class Graphics
      Parameters:
      points - the vertices
      See Also:
    • fillRectangle

      public void fillRectangle(int x, int y, int w, int h)
      Description copied from class: Graphics
      Fills a rectangle whose top-left corner is located at the point (x,y) with the given width and height.
      Specified by:
      fillRectangle in class Graphics
      Parameters:
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      See Also:
    • fillRoundRectangle

      public void fillRoundRectangle(Rectangle r, int arcWidth, int arcHeight)
      Description copied from class: Graphics
      Fills a rectangle with rounded corners using the background color. arcWidth and arcHeight represent the horizontal and vertical diameter of the corners.
      Specified by:
      fillRoundRectangle in class Graphics
      Parameters:
      r - the rectangle
      arcWidth - the arc width
      arcHeight - the arc height
      See Also:
    • fillString

      public void fillString(String s, int x, int y)
      Description copied from class: Graphics
      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.
      Specified by:
      fillString in class Graphics
      Parameters:
      s - the string
      x - the x coordinate
      y - the y coordinate
      See Also:
    • fillText

      public void fillText(String s, int x, int y)
      Description copied from class: Graphics
      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.
      Specified by:
      fillText in class Graphics
      Parameters:
      s - the text
      x - the x coordinate
      y - the y coordinate
      See Also:
    • getAbsoluteScale

      public double getAbsoluteScale()
      Description copied from class: Graphics
      Returns the current absolute scaling which will be applied to the underlying Device when painting to this Graphics. The default value is 1.0.
      Overrides:
      getAbsoluteScale in class Graphics
      Returns:
      the effective absolute scaling factor
      See Also:
    • getAlpha

      public int getAlpha()
      Description copied from class: Graphics
      Returns the current alpha value of the graphics.
      Overrides:
      getAlpha in class Graphics
      Returns:
      the alpha value
      See Also:
    • getAntialias

      public int getAntialias()
      Description copied from class: Graphics
      Returns the anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.
      Overrides:
      getAntialias in class Graphics
      Returns:
      the anti-alias setting
      See Also:
    • getBackgroundColor

      public Color getBackgroundColor()
      Description copied from class: Graphics
      Returns the background color used for filling.
      Specified by:
      getBackgroundColor in class Graphics
      Returns:
      the background color
      See Also:
    • getClip

      public Rectangle getClip(Rectangle rect)
      Description copied from class: Graphics
      Modifies the given rectangle to match the clip region and returns that rectangle.
      Specified by:
      getClip in class Graphics
      Parameters:
      rect - the rectangle to hold the clip region
      Returns:
      the clip rectangle
      See Also:
    • getAdvanced

      public boolean getAdvanced()
      Overrides:
      getAdvanced in class Graphics
      Returns:
      true if the underlying graphics device is using advanced graphics mode.
      See Also:
    • getFillRule

      public int getFillRule()
      Description copied from class: Graphics
      Returns the fill rule, which will be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.
      Overrides:
      getFillRule in class Graphics
      Returns:
      the fill rule
      See Also:
    • getFont

      public Font getFont()
      Description copied from class: Graphics
      Returns the font used to draw and fill text.
      Specified by:
      getFont in class Graphics
      Returns:
      the font
      See Also:
    • getFontMetrics

      public FontMetrics getFontMetrics()
      Description copied from class: Graphics
      Returns the font metrics for the current font.
      Specified by:
      getFontMetrics in class Graphics
      Returns:
      the font metrics
      See Also:
    • getForegroundColor

      public Color getForegroundColor()
      Description copied from class: Graphics
      Returns the foreground color used to draw lines and text.
      Specified by:
      getForegroundColor in class Graphics
      Returns:
      the foreground color
      See Also:
    • getInterpolation

      public int getInterpolation()
      Description copied from class: Graphics
      Returns the interpolation setting.
      Overrides:
      getInterpolation in class Graphics
      Returns:
      the interpolation setting
      See Also:
    • getLineCap

      public int getLineCap()
      Description copied from class: Graphics
      Returns the current line cap style.
      Overrides:
      getLineCap in class Graphics
      Returns:
      the cap style used for drawing lines
      See Also:
    • getLineJoin

      public int getLineJoin()
      Description copied from class: Graphics
      Returns the line join style.
      Overrides:
      getLineJoin in class Graphics
      Returns:
      the join style used for drawing lines
      See Also:
    • getLineStyle

      public int getLineStyle()
      Description copied from class: Graphics
      Returns the line style.
      Specified by:
      getLineStyle in class Graphics
      Returns:
      the line style
      See Also:
    • getLineMiterLimit

      public float getLineMiterLimit()
      Description copied from class: Graphics
      Returns the line miter limit.
      Overrides:
      getLineMiterLimit in class Graphics
      Returns:
      miter limit
      See Also:
    • getLineWidth

      public int getLineWidth()
      Description copied from class: Graphics
      Returns the current line width.
      Specified by:
      getLineWidth in class Graphics
      Returns:
      the line width
      See Also:
    • getLineWidthFloat

      public float getLineWidthFloat()
      Description copied from class: Graphics
      Returns the current line width.
      Specified by:
      getLineWidthFloat in class Graphics
      Returns:
      the line width
      See Also:
    • getLineAttributes

      public LineAttributes getLineAttributes()
      Description copied from class: Graphics
      Returns the current collection of line attributes.
      Overrides:
      getLineAttributes in class Graphics
      Returns:
      all attributes used for line drawing
      See Also:
    • getTextAntialias

      public int getTextAntialias()
      Description copied from class: Graphics
      Returns the textual anti-aliasing setting value, which will be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing only for text drawing operations.
      Overrides:
      getTextAntialias in class Graphics
      Returns:
      the anti-aliasing setting
      See Also:
    • getXORMode

      public boolean getXORMode()
      Description copied from class: Graphics
      Returns true if this graphics object should use XOR mode with painting.
      Specified by:
      getXORMode in class Graphics
      Returns:
      whether XOR mode is turned on
      See Also:
    • popState

      public void popState()
      Description copied from class: Graphics
      Pops the previous state of this graphics object off the stack (if Graphics.pushState() has previously been called) and restores the current state to that popped state.
      Specified by:
      popState in class Graphics
      See Also:
    • pushState

      public void pushState()
      Description copied from class: Graphics
      Pushes the current state of this graphics object onto a stack.
      Specified by:
      pushState in class Graphics
      See Also:
    • restoreState

      public void restoreState()
      Description copied from class: Graphics
      Restores the previous state of this graphics object.
      Specified by:
      restoreState in class Graphics
      See Also:
    • rotate

      public void rotate(float degrees)
      Description copied from class: Graphics
      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.
      Overrides:
      rotate in class Graphics
      Parameters:
      degrees - the degrees to rotate
      See Also:
    • scale

      public void scale(double amount)
      Description copied from class: Graphics
      Scales this graphics object by the given amount.
      Specified by:
      scale in class Graphics
      Parameters:
      amount - the scale factor
      See Also:
    • setAdvanced

      public void setAdvanced(boolean advanced)
      Description copied from class: Graphics
      Turns advanced graphics mode on or off.
      Overrides:
      setAdvanced in class Graphics
      See Also:
    • setAlpha

      public void setAlpha(int alpha)
      Description copied from class: Graphics
      Sets the alpha to the given value. Values may range from 0 to 255. A value of 0 is completely transparent.
      Overrides:
      setAlpha in class Graphics
      Parameters:
      alpha - an alpha value (0-255)
      See Also:
    • setAntialias

      public void setAntialias(int value)
      Description copied from class: Graphics
      Sets the anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing for all non-text drawing operations.
      Overrides:
      setAntialias in class Graphics
      Parameters:
      value - the anti-alias value
      See Also:
    • setBackgroundColor

      public void setBackgroundColor(Color rgb)
      Description copied from class: Graphics
      Sets the background color.
      Specified by:
      setBackgroundColor in class Graphics
      Parameters:
      rgb - the new background color
      See Also:
    • setClip

      public void setClip(Path path)
      Description copied from class: Graphics
      Sets the area which can be affected by drawing operations to the specified Path.
      Overrides:
      setClip in class Graphics
      Parameters:
      path - the clipping path
      See Also:
    • setBackgroundPattern

      public void setBackgroundPattern(Pattern pattern)
      Description copied from class: Graphics
      Sets the pattern used for fill-type graphics operations. The pattern must not be disposed while it is being used by the graphics.
      Overrides:
      setBackgroundPattern in class Graphics
      Parameters:
      pattern - the background pattern
      See Also:
    • setClip

      public void setClip(Rectangle r)
      Description copied from class: Graphics
      Sets the clip rectangle. Painting will not occur outside this area.
      Specified by:
      setClip in class Graphics
      Parameters:
      r - the new clip rectangle
      See Also:
    • clipPath

      public void clipPath(Path path)
      Description copied from class: Graphics
      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.
      Overrides:
      clipPath in class Graphics
      Parameters:
      path - the clip path
      See Also:
    • setFillRule

      public void setFillRule(int rule)
      Description copied from class: Graphics
      Sets the fill rule to the given value, which must be one of SWT.FILL_EVEN_ODD or SWT.FILL_WINDING.
      Overrides:
      setFillRule in class Graphics
      Parameters:
      rule - the fill rule
      See Also:
    • setFont

      public void setFont(Font f)
      Description copied from class: Graphics
      Sets the font.
      Specified by:
      setFont in class Graphics
      Parameters:
      f - the new font
      See Also:
    • setForegroundColor

      public void setForegroundColor(Color rgb)
      Description copied from class: Graphics
      Sets the foreground color.
      Specified by:
      setForegroundColor in class Graphics
      Parameters:
      rgb - the new foreground color
      See Also:
    • setForegroundPattern

      public void setForegroundPattern(Pattern pattern)
      Description copied from class: Graphics
      Sets the foreground pattern for draw and text operations. The pattern must not be disposed while it is being referenced by the graphics.
      Overrides:
      setForegroundPattern in class Graphics
      Parameters:
      pattern - the foreground pattern
      See Also:
    • setInterpolation

      public void setInterpolation(int interpolation)
      Description copied from class: Graphics
      Sets the interpolation setting to the given value, which must be one of SWT.DEFAULT, SWT.NONE, SWT.LOW or SWT.HIGH. This setting is relevant when working with Images.
      Overrides:
      setInterpolation in class Graphics
      Parameters:
      interpolation - the interpolation
      See Also:
    • setLineCap

      public void setLineCap(int cap)
      Description copied from class: Graphics
      Sets the line cap style to the argument, which must be one of the constants SWT.CAP_FLAT, SWT.CAP_ROUND, or SWT.CAP_SQUARE.
      Overrides:
      setLineCap in class Graphics
      Parameters:
      cap - the line cap
      See Also:
    • setLineDash

      public void setLineDash(int[] dash)
      Description copied from class: Graphics
      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 calling Graphics.pushState() and Graphics.popState().
      Overrides:
      setLineDash in class Graphics
      Parameters:
      dash - the pixel pattern
      See Also:
    • setLineDash

      public void setLineDash(float[] dash)
      Description copied from class: Graphics
      Sets the dash pattern when the custom line style is in use.
      Overrides:
      setLineDash in class Graphics
      Parameters:
      dash - the pixel pattern.
      See Also:
    • setLineDashOffset

      public void setLineDashOffset(float value)
      Description copied from class: Graphics
      Sets the line dash offset.
      Overrides:
      setLineDashOffset in class Graphics
      See Also:
    • setLineJoin

      public void setLineJoin(int join)
      Description copied from class: Graphics
      Sets the line join style to the argument, which must be one of the constants SWT.JOIN_MITER, SWT.JOIN_ROUND, or SWT.JOIN_BEVEL.
      Overrides:
      setLineJoin in class Graphics
      Parameters:
      join - the join type
      See Also:
    • setLineStyle

      public void setLineStyle(int style)
      Description copied from class: Graphics
      Sets the line style to the argument, which must be one of the constants SWT.LINE_SOLID, SWT.LINE_DASH, SWT.LINE_DOT, SWT.LINE_DASHDOT or SWT.LINE_DASHDOTDOT.
      Specified by:
      setLineStyle in class Graphics
      Parameters:
      style - the new style
      See Also:
    • setLineMiterLimit

      public void setLineMiterLimit(float value)
      Specified by:
      setLineMiterLimit in class Graphics
      See Also:
    • setLineWidth

      public void setLineWidth(int width)
      Description copied from class: Graphics
      Sets the line width.
      Specified by:
      setLineWidth in class Graphics
      Parameters:
      width - the new width
      See Also:
    • setLineWidthFloat

      public void setLineWidthFloat(float width)
      Description copied from class: Graphics
      Sets the line width.
      Specified by:
      setLineWidthFloat in class Graphics
      Parameters:
      width - the new width
      See Also:
    • setLineAttributes

      public void setLineAttributes(LineAttributes attributes)
      Description copied from class: Graphics
      Sets all line attributes together
      Overrides:
      setLineAttributes in class Graphics
      Parameters:
      attributes - the line attributes
      See Also:
    • setTextAntialias

      public void setTextAntialias(int value)
      Description copied from class: Graphics
      Sets the textual anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON. Note that this controls anti-aliasing only for all text drawing operations.
      Overrides:
      setTextAntialias in class Graphics
      Parameters:
      value - the textual anti-alias setting
      See Also:
    • setXORMode

      public void setXORMode(boolean b)
      Description copied from class: Graphics
      Sets the XOR mode.
      Specified by:
      setXORMode in class Graphics
      Parameters:
      b - the new XOR mode
      See Also:
    • translate

      public void translate(int dx, int dy)
      Description copied from class: Graphics
      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.
      Specified by:
      translate in class Graphics
      Parameters:
      dx - the horizontal offset
      dy - the vertical offset
      See Also:
    • translate

      public void translate(float dx, float dy)
      Description copied from class: Graphics
      Modifies the current transform by translating the given x and y amounts. All subsequent painting will be performed in the resulting coordinate system.
      Overrides:
      translate in class Graphics
      Parameters:
      dx - the horizontal offset
      dy - the vertical offset
      See Also: