Search in sources :

Example 1 with MultilineCell

use of com.faltenreich.diaguard.feature.export.job.pdf.view.MultilineCell in project Diaguard by Faltenreich.

the class PdfLog method getRow.

private List<Cell> getRow(PdfExportCache cache, String title, String subtitle, String description, int backgroundColor, int foregroundColor) {
    List<Cell> entryRow = new ArrayList<>();
    float width = cache.getPage().getWidth();
    Cell titleCell = new CellBuilder(new Cell(cache.getFontNormal())).setWidth(PdfLog.TIME_WIDTH).setText(title).setBackgroundColor(backgroundColor).setForegroundColor(Color.gray).build();
    entryRow.add(titleCell);
    Cell subtitleCell = new CellBuilder(new Cell(cache.getFontNormal())).setWidth(getLabelWidth()).setText(subtitle).setBackgroundColor(backgroundColor).setForegroundColor(Color.gray).build();
    entryRow.add(subtitleCell);
    Cell descriptionCell = new CellBuilder(new MultilineCell(cache.getFontNormal())).setWidth(width - titleCell.getWidth() - subtitleCell.getWidth()).setText(description).setBackgroundColor(backgroundColor).setForegroundColor(foregroundColor).build();
    entryRow.add(descriptionCell);
    return entryRow;
}
Also used : MultilineCell(com.faltenreich.diaguard.feature.export.job.pdf.view.MultilineCell) CellBuilder(com.faltenreich.diaguard.feature.export.job.pdf.view.CellBuilder) ArrayList(java.util.ArrayList) MultilineCell(com.faltenreich.diaguard.feature.export.job.pdf.view.MultilineCell) Cell(com.pdfjet.Cell)

Aggregations

CellBuilder (com.faltenreich.diaguard.feature.export.job.pdf.view.CellBuilder)1 MultilineCell (com.faltenreich.diaguard.feature.export.job.pdf.view.MultilineCell)1 Cell (com.pdfjet.Cell)1 ArrayList (java.util.ArrayList)1