From: William Victor Mote Date: Thu, 3 Jul 2003 17:44:01 +0000 (+0000) Subject: style changes only, mostly javadoc comments and refactoring of names X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1358 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f1209d7f38cf1b8a7fc4f2ea4267141e69b68735;p=xmlgraphics-fop.git style changes only, mostly javadoc comments and refactoring of names git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196565 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java index 608cfe5ab..f1acd7156 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java @@ -64,41 +64,61 @@ import java.io.Writer; import java.io.IOException; //import org.apache.fop.rtf.rtflib.jfor.main.JForVersionInfo; -/**RtfListTable: used to make the list table in the header section of the RtfFile. +/** + * RtfListTable: used to make the list table in the header section of the RtfFile. * This is the method that Word uses to make lists in RTF and the way most RTF readers, * esp. Adobe FrameMaker read lists from RTF. * @author Christopher Scott, scottc@westinghouse.com */ public class RtfListTable extends RtfContainer { - //number of list in document + /** number of list in document */ private Integer listNum; - //id of list + /** id of list */ private Integer listId; private Integer listTemplateId; private RtfList parentList; - //static data members +//static data members + /** constant for a list table */ public static final String LIST_TABLE = "listtable"; + /** constant for a list */ public static final String LIST = "list"; + /** constant for a list template id */ public static final String LIST_TEMPLATE_ID = "listtemplateid"; + /** constant for a list level */ public static final String LIST_LEVEL = "listlevel"; + /** constant for a list number type */ public static final String LIST_NUMBER_TYPE = "levelnfc"; + /** constant for a list justification */ public static final String LIST_JUSTIFICATION = "leveljc"; + /** constant for list following character */ public static final String LIST_FOLLOWING_CHAR = "levelfollow"; + /** constant for list start at */ public static final String LIST_START_AT = "levelstartat"; + /** constant for list space */ public static final String LIST_SPACE = "levelspace"; + /** constant for list indentation */ public static final String LIST_INDENT = "levelindent"; + /** constant for list text format */ public static final String LIST_TEXT_FORM = "leveltext"; + /** constant for list number positioning */ public static final String LIST_NUM_POSITION = "levelnumbers"; + /** constant for list name */ public static final String LIST_NAME = "listname ;"; + /** constant for list ID */ public static final String LIST_ID = "listid"; + /** constant for list font type */ public static final String LIST_FONT_TYPE = "f"; - + /** constant for list override table */ public static final String LIST_OVR_TABLE = "listoverridetable"; + /** constant for list override */ public static final String LIST_OVR = "listoverride"; + /** constant for list override count */ public static final String LIST_OVR_COUNT = "listoverridecount"; + /** constant for list number */ public static final String LIST_NUMBER = "ls"; + /** String array of list table attributes */ public static final String [] LIST_TABLE_ATTR = { LIST_TABLE, LIST, LIST_TEMPLATE_ID, LIST_NUMBER_TYPE, LIST_JUSTIFICATION, LIST_FOLLOWING_CHAR, @@ -108,8 +128,15 @@ public class RtfListTable extends RtfContainer { LIST_NUMBER, LIST_LEVEL }; - /**RtfListTable Constructor: sets the number of the list, and allocates - * for the RtfAttributes */ + /** + * RtfListTable Constructor: sets the number of the list, and allocates + * for the RtfAttributes + * @param parent RtfContainer holding this RtfListTable + * @param w Writer + * @param num number of the list in the document + * @param attrs attributes of new RtfListTable + * @throws IOException for I/O problems + */ public RtfListTable(RtfContainer parent, Writer w, Integer num, RtfAttributes attrs) throws IOException { super(parent, w, attrs); @@ -123,10 +150,18 @@ public class RtfListTable extends RtfContainer { attrib.set(LIST_NUMBER_TYPE, 0); } + /** + * Set parentList + * @param parent parentList to set + */ public void setParentList(RtfList parent) { parentList = parent; } + /** + * Accessor for listNum + * @return listNum + */ public Integer getListNumber() { return listNum; } @@ -150,6 +185,10 @@ public class RtfListTable extends RtfContainer { } } + /** + * Write the content + * @throws IOException for I/O problems + */ public void writeRtfContent() throws IOException { setListType(); writeGroupMark(true); @@ -192,8 +231,11 @@ public class RtfListTable extends RtfContainer { writeGroupMark(false); } - //since this has no text content we have to overwrite isEmpty to print - //the table + /** + * Since this has no text content we have to overwrite isEmpty to print + * the table + * @return false (always) + */ public boolean isEmpty() { return false; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfNull.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfNull.java index 1c5576aae..1f85c48f8 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfNull.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfNull.java @@ -61,8 +61,9 @@ package org.apache.fop.rtf.rtflib.rtfdoc; import java.io.Writer; import java.io.IOException; -/* @author Christopher Scott, scottc@westinghouse.com */ - +/** + * @author Christopher Scott, scottc@westinghouse.com + */ public class RtfNull extends RtfContainer { diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfOptions.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfOptions.java index ca7ca4e19..1e522aa97 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfOptions.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfOptions.java @@ -58,14 +58,26 @@ package org.apache.fop.rtf.rtflib.rtfdoc; -/** Simplistic options definitions for RTF generation - * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch +/** + * Simplistic options definitions for RTF generation + * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch */ - public class RtfOptions { - /** if true, RtfParagraphs that have no children do not generate any RTF code */ - public boolean ignoreEmptyParagraphs() { return true; } + /** + * If this returns true, RtfParagraphs that have no children will not + * generate any RTF code + * @return true + */ + public boolean ignoreEmptyParagraphs() { + return true; + } - /** RtfContainer does not generate any RTF is this returns false */ - public boolean renderContainer(RtfContainer c) { return true; } + /** + * If this returns false, RtfContainer will not generate any RTF + * @param c RtfContainer to be tested + * @return true + */ + public boolean renderContainer(RtfContainer c) { + return true; + } } \ No newline at end of file diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPage.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPage.java index a6f45094b..0bbcb4681 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPage.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPage.java @@ -67,19 +67,26 @@ import java.io.Writer; */ public class RtfPage -extends RtfContainer{ - private final RtfAttributes m_attrib; +extends RtfContainer { + private final RtfAttributes attrib; /**RtfPage attributes*/ - public final static String PAGE_WIDTH = "paperw"; - public final static String PAGE_HEIGHT = "paperh"; + /** constant for page width */ + public static final String PAGE_WIDTH = "paperw"; + /** constant for page height */ + public static final String PAGE_HEIGHT = "paperh"; - public final static String MARGIN_TOP = "margt"; - public final static String MARGIN_BOTTOM = "margb"; - public final static String MARGIN_LEFT = "margl"; - public final static String MARGIN_RIGHT = "margr"; + /** constant for top margin */ + public static final String MARGIN_TOP = "margt"; + /** constant for bottom margin */ + public static final String MARGIN_BOTTOM = "margb"; + /** constant for left margin */ + public static final String MARGIN_LEFT = "margl"; + /** constant for right margin */ + public static final String MARGIN_RIGHT = "margr"; - public final static String[] PAGE_ATTR = new String[]{ + /** String array of RtfPage attributes */ + public static final String[] PAGE_ATTR = new String[]{ PAGE_WIDTH, PAGE_HEIGHT, MARGIN_TOP, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT }; @@ -87,38 +94,44 @@ extends RtfContainer{ /** RtfPage creates new page attributes with the parent container, the writer and the attributes*/ RtfPage(RtfPageArea parent, Writer w, RtfAttributes attrs) throws IOException { - super((RtfContainer)parent,w); - m_attrib = attrs; + super((RtfContainer)parent, w); + attrib = attrs; } - /** RtfPage writes the attributes the attributes contained in the string - PAGE_ATTR, if not null */ + /** + * RtfPage writes the attributes the attributes contained in the string + * PAGE_ATTR, if not null + * @throws IOException for I/O problems + */ protected void writeRtfContent() throws IOException { - writeAttributes(m_attrib, PAGE_ATTR); + writeAttributes(attrib, PAGE_ATTR); - if (m_attrib != null) - { - Object widthRaw = m_attrib.getValue( PAGE_WIDTH ); - Object heightRaw = m_attrib.getValue( PAGE_HEIGHT ); + if (attrib != null) { + Object widthRaw = attrib.getValue(PAGE_WIDTH); + Object heightRaw = attrib.getValue(PAGE_HEIGHT); - if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer) && - ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) - { - writeControlWord( "landscape" ); + if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer) + && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) { + writeControlWord("landscape"); } } } - /** RtfPage - attributes accessor */ - public RtfAttributes getAttributes(){ - return m_attrib; + /** + * RtfPage - attributes accessor + * @return attributes + */ + public RtfAttributes getAttributes() { + return attrib; } - /** RtfPage - is overwritten here because page attributes have no content - only attributes. RtfContainer is defined not to write when empty. - Therefore must make this true to print.*/ - protected boolean okToWriteRtf() - { + /** + * RtfPage - is overwritten here because page attributes have no content + * only attributes. RtfContainer is defined not to write when empty. + * Therefore must make this true to print. + * @return true + */ + protected boolean okToWriteRtf() { return true; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java index f5acf7370..3d88ec846 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java @@ -61,11 +61,12 @@ package org.apache.fop.rtf.rtflib.rtfdoc; import java.io.Writer; import java.io.IOException; -/* @author Christopher Scott, scottc@westinghouse.com */ - +/** + * @author Christopher Scott, scottc@westinghouse.com + */ public class RtfPageArea extends RtfContainer { - private RtfPage m_currentPage; + private RtfPage currentPage; private RtfNull nullChild; private RtfAttributes childAttributes; @@ -74,16 +75,24 @@ extends RtfContainer { super(f, w); } - /** close current Rtfpage if any and create a new one */ + /** + * Close current Rtfpage if any and create a new one + * @param attr attributes for new RtfPage + * @return new RtfPage + * @throws IOException for I/O problems + */ public RtfPage newPage(RtfAttributes attr) throws IOException { - if (m_currentPage != null) { - m_currentPage.close(); + if (currentPage != null) { + currentPage.close(); } - m_currentPage = new RtfPage(this, writer, attr); + currentPage = new RtfPage(this, writer, attr); - return m_currentPage; + return currentPage; } + /** + * @return true + */ protected boolean okToWriteRtf() { return true; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageBreak.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageBreak.java index e5fbcc05f..e3515ecea 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageBreak.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageBreak.java @@ -71,12 +71,17 @@ public class RtfPageBreak extends RtfElement { super((RtfContainer)parent, w); } - /** overridden to write our attributes before our content */ + /** + * Overridden to write our attributes before our content + * @throws IOException for I/O problems + */ protected void writeRtfContent() throws IOException { writeControlWord("page"); } - /** true if this element would generate no "useful" RTF content */ + /** + * @return true if this element would generate no "useful" RTF content + */ public boolean isEmpty() { return false; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java index 9eb6e7141..1d3d4ce37 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java @@ -61,15 +61,22 @@ package org.apache.fop.rtf.rtflib.rtfdoc; import java.io.Writer; import java.io.IOException; -/* @author Christopher Scott, scottc@westinghouse.com */ +/** + * @author Christopher Scott, scottc@westinghouse.com + */ public class RtfPageNumber extends RtfContainer { - /** RtfText attributes: fields */ - //must be carefull of group markings and star control - //ie page field: - // "{\field {\*\fldinst {PAGE}} {\fldrslt}}" - public static String RTF_FIELD = "field"; - public static String RTF_FIELD_PAGE = "fldinst { PAGE }"; - public static String RTF_FIELD_RESULT = "fldrslt"; + /* RtfText attributes: fields + must be carefull of group markings and star control + ie page field: + "{\field {\*\fldinst {PAGE}} {\fldrslt}}" + */ + + /** constant for field */ + public static final String RTF_FIELD = "field"; + /** constant for field on page */ + public static final String RTF_FIELD_PAGE = "fldinst { PAGE }"; + /** constant for field result */ + public static final String RTF_FIELD_RESULT = "fldrslt"; /** Create an RTF paragraph as a child of given container with default attributes */ RtfPageNumber(IRtfPageNumberContainer parent, Writer w) throws IOException { @@ -89,7 +96,10 @@ public class RtfPageNumber extends RtfContainer { } } - /** write our attributes and content */ + /** + * Write our attributes and content + * @throws IOException for I/O problems + */ protected void writeRtfContent() throws IOException { writeGroupMark(true); writeControlWord(RTF_FIELD); @@ -103,7 +113,9 @@ public class RtfPageNumber extends RtfContainer { writeGroupMark(false); } - /** true if this element would generate no "useful" RTF content */ + /** + * @return true if this element would generate no "useful" RTF content + */ public boolean isEmpty() { return false; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java index f2252dd2a..257009688 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java @@ -61,17 +61,21 @@ package org.apache.fop.rtf.rtflib.rtfdoc; import java.io.Writer; import java.io.IOException; -/* +/** * @author Christopher Scott, scottc@westinghouse.com * @author Boris Pouderous, boris.pouderous@free.fr */ - public class RtfPageNumberCitation extends RtfContainer { - // Page field : - // "{\field {\*\fldinst {PAGEREF xx}} {\fldrslt}}" where xx represents the - // 'id' of the referenced page + /* Page field : + "{\field {\*\fldinst {PAGEREF xx}} {\fldrslt}}" where xx represents the + 'id' of the referenced page + */ + + /** constant for field */ public static final String RTF_FIELD = "field"; + /** constant for field pageref model */ public static final String RTF_FIELD_PAGEREF_MODEL = "fldinst { PAGEREF }"; + /** constant for field result */ public static final String RTF_FIELD_RESULT = "fldrslt"; // The 'id' of the referenced page @@ -96,6 +100,10 @@ public class RtfPageNumberCitation extends RtfContainer { this.id = id; } + /** + * Write the content + * @throws IOException for I/O problems + */ protected void writeRtfContent() throws IOException { // If we have a valid ID if (isValid()) { @@ -131,7 +139,9 @@ public class RtfPageNumberCitation extends RtfContainer { } } - /** true if this element would generate no "useful" RTF content */ + /** + * @return true if this element would generate no "useful" RTF content + */ public boolean isEmpty() { return false; }