Class AbstractShapeCustomizer
- java.lang.Object
-
- net.sf.jasperreports.charts.JRAbstractChartCustomizer
-
- net.sf.jasperreports.customizers.shape.AbstractShapeCustomizer
-
- All Implemented Interfaces:
JRChartCustomizer
,NamedChartCustomizer
- Direct Known Subclasses:
LegendShapeCustomizer
,LineDotShapeCustomizer
public abstract class AbstractShapeCustomizer extends JRAbstractChartCustomizer
Abstract 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 interface
AbstractShapeCustomizer.ShapeSetter
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_SHAPE_HEIGHT
static String
PROPERTY_SHAPE_POINTS
static String
PROPERTY_SHAPE_TYPE
static String
PROPERTY_SHAPE_WIDTH
-
Fields inherited from class net.sf.jasperreports.charts.JRAbstractChartCustomizer
chart, filler
-
Fields inherited from interface net.sf.jasperreports.charts.JRChartCustomizer
CUSTOMIZER_CLASS_PROPERTY_PREFIX, CUSTOMIZER_PROPERTY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description AbstractShapeCustomizer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Shape
buildEllipse()
Builds an ellipse shape.protected Shape
buildPolygon(ShapePoints shapePoints)
Builds a polygon shape.protected Shape
buildPolyline(ShapePoints baseShape)
Uses the points to build a polylineprotected Shape
buildRectangle()
Builds a rectangle shape.protected Shape
buildShape()
Builds the shape from the type and the points read from the respective configuration properties.protected Rectangle2D
getBounds(ShapePoints shape)
protected Integer
getHeight()
Returns the height of the shape.protected abstract Point
getOffset(Dimension2D size)
protected abstract Point
getOffset(Rectangle2D bounds)
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.protected Integer
getWidth()
Returns the width of the shape.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 parameterprotected void
updateItems(ItemsCounter itemsCounter, AbstractShapeCustomizer.ShapeSetter shapeSetter)
Update all the items in the collection-
Methods inherited from class net.sf.jasperreports.charts.JRAbstractChartCustomizer
getBooleanProperty, getCustomizerPropertyName, getDoubleProperty, getFieldValue, getFieldValue, getFloatProperty, getIntegerProperty, getParameterValue, getParameterValue, getProperty, getVariableValue, getVariableValue, init, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.charts.JRChartCustomizer
customize
-
-
-
-
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
-
-