vmote       2003/07/03 10:44:01

  Modified:    src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfListTable.java
                        RtfNull.java RtfOptions.java RtfPage.java
                        RtfPageArea.java RtfPageBreak.java
                        RtfPageNumber.java RtfPageNumberCitation.java
  Log:
  style changes only, mostly javadoc comments and refactoring of names
  
  Revision  Changes    Path
  1.8       +52 -10    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java
  
  Index: RtfListTable.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RtfListTable.java 2 Jul 2003 16:59:54 -0000       1.7
  +++ RtfListTable.java 3 Jul 2003 17:44:01 -0000       1.8
  @@ -64,41 +64,61 @@
   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, [EMAIL PROTECTED]
    */
   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 @@
           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 @@
           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 @@
           }
       }
   
  +    /**
  +     * Write the content
  +     * @throws IOException for I/O problems
  +     */
       public void writeRtfContent() throws IOException {
           setListType();
           writeGroupMark(true);
  @@ -192,8 +231,11 @@
           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;
       }
  
  
  
  1.5       +4 -3      xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfNull.java
  
  Index: RtfNull.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfNull.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RtfNull.java      30 Jun 2003 06:10:05 -0000      1.4
  +++ RtfNull.java      3 Jul 2003 17:44:01 -0000       1.5
  @@ -61,8 +61,9 @@
   import java.io.Writer;
   import java.io.IOException;
   
  -/* @author Christopher Scott, [EMAIL PROTECTED] */
  -
  +/**
  + * @author Christopher Scott, [EMAIL PROTECTED]
  + */
   public class RtfNull
   extends RtfContainer {
   
  
  
  
  1.4       +20 -8     
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfOptions.java
  
  Index: RtfOptions.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfOptions.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RtfOptions.java   30 Jun 2003 06:10:05 -0000      1.3
  +++ RtfOptions.java   3 Jul 2003 17:44:01 -0000       1.4
  @@ -58,14 +58,26 @@
   
   package org.apache.fop.rtf.rtflib.rtfdoc;
   
  -/**  Simplistic options definitions for RTF generation
  - *  @author Bertrand Delacretaz [EMAIL PROTECTED]
  +/**
  + * Simplistic options definitions for RTF generation
  + * @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
  -
   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;
  +    }
   }
  
  
  
  1.5       +46 -33    xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPage.java
  
  Index: RtfPage.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RtfPage.java      30 Jun 2003 21:04:06 -0000      1.4
  +++ RtfPage.java      3 Jul 2003 17:44:01 -0000       1.5
  @@ -67,19 +67,26 @@
    */
   
   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";
  +
  +    /** 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 MARGIN_TOP = "margt";
  -    public final static String MARGIN_BOTTOM = "margb";
  -    public final static String MARGIN_LEFT = "margl";
  -    public final static 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 @@
       /**    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 ((widthRaw instanceof Integer) && (heightRaw instanceof Integer) &&
  -                ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue())
  -            {
  -                writeControlWord( "landscape" );
  +        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");
               }
           }
       }
   
  -    /** 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;
       }
   
  
  
  
  1.6       +18 -9     
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java
  
  Index: RtfPageArea.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RtfPageArea.java  2 Jul 2003 16:59:54 -0000       1.5
  +++ RtfPageArea.java  3 Jul 2003 17:44:01 -0000       1.6
  @@ -61,11 +61,12 @@
   import java.io.Writer;
   import java.io.IOException;
   
  -/* @author Christopher Scott, [EMAIL PROTECTED] */
  -
  +/**
  + * @author Christopher Scott, [EMAIL PROTECTED]
  + */
   public class RtfPageArea
   extends RtfContainer {
  -    private RtfPage m_currentPage;
  +    private RtfPage currentPage;
       private RtfNull nullChild;
       private RtfAttributes childAttributes;
   
  @@ -74,16 +75,24 @@
           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;
       }
  
  
  
  1.4       +8 -3      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageBreak.java
  
  Index: RtfPageBreak.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageBreak.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RtfPageBreak.java 30 Jun 2003 06:10:05 -0000      1.3
  +++ RtfPageBreak.java 3 Jul 2003 17:44:01 -0000       1.4
  @@ -71,12 +71,17 @@
           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;
       }
  
  
  
  1.7       +23 -11    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java
  
  Index: RtfPageNumber.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RtfPageNumber.java        2 Jul 2003 16:59:54 -0000       1.6
  +++ RtfPageNumber.java        3 Jul 2003 17:44:01 -0000       1.7
  @@ -61,15 +61,22 @@
   import java.io.Writer;
   import java.io.IOException;
   
  -/* @author Christopher Scott, [EMAIL PROTECTED] */
  +/**
  + * @author Christopher Scott, [EMAIL PROTECTED]
  + */
   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 @@
            }
        }
   
  -    /** 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 @@
           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;
       }
  
  
  
  1.7       +17 -7     
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java
  
  Index: RtfPageNumberCitation.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RtfPageNumberCitation.java        2 Jul 2003 16:59:54 -0000       1.6
  +++ RtfPageNumberCitation.java        3 Jul 2003 17:44:01 -0000       1.7
  @@ -61,17 +61,21 @@
   import java.io.Writer;
   import java.io.IOException;
   
  -/*
  +/**
    * @author Christopher Scott, [EMAIL PROTECTED]
    * @author Boris Pouderous, [EMAIL PROTECTED]
    */
  -
   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 @@
         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 @@
       }
     }
   
  -  /** 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;
     }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to