List of usage examples for com.itextpdf.text Element ALIGN_MIDDLE
int ALIGN_MIDDLE
To view the source code for com.itextpdf.text Element ALIGN_MIDDLE.
Click Source Link
From source file:com.softwaremagico.tm.pdf.complete.skills.CounterTable.java
License:Open Source License
private PdfPCell createCircle() { PdfPCell cell = createValue("O", new Font(FadingSunsTheme.getTitleFont(), FadingSunsTheme.CHARACTERISTICS_TITLE_FONT_SIZE), Element.ALIGN_MIDDLE); return cell;/*w w w .ja v a2 s . co m*/ }
From source file:com.softwaremagico.tm.pdf.complete.skills.occultism.OccultismTable.java
License:Open Source License
private PdfPCell createContent(CharacterPlayer characterPlayer, String language) throws InvalidXmlElementException { float[] widths = { 3f, 1f, 1f, 3f }; PdfPTable table = new PdfPTable(widths); BaseElement.setTablePropierties(table); table.getDefaultCell().setBorder(0); table.getDefaultCell().setPadding(0); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); for (OccultismType occulstimType : OccultismTypeFactory.getInstance().getElements(language)) { PdfPCell psiqueTitleCell = new PdfPCell(new Phrase(occulstimType.getName(), new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.CHARACTERISTICS_LINE_FONT_SIZE))); psiqueTitleCell.setBorder(0);//from www. j a v a2 s . co m // psiTitleCell.setMinimumHeight(30); psiqueTitleCell.setHorizontalAlignment(Element.ALIGN_RIGHT); table.addCell(psiqueTitleCell); if (characterPlayer == null) { table.addCell(createRectangle()); table.addCell(createRectangle()); } else { table.addCell(createRectangle(characterPlayer.getPsiqueLevel(occulstimType))); table.addCell(createRectangle(characterPlayer.getDarkSideLevel(occulstimType))); } PdfPCell darkSideTitleCell = new PdfPCell(new Phrase(occulstimType.getDarkSideName(), new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.CHARACTERISTICS_LINE_FONT_SIZE))); darkSideTitleCell.setBorder(0); darkSideTitleCell.setHorizontalAlignment(Element.ALIGN_LEFT); table.addCell(darkSideTitleCell); } PdfPCell cell = new PdfPCell(); cell.addElement(table); cell.setPadding(0); BaseElement.setCellProperties(cell); return cell; }
From source file:com.softwaremagico.tm.pdf.complete.skills.SkillsTable.java
License:Open Source License
protected static PdfPCell createCompactTitle(String text, int fontSize) { PdfPCell cell = getCell(text, 0, 2, Element.ALIGN_CENTER, BaseColor.WHITE, FadingSunsTheme.getTitleFont(), fontSize);/* w w w . j av a 2 s . com*/ cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; }
From source file:com.softwaremagico.tm.pdf.complete.skills.SkillsTable.java
License:Open Source License
protected static PdfPCell createSkillElement(CharacterPlayer characterPlayer, AvailableSkill skill, int fontSize, int maxColumnWidth) { PdfPCell cell = getCell(createSkillSufix(characterPlayer, skill, fontSize, maxColumnWidth), 0, 1, Element.ALIGN_LEFT, BaseColor.WHITE); cell.setMinimumHeight((MainSkillsTableFactory.HEIGHT / ROWS)); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell;/* ww w . j av a2s. com*/ }
From source file:com.softwaremagico.tm.pdf.complete.skills.SkillsTable.java
License:Open Source License
protected static PdfPCell createSkillElement(SkillDefinition skill, int fontSize, int maxColumnWidth) { PdfPCell cell = getCell(createSkillSufix(skill, fontSize, maxColumnWidth), 0, 1, Element.ALIGN_LEFT, BaseColor.WHITE);/*from w ww .j a v a 2 s .c o m*/ cell.setMinimumHeight((MainSkillsTableFactory.HEIGHT / ROWS)); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; }
From source file:com.softwaremagico.tm.pdf.complete.skills.SkillsTable.java
License:Open Source License
protected static PdfPCell createSkillLine(String text, int fontSize) { PdfPCell cell = getCell(text, 0, 1, Element.ALIGN_LEFT, BaseColor.WHITE, FadingSunsTheme.getLineFont(), fontSize);/*from w w w. ja v a2 s . c o m*/ cell.setMinimumHeight((MainSkillsTableFactory.HEIGHT / ROWS)); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; }
From source file:com.softwaremagico.tm.pdf.complete.skills.SkillsTable.java
License:Open Source License
protected static PdfPCell createSkillValue(Integer value, boolean special, boolean modified, int fontSize) { if (value == null) { return createSkillLine(SKILL_VALUE_GAP, fontSize); }// ww w . ja va 2s .c o m PdfPCell cell = getCell(value + (special ? "*" : "") + (modified && value > 0 ? "!" : ""), 0, 1, Element.ALIGN_CENTER, BaseColor.WHITE, FadingSunsTheme.getHandwrittingFont(), FadingSunsTheme.getHandWrittingFontSize(fontSize)); cell.setMinimumHeight((MainSkillsTableFactory.HEIGHT / ROWS)); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; }
From source file:com.softwaremagico.tm.pdf.complete.skills.VitalityTable.java
License:Open Source License
public VitalityTable(CharacterPlayer characterPlayer) { super(WIDTHS); addedCircle = 0;/* w ww .j a va 2 s . co m*/ addCell(createLateralVerticalTitle(getTranslator().getTranslatedText("vitality"), TITLE_SPAN)); for (int i = 0; i < TITLE_SPAN; i++) { addCell(getCircle(characterPlayer)); addedCircle++; } addCell(space(CIRCLES - TITLE_SPAN - MODIFICATORS_SPAN)); for (int i = 0; i < CIRCLES - TITLE_SPAN - MODIFICATORS_SPAN; i++) { addCell(getCircle(characterPlayer)); addedCircle++; } for (int i = 1; i <= MODIFICATORS_SPAN; i++) { addCell(createValue("-" + (i * 2), new Font(FadingSunsTheme.getLineFont(), FadingSunsTheme.CHARACTERISTICS_TITLE_FONT_SIZE - 6), Element.ALIGN_MIDDLE)); addCell(getCircle(characterPlayer)); addedCircle++; } }
From source file:com.softwaremagico.tm.pdf.complete.traits.VictoryPointsTable.java
License:Open Source License
private static PdfPCell createLine(String text, BaseColor color) { PdfPCell cell = BaseElement.getCell(text, 0, 1, Element.ALIGN_CENTER, color, FadingSunsTheme.getLineFont(), FadingSunsTheme.VICTORY_POINTS_FONT_SIZE); cell.setMinimumHeight(11);//from w w w. j a v a2 s .co m cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; }
From source file:com.softwaremagico.tm.pdf.complete.traits.VictoryPointsTable.java
License:Open Source License
private static PdfPCell createSubTitle(String text, BaseColor color) { PdfPCell cell = BaseElement.getCell(text, 0, 1, Element.ALIGN_CENTER, color, FadingSunsTheme.getLineFontBold(), FadingSunsTheme.VICTORY_POINTS_FONT_SIZE); cell.setMinimumHeight(13);//w w w. j ava 2 s .c o m cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; }