TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.report.igc.swt.internal
Class SWTGC

java.lang.Object
  extended by org.eclipse.tptp.platform.report.igc.swt.internal.SWTGC
All Implemented Interfaces:
IGC

Deprecated. As of TPTP 4.5.0, use the TPTP Business Intelligence and Reporting Tools (BIRT) reporting infrastructure (org.eclipse.tptp.platform.report.birt).

public class SWTGC
extends java.lang.Object
implements IGC

implementation of IGC for SWT ... for TEST ONLY NEED TO BE IMPROVED. Does not support transparency in any way... Support clipping using IRect only.


Field Summary
protected  IBrush brush_
          Deprecated. current brush used, null if not already created.
protected  boolean brush_swt_compliant_
          Deprecated. true if current brush is null or a SolidBrush compliant with SWT, so I can use swt.GC methods.
protected  org.eclipse.swt.graphics.Device device_
          Deprecated. swt's device used
protected  boolean dispose_gc_
          Deprecated. true is gc can be dispose on dispose() call
protected  IFont font_
          Deprecated. current font used, null if not created
protected  org.eclipse.swt.graphics.GC gc_
          Deprecated. swt's GC used to draw
protected  IGCDirect gd_
          Deprecated. current IGCDirect used
protected  float KdpiX_
          Deprecated. dpiX/Y factor used to convert from pixel to device
protected  float KdpiY_
          Deprecated. dpiX/Y factor used to convert from pixel to device
protected  boolean line_style_pen_swt_compliant_
          Deprecated. true if current pen is null or a LineStylePen compliant with SWT line style definition.
protected  IPen pen_
          Deprecated. current pen used, null if not already created.
protected  org.eclipse.swt.graphics.Font swtfont_
          Deprecated. current used swt font (null for none)
 
Fields inherited from interface org.eclipse.tptp.platform.report.igc.internal.IGC
C_INFO_BACKGROUND, C_INFO_FOREGROUND, C_LIST_BACKGROUND, C_LIST_FOREGROUND, C_LIST_SELECTION_BACKGROUND, C_LIST_SELECTION_TEXT, C_TITLE_BACKGROUND, C_TITLE_BACKGROUND_GRADIENT, C_TITLE_FOREGROUND, C_TITLE_INACTIVE_BACKGROUND, C_TITLE_INACTIVE_BACKGROUND_GRADIENT, C_TITLE_INACTIVE_FOREGROUND, C_WIDGET_BACKGROUND, C_WIDGET_BORDER, C_WIDGET_DARK_SHADOW, C_WIDGET_FOREGROUND, C_WIDGET_HIGHLIGHT_SHADOW, C_WIDGET_LIGHT_SHADOW, C_WIDGET_NORMAL_SHADOW
 
