
net.sf.nervalreports.generators.PDFSentence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdf-generator Show documentation
Show all versions of pdf-generator Show documentation
This is the PDF generator package of NervalReports (a lightweight report creation library),
used to generate a report directly to a .pdf file.
/** This file is part of nervalreports.
*
* nervalreports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* nervalreports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with nervalreports. If not, see . */
package net.sf.nervalreports.generators;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
/** Basic class for sentences in {@link PDFReportGenerator}. A sentence usually is combined
* with another sentences to form a line.
* @author farrer */
/* default */ abstract class PDFSentence {
/** Needed width for containing the current sentence. */
private float width;
/** Needed height for containing the current sentence */
private float height;
/** Flush the sentence to the page.
* @param pageContentStream content stream to flush the sentence to.
* @param x page X position to flush the sentence to.
* @param y page Y position to flush the sentence to. */
/* default */ abstract void flush(PDPageContentStream pageContentStream, float x, float y) throws Exception;
/** @return {@link #width}. */
/* default */ float getWidth() {
return width;
}
/** Set {@link #width}.
* @param width new width value */
protected void setWidth(float width) {
this.width = width;
}
/** @return {@link #height}. */
/* default */ float getHeight() {
return height;
}
/** Set {@link #height}.
* @param height new height value */
protected void setHeight(float height) {
this.height = height;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy