From: Peter Herweg Date: Tue, 24 Jan 2006 19:25:44 +0000 (+0000) Subject: just a few changes in order to satisfy checkstyle X-Git-Tag: fop-0_92-beta~182 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e6a3bb0e359392bb6639c6e66e933d59d2e37439;p=xmlgraphics-fop.git just a few changes in order to satisfy checkstyle git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@371989 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index a6611f5bd..68addd742 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -137,6 +137,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startDocument() + * @throws SAXException In case of a IO-problem */ public void startDocument() throws SAXException { // TODO sections should be created @@ -151,6 +152,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endDocument() + * @throws SAXException In case of a IO-problem */ public void endDocument() throws SAXException { try { @@ -163,6 +165,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler + * @param pageSeq PageSequence that is starting */ public void startPageSequence(PageSequence pageSeq) { try { @@ -201,6 +204,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endPageSequence(PageSequence) + * @param pageSeq PageSequence that is ending */ public void endPageSequence(PageSequence pageSeq) { if (bDefer) { @@ -219,6 +223,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startFlow(Flow) + * @param fl Flow that is starting */ public void startFlow(Flow fl) { if (bDefer) { @@ -299,6 +304,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endFlow(Flow) + * @param fl Flow that is ending */ public void endFlow(Flow fl) { if (bDefer) { @@ -321,6 +327,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startBlock(Block) + * @param bl Block that is starting */ public void startBlock(Block bl) { if (bDefer) { @@ -354,6 +361,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endBlock(Block) + * @param bl Block that is ending */ public void endBlock(Block bl) { @@ -383,6 +391,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startBlockContainer(BlockContainer) + * @param blc BlockContainer that is starting */ public void startBlockContainer(BlockContainer blc) { if (bDefer) { @@ -414,6 +423,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endBlockContainer(BlockContainer) + * @param bl BlockContainer that is ending */ public void endBlockContainer(BlockContainer bl) { if (bDefer) { @@ -442,6 +452,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startTable(Table) + * @param tbl Table that is starting */ public void startTable(Table tbl) { if (bDefer) { @@ -469,6 +480,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endTable(Table) + * @param tbl Table that is ending */ public void endTable(Table tbl) { if (bDefer) { @@ -515,24 +527,28 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startHeader(TableBody) + * @param th TableBody that is starting */ public void startHeader(TableBody th) { } /** * @see org.apache.fop.fo.FOEventHandler#endHeader(TableBody) + * @param th TableBody that is ending */ public void endHeader(TableBody th) { } /** * @see org.apache.fop.fo.FOEventHandler#startFooter(TableBody) + * @param tf TableFooter that is starting */ public void startFooter(TableBody tf) { } /** * @see org.apache.fop.fo.FOEventHandler#endFooter(TableBody) + * @param tf TableFooter that is ending */ public void endFooter(TableBody tf) { } @@ -596,6 +612,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startBody(TableBody) + * @param tb TableBody that is starting */ public void startBody(TableBody tb) { if (bDefer) { @@ -615,6 +632,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endBody(TableBody) + * @param tb TableBody that is ending */ public void endBody(TableBody tb) { if (bDefer) { @@ -632,6 +650,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startRow(TableRow) + * @param tr TableRow that is starting */ public void startRow(TableRow tr) { if (bDefer) { @@ -662,6 +681,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endRow(TableRow) + * @param tr TableRow that is ending */ public void endRow(TableRow tr) { if (bDefer) { @@ -674,6 +694,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startCell(TableCell) + * @param tc TableCell that is starting */ public void startCell(TableCell tc) { if (bDefer) { @@ -743,6 +764,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endCell(TableCell) + * @param tc TableCell that is ending */ public void endCell(TableCell tc) { if (bDefer) { @@ -756,6 +778,7 @@ public class RTFHandler extends FOEventHandler { // Lists /** * @see org.apache.fop.fo.FOEventHandler#startList(ListBlock) + * @param lb ListBlock that is starting */ public void startList(ListBlock lb) { if (bDefer) { @@ -784,6 +807,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endList(ListBlock) + * @param lb ListBlock that is ending */ public void endList(ListBlock lb) { if (bDefer) { @@ -795,6 +819,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startListItem(ListItem) + * @param li ListItem that is starting */ public void startListItem(ListItem li) { if (bDefer) { @@ -820,6 +845,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endListItem(ListItem) + * @param li ListItem that is ending */ public void endListItem(ListItem li) { if (bDefer) { @@ -902,6 +928,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startLink(BasicLink basicLink) + * @param basicLink BasicLink that is starting */ public void startLink(BasicLink basicLink) { if (bDefer) { @@ -947,6 +974,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#image(ExternalGraphic) + * @param eg ExternalGraphic that is starting */ public void image(ExternalGraphic eg) { if (bDefer) { @@ -1063,12 +1091,14 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#foreignObject(InstreamForeignObject) + * @param ifo InstreamForeignObject that is starting */ public void foreignObject(InstreamForeignObject ifo) { } /** * @see org.apache.fop.fo.FOEventHandler#startFootnote(Footnote) + * @param footnote Footnote that is starting */ public void startFootnote(Footnote footnote) { if (bDefer) { @@ -1098,6 +1128,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endFootnote(Footnote) + * @param footnote Footnote that is ending */ public void endFootnote(Footnote footnote) { if (bDefer) { @@ -1109,6 +1140,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#startFootnoteBody(FootnoteBody) + * @param body FootnoteBody that is starting */ public void startFootnoteBody(FootnoteBody body) { if (bDefer) { @@ -1134,6 +1166,7 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#endFootnoteBody(FootnoteBody) + * @param body FootnoteBody that is ending */ public void endFootnoteBody(FootnoteBody body) { if (bDefer) { @@ -1159,12 +1192,16 @@ public class RTFHandler extends FOEventHandler { /** * @see org.apache.fop.fo.FOEventHandler#leader(Leader) + * @param l Leader that is starting */ public void leader(Leader l) { } /** - * @see org.apache.fop.fo.FOEventHandler#characters(char[], int, int) + * @param text FOText object + * @param data Array of characters to process. + * @param start Offset for characters to process. + * @param length Portion of array to process. */ public void text(FOText text, char[] data, int start, int length) { if (bDefer) { diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java index e5a0bc122..6385ca4a6 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java @@ -152,6 +152,10 @@ public class RtfTable extends RtfContainer { headerAttribs = attrs; } + /** + * + * @return RtfAttributes of Header + */ public RtfAttributes getHeaderAttribs() { return headerAttribs; } @@ -190,6 +194,10 @@ public class RtfTable extends RtfContainer { return false; } + /** + * + * @return Parent row table (for nested tables only) + */ public RtfTableRow getRow() { RtfElement e = this; while (e.parent != null) { diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java index f19d2aa17..19301cab3 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java @@ -146,6 +146,10 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { super.writeRtfContent(); } + /** + * + * @throws IOException In case of a IO-problem + */ public void writeRowAndCellsDefintions() throws IOException { // render the row and cells definitions writeControlWord("trowd"); @@ -190,36 +194,36 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { // Added by Normand Masse // Adjust the cell's display attributes so the table's/row's borders // are drawn properly. - RtfTableCell cell = (RtfTableCell)e; + RtfTableCell rtfcell = (RtfTableCell)e; if (index == 0) { - if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) { - cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_LEFT, + if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) { + rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_LEFT, (String)attrib.getValue(ITableAttributes.ROW_BORDER_LEFT)); } } if (index == this.getChildCount() - 1) { - if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_RIGHT)) { - cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_RIGHT, + if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_RIGHT)) { + rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_RIGHT, (String)attrib.getValue(ITableAttributes.ROW_BORDER_RIGHT)); } } if (isFirstRow()) { - if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_TOP)) { - cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_TOP, + if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_TOP)) { + rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_TOP, (String)attrib.getValue(ITableAttributes.ROW_BORDER_TOP)); } } if ((parentTable != null) && (parentTable.isHighestRow(id))) { - if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) { - cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM, + if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) { + rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM, (String)attrib.getValue(ITableAttributes.ROW_BORDER_BOTTOM)); } } - xPos = cell.writeCellDef(xPos); + xPos = rtfcell.writeCellDef(xPos); } index++; // Added by Boris POUDEROUS on 2002/07/02 } @@ -315,13 +319,17 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { } /** - * @param id cell id to check + * @param cellId cell id to check * @return true if the cell is the highest cell */ - public boolean isHighestCell(int id) { - return (highestCell == id) ? true : false; + public boolean isHighestCell(int cellId) { + return (highestCell == cellId) ? true : false; } + /** + * + * @return Parent table of the row. + */ public RtfTable getTable() { RtfElement e = this; while (e.parent != null) { diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java index 0d458f27e..fadb5236f 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java @@ -64,36 +64,63 @@ public class TableContext implements ITableColumnsInfo { private boolean bNextRowBelongsToHeader = false; + /** + * + * @param value Specifies, if next row belongs to header + */ public void setNextRowBelongsToHeader(boolean value) { this.bNextRowBelongsToHeader = value; } + /** + * + * @return true, if next row belongs to header + */ public boolean getNextRowBelongsToHeader() { return bNextRowBelongsToHeader; } + /** + * + * @param ctx BuilderContext + */ public TableContext(BuilderContext ctx) { context = ctx; } + /** + * + * @param width Width of next column + * @throws Exception + */ public void setNextColumnWidth(Float width) throws Exception { colWidths.add(width); } - //Added by Peter Herweg on 2002-06-29 + /** + * + * @return RtfAttributes of current row-spanning cell + */ public RtfAttributes getColumnRowSpanningAttrs() { return (RtfAttributes)colRowSpanningAttrs.get(colIndex); } - //Added by Peter Herweg on 2002-06-29 + /** + * + * @return Number of currently spanned rows + */ public Integer getColumnRowSpanningNumber() { return (Integer)colRowSpanningNumber.get(colIndex); } - //Added by Peter Herweg on 2002-06-29 - public void setCurrentColumnRowSpanning(Integer iRowSpanning, RtfAttributes attrs) - throws Exception { + /** + * + * @param iRowSpanning number of rows to span + * @param attrs RtfAttributes of row-spanning cell + */ + public void setCurrentColumnRowSpanning( + Integer iRowSpanning, RtfAttributes attrs) { if (colIndex < colRowSpanningNumber.size()) { colRowSpanningNumber.set(colIndex, iRowSpanning); @@ -104,7 +131,11 @@ public class TableContext implements ITableColumnsInfo { } } - //Added by Peter Herweg on 2002-06-29 + /** + * + * @param iRowSpanning number of rows to span in next column + * @param attrs RtfAttributes of row-spanning cell + */ public void setNextColumnRowSpanning(Integer iRowSpanning, RtfAttributes attrs) { colRowSpanningNumber.add(iRowSpanning);