Class AbstractShapeCustomizer
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractChartCustomizer
-
- net.sf.jasperreports.customizers.shape.AbstractShapeCustomizer
-
- All Implemented Interfaces:
net.sf.jasperreports.engine.JRChartCustomizer,net.sf.jasperreports.engine.NamedChartCustomizer
- Direct Known Subclasses:
LegendShapeCustomizer,LineDotShapeCustomizer
public abstract class AbstractShapeCustomizer extends net.sf.jasperreports.engine.JRAbstractChartCustomizerAbstract customizer that provide the utility methods to work with shapes.- Author:
- Marco Orlandin (dejawho2@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceAbstractShapeCustomizer.ShapeSetter
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_SHAPE_HEIGHTstatic StringPROPERTY_SHAPE_POINTSstatic StringPROPERTY_SHAPE_TYPEstatic StringPROPERTY_SHAPE_WIDTH
-
Constructor Summary
Constructors Constructor Description AbstractShapeCustomizer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ShapebuildEllipse()Builds an ellipse shape.protected ShapebuildPolygon(ShapePoints shapePoints)Builds a polygon shape.protected ShapebuildPolyline(ShapePoints baseShape)Uses the points to build a polylineprotected ShapebuildRectangle()Builds a rectangle shape.protected ShapebuildShape()Builds the shape from the type and the points read from the respective configuration properties.protected Rectangle2DgetBounds(ShapePoints shape)protected IntegergetHeight()Returns the height of the shape.protected abstract PointgetOffset(Dimension2D size)protected abstract PointgetOffset(Rectangle2D bounds)protected Dimension2DgetSize()Returns the width and height properties defined, if only one is defined it value will be used also for the other, if they are both undefined it will return null.protected IntegergetWidth()Returns the width of the shape.protected voidupdateItem(ItemsCounter itemsCounter, AbstractShapeCustomizer.ShapeSetter shapeSetter, int index)Apply the shaped defined in the configuration to the ShapeSetter in the specified index of the passed parameterprotected voidupdateItems(ItemsCounter itemsCounter, AbstractShapeCustomizer.ShapeSetter shapeSetter)Update all the items in the collection-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractChartCustomizer
getBooleanProperty, getCustomizerPropertyName, getDoubleProperty, getFieldValue, getFieldValue, getFloatProperty, getIntegerProperty, getParameterValue, getParameterValue, getProperty, getVariableValue, getVariableValue, init, setName
-
-
-
-
Field Detail
-
PROPERTY_SHAPE_WIDTH
public static final String PROPERTY_SHAPE_WIDTH
- See Also:
- Constant Field Values
-
PROPERTY_SHAPE_HEIGHT
public static final String PROPERTY_SHAPE_HEIGHT
- See Also:
- Constant Field Values
-
PROPERTY_SHAPE_TYPE
public static final String PROPERTY_SHAPE_TYPE
- See Also:
- Constant Field Values
-
PROPERTY_SHAPE_POINTS
public static final String PROPERTY_SHAPE_POINTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getWidth
protected Integer getWidth()
Returns the width of the shape.- Returns:
- the width of the shape or null if it is not specified
-
getHeight
protected Integer getHeight()
Returns the height of the shape.- Returns:
- the height of the shape or null if it is not specified
-
buildShape
protected Shape buildShape()
Builds the shape from the type and the points read from the respective configuration properties.- Returns:
- the Shape or null if the configuration properties are not valid
-
getSize
protected Dimension2D getSize()
Returns the width and height properties defined, if only one is defined it value will be used also for the other, if they are both undefined it will return null.- Returns:
- a size or null if it is undefined
-
getBounds
protected Rectangle2D getBounds(ShapePoints shape)
-
getOffset
protected abstract Point getOffset(Dimension2D size)
-
getOffset
protected abstract Point getOffset(Rectangle2D bounds)
-
buildEllipse
protected Shape buildEllipse()
Builds an ellipse shape.- Returns:
- the ellipse or null if its size is not specified
-
buildRectangle
protected Shape buildRectangle()
Builds a rectangle shape.- Returns:
- the rectangle or null if its size is not specified
-
buildPolygon
protected Shape buildPolygon(ShapePoints shapePoints)
Builds a polygon shape.- Parameters:
shapePoints- the points of the polygon- Returns:
- the polygon or null if it can't be build from the current configuration
-
buildPolyline
protected Shape buildPolyline(ShapePoints baseShape)
Uses the points to build a polyline- Parameters:
baseShape- the points of the polyline- Returns:
- a polyline shape or null if it can't be build from the current configuration
-
updateItem
protected void updateItem(ItemsCounter itemsCounter, AbstractShapeCustomizer.ShapeSetter shapeSetter, int index)
Apply the shaped defined in the configuration to the ShapeSetter in the specified index of the passed parameter
-
updateItems
protected void updateItems(ItemsCounter itemsCounter, AbstractShapeCustomizer.ShapeSetter shapeSetter)
Update all the items in the collection
-
-