public class

Shape

extends ContentNode
java.lang.Object
   ↳ com.pdftron.layout.ContentElement
     ↳ com.pdftron.layout.ContentNode
       ↳ com.pdftron.layout.Shape

Class Overview

A Shape is a content element that draws a preset shape such as a line, a rectangle or an oval.

A shape can carry a background color or a background image, an outline, and it can hold text in its text box.

Summary

Nested Classes
enum Shape.ShapeType The preset geometry of a Shape. 
Public Methods
double getArrowHeadSize()
double getCornerRadius()
boolean getFlipHorizontal()
boolean getFlipVertical()
double getHeight()
double getOutlineThickness()
double getRotation()
ContentContainer getTextBox()
Gets the text box of the shape, which content can be added to.
Shape.ShapeType getType()
double getWidth()
void setArrowHeadSize(double sizePoints)
Sets the size of the arrow heads of line shapes.
void setBackgroundColor(int red, int green, int blue)
Sets the background color of the shape.
void setBackgroundImageFilter(Filter imageFilter)
Sets an image as the background of the shape.
void setBackgroundImagePath(String filePath)
Sets an image as the background of the shape.
void setCornerRadius(double radiusPoints)
Sets the corner radius of rounded rectangle shapes.
void setFlipHorizontal(boolean value)
Sets whether the shape is mirrored horizontally.
void setFlipVertical(boolean value)
Sets whether the shape is mirrored vertically.
void setHeight(double heightPoints)
Sets the height of the shape.
void setOutlineColor(int red, int green, int blue)
Sets the outline color of the shape.
void setOutlineThickness(double thicknessPoints)
Sets the outline thickness of the shape.
void setRotation(double angle)
Sets the rotation of the shape.
void setType(Shape.ShapeType type)
Sets the preset geometry of the shape.
void setWidth(double widthPoints)
Sets the width of the shape.
[Expand]
Inherited Methods
From class com.pdftron.layout.ContentNode
From class com.pdftron.layout.ContentElement
From class java.lang.Object

Public Methods

public double getArrowHeadSize ()

Returns
  • The arrow head size in points

public double getCornerRadius ()

Returns
  • The corner radius in points

public boolean getFlipHorizontal ()

Returns
  • Whether the shape is mirrored horizontally

public boolean getFlipVertical ()

Returns
  • Whether the shape is mirrored vertically

public double getHeight ()

Returns
  • The height of the shape in points

public double getOutlineThickness ()

Returns
  • The outline thickness in points

public double getRotation ()

Returns
  • The rotation angle of the shape, in degrees

public ContentContainer getTextBox ()

Gets the text box of the shape, which content can be added to.

Returns
  • The text box of the shape

public Shape.ShapeType getType ()

Returns
  • The preset geometry of the shape

public double getWidth ()

Returns
  • The width of the shape in points

public void setArrowHeadSize (double sizePoints)

Sets the size of the arrow heads of line shapes.

Parameters
sizePoints The arrow head size in points

public void setBackgroundColor (int red, int green, int blue)

Sets the background color of the shape.

Parameters
red The red component of the color
green The green component of the color
blue The blue component of the color

public void setBackgroundImageFilter (Filter imageFilter)

Sets an image as the background of the shape.

Parameters
imageFilter A filter providing the image data

public void setBackgroundImagePath (String filePath)

Sets an image as the background of the shape.

Parameters
filePath The path of the image file

public void setCornerRadius (double radiusPoints)

Sets the corner radius of rounded rectangle shapes.

Parameters
radiusPoints The corner radius in points

public void setFlipHorizontal (boolean value)

Sets whether the shape is mirrored horizontally.

Parameters
value true to flip the shape horizontally

public void setFlipVertical (boolean value)

Sets whether the shape is mirrored vertically.

Parameters
value true to flip the shape vertically

public void setHeight (double heightPoints)

Sets the height of the shape.

Parameters
heightPoints The height in points

public void setOutlineColor (int red, int green, int blue)

Sets the outline color of the shape.

Parameters
red The red component of the color
green The green component of the color
blue The blue component of the color

public void setOutlineThickness (double thicknessPoints)

Sets the outline thickness of the shape.

Parameters
thicknessPoints The outline thickness in points

public void setRotation (double angle)

Sets the rotation of the shape.

Parameters
angle The rotation angle, in degrees

public void setType (Shape.ShapeType type)

Sets the preset geometry of the shape.

Parameters
type The shape type

public void setWidth (double widthPoints)

Sets the width of the shape.

Parameters
widthPoints The width in points