FreeHEP API
Version current

org.freehep.graphics2d
Class SymbolShape

java.lang.Object
  extended byorg.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.9 2004/06/15 23:37:25 duns Exp $
Author:
Simon Fischer
Source Code:
SymbolShape.java

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 symbol, double x, double y, double size)
          Type must be one of the symbols defined in VectorGraphicsConstants except TYPE_CIRCLE.
 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)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 symbol,
                   double x,
                   double y,
                   double size)
Type must be one of the symbols defined in VectorGraphicsConstants except TYPE_CIRCLE.

See Also:
VectorGraphicsConstants

toString

public String toString()

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.