Class HSLFFreeformShape

All Implemented Interfaces:
Iterable<HSLFTextParagraph>, IAdjustableShape, AutoShape<HSLFShape,HSLFTextParagraph>, FreeformShape<HSLFShape,HSLFTextParagraph>, PlaceableShape<HSLFShape,HSLFTextParagraph>, Shape<HSLFShape,HSLFTextParagraph>, SimpleShape<HSLFShape,HSLFTextParagraph>, TextShape<HSLFShape,HSLFTextParagraph>

public final class HSLFFreeformShape extends HSLFAutoShape implements FreeformShape<HSLFShape,HSLFTextParagraph>
A "Freeform" shape.

Shapes drawn with the "Freeform" tool have cubic bezier curve segments in the smooth sections and straight-line segments in the straight sections. This object closely corresponds to java.awt.geom.GeneralPath.

  • Constructor Details

    • HSLFFreeformShape

      public HSLFFreeformShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
      Create a new Freeform. This constructor is used when a new shape is created.
      Parameters:
      parent - the parent of this Shape. For example, if this text box is a cell in a table then the parent is Table.
    • HSLFFreeformShape

      public HSLFFreeformShape()
      Create a new Freeform. This constructor is used when a new shape is created.
  • Method Details

    • setPath

      public int setPath(Path2D path)
      Description copied from interface: FreeformShape
      Set the shape path
      Specified by:
      setPath in interface FreeformShape<HSLFShape,HSLFTextParagraph>
      Parameters:
      path - shape outline
      Returns:
      the number of points written
    • getPath

      public Path2D getPath()
      Description copied from interface: FreeformShape
      Gets the shape path.

      The path is translated in the shape's coordinate system, i.e. freeform.getPath2D().getBounds2D() equals to freeform.getAnchor() (small discrepancies are possible due to rounding errors)

      Specified by:
      getPath in interface FreeformShape<HSLFShape,HSLFTextParagraph>
      Returns:
      the path