* document object
*/
public void addTables(Document doc) {
try {
// Create the title for the data table
Chunk theDataTable = new Chunk("The Data Table", new Font(Font.TIMES_ROMAN, 18, Font.BOLD));
Paragraph pData = new Paragraph(theDataTable);
pData.setAlignment(Element.ALIGN_CENTER);
doc.add(pData);
doc.add(Chunk.NEWLINE);
// Generates the data table
int rowNo = 5;
PdfPTable dataTableHeader = new PdfPTable(rowNo);
PdfPCell dataTblHeaderCell;
Phrase pTemp = new Phrase("NODE", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
dataTblHeaderCell = new PdfPCell(pTemp);
dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTableHeader.addCell(dataTblHeaderCell);
pTemp = new Phrase("DEPTH"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
dataTblHeaderCell = new PdfPCell(pTemp);
dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTableHeader.addCell(dataTblHeaderCell);
pTemp = new Phrase("MODULUS OF SUBGRADE REACTION"+"\n"+"(kN/m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
dataTblHeaderCell = new PdfPCell(pTemp);
dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTableHeader.addCell(dataTblHeaderCell);
pTemp = new Phrase("LATERAL SOIL MOVEMENTS"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
dataTblHeaderCell = new PdfPCell(pTemp);
dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTableHeader.addCell(dataTblHeaderCell);
pTemp = new Phrase("LIMIT SOIL PRESSURE"+"\n"+"(kN/m²)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
dataTblHeaderCell = new PdfPCell(pTemp);
dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTableHeader.addCell(dataTblHeaderCell);
PdfPCell dataTblCell;
PdfPTable dataTable = new PdfPTable(rowNo);
for (int i = 0; i <= data.getNumOfElements(); i++) {
Phrase pNode = new Phrase(Integer.toString(i), FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
dataTblCell = new PdfPCell(pNode);
dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTable.addCell(dataTblCell);
Phrase pPileNodeCoord = new Phrase(Double.toString(data.getPileNodeCoordinate(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
dataTblCell = new PdfPCell(pPileNodeCoord);
dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTable.addCell(dataTblCell);
Phrase pModOfSub = new Phrase(Double.toString(data.getModOfSubgradeReaction(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
dataTblCell = new PdfPCell(pModOfSub);
dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTable.addCell(dataTblCell);
Phrase pLateralSoilMov = new Phrase(Double.toString(data.getLateralSoilMovement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
dataTblCell = new PdfPCell(pLateralSoilMov);
dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTable.addCell(dataTblCell);
Phrase pLimitSoilPress = new Phrase(Double.toString(data.getLimitSoilPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
dataTblCell = new PdfPCell(pLimitSoilPress);
dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
dataTable.addCell(dataTblCell);
}
doc.add(dataTableHeader);
doc.add(dataTable);
doc.newPage();
// Create the title for the result table
Chunk theResultTable = new Chunk("The Result Table", new Font(Font.TIMES_ROMAN, 18, Font.BOLD));
Paragraph pResult = new Paragraph(theResultTable);
pResult.setAlignment(Element.ALIGN_CENTER);
doc.add(pResult);
doc.add(Chunk.NEWLINE);