public class ReportCompositeElement extends java.lang.Object implements ReportElement
Created by skaupper on 04.08.2016.
| Constructor and Description |
|---|
ReportCompositeElement() |
| Modifier and Type | Method and Description |
|---|---|
ReportCompositeElement |
addElement(ReportElement element) |
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
|
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 startX,
float startY,
float allowedWidth) |
void |
setSplitable(boolean splitable) |
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.
|
public ReportCompositeElement addElement(ReportElement element)
public void setSplitable(boolean splitable)
public float print(org.apache.pdfbox.pdmodel.PDDocument document,
org.apache.pdfbox.pdmodel.PDPageContentStream stream,
int pageNumber,
float startX,
float startY,
float allowedWidth)
throws java.io.IOException
print in interface ReportElementdocument - PdfBox documentstream - PdfBox streampageNumber - current page number (0 based)startX - starting xstartY - starting yallowedWidth - maximal width of segmentjava.io.IOException - in case something happens during printingpublic 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 ReportElement