List of usage examples for com.itextpdf.text BaseColor MAGENTA
BaseColor MAGENTA
To view the source code for com.itextpdf.text BaseColor MAGENTA.
Click Source Link
From source file:br.com.ifrn.panfleto.gui.PainelCadastrar.java
public BaseColor corPagina() { if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Branco")) { return BaseColor.WHITE; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Preto")) { return BaseColor.BLACK; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Azul")) { return BaseColor.BLUE; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza Escuro")) { return BaseColor.DARK_GRAY; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza")) { return BaseColor.GRAY; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cinza Claro")) { return BaseColor.LIGHT_GRAY; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Magenta")) { return BaseColor.MAGENTA; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Laranja")) { return BaseColor.ORANGE; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Rosa")) { return BaseColor.PINK; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Vermlho")) { return BaseColor.RED; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Amarero")) { return BaseColor.YELLOW; } else if (comboxSelecionarCorPainelGerarPdf.getSelectedItem().equals("Cyan")) { return BaseColor.CYAN; }//from w ww .ja v a 2s. c o m return BaseColor.WHITE; }
From source file:fll.scheduler.TournamentSchedule.java
License:Open Source License
private void outputPerformanceSchedule(final Document detailedSchedules) throws DocumentException { final SortedMap<PerformanceTime, TeamScheduleInfo> performanceTimes = new TreeMap<PerformanceTime, TeamScheduleInfo>(); for (int round = 0; round < getNumberOfRounds(); ++round) { for (final TeamScheduleInfo si : _schedule) { performanceTimes.put(si.getPerf(round), si); }/* w ww .ja va 2s . c o m*/ } // list of teams staying around to even up the teams final List<TeamScheduleInfo> teamsStaying = new LinkedList<TeamScheduleInfo>(); final PdfPTable table = PdfUtils.createTable(7); table.setWidths(new float[] { 2, 1, 3, 3, 2, 2, 2 }); final PdfPCell tournamentCell = PdfUtils.createHeaderCell("Tournament: " + getName() + " Performance"); tournamentCell.setColspan(7); table.addCell(tournamentCell); table.addCell(PdfUtils.createHeaderCell(TEAM_NUMBER_HEADER)); table.addCell(PdfUtils.createHeaderCell(DIVISION_HEADER)); table.addCell(PdfUtils.createHeaderCell(ORGANIZATION_HEADER)); table.addCell(PdfUtils.createHeaderCell(TEAM_NAME_HEADER)); table.addCell(PdfUtils.createHeaderCell("Time")); table.addCell(PdfUtils.createHeaderCell("Table")); table.addCell(PdfUtils.createHeaderCell("Round")); table.setHeaderRows(1); for (final Map.Entry<PerformanceTime, TeamScheduleInfo> entry : performanceTimes.entrySet()) { final PerformanceTime performance = entry.getKey(); final TeamScheduleInfo si = entry.getValue(); final int round = si.computeRound(performance); // check if team needs to stay and color the cell magenta if they do final BaseColor backgroundColor; if (null != checkIfTeamNeedsToStay(si, round)) { teamsStaying.add(si); backgroundColor = BaseColor.MAGENTA; } else { backgroundColor = null; } table.addCell(PdfUtils.createCell(String.valueOf(si.getTeamNumber()))); table.addCell(PdfUtils.createCell(si.getAwardGroup())); table.addCell(PdfUtils.createCell(si.getOrganization())); table.addCell(PdfUtils.createCell(si.getTeamName())); table.addCell(PdfUtils.createCell(formatTime(si.getPerfTime(round)), backgroundColor)); table.addCell(PdfUtils.createCell(si.getPerfTableColor(round) + " " + si.getPerfTableSide(round), backgroundColor)); table.addCell(PdfUtils.createCell(String.valueOf(round + 1))); } detailedSchedules.add(table); // output teams staying if (!teamsStaying.isEmpty()) { final String formatString = "Team %d will please stay at the table and compete again - score will not count."; final PdfPTable stayingTable = PdfUtils.createTable(1); for (final TeamScheduleInfo si : teamsStaying) { stayingTable.addCell(PdfUtils.createCell( new Formatter().format(formatString, si.getTeamNumber()).toString(), BaseColor.MAGENTA)); } detailedSchedules.add(stayingTable); } detailedSchedules.add(Chunk.NEXTPAGE); }