Example usage for com.itextpdf.text.pdf PdfPCell setMinimumHeight

List of usage examples for com.itextpdf.text.pdf PdfPCell setMinimumHeight

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfPCell setMinimumHeight.

Prototype

public void setMinimumHeight(float minimumHeight) 

Source Link

Document

Set a minimum height for the cell.

Usage

From source file:com.softwaremagico.tm.pdf.complete.elements.BaseElement.java

License:Open Source License

public static PdfPCell createBlackSeparator() {
    PdfPCell cell = new PdfPCell();
    cell.setBackgroundColor(BaseColor.BLACK);
    setCellProperties(cell);/* w ww.ja  va 2  s . c  o m*/
    cell.setMinimumHeight(10f);
    return cell;
}

From source file:com.softwaremagico.tm.pdf.complete.elements.BaseElement.java

License:Open Source License

public static PdfPCell createWhiteSeparator() {
    PdfPCell cell = new PdfPCell();
    cell.setBackgroundColor(BaseColor.WHITE);
    setCellProperties(cell);/*from   www .java  2s . c  o m*/
    cell.setMinimumHeight(6f);
    return cell;
}

From source file:com.softwaremagico.tm.pdf.complete.elements.CustomPdfTable.java

License:Open Source License

protected static PdfPCell createEmptyElementLine(int alignment, String text) {
    PdfPCell cell = BaseElement.getCell(text, 0, 1, alignment, BaseColor.WHITE, FadingSunsTheme.getLineFont(),
            FadingSunsTheme.TABLE_LINE_FONT_SIZE);
    cell.setMinimumHeight(10);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    return cell;//w w w  .  j  av a  2 s. c  o m
}

From source file:com.softwaremagico.tm.pdf.complete.elements.CustomPdfTable.java

License:Open Source License

private static PdfPCell createBasicElementLine(String text, int fontSize, int horizontalAlignment) {
    PdfPCell cell = BaseElement.getCell(text, 0, 1, horizontalAlignment, BaseColor.WHITE,
            FadingSunsTheme.getHandwrittingFont(), fontSize);
    cell.setMinimumHeight(12);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    return cell;//www. j a va2 s . c  o  m
}

From source file:com.softwaremagico.tm.pdf.complete.elements.CustomPdfTable.java

License:Open Source License

protected PdfPCell createRectangle() {
    PdfPCell box = new PdfPCell();
    box.setMinimumHeight(15);
    box.setBorder(0);/*from  ww  w  .j  av a2  s.c  o  m*/
    box.setCellEvent(
            new CellCompleteBoxEvent(new Border[] { Border.TOP, Border.BOTTOM, Border.LEFT, Border.RIGHT }));
    return box;
}

From source file:com.softwaremagico.tm.pdf.complete.elements.CustomPdfTable.java

License:Open Source License

protected PdfPCell createRectangle(String value) {
    if (value == null) {
        return createRectangle();
    }//ww w . j a  va2 s  .  c om
    PdfPCell box = new PdfPCell(new Paragraph(value,
            new Font(FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.HANDWRITTING_DEFAULT_FONT_SIZE)));
    box.setVerticalAlignment(Element.ALIGN_MIDDLE);
    box.setHorizontalAlignment(Element.ALIGN_CENTER);
    box.setMinimumHeight(15);
    box.setBorder(0);
    box.setCellEvent(
            new CellCompleteBoxEvent(new Border[] { Border.TOP, Border.BOTTOM, Border.LEFT, Border.RIGHT }));
    return box;
}

From source file:com.softwaremagico.tm.pdf.complete.elements.LateralHeaderPdfPTable.java

License:Open Source License

protected static PdfPCell createTableSubtitleElement(String text, int height) {
    PdfPCell cell = BaseElement.getCell(text, 0, 1, Element.ALIGN_CENTER, BaseColor.WHITE,
            FadingSunsTheme.getSubtitleFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE);
    cell.setMinimumHeight(height);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    return cell;//  w  w  w.j  a v  a  2s  .c om
}

From source file:com.softwaremagico.tm.pdf.complete.elements.VerticalTable.java

License:Open Source License

protected static PdfPCell createSubtitleLine(String text, int fontSize, int colspan, int alignment) {
    PdfPCell cell = BaseElement.getCell(text, 0, colspan, alignment, BaseColor.WHITE,
            FadingSunsTheme.getSubtitleFont(), fontSize);
    cell.setMinimumHeight(10);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    return cell;//from www  .j  av  a  2  s .c o m
}

From source file:com.softwaremagico.tm.pdf.complete.elements.VerticalTable.java

License:Open Source License

protected static PdfPCell createValueLine(String text, int fontSize) {
    PdfPCell cell = BaseElement.getCell(text, 0, 1, Element.ALIGN_CENTER, BaseColor.WHITE,
            FadingSunsTheme.getHandwrittingFont(), fontSize);
    cell.setMinimumHeight(10);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    return cell;/*  ww  w. j  a  v a2  s .  c  om*/
}

From source file:com.softwaremagico.tm.pdf.complete.fighting.ArmourTable.java

License:Open Source License

public ArmourTable(CharacterPlayer characterPlayer) throws InvalidXmlElementException {
    super(WIDTHS);
    getDefaultCell().setBorder(0);//from   w  w w.j ava2 s .co m

    addCell(createLateralVerticalTitle(getTranslator().getTranslatedText("armor"), ROWS + 1));

    PdfPCell nameCell;
    if (characterPlayer == null || characterPlayer.getArmour() == null) {
        nameCell = createEmptyElementLine(GAP);
    } else {
        nameCell = createElementLine(characterPlayer.getArmour().getName(), NAME_COLUMN_WIDTH,
                FadingSunsTheme.ARMOUR_CONTENT_FONT_SIZE);
    }
    nameCell.setColspan(WIDTHS.length);
    nameCell.setMinimumHeight(20);
    addCell(nameCell);
    PdfPCell protectionCell;
    if (characterPlayer == null || characterPlayer.getArmour() == null) {
        protectionCell = createEmptyElementLine(getTranslator().getTranslatedText("armorRating") + ": ____ "
                + getTranslator().getTranslatedText("diceAbbreviature"));
    } else {
        Paragraph paragraph = new Paragraph();
        paragraph.add(new Paragraph(getTranslator().getTranslatedText("armorRating") + ": ",
                new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE)));

        paragraph.add(new Paragraph(characterPlayer.getArmour().getProtection() + " ",
                new Font(FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.ARMOUR_CONTENT_FONT_SIZE)));

        paragraph.add(new Paragraph(getTranslator().getTranslatedText("diceAbbreviature"),
                new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE)));

        protectionCell = createEmptyElementLine("");

        protectionCell.setPhrase(paragraph);
    }
    protectionCell.setColspan(WIDTHS.length);
    addCell(protectionCell);

    PdfPCell malusCell;
    if (characterPlayer == null || characterPlayer.getArmour() == null) {
        malusCell = createEmptyElementLine(getTranslator().getTranslatedText("strengthAbbreviature") + ":__  "
                + getTranslator().getTranslatedText("dexterityAbbreviature") + ":__  "
                + getTranslator().getTranslatedText("enduranceAbbreviature") + ":__ "
                + getTranslator().getTranslatedText("iniciativeAbbreviature") + ":__");
    } else {
        Paragraph paragraph = new Paragraph();
        paragraph.add(new Paragraph(getTranslator().getTranslatedText("strengthAbbreviature") + ":",
                new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE)));
        paragraph.add(new Paragraph(
                characterPlayer.getArmour().getStandardPenalizations().getStrengthModification() + " ",
                new Font(FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.ARMOUR_CONTENT_FONT_SIZE)));

        paragraph.add(new Paragraph(" " + getTranslator().getTranslatedText("dexterityAbbreviature") + ":",
                new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE)));
        paragraph.add(new Paragraph(
                characterPlayer.getArmour().getStandardPenalizations().getDexterityModification() + " ",
                new Font(FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.ARMOUR_CONTENT_FONT_SIZE)));

        paragraph.add(new Paragraph(" " + getTranslator().getTranslatedText("enduranceAbbreviature") + ":",
                new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE)));
        paragraph.add(new Paragraph(
                characterPlayer.getArmour().getStandardPenalizations().getEnduranceModification() + " ",
                new Font(FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.ARMOUR_CONTENT_FONT_SIZE)));

        paragraph.add(new Paragraph(" " + getTranslator().getTranslatedText("iniciativeAbbreviature") + ":",
                new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.TABLE_LINE_FONT_SIZE)));
        paragraph.add(new Paragraph(
                characterPlayer.getArmour().getStandardPenalizations().getEnduranceModification() + " ",
                new Font(FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.ARMOUR_CONTENT_FONT_SIZE)));

        malusCell = createEmptyElementLine("");

        malusCell.setPhrase(paragraph);
    }
    malusCell.setColspan(WIDTHS.length);
    addCell(malusCell);

    if (characterPlayer == null || characterPlayer.getArmour() == null) {
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorHardAbbreviature"), false));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorFireAbbreviature"), false));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorLaserAbbreviature"), false));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorPlasmAbbreviature"), false));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorShockAbbreviature"), false));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorImpactAbbreviature"), false));
    } else {
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorHardAbbreviature"),
                characterPlayer.getArmour().getDamageTypes().contains(
                        DamageTypeFactory.getInstance().getElement("hard", characterPlayer.getLanguage()))));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorFireAbbreviature"),
                characterPlayer.getArmour().getDamageTypes().contains(
                        DamageTypeFactory.getInstance().getElement("fire", characterPlayer.getLanguage()))));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorLaserAbbreviature"),
                characterPlayer.getArmour().getDamageTypes().contains(
                        DamageTypeFactory.getInstance().getElement("laser", characterPlayer.getLanguage()))));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorPlasmAbbreviature"),
                characterPlayer.getArmour().getDamageTypes().contains(
                        DamageTypeFactory.getInstance().getElement("plasma", characterPlayer.getLanguage()))));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorShockAbbreviature"),
                characterPlayer.getArmour().getDamageTypes().contains(
                        DamageTypeFactory.getInstance().getElement("shock", characterPlayer.getLanguage()))));
        addCell(getArmourProperty(getTranslator().getTranslatedText("armorImpactAbbreviature"),
                characterPlayer.getArmour().getDamageTypes().contains(
                        DamageTypeFactory.getInstance().getElement("impact", characterPlayer.getLanguage()))));
    }

}