TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.report.igc.util.internal
Class Polygon

java.lang.Object
  extended by org.eclipse.tptp.platform.report.igc.util.internal.Polygon
All Implemented Interfaces:
IPath, IPolygon, IShape

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 Polygon
extends java.lang.Object
implements IPolygon, IPath

Implementation of IPolygon using SWT GC.drawPoly() compliant definition. I means one dimension integer array where x and y coodinate are stored "xyxyxy..". Note: if this is compliant to SWT definition, this class doesn't depends on any SWT classes.


Field Summary
protected  int current_index_
          Deprecated.  
protected  IGCDirect gd_
          Deprecated.  
protected  Segment path_segment_
          Deprecated.  
protected  int[] points_xy_
          Deprecated.  
protected  int size_
          Deprecated.  
 
Constructor Summary
Polygon()
          Deprecated. Create empty polygon, use resize() of setPoints() to define it
Polygon(int _alloc_size)
          Deprecated. Create a sized polygon, all points are (0,0), use setPoint() to define them
Polygon(int[] points)
          Deprecated. !
Polygon(IPolygon poly)
          Deprecated. Create SWTPolygon from IPolygon interface, do a deep-copy in case of Polygon
 
Method Summary
 void compact()
          Deprecated. reduce internal array to size needed
 boolean contains(int px, int py)
          Deprecated.  
 boolean contains(IPoint p)
          Deprecated.  
static boolean Contains(IPolygon p, int px, int py)
          Deprecated.  
 IShape copyShape()
          Deprecated.  
 IRect getBounds()
          Deprecated.  
static Point GetCenter(IPolygon poly, Point ctr)
          Deprecated.  
 Point getCenter(Point ctr)
          Deprecated.  
 int[] getPoints()
          Deprecated.  
 int getPolySize()
          Deprecated.  
 int getPolyX(int index)
          Deprecated.  
 int getPolyY(int index)
          Deprecated.  
 boolean isPolyClosed()
          Deprecated.  
 IPathElement nextPathElement()
          Deprecated.  
 boolean pathBegin(IGC gc, IGCDirect gd)
          Deprecated.  
 void pathEnd()
          Deprecated. Called to end the path, time to release any gc, gd memorized...
 void resize(int _num_points)
          Deprecated. change number of points only if size is reduced
 void rotate(int cx, int cy, double _angle)
          Deprecated. rotate all points with given angle (radian), (cx,cy) is center of rotation
 void setPoint(int index, int x, int y)
          Deprecated. replace or resize polygon up to given index
 void setPoints(int[] points)
          Deprecated. Change current polygon points !
 void setPolySize(int _size)
          Deprecated.  
 java.lang.String toString()
          Deprecated.  
 void translate(int _tx, int _ty)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

points_xy_

protected int[] points_xy_
Deprecated. 

size_

protected int size_
Deprecated. 

gd_

protected IGCDirect gd_
Deprecated. 

path_segment_

protected Segment path_segment_
Deprecated. 

current_index_

protected int current_index_
Deprecated. 
Constructor Detail

Polygon

public Polygon()
Deprecated. 
Create empty polygon, use resize() of setPoints() to define it


Polygon

public Polygon(int _alloc_size)
Deprecated. 
Create a sized polygon, all points are (0,0), use setPoint() to define them


Polygon

public Polygon(int[] points)
Deprecated. 
!no copy of points, use reference to given array only.


Polygon

public Polygon(IPolygon poly)
Deprecated. 
Create SWTPolygon from IPolygon interface, do a deep-copy in case of Polygon

Method Detail

copyShape

public IShape copyShape()
Deprecated. 
Specified by:
copyShape in interface IShape
Returns:
full deep-copy of this shape

setPolySize

public void setPolySize(int _size)
Deprecated. 

resize

public void resize(int _num_points)
Deprecated. 
change number of points only if size is reduced


compact

public void compact()
Deprecated. 
reduce internal array to size needed


setPoint

public void setPoint(int index,
                     int x,
                     int y)
Deprecated. 
replace or resize polygon up to given index


getPolySize

public int getPolySize()
Deprecated. 
Specified by:
getPolySize in interface IPolygon
Returns:
the number of polygon's points

getPolyX

public int getPolyX(int index)
Deprecated. 
Specified by:
getPolyX in interface IPolygon
Returns:
x coordinate of point at given index

getPolyY

public int getPolyY(int index)
Deprecated. 
Specified by:
getPolyY in interface IPolygon
Returns:
y coordinate of point at given index

isPolyClosed

public boolean isPolyClosed()
Deprecated. 
Specified by:
isPolyClosed in interface IPolygon
Returns:
true is polygon is closed. IRender use this to draw a closed polygon. IPolygon implementer doesn't have to create a virtual point over first poly's point to close the figure.

getPoints

public int[] getPoints()
Deprecated. 

translate

public void translate(int _tx,
                      int _ty)
Deprecated. 

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object
Returns:
String representation of polygon including first 20 points coordinates

contains

public boolean contains(IPoint p)
Deprecated. 
Specified by:
contains in interface IShape
Returns:
true if point (in pixels) is contained in shape

contains

public boolean contains(int px,
                        int py)
Deprecated. 
Specified by:
contains in interface IShape
Returns:
true if point (in pixels) is contained in shape

getBounds

public IRect getBounds()
Deprecated. 
Specified by:
getBounds in interface IShape
Returns:
bounding box of shape

pathBegin

public boolean pathBegin(IGC gc,
                         IGCDirect gd)
Deprecated. 
Specified by:
pathBegin in interface IPath
Returns:
true if path contains at least one path element

pathEnd

public void pathEnd()
Deprecated. 
Description copied from interface: IPath
Called to end the path, time to release any gc, gd memorized...

Specified by:
pathEnd in interface IPath

nextPathElement

public IPathElement nextPathElement()
Deprecated. 
Specified by:
nextPathElement in interface IPath
Returns:
next IPathElement contained in this path, null is there are no more element. Take care the returned path element can be a reusage of previous returned one with new parameters (mainly for reduced memory consumption): If caller need to memorize a path element it's a good idea to .copyPathElement() it.

rotate

public void rotate(int cx,
                   int cy,
                   double _angle)
Deprecated. 
rotate all points with given angle (radian), (cx,cy) is center of rotation


setPoints

public void setPoints(int[] points)
Deprecated. 
Change current polygon points !no copy of points, use reference to given array.


getCenter

public Point getCenter(Point ctr)
Deprecated. 
Returns:
center of polygon

GetCenter

public static Point GetCenter(IPolygon poly,
                              Point ctr)
Deprecated. 
Returns:
center of polygon

Contains

public static boolean Contains(IPolygon p,
                               int px,
                               int py)
Deprecated. 

TPTP 4.5.0 Platform Project
Internal API Specification