GraphicsUtils Class Reference

List of all members.

Static Public Member Functions

static Polygon createPolygon (Point2D...points)
 Creates a polygon from an array of points.
static RenderingHints getBestRenderingHints ()
static String getPathAsString (PathIterator pathIterator)
static Point2D[] getPointsRecentered (Point2D[] points, double originX, double originY)
 Recenter the points around x and y.
static Point2D[] getPointsWithConvertedUnits (Units sourceUnit, Units destUnit, Point2D...points)
 Takes an input array of points, and returns a new array of points where all the values have been converted from the old unit to the new destination unit.

Detailed Description

This software is distributed under the BSD License.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)
For working with Shapes and Java2D Graphics.

Definition at line 20 of file GraphicsUtils.java.


Member Function Documentation

static Polygon createPolygon ( Point2D...  points  )  [static]

Creates a polygon from an array of points.

It rounds off all the points' x & y values to the nearest integer, as the Java Polygons only work with ints.

Parameters:
points 
Returns:
the Polygon

Definition at line 31 of file GraphicsUtils.java.

static RenderingHints getBestRenderingHints (  )  [static]

Returns:
smooth as silk rendering hints, useful for nice scaling. Use this with Graphics2D, to create nice graphics.

Definition at line 43 of file GraphicsUtils.java.

static String getPathAsString ( PathIterator  pathIterator  )  [static]

Parameters:
pathIterator 
Returns:

Definition at line 59 of file GraphicsUtils.java.

static Point2D [] getPointsRecentered ( Point2D[]  points,
double  originX,
double  originY 
) [static]

Recenter the points around x and y.

Parameters:
points each point will be recalculatd relative to the new origin.
originX the new originX
originY 
Returns:

Definition at line 101 of file GraphicsUtils.java.

static Point2D [] getPointsWithConvertedUnits ( Units  sourceUnit,
Units  destUnit,
Point2D...  points 
) [static]

Takes an input array of points, and returns a new array of points where all the values have been converted from the old unit to the new destination unit.

Parameters:
sourceUnit the input points are defined in this unit
destUnit the output Point2D[] is definited in this unit.
points the input points.
Returns:

Definition at line 122 of file GraphicsUtils.java.

References Units.getConversionTo().


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:46 2007 for R3 Paper Toolkit by  doxygen 1.4.7