|
From: xanaot <xa...@us...> - 2007-09-26 18:25:52
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16481/src/java/net/sf/tail/report/xls Modified Files: ReportXlsGenerator.java CompleteXlsGenerator.java CellStylist.java SliceXlsGenerator.java Log Message: Refatoracao dos report e criacao de teste Index: CellStylist.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls/CellStylist.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CellStylist.java 25 Sep 2007 00:04:22 -0000 1.3 --- CellStylist.java 26 Sep 2007 18:25:47 -0000 1.4 *************** *** 99,103 **** style.setBorderTop(HSSFCellStyle.BORDER_MEDIUM); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); ! style.setFillBackgroundColor(HSSFColor.AQUA.index); HSSFFont font = workbook.createFont(); --- 99,103 ---- style.setBorderTop(HSSFCellStyle.BORDER_MEDIUM); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); ! style.setFillBackgroundColor(HSSFColor.BLUE_GREY.index); HSSFFont font = workbook.createFont(); *************** *** 110,116 **** } ! protected void drawImage(File reportPNG, HSSFSheet sheet) throws IOException { HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); ! HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) 1, 1, (short) 7, 17); anchor.setAnchorType(3); --- 110,116 ---- } ! protected void drawImage(File reportPNG, HSSFSheet sheet, int columnStart, int columnEnd) throws IOException { HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); ! HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) 1, columnStart, (short) columnEnd, 17); anchor.setAnchorType(3); Index: CompleteXlsGenerator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls/CompleteXlsGenerator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CompleteXlsGenerator.java 25 Sep 2007 00:04:22 -0000 1.7 --- CompleteXlsGenerator.java 26 Sep 2007 18:25:47 -0000 1.8 *************** *** 22,28 **** criteria.add(new TotalProfitCriterion()); return generate(report, criteria, period); - } ! public List<HSSFSheet> generate(Report report, List<AnalysisCriterion> criteria, Period period) throws IOException { List<HSSFSheet> sheets = new LinkedList<HSSFSheet>(); --- 22,27 ---- criteria.add(new TotalProfitCriterion()); return generate(report, criteria, period); } ! public List<HSSFSheet> generate(Report report, List<AnalysisCriterion> criteria, Period period) throws IOException { List<HSSFSheet> sheets = new LinkedList<HSSFSheet>(); *************** *** 44,46 **** --- 43,46 ---- return sheets; } + } Index: SliceXlsGenerator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls/SliceXlsGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SliceXlsGenerator.java 25 Sep 2007 00:04:22 -0000 1.4 --- SliceXlsGenerator.java 26 Sep 2007 18:25:47 -0000 1.5 *************** *** 68,72 **** File reportPNG = image.generateImage(decision); ! stylist.drawImage(reportPNG, sheet); stylist.rearrangeSheet(sheet, 10); --- 68,72 ---- File reportPNG = image.generateImage(decision); ! stylist.drawImage(reportPNG, sheet, 1, 7); stylist.rearrangeSheet(sheet, 10); *************** *** 91,95 **** createCell(rowHeader, "Trade", (short) columnIndex++, style); createCell(rowHeader, "Buy Date", (short) columnIndex++, style); ! createCell(rowHeader, "Bue Price", (short) columnIndex++, style); createCell(rowHeader, "Sell Date", (short) columnIndex++, style); createCell(rowHeader, "Sell Price", (short) columnIndex++, style); --- 91,95 ---- createCell(rowHeader, "Trade", (short) columnIndex++, style); createCell(rowHeader, "Buy Date", (short) columnIndex++, style); ! createCell(rowHeader, "Buy Price", (short) columnIndex++, style); createCell(rowHeader, "Sell Date", (short) columnIndex++, style); createCell(rowHeader, "Sell Price", (short) columnIndex++, style); Index: ReportXlsGenerator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls/ReportXlsGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReportXlsGenerator.java 25 Sep 2007 00:04:22 -0000 1.4 --- ReportXlsGenerator.java 26 Sep 2007 18:25:47 -0000 1.5 *************** *** 65,69 **** File reportPNG = image.generateImage(report, period); ! stylist.drawImage(reportPNG, sheet); stylist.rearrangeSheet(sheet, 10); --- 65,69 ---- File reportPNG = image.generateImage(report, period); ! stylist.drawImage(reportPNG, sheet, 1, 6); stylist.rearrangeSheet(sheet, 10); *************** *** 79,84 **** createCell(rowHeader, "Period", (short) columnIndex++, style); ! createCell(rowHeader, "First Date", (short) columnIndex++, style); ! createCell(rowHeader, "Last Date", (short) columnIndex++, style); createCell(rowHeader, "Strategy", (short) columnIndex++, style); createCell(rowHeader, "Time Frame", (short) columnIndex++, style); --- 79,84 ---- createCell(rowHeader, "Period", (short) columnIndex++, style); ! createCell(rowHeader, "Initial Date", (short) columnIndex++, style); ! createCell(rowHeader, "Final Date", (short) columnIndex++, style); createCell(rowHeader, "Strategy", (short) columnIndex++, style); createCell(rowHeader, "Time Frame", (short) columnIndex++, style); *************** *** 122,125 **** --- 122,126 ---- HSSFRow rowDecision = sheet.createRow((short) firtRow++); strategyTimeFrame = decision.getStrategy().getName().split(":"); + createCell(rowDecision, index++, (short) indexcolumn++, style); createCell(rowDecision, decision.getSeries().getTick(decision.getSeries().getBegin()).getDateName(), *************** *** 127,131 **** createCell(rowDecision, decision.getSeries().getTick(decision.getSeries().getEnd()).getDateName(), (short) indexcolumn++, style); ! createCell(rowDecision, strategyTimeFrame[0], (short) indexcolumn++, style); createCell(rowDecision, Integer.parseInt(strategyTimeFrame[1].trim()), (short) indexcolumn++, style); calculate = report.getApplyedCriterion().calculate(decision.getSeries(), decision.getTrades()); --- 128,132 ---- createCell(rowDecision, decision.getSeries().getTick(decision.getSeries().getEnd()).getDateName(), (short) indexcolumn++, style); ! createCell(rowDecision, strategyTimeFrame[0].split("time")[0], (short) indexcolumn++, style); createCell(rowDecision, Integer.parseInt(strategyTimeFrame[1].trim()), (short) indexcolumn++, style); calculate = report.getApplyedCriterion().calculate(decision.getSeries(), decision.getTrades()); |