intarsys runtime library

de.intarsys.tools.geometry
Class GeometryTools

java.lang.Object
  extended by de.intarsys.tools.geometry.GeometryTools

public class GeometryTools
extends Object

Tool class for common geometry tasks.


Method Summary
static void deltaTransformPoint(AffineTransform transform, float[] pts)
           
static Point2D deltaTransformPoint(AffineTransform transform, float x, float y)
           
static void deltaTransformPoint(AffineTransform transform, Point2D pt)
           
static double getScale(AffineTransform transform)
          The absolute scale of the transformation.
static void inverseTransformRect(AffineTransform transform, Rectangle2D rect)
          Transform a rectangle in device space to user space.
static void normalizeRect(float[] pts)
           
static void normalizeRect(Rectangle2D rect)
          Normalize the rectangle.
static float[] toFloatArray(Rectangle2D rect)
           
static void transformPoint(AffineTransform transform, float[] pts)
           
static Point2D transformPoint(AffineTransform transform, float x, float y)
           
static void transformPoint(AffineTransform transform, Point2D pt)
           
static void transformRect(AffineTransform transform, float[] pts)
           
static void transformRect(AffineTransform transform, Rectangle2D rect)
          Transform a rectangle, the rectangle is modified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deltaTransformPoint

public static Point2D deltaTransformPoint(AffineTransform transform,
                                          float x,
                                          float y)

deltaTransformPoint

public static void deltaTransformPoint(AffineTransform transform,
                                       float[] pts)

deltaTransformPoint

public static void deltaTransformPoint(AffineTransform transform,
                                       Point2D pt)

getScale

public static double getScale(AffineTransform transform)
The absolute scale of the transformation. This method assumes a uniform scale in x and y direction and a rotation in multiple of 90 degrees.

Parameters:
transform - The transformation whose scale is computed.
Returns:
The absolute scale of the transformation

inverseTransformRect

public static void inverseTransformRect(AffineTransform transform,
                                        Rectangle2D rect)
Transform a rectangle in device space to user space. The rectangle is modified. The coordinates of the result are normalized (lower left corner has smallest coordinate values).

Parameters:
transform - The transformation from user space to device space.
rect - The rectangle whose coordinates are transformed, the rectangle is modified.

normalizeRect

public static void normalizeRect(float[] pts)

normalizeRect

public static void normalizeRect(Rectangle2D rect)
Normalize the rectangle. The x and y value of the rectangle are updated to have the smallest coordinates (lower left corner).

Parameters:
rect - The rectangle whose coordinates are normalized, the rectangle is modified.

toFloatArray

public static float[] toFloatArray(Rectangle2D rect)

transformPoint

public static Point2D transformPoint(AffineTransform transform,
                                     float x,
                                     float y)

transformPoint

public static void transformPoint(AffineTransform transform,
                                  float[] pts)

transformPoint

public static void transformPoint(AffineTransform transform,
                                  Point2D pt)

transformRect

public static void transformRect(AffineTransform transform,
                                 float[] pts)

transformRect

public static void transformRect(AffineTransform transform,
                                 Rectangle2D rect)
Transform a rectangle, the rectangle is modified. The coordinates of the result are normalized (lower left corner has smallest coordinate values).

Parameters:
transform - The transformation from user space to device space.
rect - The rectangle whose coordinates are transformed, the rectangle is modified.

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.