org.jfree.util
Class ShapeUtils

java.lang.Object
  extended byorg.jfree.util.ShapeUtils

Deprecated. Use ShapeUtilities.

public abstract class ShapeUtils
extends java.lang.Object

Utility methods for Shape objects.


Constructor Summary
ShapeUtils()
          Deprecated.  
 
Method Summary
static java.awt.Shape clone(java.awt.Shape shape)
          Deprecated. Returns a clone of the specified shape, or null.
static java.awt.Shape createDiagonalCross(float l, float t)
          Deprecated. Creates a diagonal cross shape.
static java.awt.Shape createDiamond(float s)
          Deprecated. Creates a diamond shape.
static java.awt.Shape createDownTriangle(float s)
          Deprecated. Creates a triangle shape that points downwards.
static java.awt.Shape createLineRegion(java.awt.geom.Line2D line, float width)
          Deprecated. Creates a region surrounding a line segment by 'widening' the line segment.
static java.awt.Shape createRegularCross(float l, float t)
          Deprecated. Creates a diagonal cross shape.
static java.awt.Shape createUpTriangle(float s)
          Deprecated. Creates a triangle shape that points upwards.
static void drawRotatedShape(java.awt.Graphics2D g2, java.awt.Shape shape, double angle, float x, float y)
          Deprecated. Draws a shape with the specified rotation about (x, y).
static boolean equal(java.awt.Polygon p1, java.awt.Polygon p2)
          Deprecated. Tests two polygons for equality.
static java.awt.geom.Point2D getPointInRectangle(double x, double y, java.awt.geom.Rectangle2D area)
          Deprecated. Returns a point based on (x, y) but constrained to be within the bounds of a given rectangle.
static java.awt.Shape rotateShape(java.awt.Shape base, double angle, float x, float y)
          Deprecated. Rotates a shape about the specified coordinates.
static java.awt.Shape translateShape(java.awt.Shape shape, double transX, double transY)
          Deprecated. Returns a translated shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeUtils

public ShapeUtils()
Deprecated. 
Method Detail

clone

public static java.awt.Shape clone(java.awt.Shape shape)
Deprecated. 
Returns a clone of the specified shape, or null. At the current time, this method supports cloning for instances of Line2D, RectangularShape, Area and GeneralPath.

RectangularShape includes Arc2D, Ellipse2D, Rectangle2D, RoundRectangle2D.

Parameters:
shape - the shape to clone (null permitted, returns null).
Returns:
A clone or null.

equal

public static boolean equal(java.awt.Polygon p1,
                            java.awt.Polygon p2)
Deprecated. 
Tests two polygons for equality. If both are null this method returns true.

Parameters:
p1 - polygon 1 (null permitted).
p2 - polygon 2 (null permitted).
Returns:
A boolean.

translateShape

public static java.awt.Shape translateShape(java.awt.Shape shape,
                                            double transX,
                                            double transY)
Deprecated. 
Returns a translated shape.

Parameters:
shape - the shape (null not permitted).
transX - the x translation.
transY - the y translation.
Returns:
The translated shape.

rotateShape

public static java.awt.Shape rotateShape(java.awt.Shape base,
                                         double angle,
                                         float x,
                                         float y)
Deprecated. 
Rotates a shape about the specified coordinates.

Parameters:
base - the shape (null permitted, returns null).
angle - the angle (in radians).
x - the x coordinate for the rotation point (in Java2D space).
y - the y coordinate for the rotation point (in Java2D space).
Returns:
the rotated shape.

drawRotatedShape

public static void drawRotatedShape(java.awt.Graphics2D g2,
                                    java.awt.Shape shape,
                                    double angle,
                                    float x,
                                    float y)
Deprecated. 
Draws a shape with the specified rotation about (x, y).

Parameters:
g2 - the graphics device (null not permitted).
shape - the shape (null not permitted).
angle - the angle (in radians).
x - the x coordinate for the rotation point.
y - the y coordinate for the rotation point.

createDiagonalCross

public static java.awt.Shape createDiagonalCross(float l,
                                                 float t)
Deprecated. 
Creates a diagonal cross shape.

Parameters:
l - the length of each 'arm'.
t - the thickness.
Returns:
A diagonal cross shape.

createRegularCross

public static java.awt.Shape createRegularCross(float l,
                                                float t)
Deprecated. 
Creates a diagonal cross shape.

Parameters:
l - the length of each 'arm'.
t - the thickness.
Returns:
A diagonal cross shape.

createDiamond

public static java.awt.Shape createDiamond(float s)
Deprecated. 
Creates a diamond shape.

Parameters:
s - the size factor (equal to half the height of the diamond).
Returns:
A diamond shape.

createUpTriangle

public static java.awt.Shape createUpTriangle(float s)
Deprecated. 
Creates a triangle shape that points upwards.

Parameters:
s - the size factor (equal to half the height of the triangle).
Returns:
A triangle shape.

createDownTriangle

public static java.awt.Shape createDownTriangle(float s)
Deprecated. 
Creates a triangle shape that points downwards.

Parameters:
s - the size factor (equal to half the height of the triangle).
Returns:
A triangle shape.

createLineRegion

public static java.awt.Shape createLineRegion(java.awt.geom.Line2D line,
                                              float width)
Deprecated. 
Creates a region surrounding a line segment by 'widening' the line segment. A typical use for this method is the creation of a 'clickable' region for a line that is displayed on-screen.

Parameters:
line - the line (null not permitted).
width - the width of the region.
Returns:
A region that surrounds the line.

getPointInRectangle

public static java.awt.geom.Point2D getPointInRectangle(double x,
                                                        double y,
                                                        java.awt.geom.Rectangle2D area)
Deprecated. 
Returns a point based on (x, y) but constrained to be within the bounds of a given rectangle.

Parameters:
x - the x-coordinate.
y - the y-coordinate.
area - the constraining rectangle (null not permitted).
Returns:
A point within the rectangle.
Throws:
java.lang.NullPointerException - if area is null.