edu.umd.cs.piccolox.swt
Class SWTShapeManager

java.lang.Object
  extended by edu.umd.cs.piccolox.swt.SWTShapeManager

public class SWTShapeManager
extends Object

SWT shape manager.

Author:
Lance Good

Constructor Summary
SWTShapeManager()
           
 
Method Summary
static void awtToSWT(Rectangle2D aRect, org.eclipse.swt.graphics.Rectangle sRect)
          Populates the SWT rectangle with the provided Swing Rectangle2D's coordinates.
static double[] shapeToPolyline(Shape shape)
          Converts the provided shape into an array of point coordinates given as one dimensional array with this format: x1,y1,x2,y3,....
static int[] transform(double[] points, AffineTransform at)
          Transforms the given points by the transform provided, leaving the original points untouched.
static void transform(Rectangle2D rect, AffineTransform at)
          Apply the specified transform to the specified rectangle, modifying the rect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWTShapeManager

public SWTShapeManager()
Method Detail

transform

public static void transform(Rectangle2D rect,
                             AffineTransform at)
Apply the specified transform to the specified rectangle, modifying the rect.

Parameters:
rect - The rectangle to be transformed
at - The transform to use to transform the rectangle

awtToSWT

public static void awtToSWT(Rectangle2D aRect,
                            org.eclipse.swt.graphics.Rectangle sRect)
Populates the SWT rectangle with the provided Swing Rectangle2D's coordinates. Rounding up to the nearest integer.

Parameters:
aRect - awt rectangle to extract coordinates from
sRect - swt rectangle to populate

shapeToPolyline

public static double[] shapeToPolyline(Shape shape)
Converts the provided shape into an array of point coordinates given as one dimensional array with this format: x1,y1,x2,y3,....

Parameters:
shape - shape to convert
Returns:
point coordinates given as one dimensional array with this format: x1,y1,x2,y3,...

transform

public static int[] transform(double[] points,
                              AffineTransform at)
Transforms the given points by the transform provided, leaving the original points untouched.

Parameters:
points - points to transform
at - transform to apply
Returns:
transformed coordinates given in format x1,y2,x2,y2,...


Copyright © 1995-2011 Piccolo2D. All Rights Reserved.