private String[][] getCashFlow() { String rows[][] = new String[sidit.getNoteTerm()][9]; double prin = sidit.getFmv(); double growth = sidit.getAssetGrowth(); double income = sidit.getAssetIncome(); double pay[] = sidit.getNotePayment(); double premium = sidit.getLifePremium(); double lifeYears = sidit.getLifePremiumYears(); double noteBalance[] = sidit.getNoteBalance(); for (int i = 0; i < sidit.getNoteTerm(); i++) { rows[i][0] = Integer.toString(i + 1); rows[i][1] = dollar.format(prin); rows[i][2] = dollar.format(prin * growth); rows[i][3] = dollar.format(prin * income); rows[i][4] = dollar.format(-pay[i]); if (i < lifeYears) { rows[i][5] = dollar.format(-premium); } else { rows[i][5] = ""; premium = 0; } prin = prin * (1 + growth + income) - pay[i] - premium; rows[i][6] = dollar.format(prin); rows[i][7] = dollar.format(prin + sidit.getLifeDeathBenefit() - noteBalance[i]); rows[i][8] = "[border=l+r+b][border=r+b][border=r+b][border=r+b][border=r+b][border=r+b,color=" + makeColor(0, 0, 24) + "][border=r+b][border=r+b]"; } return rows; }
public void page3() { drawBorder(pageIcon, "IDIT"); drawHeader(userInfo.getClientHeading(), "Intentionally Defective Irrevocable Trust (IDIT)"); Rectangle rct = new Rectangle(prctTop); rct.setTop(rct.getTop() - (12 * _1_4TH)); rct.setBottom(rct.getBottom() - _1_4TH); rct.setLeft(rct.getLeft() - _1_4TH); if (useLLC) { if (userInfo.isSingle()) { if (userInfo.getClientGender().equalsIgnoreCase("M")) { drawDiagram("LLC-SIDIT-M.png", rct, CNTR_TB + CNTR_LR); } else { drawDiagram("LLC-SIDIT-F.png", rct, CNTR_TB + CNTR_LR); } } else { drawDiagram("LLC-SIDIT.png", rct, CNTR_TB + CNTR_LR); } } else { if (userInfo.isSingle()) { if (userInfo.getClientGender().equalsIgnoreCase("M")) { drawDiagram("SIDIT-M.png", rct, CNTR_TB + CNTR_LR); } else { drawDiagram("SIDIT-F.png", rct, CNTR_TB + CNTR_LR); } } else { drawDiagram("SIDIT.png", rct, CNTR_LR + CNTR_TB); } } // We now need the values placed on the left hand side of the page! // Now do the table. Rectangle lrct = new Rectangle(prctLLeft); lrct.setTop(lrct.getTop() - (_1_2TH + _1_4TH)); drawSection( lrct, "Comparison in " + Integer.toString(sidit.getFinalDeath()) + " Years", new String[0], 0); rct = new Rectangle(prctLLeft); rct.setTop(rct.getTop() - (_1_2TH + _1_2TH)); PageTable table = new PageTable(writer); table.setTableFormat(rct, 4); CellInfoFactory cif = new CellInfoFactory(); BaseFont baseFont = PageUtils.LoadFont("GARA.TTF"); BaseFont baseFontBold = PageUtils.LoadFont("GARABD.TTF"); float ptSize = 10f; cif.setDefaultFont(new Font(baseFont, ptSize)); Color green = new Color(0, 176, 0); Color red = new Color(192, 0, 0); Font fontBold = new Font(baseFontBold, ptSize, Font.NORMAL); Font fontBGreen = new Font(baseFontBold, ptSize, Font.NORMAL, green); Font fontBRed = new Font(baseFontBold, ptSize, Font.NORMAL, red); double f = sidit.getFinalBalance(); double t = f * .55; double result = f - t; double balance = sidit.getBalance()[sidit.getFinalDeath() - 1] + sidit.getLifeDeathBenefit(); double note = sidit.getNoteBalance()[0]; double noteTax = note * .55; double noteValueToFamily = note - noteTax; CellInfo cellData[][] = { // Column Headers { cif.getCellInfo(" "), cif.getCellInfo("Keep in the Estate", Element.ALIGN_CENTER, fontBold), cif.getCellInfo("IDIT", Element.ALIGN_CENTER, fontBold), cif.getCellInfo("Difference", Element.ALIGN_CENTER, fontBold) }, { cif.getCellInfo("Estate/Gift Taxable:"), cif.getCellInfo(dollar.format(f), Element.ALIGN_CENTER, fontBold), cif.getCellInfo(dollar.format(note) + " **", Element.ALIGN_CENTER, fontBold), cif.getCellInfo(dollar.format(f - note), Element.ALIGN_CENTER, fontBold) }, { cif.getCellInfo("Total Estate/Gift Taxes:"), cif.getCellInfo(dollar.format(t), Element.ALIGN_CENTER, fontBRed), cif.getCellInfo(dollar.format(noteTax), Element.ALIGN_CENTER, fontBRed), cif.getCellInfo(dollar.format(t - noteTax), Element.ALIGN_CENTER, fontBRed), }, { cif.getCellInfo("Life Insurance:"), cif.getCellInfo("0", Element.ALIGN_CENTER, fontBGreen), cif.getCellInfo( dollar.format(sidit.getLifeDeathBenefit()), Element.ALIGN_CENTER, fontBGreen), cif.getCellInfo( dollar.format(sidit.getLifeDeathBenefit()), Element.ALIGN_CENTER, fontBGreen), }, { cif.getCellInfo("Total to Family"), cif.getCellInfo(dollar.format(result), Element.ALIGN_CENTER, fontBGreen), cif.getCellInfo( dollar.format(balance + noteValueToFamily), Element.ALIGN_CENTER, fontBGreen), cif.getCellInfo( dollar.format((balance + noteValueToFamily) - result), Element.ALIGN_CENTER, fontBGreen), }, }; // Do the chart DefaultCategoryDataset dataSet = new DefaultCategoryDataset(); String series1 = "Keep in Estate"; String series2 = "IDIT"; String cat1 = "Estate Taxes"; String cat2 = "Total to Family"; dataSet.addValue(t, series1, cat1); dataSet.addValue(noteTax, series2, cat1); dataSet.addValue(result, series1, cat2); dataSet.addValue(balance + noteValueToFamily, series2, cat2); BarChart barChart = new BarChart(); barChart.setTitle("IDIT Comparison"); barChart.setDataSet(dataSet); Rectangle barRect = new Rectangle(prctLRight); barRect.setRight(barRect.getRight() + _1_2TH); barChart.setRect(barRect); barChart.generateBarChart(); barChart.setSeriesColor(new Color(0xff0000), new Color(0x00ff00)); barChart.setColor(0, Color.red); barChart.setColor(1, Color.green); barChart.setLablesOff(true); Image img = barChart.getBarChartImage(); drawDiagram(img, barRect, 0, 72); table.setTableData(cellData); table.drawTable(); drawLabel( "** The value(s) of the note is kept inside the taxable estate.", prctBottom, "GARA.TTF", new Color(64, 64, 64), 9, LBL_LEFT, LBL_BOTTOM); }