Constructor Summary
SWTGC(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
          Deprecated. Create an IGC with an existing GC, this one is not disposed on dispose() call
 
Method Summary
 org.eclipse.swt.graphics.Color createColor(int _rgba)
          Deprecated.  
 int createRGBA(org.eclipse.swt.graphics.Color c)
          Deprecated.  
 void dispose()
          Deprecated. dispose any resource used
 void drawArc(int xc, int yc, double _r1_angle, int r1, int r2, double _start_angle, double _arc_length)
          Deprecated. draw an oriented arc defined by start angle and length (>0 means counter-clockwise in the sense (1,0)>(0,1)).
 void drawCircle(int cx, int cy, int radius)
          Deprecated. Draw a circle of radius and centered at (cx,cy) using current brush or color.
 void drawEllipse(int xc, int yc, double _r1_angle, int r1, int r2)
          Deprecated. Draw an oriented ellipse, not necessary coordinate aligned one.
 void drawFocus(int x, int y, int w, int h)
          Deprecated. Draw the focus with rectangle coordinates Call directly the method drawFocus(x,y,w,h) of the SWT GC
 void drawFocus(IRect rect)
          Deprecated. Draw the focus with rectangle object.
 void drawImage(IImage image, int x, int y)
          Deprecated. Support for ImageProxy, SWTImage and RGBAImage, others are ignored.
 void drawImage(IImage image, int x, int y, int w, int h)
          Deprecated. Support for ImageProxy, SWTImage and RGBAImage, others are ignored.
 void drawImage(IImage image, int srcX, int srcY, int srcW, int srcH, int dstX, int dstY, int dstW, int dstH)
          Deprecated. Support for ImageProxy, SWTImage and RGBAImage others are ignored.
 void drawLine(int x1, int y1, int x2, int y2)
          Deprecated. Draw a line using current pen. points are expressed in pixel coordinates
 void drawOval(int x, int y, int w, int h)
          Deprecated. Draw using current brush or color the oval defined inside given rectangle.
 void drawPath(IPath path)
          Deprecated. If path is a IPolygon, use drawPoly().
 void drawPoint(int x, int y)
          Deprecated. Draw pixel at location (x,y) using current brush
 void drawPoly(IPolygon poly)
          Deprecated. If current pen is a LineStylePen use swt.gc.drawPolyline.
 void drawRect(int x, int y, int w, int h)
          Deprecated. If current pen is null or a LineStylePen, use swt.GC.drawRectangle().
 void drawRect(IRect r)
          Deprecated. Draw the outline of rectangle using current pen.
 void drawText(java.lang.String text, int x, int y)
          Deprecated. Need a SolidBrush to works.
 void drawText(java.lang.String text, int x, int y, double angle)
          Deprecated. Support only 0,90,180 and 270 degree angles and SolidBrush
protected  void drawTextImage(RGBAImage data, int devx, int devy, boolean transparent)
          Deprecated. devx,devy is top left corner of image (!
 void fillArc(int xc, int yc, double _r1_angle, int r1, int r2, double _start_angle, double _arc_length)
          Deprecated. fill an oriented arc defined by start angle and length (>0 means counter-clockwise in the sense (1,0)>(0,1)).
 void fillCircle(int cx, int cy, int radius)
          Deprecated. Fill circle using current brush or color
 void fillEllipse(int xc, int yc, double _r1_angle, int r1, int r2)
          Deprecated. Fill an oriented ellipse, not necessary coordinate aligned one.
 void fillOval(int x, int y, int w, int h)
          Deprecated. Fill using current brush or color the oval defined inside given rectangle.
 void fillPoly(IPolygon poly)
          Deprecated. fill the polygon using current brush or color.
 void fillRect(int x, int y, int w, int h)
          Deprecated. Fill rectangle including outline using current brush (@see IRect for rectangle definition).
 void fillRect(IRect r)
          Deprecated. Fill rectangle including outline using current brush
 void fillShape(IShape shape)
          Deprecated. If shape is an IRect, IOval call fillRect/fillOval instead.
 IBrush getBrush()
          Deprecated.  
 IShape getClipping()
          Deprecated.  
 IFont getFont()
          Deprecated.  
 IFontMetrics getFontMetrics()
          Deprecated.  
 IGCDirect getIGCDirect()
          Deprecated.  
 IPen getPen()
          Deprecated.  
 int getPoint(int x, int y)
          Deprecated.  
 int getSystemColor(int id)
          Deprecated. Return system color for given id.
protected  void rotatedDrawText(java.lang.String text, int tx, int ty, int angle)
          Deprecated. tx,ty is top left corner (in pixels) where text is printed, angle in degree.
 IBrush setBrush(IBrush _brush)
          Deprecated. Change current brush, special support for SolidBrush and SWTFillGradientRectangleBrush, others will be used/or not depending on shape to fill.
 IShape setClipping(IShape s)
          Deprecated. Change current clipping area, and return previous one.
 IFont setFont(IFont font)
          Deprecated. support all IFont.
 IPen setPen(IPen _pen)
          Deprecated. Change current pen, special supports for:
-LineStylePen: use directly swt.GC. methods.
 ISize textExtent(java.lang.String text)
          Deprecated.  
 ISize textExtent(java.lang.String text, double _angle)
          Deprecated. Support only 0,90,180 and 270 degree angles
 IPolygon textExtent(java.lang.String text, int x, int y, double angle)
          Deprecated.  
protected static void Unsupported(java.lang.String what)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

device_

protected org.eclipse.swt.graphics.Device device_
Deprecated. 
swt's device used


gc_

protected org.eclipse.swt.graphics.GC gc_
Deprecated. 
swt's GC used to draw


dispose_gc_

protected boolean dispose_gc_
Deprecated. 
true is gc can be dispose on dispose() call


brush_

protected IBrush brush_
Deprecated. 
current brush used, null if not already created.


pen_

protected IPen pen_
Deprecated. 
current pen used, null if not already created.


font_

protected IFont font_
Deprecated. 
current font used, null if not created


gd_

protected IGCDirect gd_
Deprecated. 
current IGCDirect used


swtfont_

protected org.eclipse.swt.graphics.Font swtfont_
Deprecated. 
current used swt font (null for none)


line_style_pen_swt_compliant_

protected boolean line_style_pen_swt_compliant_
Deprecated. 
true if current pen is null or a LineStylePen compliant with SWT line style definition. meaning swt.GC methods can be used.


brush_swt_compliant_

protected boolean brush_swt_compliant_
Deprecated. 
true if current brush is null or a SolidBrush compliant with SWT, so I can use swt.GC methods.


KdpiX_

protected float KdpiX_
Deprecated. 
dpiX/Y factor used to convert from pixel to device


KdpiY_

protected float KdpiY_
Deprecated. 
dpiX/Y factor used to convert from pixel to device

Constructor Detail

SWTGC

public SWTGC(org.eclipse.swt.graphics.Device device,
             org.eclipse.swt.graphics.GC gc)
Deprecated. 
Create an IGC with an existing GC, this one is not disposed on dispose() call

Method Detail

getIGCDirect

public IGCDirect getIGCDirect()
Deprecated. 
Specified by:
getIGCDirect in interface IGC
Returns:
factor to convert pixel to current device coordinate

dispose

public void dispose()
Deprecated. 
dispose any resource used


createColor

public org.eclipse.swt.graphics.Color createColor(int _rgba)
Deprecated. 

createRGBA

public int createRGBA(org.eclipse.swt.graphics.Color c)
Deprecated. 

getBrush

public IBrush getBrush()
Deprecated. 
Specified by:
getBrush in interface IGC
Returns:
current brush, or null if no brush are used

setBrush

public IBrush setBrush(IBrush _brush)
Deprecated. 
Change current brush, special support for SolidBrush and SWTFillGradientRectangleBrush, others will be used/or not depending on shape to fill. GradientBrush is used for fillRect() method only

Specified by:
setBrush in interface IGC
See Also:
IGC.setBrush(org.eclipse.tptp.platform.report.igc.internal.IBrush)

getPen

public IPen getPen()
Deprecated. 
Specified by:
getPen in interface IGC
Returns:
curren pen, or null is no pen are used

setPen

public IPen setPen(IPen _pen)
Deprecated. 
Change current pen, special supports for:
-LineStylePen: use directly swt.GC. methods.
Others are taken into account depending on path to draw.

Specified by:
setPen in interface IGC
See Also:
IGC.setPen(org.eclipse.tptp.platform.report.igc.internal.IPen)

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Deprecated. 
Description copied from interface: IGC
Draw a line using current pen. points are expressed in pixel coordinates

Specified by:
drawLine in interface IGC

getPoint

public int getPoint(int x,
                    int y)
Deprecated. 
Specified by:
getPoint in interface IGC
Parameters:
x - coordinate of point to get color.
y - coorindate of point to get color.
Returns:
RGBA.TRANSPARENT as this is not supported by swt's GC class.
See Also:
IGC.getPoint(int, int)

drawPoint

public void drawPoint(int x,
                      int y)
Deprecated. 
Description copied from interface: IGC
Draw pixel at location (x,y) using current brush

Specified by:
drawPoint in interface IGC

drawCircle

public void drawCircle(int cx,
                       int cy,
                       int radius)
Deprecated. 
Description copied from interface: IGC
Draw a circle of radius and centered at (cx,cy) using current brush or color.

Specified by:
drawCircle in interface IGC

fillCircle

public void fillCircle(int cx,
                       int cy,
                       int radius)
Deprecated. 
Description copied from interface: IGC
Fill circle using current brush or color

Specified by:
fillCircle in interface IGC

drawOval

public void drawOval(int x,
                     int y,
                     int w,
                     int h)
Deprecated. 
Description copied from interface: IGC
Draw using current brush or color the oval defined inside given rectangle.

Specified by:
drawOval in interface IGC

fillOval

public void fillOval(int x,
                     int y,
                     int w,
                     int h)
Deprecated. 
Description copied from interface: IGC
Fill using current brush or color the oval defined inside given rectangle.

Specified by:
fillOval in interface IGC

drawArc

public void drawArc(int xc,
                    int yc,
                    double _r1_angle,
                    int r1,
                    int r2,
                    double _start_angle,
                    double _arc_length)
Deprecated. 
Description copied from interface: IGC
draw an oriented arc defined by start angle and length (>0 means counter-clockwise in the sense (1,0)>(0,1)).

Specified by:
drawArc in interface IGC
Parameters:
xc - X center of the ellipse.
yc - Y center of the ellipse.
_r1_angle - angle of main radius (r1) from X coordinate axis.
r1 - main radius
r2 - secondary radius (90 degree from r1)
_start_angle - start angle of arc 0 is 3 O'clock position
_arc_length - arc length from start angle >0 for counter-clockwise, 2*PI for full ellipse.

fillArc

public void fillArc(int xc,
                    int yc,
                    double _r1_angle,
                    int r1,
                    int r2,
                    double _start_angle,
                    double _arc_length)
Deprecated. 
Description copied from interface: IGC
fill an oriented arc defined by start angle and length (>0 means counter-clockwise in the sense (1,0)>(0,1)). Fill include the center of ellipse.

Specified by:
fillArc in interface IGC
Parameters:
xc - X center of the ellipse.
yc - Y center of the ellipse.
_r1_angle - angle of main radius (r1) from X coordinate axis.
r1 - main radius
r2 - secondary radius (90 degree from r1)
_start_angle - start angle (radian) of arc 0 is 3 O'clock position
_arc_length - arc length (radian) from start angle >0 for counter-clockwise, 2*PI for full ellipse.

drawEllipse

public void drawEllipse(int xc,
                        int yc,
                        double _r1_angle,
                        int r1,
                        int r2)
Deprecated. 
Description copied from interface: IGC
Draw an oriented ellipse, not necessary coordinate aligned one.

Specified by:
drawEllipse in interface IGC
Parameters:
xc - X center of the ellipse.
yc - Y center of the ellipse.
_r1_angle - angle of main radius (r1) from X coordinate axis.
r1 - main radius
r2 - secondary radius (90 degree from r1)

fillEllipse

public void fillEllipse(int xc,
                        int yc,
                        double _r1_angle,
                        int r1,
                        int r2)
Deprecated. 
Description copied from interface: IGC
Fill an oriented ellipse, not necessary coordinate aligned one.

Specified by:
fillEllipse in interface IGC
Parameters:
xc - X center of the ellipse.
yc - Y center of the ellipse.
_r1_angle - angle (radian) of main radius (r1) from X coordinate axis.
r1 - main radius
r2 - secondary radius (90 degree from r1)

fillRect

public void fillRect(int x,
                     int y,
                     int w,
                     int h)
Deprecated. 
Description copied from interface: IGC
Fill rectangle including outline using current brush (@see IRect for rectangle definition).

Specified by:
fillRect in interface IGC

drawRect

public void drawRect(int x,
                     int y,
                     int w,
                     int h)
Deprecated. 
If current pen is null or a LineStylePen, use swt.GC.drawRectangle(). Otherwise use pen's methods.

Specified by:
drawRect in interface IGC
See Also:
IGC.drawRect(int, int, int, int)

fillRect

public void fillRect(IRect r)
Deprecated. 
Description copied from interface: IGC
Fill rectangle including outline using current brush

Specified by:
fillRect in interface IGC

drawRect

public void drawRect(IRect r)
Deprecated. 
Description copied from interface: IGC
Draw the outline of rectangle using current pen.

Specified by:
drawRect in interface IGC

drawImage

public void drawImage(IImage image,
                      int x,
                      int y)
Deprecated. 
Support for ImageProxy, SWTImage and RGBAImage, others are ignored.

Specified by:
drawImage in interface IGC
See Also:
org.eclipse.tptp.platform.report.igc.internal.IGC#drawImage(int, int, org.eclipse.tptp.platform.report.igc.internal.IImage)

drawImage

public void drawImage(IImage image,
                      int x,
                      int y,
                      int w,
                      int h)
Deprecated. 
Support for ImageProxy, SWTImage and RGBAImage, others are ignored.

Specified by:
drawImage in interface IGC
See Also:
org.eclipse.tptp.platform.report.igc.internal.IGC#drawImage(int, int, org.eclipse.tptp.platform.report.igc.internal.IImage)

drawImage

public void drawImage(IImage image,
                      int srcX,
                      int srcY,
                      int srcW,
                      int srcH,
                      int dstX,
                      int dstY,
                      int dstW,
                      int dstH)
Deprecated. 
Support for ImageProxy, SWTImage and RGBAImage others are ignored.

Specified by:
drawImage in interface IGC
See Also:
org.eclipse.tptp.platform.report.igc.internal.IGC#drawImage(int, int, org.eclipse.tptp.platform.report.igc.internal.IImage)

drawPoly

public void drawPoly(IPolygon poly)
Deprecated. 
If current pen is a LineStylePen use swt.gc.drawPolyline. If polygon is a IPath: - If pen implements IGCHelperDrawPath, try to use this drawPath(). - If polygon implements IGCHelperDrawPath, try to use this drawPath().

Specified by:
drawPoly in interface IGC
See Also:
IGC.drawPoly(org.eclipse.tptp.platform.report.igc.internal.IPolygon)

fillPoly

public void fillPoly(IPolygon poly)
Deprecated. 
Description copied from interface: IGC
fill the polygon using current brush or color.

Specified by:
fillPoly in interface IGC

textExtent

public ISize textExtent(java.lang.String text)
Deprecated. 
Specified by:
textExtent in interface IGC
Returns:
size of text bounding box in pixels

textExtent

public ISize textExtent(java.lang.String text,
                        double _angle)
Deprecated. 
Support only 0,90,180 and 270 degree angles

Specified by:
textExtent in interface IGC
Returns:
size of rotated text using given angle (in radian), or null if rotation is not supported.
See Also:
IGC.textExtent(java.lang.String, double)

textExtent

public IPolygon textExtent(java.lang.String text,
                           int x,
                           int y,
                           double angle)
Deprecated. 
Specified by:
textExtent in interface IGC
Returns:
rotated text bounding polygon in pixels, using given angle (radian). null is rotation is not supported. (x,y) is where text will be drawn, (top left corner of text before rotation). By convention, first point must be top-left corner of text (x,y), second one is top right corner, third is bottom right and last one if bottom left corner, more points can be returned, but only the fourth first are mandatory. If you want to get size of rotated text, use IPolygon.getBounds();

drawText

public void drawText(java.lang.String text,
                     int x,
                     int y)
Deprecated. 
Need a SolidBrush to works.

Specified by:
drawText in interface IGC
See Also:
IGC.drawText(java.lang.String, int, int )

drawText

public void drawText(java.lang.String text,
                     int x,
                     int y,
                     double angle)
Deprecated. 
Support only 0,90,180 and 270 degree angles and SolidBrush

Specified by:
drawText in interface IGC
See Also:
IGC.drawText(java.lang.String, int, int, double)

drawTextImage

protected void drawTextImage(RGBAImage data,
                             int devx,
                             int devy,
                             boolean transparent)
Deprecated. 
devx,devy is top left corner of image (! be careful)


drawFocus

public void drawFocus(int x,
                      int y,
                      int w,
                      int h)
Deprecated. 
Draw the focus with rectangle coordinates Call directly the method drawFocus(x,y,w,h) of the SWT GC

Specified by:
drawFocus in interface IGC
See Also:
org.eclipse.swt.GC#drawFocus

drawFocus

public void drawFocus(IRect rect)
Deprecated. 
Draw the focus with rectangle object. Call drawFocus(x,y,w,h)

Specified by:
drawFocus in interface IGC
See Also:
drawFocus(int, int, int, int)

getFont

public IFont getFont()
Deprecated. 
Specified by:
getFont in interface IGC
Returns:
current font used by drawText.

setFont

public IFont setFont(IFont font)
Deprecated. 
support all IFont.

Specified by:
setFont in interface IGC
See Also:
IGC.setFont(org.eclipse.tptp.platform.report.igc.internal.IFont)

getFontMetrics

public IFontMetrics getFontMetrics()
Deprecated. 
Specified by:
getFontMetrics in interface IGC
Returns:
current font metrics

getClipping

public IShape getClipping()
Deprecated. 
Specified by:
getClipping in interface IGC
Returns:
current clipping area, null if none

setClipping

public IShape setClipping(IShape s)
Deprecated. 
Description copied from interface: IGC
Change current clipping area, and return previous one.

Specified by:
setClipping in interface IGC

fillShape

public void fillShape(IShape shape)
Deprecated. 
If shape is an IRect, IOval call fillRect/fillOval instead. If current brush implements IShapeFiller, call brush_.fillShape(). If shape implements IShapeFiller, call shape.fillShape(). Otherwise fill nothing.

Specified by:
fillShape in interface IGC

drawPath

public void drawPath(IPath path)
Deprecated. 
If path is a IPolygon, use drawPoly(). If pen implements IGCHelperDrawPath try to use it. If path implements IGCHelperDrawPath try to use it. Otherwise draw nothing.

Specified by:
drawPath in interface IGC

Unsupported

protected static void Unsupported(java.lang.String what)
Deprecated. 

rotatedDrawText

protected void rotatedDrawText(java.lang.String text,
                               int tx,
                               int ty,
                               int angle)
Deprecated. 
tx,ty is top left corner (in pixels) where text is printed, angle in degree. This method use current gc's background as font color.


getSystemColor

public int getSystemColor(int id)
Deprecated. 
Description copied from interface: IGC
Return system color for given id.
Note: for constant color as white,red,... use RGBA class instead.

Specified by:
getSystemColor in interface IGC
Parameters:
id - identifiant of system color, see C_xxx constants
Returns:
rgba color defined in system for given id.
See Also:
class.

TPTP 4.5.0 Platform Project
Internal API Specification