|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.elementfactory.ElementFactory
org.jfree.report.elementfactory.ShapeElementFactory
org.jfree.report.elementfactory.StaticShapeElementFactory
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
createShapeElement(String, Color, Stroke, Shape,
boolean, boolean)
extracts the bounds from the given shape and performs an tranlate
transform to map the shape to the coordinate (0,0).
Constructor Summary | |
StaticShapeElementFactory()
Default Constructor. |
Method Summary | |
Element |
createElement()
Generates a new shape element. |
static ShapeElement |
createLineShapeElement(java.lang.String name,
java.awt.Color paint,
java.awt.Stroke stroke,
java.awt.geom.Line2D shape)
Creates a new LineShapeElement. |
static ShapeElement |
createRectangleShapeElement(java.lang.String name,
java.awt.Color paint,
java.awt.Stroke stroke,
java.awt.geom.Rectangle2D shape,
boolean shouldDraw,
boolean shouldFill)
Creates a new RectangleShapeElement. |
static ShapeElement |
createShapeElement(java.lang.String name,
java.awt.Color paint,
java.awt.Stroke stroke,
java.awt.Shape shape,
boolean shouldDraw,
boolean shouldFill)
Creates a new LineShapeElement. |
static ShapeElement |
createShapeElement(java.lang.String name,
java.awt.geom.Rectangle2D bounds,
java.awt.Color paint,
java.awt.Stroke stroke,
java.awt.Shape shape,
boolean shouldDraw,
boolean shouldFill,
boolean shouldScale)
Creates a new ShapeElement. |
static ShapeElement |
createShapeElement(java.lang.String name,
java.awt.geom.Rectangle2D bounds,
java.awt.Color paint,
java.awt.Stroke stroke,
java.awt.Shape shape,
boolean shouldDraw,
boolean shouldFill,
boolean shouldScale,
boolean keepAspectRatio)
Creates a new ShapeElement. |
java.awt.Shape |
getShape()
Returns the shape object used as content of the new elements. |
void |
setShape(java.awt.Shape shape)
Defines the shape object used as content of the new elements. |
Methods inherited from class org.jfree.report.elementfactory.ShapeElementFactory |
applyStyle, getColor, getKeepAspectRatio, getScale, getShouldDraw, getShouldFill, getStroke, setColor, setKeepAspectRatio, setScale, setShouldDraw, setShouldFill, setStroke |
Methods inherited from class org.jfree.report.elementfactory.ElementFactory |
applyElementName, getAbsolutePosition, getDynamicHeight, getMaximumSize, getMinimumSize, getName, getPreferredSize, setAbsolutePosition, setDynamicHeight, setMaximumSize, setMinimumSize, setName, setPreferredSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StaticShapeElementFactory()
Method Detail |
public java.awt.Shape getShape()
public void setShape(java.awt.Shape shape)
shape
- the shape content.public Element createElement()
createElement
in class ElementFactory
ElementFactory.createElement()
public static ShapeElement createLineShapeElement(java.lang.String name, java.awt.Color paint, java.awt.Stroke stroke, java.awt.geom.Line2D shape)
name
- the name of the new elementpaint
- the line color of this elementstroke
- the stroke of this shape. For pdf use, restrict to BasicStokes.shape
- the Line2D shape
java.lang.NullPointerException
- if bounds or shape are null
java.lang.IllegalArgumentException
- if the given alignment is invalidpublic static ShapeElement createShapeElement(java.lang.String name, java.awt.Color paint, java.awt.Stroke stroke, java.awt.Shape shape, boolean shouldDraw, boolean shouldFill)
name
- the name of the new element.paint
- the line color of this element.stroke
- the stroke of this shape. For pdf use, restrict to BasicStrokes.shape
- the shape.shouldDraw
- draw the shape?shouldFill
- fill the shape?
java.lang.NullPointerException
- if bounds or shape are null
java.lang.IllegalArgumentException
- if the given alignment is invalidpublic static ShapeElement createShapeElement(java.lang.String name, java.awt.geom.Rectangle2D bounds, java.awt.Color paint, java.awt.Stroke stroke, java.awt.Shape shape, boolean shouldDraw, boolean shouldFill, boolean shouldScale)
name
- the name of the new element.bounds
- the bounds.paint
- the line color of this element.stroke
- the stroke of this shape. For pdf use, restrict to BasicStrokes.shape
- the shape.shouldDraw
- draw the shape?shouldFill
- fill the shape?shouldScale
- scale the shape?
java.lang.NullPointerException
- if bounds or shape are null
java.lang.IllegalArgumentException
- if the given alignment is invalidpublic static ShapeElement createShapeElement(java.lang.String name, java.awt.geom.Rectangle2D bounds, java.awt.Color paint, java.awt.Stroke stroke, java.awt.Shape shape, boolean shouldDraw, boolean shouldFill, boolean shouldScale, boolean keepAspectRatio)
name
- the name of the new element.bounds
- the bounds.paint
- the line color of this element.stroke
- the stroke of this shape. For pdf use, restrict to BasicStrokes.shape
- the shape.shouldDraw
- draw the shape?shouldFill
- fill the shape?shouldScale
- scale the shape?keepAspectRatio
- preserve the aspect ratio?
java.lang.NullPointerException
- if bounds or shape are null
java.lang.IllegalArgumentException
- if the given alignment is invalidpublic static ShapeElement createRectangleShapeElement(java.lang.String name, java.awt.Color paint, java.awt.Stroke stroke, java.awt.geom.Rectangle2D shape, boolean shouldDraw, boolean shouldFill)
name
- the name of the new elementpaint
- the line color of this elementstroke
- the stroke of this shape. For pdf use, restrict to BasicStokes.shape
- the Rectangle2D shapeshouldDraw
- a flag controlling whether or not the shape outline is drawn.shouldFill
- a flag controlling whether or not the shape interior is filled.
java.lang.NullPointerException
- if bounds or shape are null
java.lang.IllegalArgumentException
- if the given alignment is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |