FreeHEP API
Version v1.2

org.freehep.graphics2d
Class SymbolShape

java.lang.Object
  |
  +--org.freehep.graphics2d.SymbolShape
All Implemented Interfaces:
Shape

public class SymbolShape
extends Object
implements Shape

This class can be used to create and render simple shapes quickly and without memory allocation. A common point array is used for all created shapes. The factory methods don't return a new shape, but set the object to the selected shape. Hence, the class is not thread-safe and only one PathIterator can be used at the same time.

Version:
$Id: SymbolShape.java,v 1.5 2003/04/25 23:12:45 duns Exp $
Author:
Simon Fischer

Constructor Summary
SymbolShape()
           
 
Method Summary
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(Point2D p)
           
 boolean contains(Rectangle2D r)
           
 void create(int type, double x, double y, double size)
          Type must be one of the symbols defined in VectorGraphicsConstants except TYPE_CIRCLE.
 void createBox(double x, double y, double size)
           
 void createCross(double x, double y, double size)
           
 void createDiamond(double x, double y, double size)
           
 void createDownTriangle(double x, double y, double size)
           
 void createHLine(double x, double y, double size)
           
 void createPlus(double x, double y, double size)
           
 void createStar(double x, double y, double size)
           
 void createUpTriangle(double x, double y, double size)
           
 void createVLine(double x, double y, double size)
           
 Rectangle getBounds()
           
 Rectangle2D getBounds2D()
           
 PathIterator getPathIterator(AffineTransform t)
           
 PathIterator getPathIterator(AffineTransform at, double flatness)
           
 boolean intersects(double x, double y, double w, double h)
          Returns true, if at least one of the points is contained by the shape.
 boolean intersects(Rectangle2D r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolShape

public SymbolShape()
Method Detail

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface Shape

contains

public boolean contains(Point2D p)
Specified by:
contains in interface Shape

contains

public boolean contains(Rectangle2D r)
Specified by:
contains in interface Shape

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Returns true, if at least one of the points is contained by the shape.

Specified by:
intersects in interface Shape

intersects

public boolean intersects(Rectangle2D r)
Specified by:
intersects in interface Shape

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Specified by:
getPathIterator in interface Shape

getBounds2D

public Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface Shape

getBounds

public Rectangle getBounds()
Specified by:
getBounds in interface Shape

getPathIterator

public PathIterator getPathIterator(AffineTransform t)
Specified by:
getPathIterator in interface Shape

create

public void create(int type,
                   double x,
                   double y,
                   double size)
Type must be one of the symbols defined in VectorGraphicsConstants except TYPE_CIRCLE.

See Also:
VectorGraphicsConstants

createHLine

public void createHLine(double x,
                        double y,
                        double size)

createVLine

public void createVLine(double x,
                        double y,
                        double size)

createPlus

public void createPlus(double x,
                       double y,
                       double size)

createCross

public void createCross(double x,
                        double y,
                        double size)

createStar

public void createStar(double x,
                       double y,
                       double size)

createUpTriangle

public void createUpTriangle(double x,
                             double y,
                             double size)

createDownTriangle

public void createDownTriangle(double x,
                               double y,
                               double size)

createDiamond

public void createDiamond(double x,
                          double y,
                          double size)

createBox

public void createBox(double x,
                      double y,
                      double size)

FreeHEP API
Version v1.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.