Draw2D v2.0

org.eclipse.draw2d
Class SWTGraphics

java.lang.Object
  |
  +--org.eclipse.draw2d.Graphics
        |
        +--org.eclipse.draw2d.SWTGraphics

public class SWTGraphics
extends Graphics

Implementation of providing the drawing capabilities of SWT's GC class in draw2d.


Inner Class Summary
protected static class SWTGraphics.State
           
 
Inner classes inherited from class org.eclipse.draw2d.Graphics
Graphics.TransparencyFlag
 
Field Summary
static boolean debug
           
 
Fields inherited from class org.eclipse.draw2d.Graphics
LINE_DASH, LINE_DASHDOT, LINE_DASHDOTDOT, LINE_DOT, LINE_SOLID, NON_TRANSPARENT, TRANSPARENT
 
Constructor Summary
SWTGraphics(GC gc)
           
 
Method Summary
protected  void checkFill()
           
protected  void checkGC()
           
protected  void checkPaint()
           
protected  void checkText()
           
 void clipRect(Rectangle rect)
           
 void drawArc(Rectangle r, int offset, int length)
           
 void drawFocus(int x, int y, int w, int h)
           
 void drawFocus(Rectangle r)
           
 void drawImage(Image srcImage, int x, int y)
           
 void drawImage(Image srcImage, int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2)
           
 void drawImage(Image srcImage, Point p)
           
 void drawImage(Image srcImage, Rectangle src, Rectangle dest)
           
 void drawLine(int x1, int y1, int x2, int y2)
           
 void drawLine(Point p1, Point p2)
           
 void drawOval(Rectangle r)
           
 void drawPolygon(PointList points)
           
 void drawPolyline(PointList points)
           
 void drawRectangle(int x, int y, int width, int height)
           
 void drawRectangle(Rectangle r)
           
 void drawRoundRectangle(Rectangle r, int arcWidth, int arcHeight)
           
 void drawString(String s, int x, int y)
           
 void drawString(String s, int x, int y, Graphics.TransparencyFlag transparent)
          Deprecated. use Graphics.drawString(String, int, int) and Graphics.fillString(String, int, int)
 void drawString(String s, Point p, Graphics.TransparencyFlag transparent)
          Deprecated. use Graphics.drawString(String, Point) and Graphics.fillString(String, Point)
 void drawText(String s, int x, int y)
           
 void drawText(String s, int x, int y, Graphics.TransparencyFlag transparent)
          Deprecated. use Graphics.drawText(String, int, int) and Graphics.fillText(String, int, int)
 void drawText(String s, Point p, Graphics.TransparencyFlag transparent)
          Deprecated. use Graphics.drawText(String, Point) and Graphics.fillText(String, Point)
 void fillArc(Rectangle r, int offset, int length)
           
 void fillOval(Rectangle r)
           
 void fillPolygon(PointList points)
           
 void fillRectangle(int x, int y, int width, int height)
           
 void fillRectangle(Rectangle r)
           
 void fillRoundRectangle(Rectangle r, int arcWidth, int arcHeight)
           
 void fillString(String s, int x, int y)
           
 void fillText(String s, int x, int y)
           
 int getAdvanceWidth(char c)
           
 Color getBackgroundColor()
           
 int getCharWidth(char c)
           
 Rectangle getClip(Rectangle rect)
           
 Font getFont()
           
 FontMetrics getFontMetrics()
           
 Color getForegroundColor()
           
 int getLineStyle()
           
 int getLineWidth()
           
 Dimension getStringExtent(String text)
           
 Dimension getTextExtent(String text)
           
 boolean getXORMode()
           
protected  void init()
           
 void popState()
           
 void pushState()
           
 void restoreState()
           
protected  void restoreState(SWTGraphics.State s)
           
 void scale(float factor)
           
 void setBackgroundColor(Color color)
           
 void setClip(Rectangle rect)
           
protected  void setClipAbsolute(int x, int y, int w, int h)
           
 void setFont(Font f)
           
 void setForegroundColor(Color color)
           
 void setLineStyle(int style)
           
 void setLineWidth(int width)
           
protected  void setTranslation(int x, int y)
           
 void setXORMode(boolean b)
           
 void translate(int x, int y)
           
 void translate(Point pt)
           
 
Methods inherited from class org.eclipse.draw2d.Graphics
drawString, drawText, fillString, fillText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Constructor Detail

SWTGraphics

public SWTGraphics(GC gc)
Method Detail

clipRect

public void clipRect(Rectangle rect)
Overrides:
clipRect in class Graphics

init

protected void init()

checkFill

protected final void checkFill()

checkGC

protected final void checkGC()

checkPaint

protected final void checkPaint()

checkText

protected final void checkText()

drawArc

public void drawArc(Rectangle r,
                    int offset,
                    int length)
Overrides:
drawArc in class Graphics

drawFocus

public final void drawFocus(Rectangle r)
Overrides:
drawFocus in class Graphics

drawFocus

public void drawFocus(int x,
                      int y,
                      int w,
                      int h)
Overrides:
drawFocus in class Graphics

fillArc

public void fillArc(Rectangle r,
                    int offset,
                    int length)
Overrides:
fillArc in class Graphics

drawImage

public void drawImage(Image srcImage,
                      Point p)
Overrides:
drawImage in class Graphics

drawImage

public void drawImage(Image srcImage,
                      int x,
                      int y)
Overrides:
drawImage in class Graphics

drawImage

public void drawImage(Image srcImage,
                      Rectangle src,
                      Rectangle dest)
Overrides:
drawImage in class Graphics

drawImage

