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,
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);
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;
}
}
}
+ /**
+ * Write the content
+ * @throws IOException for I/O problems
+ */
public void writeRtfContent() throws IOException {
setListType();
writeGroupMark(true);
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;
}
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 {
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
*/
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
};
/** 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;
}
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;
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;
}
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;
}
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 {
}
}
- /** 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);
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;
}
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
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()) {
}
}
- /** 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;
}