|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.util.ShapeTransform
public final class ShapeTransform
Utility class, which resizes or translates a Shape. The class contains special handlers for Rectangles and Lines.
Field Summary | |
---|---|
static int |
ABOVE
Flag for point lying "above" clipping area. |
static int |
BELOW
Flag for point lying "below" clipping area. |
static int |
H_CENTER
Flag for point lying between horizontal bounds of area. |
static int |
INSIDE
Mask for points which are inside. |
static int |
LEFT
Flag for point lying left of clipping area. |
static int |
OUTSIDE
Mask for points which are outside. |
static int |
RIGHT
Flag for point lying right of clipping area. |
static int |
V_CENTER
Flag for point lying between vertical bounds of clipping area. |
Method Summary | |
---|---|
static Point2D[] |
getClipped(double x1,
double y1,
double x2,
double y2,
double xmin,
double xmax,
double ymin,
double ymax)
Calculate the clipping points of a line with a rectangle. |
static Shape |
performCliping(Shape s,
Rectangle2D bounds)
Clips the given shape to the given bounds. |
static Shape |
resizeRect(RectangularShape rectangularShape,
double width,
double height)
Resizes a rectangle. |
static Shape |
resizeShape(Shape s,
float width,
float height)
Resizes a shape, so that the shape has the given width and height, but the origin of the shape does not change. |
static Shape |
transformShape(Shape s,
boolean scale,
boolean keepAR,
Dimension2D dim)
Translates the given shape. |
static Shape |
transformShape(Shape s,
boolean scale,
boolean keepAR,
double width,
double height)
Translates the given shape. |
static Shape |
translateShape(Shape s,
double x,
double y)
Translates a se. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LEFT
public static final int H_CENTER
public static final int RIGHT
public static final int BELOW
public static final int V_CENTER
public static final int ABOVE
public static final int INSIDE
public static final int OUTSIDE
Method Detail |
---|
public static Shape resizeShape(Shape s, float width, float height)
s
- the shapewidth
- the new widthheight
- the new height
public static Shape resizeRect(RectangularShape rectangularShape, double width, double height)
rectangularShape
- the rectanglewidth
- the new width of the rectangleheight
- the new height of the rectangle.
public static Shape transformShape(Shape s, boolean scale, boolean keepAR, double width, double height)
point
. If scaling is
requested, the shape will also be scaled using an AffineTransform.
s
- the shape that should be transformedscale
- true, if the shape should be scaled, false otherwisekeepAR
- true, if the scaled shape should keep the aspect ratiowidth
- the target width.height
- the target height.
public static Shape transformShape(Shape s, boolean scale, boolean keepAR, Dimension2D dim)
point
. If scaling is
requested, the shape will also be scaled using an AffineTransform.
s
- the shape that should be transformedscale
- true, if the shape should be scaled, false otherwisekeepAR
- true, if the scaled shape should keep the aspect ratiodim
- the target dimension.
public static Shape performCliping(Shape s, Rectangle2D bounds)
s
- the shape to be clippedbounds
- the bounds to which the shape should be clipped
public static Shape translateShape(Shape s, double x, double y)
s
- the shapex
- the x coordinate where the shape is translated toy
- the y coordinate where the shape is translated to
public static Point2D[] getClipped(double x1, double y1, double x2, double y2, double xmin, double xmax, double ymin, double ymax)
x1
- starting x of liney1
- starting y of linex2
- ending x of liney2
- ending y of linexmin
- lower left x of rectanglexmax
- upper right x of rectangleymin
- lower left y of rectangleymax
- upper right y of rectangle
null
(does not clip) or array of two points
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |