public class ReportTextBox extends java.lang.Object implements ReportElement
IMPORTANT: Although this class is publicly visible, it is subject to change and may not be implemented by clients!
| Modifier and Type | Field and Description |
|---|---|
protected ReportAlignType |
align |
protected java.util.Map<cc.catalysts.boot.report.pdf.elements.ReportTextBox.CacheKey,java.lang.String[]> |
cache |
protected float |
lineDistance |
protected java.lang.String |
text |
protected PdfTextStyle |
textConfig |
| Constructor and Description |
|---|
ReportTextBox(PdfTextStyle textConfig,
float lineDistance,
java.lang.String text) |
ReportTextBox(ReportTextBox object,
java.lang.String text)
copy constructor with new text
|
| Modifier and Type | Method and Description |
|---|---|
ReportTextBox |
clone(java.lang.String newString) |
ReportAlignType |
getAlign() |
float |
getFirstSegmentHeight(float allowedWidth)
in case isSplitable is true, this method will be called.
|
float |
getHeight(float allowedWidth)
Height of this segment
|
float |
getHeightOfElementToSplit(float allowedWidth,
float allowedHeight)
For splittable elements returns the current height of the element that needs to be split.
|
java.util.Collection<ReportImage.ImagePrintIntent> |
getImageIntents()
Returns all the images that should have been printed by this element
|
java.lang.String |
getText() |
boolean |
isSplitable()
In case the element may be split over pages, this method should return true
|
float |
print(org.apache.pdfbox.pdmodel.PDDocument document,
org.apache.pdfbox.pdmodel.PDPageContentStream stream,
int pageNumber,
float textX,
float textY,
float allowedWidth) |
void |
setAlign(ReportAlignType align) |
void |
setText(java.lang.String text) |
ReportElement[] |
split(float allowedWidth)
If the element my be split this method should return two elements.
|
ReportElement[] |
split(float allowedWidth,
float allowedHeight)
Will split the report element, so the height of the first segment will the maximum value less or equal to the allowed height value.
|
protected java.lang.String[] |
split(float allowedWidth,
java.lang.String text) |
protected PdfTextStyle textConfig
protected java.lang.String text
protected final float lineDistance
protected ReportAlignType align
protected java.util.Map<cc.catalysts.boot.report.pdf.elements.ReportTextBox.CacheKey,java.lang.String[]> cache
public ReportTextBox(PdfTextStyle textConfig, float lineDistance, java.lang.String text)
public ReportTextBox(ReportTextBox object, java.lang.String text)
object - reportTextBox object for configurationstext - text of text boxpublic ReportTextBox clone(java.lang.String newString)
public float print(org.apache.pdfbox.pdmodel.PDDocument document,
org.apache.pdfbox.pdmodel.PDPageContentStream stream,
int pageNumber,
float textX,
float textY,
float allowedWidth)
print in interface ReportElementdocument - PdfBox documentstream - PdfBox streampageNumber - current page number (0 based)textX - starting xtextY - starting yallowedWidth - maximal width of segmentpublic float getHeight(float allowedWidth)
ReportElementgetHeight in interface ReportElementallowedWidth - allowed with of the segmentpublic boolean isSplitable()
ReportElementisSplitable in interface ReportElementpublic float getFirstSegmentHeight(float allowedWidth)
ReportElementgetFirstSegmentHeight in interface ReportElementallowedWidth - the maximum allowed width for this elementpublic ReportElement[] split(float allowedWidth)
ReportElementsplit in interface ReportElementallowedWidth - allowed with of the segmentpublic ReportElement[] split(float allowedWidth, float allowedHeight)
ReportElementsplit in interface ReportElementallowedWidth - width of report elementallowedHeight - max height of first segment.public float getHeightOfElementToSplit(float allowedWidth,
float allowedHeight)
ReportElementgetHeightOfElementToSplit in interface ReportElementallowedWidth - width of report elementallowedHeight - max height of first segment.public java.util.Collection<ReportImage.ImagePrintIntent> getImageIntents()
ReportElementgetImageIntents in interface ReportElementprotected java.lang.String[] split(float allowedWidth,
java.lang.String text)
public ReportAlignType getAlign()
public void setAlign(ReportAlignType align)
public java.lang.String getText()
public void setText(java.lang.String text)