| java.lang.Object org.jfree.report.elementfactory.ElementFactory org.jfree.report.elementfactory.ShapeElementFactory org.jfree.report.elementfactory.StaticShapeElementFactory
StaticShapeElementFactory | public class StaticShapeElementFactory extends ShapeElementFactory (Code) | | A factory to produce static shape elements. The shapes must not contain negative
coordinates and should start at (0,0). The factory does not scale shapes which have a
negative width or height. This behaviour was valid for JFreeReport versions up to
version 0.8.3 and is highly dangerous.
The shape is considered immutable.
The static utility methods provided in that class try to map negative values of lines
and rectangles in the createLineShapeElement and createRectangleElement to preserve the
old behaviour.
The static method
StaticShapeElementFactory.createShapeElement(StringColorStrokeShapebooleanboolean) extracts the bounds from the given shape and performs
an tranlate transform to map the shape to the coordinate (0,0).
author: Thomas Morgner |
Method Summary | |
public Element | createElement() Generates a new shape element. | public static ShapeElement | createEllipseShapeElement(String name, Color paint, Stroke stroke, Ellipse2D shape, boolean shouldDraw, boolean shouldFill) Creates a new RectangleShapeElement.
Parameters: name - the name of the new element Parameters: paint - the line color of this element Parameters: stroke - the stroke of this shape. | public static ShapeElement | createHorizontalLine(String name, Color paint, Stroke stroke, double y1) Creates a horizontal line. | public static ShapeElement | createLineShapeElement(String name, Color paint, Stroke stroke, Line2D shape) Creates a new LineShapeElement. | public static ShapeElement | createRectangleShapeElement(String name, Color paint, Stroke stroke, Rectangle2D shape, boolean shouldDraw, boolean shouldFill) Creates a new RectangleShapeElement.
Parameters: name - the name of the new element Parameters: paint - the line color of this element Parameters: stroke - the stroke of this shape. | public static ShapeElement | createRoundRectangleShapeElement(String name, Color paint, Stroke stroke, RoundRectangle2D shape, boolean shouldDraw, boolean shouldFill) Creates a new RectangleShapeElement.
Parameters: name - the name of the new element Parameters: paint - the line color of this element Parameters: stroke - the stroke of this shape. | public static ShapeElement | createShapeElement(String name, Color paint, Stroke stroke, Shape shape, boolean shouldDraw, boolean shouldFill) Creates a new LineShapeElement. | public static ShapeElement | createShapeElement(String name, Rectangle2D bounds, Color paint, Stroke stroke, Shape shape, boolean shouldDraw, boolean shouldFill, boolean shouldScale) Creates a new ShapeElement.
Parameters: name - the name of the new element. Parameters: bounds - the bounds. Parameters: paint - the line color of this element. Parameters: stroke - the stroke of this shape. | public static ShapeElement | createShapeElement(String name, Rectangle2D bounds, Color paint, Stroke stroke, Shape shape, boolean shouldDraw, boolean shouldFill, boolean shouldScale, boolean keepAspectRatio) Creates a new ShapeElement.
Parameters: name - the name of the new element. Parameters: bounds - the bounds. Parameters: paint - the line color of this element. Parameters: stroke - the stroke of this shape. | public static ShapeElement | createVerticalLine(String name, Color paint, Stroke stroke, double x) Creates a vertical line. | public Shape | getShape() Returns the shape object used as content of the new elements. | public void | setShape(Shape shape) Defines the shape object used as content of the new elements. |
StaticShapeElementFactory | public StaticShapeElementFactory()(Code) | | Default Constructor.
|
createEllipseShapeElement | public static ShapeElement createEllipseShapeElement(String name, Color paint, Stroke stroke, Ellipse2D shape, boolean shouldDraw, boolean shouldFill)(Code) | | Creates a new RectangleShapeElement.
Parameters: name - the name of the new element Parameters: paint - the line color of this element Parameters: stroke - the stroke of this shape. For pdf use, restrict to BasicStokes. Parameters: shape - the Rectangle2D shape Parameters: shouldDraw - a flag controlling whether or not the shape outline is drawn. Parameters: shouldFill - a flag controlling whether or not the shape interior is filled. a report element for drawing a rectangle. throws: NullPointerException - if bounds or shape are null throws: IllegalArgumentException - if the given alignment is invalid |
createHorizontalLine | public static ShapeElement createHorizontalLine(String name, Color paint, Stroke stroke, double y1)(Code) | | Creates a horizontal line. The line spans the complete width of the band (starts at 0
and goes to 100%) and is on the given y position.
Parameters: name - the name of the line element (or zero for no name). Parameters: paint - the paint (or zero for the default). Parameters: stroke - the stroke (or zero for the default). Parameters: y1 - the y position of the line. the created and fully initialized shape element. |
createRectangleShapeElement | public static ShapeElement createRectangleShapeElement(String name, Color paint, Stroke stroke, Rectangle2D shape, boolean shouldDraw, boolean shouldFill)(Code) | | Creates a new RectangleShapeElement.
Parameters: name - the name of the new element Parameters: paint - the line color of this element Parameters: stroke - the stroke of this shape. For pdf use, restrict to BasicStokes. Parameters: shape - the Rectangle2D shape Parameters: shouldDraw - a flag controlling whether or not the shape outline is drawn. Parameters: shouldFill - a flag controlling whether or not the shape interior is filled. a report element for drawing a rectangle. throws: NullPointerException - if bounds or shape are null throws: IllegalArgumentException - if the given alignment is invalid |
createRoundRectangleShapeElement | public static ShapeElement createRoundRectangleShapeElement(String name, Color paint, Stroke stroke, RoundRectangle2D shape, boolean shouldDraw, boolean shouldFill)(Code) | | Creates a new RectangleShapeElement.
Parameters: name - the name of the new element Parameters: paint - the line color of this element Parameters: stroke - the stroke of this shape. For pdf use, restrict to BasicStokes. Parameters: shape - the Rectangle2D shape Parameters: shouldDraw - a flag controlling whether or not the shape outline is drawn. Parameters: shouldFill - a flag controlling whether or not the shape interior is filled. a report element for drawing a rectangle. throws: NullPointerException - if bounds or shape are null throws: IllegalArgumentException - if the given alignment is invalid |
createShapeElement | public static ShapeElement createShapeElement(String name, Color paint, Stroke stroke, Shape shape, boolean shouldDraw, boolean shouldFill)(Code) | | Creates a new LineShapeElement. This methods extracts the bounds from the shape and
correct the shape to start from point (0,0) by using an AffineTransform. Use one of
the createShape methods, that allow you to supply separate bounds and shapes, if you
want to have full control over the creation process.
Warning: This function will misbehave, if you supply a Line2D
instance with relative coordinates. The bounds of such lines cannot be securely
translated into relative coordinates as used by JFreeReport.
Parameters: name - the name of the new element. Parameters: paint - the line color of this element. Parameters: stroke - the stroke of this shape. For pdf use, restrict to BasicStrokes. Parameters: shape - the shape. Parameters: shouldDraw - draw the shape? Parameters: shouldFill - fill the shape? a report element for drawing a line. throws: NullPointerException - if bounds or shape are null throws: IllegalArgumentException - if the given alignment is invalid |
createShapeElement | public static ShapeElement createShapeElement(String name, Rectangle2D bounds, Color paint, Stroke stroke, Shape shape, boolean shouldDraw, boolean shouldFill, boolean shouldScale)(Code) | | Creates a new ShapeElement.
Parameters: name - the name of the new element. Parameters: bounds - the bounds. Parameters: paint - the line color of this element. Parameters: stroke - the stroke of this shape. For pdf use, restrict to BasicStrokes. Parameters: shape - the shape. Parameters: shouldDraw - draw the shape? Parameters: shouldFill - fill the shape? Parameters: shouldScale - scale the shape? a report element for drawing a line. throws: NullPointerException - if bounds or shape are null throws: IllegalArgumentException - if the given alignment is invalid |
createShapeElement | public static ShapeElement createShapeElement(String name, Rectangle2D bounds, Color paint, Stroke stroke, Shape shape, boolean shouldDraw, boolean shouldFill, boolean shouldScale, boolean keepAspectRatio)(Code) | | Creates a new ShapeElement.
Parameters: name - the name of the new element. Parameters: bounds - the bounds. Parameters: paint - the line color of this element. Parameters: stroke - the stroke of this shape. For pdf use, restrict toBasicStrokes. Parameters: shape - the shape. Parameters: shouldDraw - draw the shape? Parameters: shouldFill - fill the shape? Parameters: shouldScale - scale the shape? Parameters: keepAspectRatio - preserve the aspect ratio? a report element for drawing a line. throws: NullPointerException - if bounds or shape are null throws: IllegalArgumentException - if the given alignment is invalid |
createVerticalLine | public static ShapeElement createVerticalLine(String name, Color paint, Stroke stroke, double x)(Code) | | Creates a vertical line. The line spans the complete height of the band (starts at 0
and goes to 100%) and is on the given x position.
Parameters: name - the name of the line element (or zero for no name). Parameters: paint - the paint (or zero for the default). Parameters: stroke - the stroke (or zero for the default). Parameters: x - the x position of the line. the created and fully initialized shape element. |
getShape | public Shape getShape()(Code) | | Returns the shape object used as content of the new elements.
the shape content. |
setShape | public void setShape(Shape shape)(Code) | | Defines the shape object used as content of the new elements.
Parameters: shape - the shape content. |
|
|