TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.report.drawutil.internal
Class ISymbol.PolygonSymbol

java.lang.Object
  extended by org.eclipse.tptp.platform.report.drawutil.internal.ISymbol.PolygonSymbol
All Implemented Interfaces:
ISymbol
Direct Known Subclasses:
ISymbol.Diamond, ISymbol.Down, ISymbol.GeneratedPolygonSymbol, ISymbol.HTri2, ISymbol.Left, ISymbol.Plus, ISymbol.Right, ISymbol.Up, ISymbol.VTri2
Enclosing interface:
ISymbol

public abstract static class ISymbol.PolygonSymbol
extends java.lang.Object
implements ISymbol

Polygon shaped symbol. To use this class, subclass it and redefine getPoints() method.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.tptp.platform.report.drawutil.internal.ISymbol
ISymbol.Cross, ISymbol.Cross2, ISymbol.Diamond, ISymbol.Down, ISymbol.GeneratedPolygonSymbol, ISymbol.Hexagon, ISymbol.HexagonCross, ISymbol.HexagonCross2, ISymbol.HTri2, ISymbol.Left, ISymbol.Minus, ISymbol.MoonDown, ISymbol.MoonLeft, ISymbol.MoonRight, ISymbol.MoonUp, ISymbol.Oval, ISymbol.OvalDot, ISymbol.Pentagon, ISymbol.Plus, ISymbol.PolygonSymbol, ISymbol.Right, ISymbol.Square, ISymbol.Square2, ISymbol.Star, ISymbol.Up, ISymbol.VTri2
 
Constructor Summary
ISymbol.PolygonSymbol()
           
 
Method Summary
 boolean contains(IGC gc, IRect rect, int px, int py)
           
 void draw(IGC gc, IRect rect)
          Draw the symbol using igc's current pen and brush
 java.lang.String getId()
           
protected abstract  Polygon getPolygon(IRect r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISymbol.PolygonSymbol

public ISymbol.PolygonSymbol()
Method Detail

getPolygon

protected abstract Polygon getPolygon(IRect r)
Returns:
the polygon definition, as IGC.fillPoly() require.

draw

public void draw(IGC gc,
                 IRect rect)
Description copied from interface: ISymbol
Draw the symbol using igc's current pen and brush

Specified by:
draw in interface ISymbol
Parameters:
gc - the graphic context used to draw the symbol.
rect - the rectangle where the symbol must be drawn.

contains

public boolean contains(IGC gc,
                        IRect rect,
                        int px,
                        int py)
Specified by:
contains in interface ISymbol
Parameters:
gc - use this to get any info you want (as text extends ...)
rect - bounding rectangle of the symbol.
px - x coordinate of point to check.
Returns:
true if point (px,py) is inside symbol.

getId

public java.lang.String getId()
Specified by:
getId in interface ISymbol
Returns:
the id associated with this symbol ( a class name is a good idea, for example).

TPTP 4.5.0 Platform Project
Internal API Specification