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)
  • Field Details

  • Constructor Details

    • AbstractShapeCustomizer

      public AbstractShapeCustomizer()
  • Method Details

    • 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