public void drawImage(Image srcImage,
                      int x1,
                      int y1,
                      int w1,
                      int h1,
                      int x2,
                      int y2,
                      int w2,
                      int h2)
Overrides:
drawImage in class Graphics

drawLine

public void drawLine(Point p1,
                     Point p2)
Overrides:
drawLine in class Graphics

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Overrides:
drawLine in class Graphics

drawOval

public void drawOval(Rectangle r)
Overrides:
drawOval in class Graphics

fillOval

public void fillOval(Rectangle r)
Overrides:
fillOval in class Graphics

drawPolygon

public void drawPolygon(PointList points)
Overrides:
drawPolygon in class Graphics

fillPolygon

public void fillPolygon(PointList points)
Overrides:
fillPolygon in class Graphics

drawPolyline

public void drawPolyline(PointList points)
Overrides:
drawPolyline in class Graphics

drawRectangle

public void drawRectangle(Rectangle r)
Overrides:
drawRectangle in class Graphics

drawRectangle

public void drawRectangle(int x,
                          int y,
                          int width,
                          int height)
Overrides:
drawRectangle in class Graphics

fillRectangle

public void fillRectangle(Rectangle r)
Overrides:
fillRectangle in class Graphics

fillRectangle

public void fillRectangle(int x,
                          int y,
                          int width,
                          int height)
Overrides:
fillRectangle in class Graphics

drawRoundRectangle

public void drawRoundRectangle(Rectangle r,
                               int arcWidth,
                               int arcHeight)
Overrides:
drawRoundRectangle in class Graphics

fillRoundRectangle

public void fillRoundRectangle(Rectangle r,
                               int arcWidth,
                               int arcHeight)
Overrides:
fillRoundRectangle in class Graphics

drawString

public void drawString(String s,
                       Point p,
                       Graphics.TransparencyFlag transparent)
Deprecated. use Graphics.drawString(String, Point) and Graphics.fillString(String, Point)

Overrides:
drawString in class Graphics

drawString

public void drawString(String s,
                       int x,
                       int y,
                       Graphics.TransparencyFlag transparent)
Deprecated. use Graphics.drawString(String, int, int) and Graphics.fillString(String, int, int)

Overrides:
drawString in class Graphics

drawString

public void drawString(String s,
                       int x,
                       int y)
Overrides:
drawString in class Graphics

fillString

public void fillString(String s,
                       int x,
                       int y)
Overrides:
fillString in class Graphics

drawText

public void drawText(String s,
                     Point p,
                     Graphics.TransparencyFlag transparent)
Deprecated. use Graphics.drawText(String, Point) and Graphics.fillText(String, Point)

Overrides:
drawText in class Graphics

drawText

public void drawText(String s,
                     int x,
                     int y,
                     Graphics.TransparencyFlag transparent)
Deprecated. use Graphics.drawText(String, int, int) and Graphics.fillText(String, int, int)

Overrides:
drawText in class Graphics

drawText

public void drawText(String s,
                     int x,
                     int y)
Overrides:
drawText in class Graphics

fillText

public void fillText(String s,
                     int x,
                     int y)
Overrides:
fillText in class Graphics

getAdvanceWidth

public int getAdvanceWidth(char c)
Overrides:
getAdvanceWidth in class Graphics

getBackgroundColor

public Color getBackgroundColor()
Overrides:
getBackgroundColor in class Graphics

getCharWidth

public int getCharWidth(char c)
Overrides:
getCharWidth in class Graphics

getClip

public Rectangle getClip(Rectangle rect)
Overrides:
getClip in class Graphics

getFont

public Font getFont()
Overrides:
getFont in class Graphics

getFontMetrics

public FontMetrics getFontMetrics()
Overrides:
getFontMetrics in class Graphics

getForegroundColor

public Color getForegroundColor()
Overrides:
getForegroundColor in class Graphics

getLineStyle

public int getLineStyle()
Overrides:
getLineStyle in class Graphics

getLineWidth

public int getLineWidth()
Overrides:
getLineWidth in class Graphics

getStringExtent

public Dimension getStringExtent(String text)
Overrides:
getStringExtent in class Graphics

getTextExtent

public Dimension getTextExtent(String text)
Overrides:
getTextExtent in class Graphics

getXORMode

public boolean getXORMode()
Overrides:
getXORMode in class Graphics

popState

public void popState()
Overrides:
popState in class Graphics

pushState

public void pushState()
Overrides:
pushState in class Graphics

restoreState

public void restoreState()
Overrides:
restoreState in class Graphics

restoreState

protected void restoreState(SWTGraphics.State s)

scale

public void scale(float factor)
Overrides:
scale in class Graphics

setBackgroundColor

public void setBackgroundColor(Color color)
Overrides:
setBackgroundColor in class Graphics

setClip

public void setClip(Rectangle rect)
Overrides:
setClip in class Graphics

setClipAbsolute

protected void setClipAbsolute(int x,
                               int y,
                               int w,
                               int h)

setFont

public void setFont(Font f)
Overrides:
setFont in class Graphics

setForegroundColor

public void setForegroundColor(Color color)
Overrides:
setForegroundColor in class Graphics

setLineStyle

public void setLineStyle(int style)
Overrides:
setLineStyle in class Graphics

setLineWidth

public void setLineWidth(int width)
Overrides:
setLineWidth in class Graphics

setTranslation

protected void setTranslation(int x,
                              int y)

setXORMode

public void setXORMode(boolean b)
Overrides:
setXORMode in class Graphics

translate

public final void translate(Point pt)
Overrides:
translate in class Graphics

translate

public void translate(int x,
                      int y)
Overrides:
translate in class Graphics

Draw2D v2.0