org.freehep.graphics2d
Class SymbolShape

java.lang.Object
  extended by org.freehep.graphics2d.SymbolShape
All Implemented Interfaces:
java.awt.Shape

public class SymbolShape
extends java.lang.Object
implements java.awt.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 8584 2006-08-10 23:06:37Z duns $
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(java.awt.geom.Point2D p)
           
 boolean contains(java.awt.geom.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.
 java.awt.Rectangle getBounds()
           
 java.awt.geom.Rectangle2D getBounds2D()
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform t)
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.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(java.awt.geom.Rectangle2D r)
           
 java.lang.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 java.awt.Shape

contains

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

contains

public boolean contains(java.awt.geom.Point2D p)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D r)
Specified by:
contains in interface java.awt.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 java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Specified by:
intersects in interface java.awt.Shape

getPathIterator

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

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform t)
Specified by:
getPathIterator in interface java.awt.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2007 FreeHEP. All Rights Reserved.