vmote 2003/07/04 00:04:50
Modified: src/java/org/apache/fop/rtf/rtflib/interfaces
ITableColumnsInfo.java
src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfTemplate.java
RtfText.java
src/java/org/apache/fop/rtf/rtflib/tools ImageConstants.java
Log:
style changes only, mostly javadoc comments and refactoring of names
Revision Changes Path
1.6 +2 -1
xml-fop/src/java/org/apache/fop/rtf/rtflib/interfaces/ITableColumnsInfo.java
Index: ITableColumnsInfo.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/interfaces/ITableColumnsInfo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ITableColumnsInfo.java 30 Jun 2003 22:00:53 -0000 1.5
+++ ITableColumnsInfo.java 4 Jul 2003 07:04:49 -0000 1.6
@@ -63,6 +63,7 @@
*/
public interface ITableColumnsInfo {
+ /** value for invalid column width */
float INVALID_COLUM_WIDTH = 200f;
/** reset the column iteration index, meant to be called when creating a new
row */
1.5 +4 -4
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTemplate.java
Index: RtfTemplate.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTemplate.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RtfTemplate.java 30 Jun 2003 01:31:15 -0000 1.4
+++ RtfTemplate.java 4 Jul 2003 07:04:50 -0000 1.5
@@ -95,9 +95,9 @@
/**
- *Set the template file and adjust tha path separator
- *
- [EMAIL PROTECTED] templateFilePath The full path of the template
+ * Set the template file and adjust tha path separator
+ * @param templateFilePath The full path of the template
+ * @throws IOException for I/O problems
**/
public void setTemplateFilePath(String templateFilePath) throws IOException {
// no validity checks here - leave this to the RTF client
1.6 +93 -48 xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java
Index: RtfText.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RtfText.java 2 Jul 2003 16:59:54 -0000 1.5
+++ RtfText.java 4 Jul 2003 07:04:50 -0000 1.6
@@ -80,81 +80,113 @@
private static final int CHAR_BOLD_END = 131;
/** members */
- private String m_text;
- private final RtfAttributes m_attr;
+ private String text;
+ private final RtfAttributes attr;
/** RtfText attributes: attribute names are RTF control word names to avoid
* additional mapping */
+ /** constant for bold */
public static final String ATTR_BOLD = "b";
+ /** constant for italic */
public static final String ATTR_ITALIC = "i";
+ /** constant for underline */
public static final String ATTR_UNDERLINE = "ul";
+ /** constant for font size */
public static final String ATTR_FONT_SIZE = "fs";
+ /** constant for font family */
public static final String ATTR_FONT_FAMILY = "f";
+ /** constant for font color */
public static final String ATTR_FONT_COLOR = "cf";
+ /** constant for background color */
public static final String ATTR_BACKGROUND_COLOR = "chcbpat"; // Added by Boris
on 06/25//02
/** RtfText attributes: alignment attributes */
- public static String ALIGN_CENTER = "qc";
- public static String ALIGN_LEFT = "ql";
- public static String ALIGN_RIGHT = "qr";
- public static String ALIGN_JUSTIFIED = "qj";
- public static String ALIGN_DISTRIBUTED = "qd";
+ /** constant for align center */
+ public static final String ALIGN_CENTER = "qc";
+ /** constant for align left */
+ public static final String ALIGN_LEFT = "ql";
+ /** constant for align right */
+ public static final String ALIGN_RIGHT = "qr";
+ /** constant for align justified */
+ public static final String ALIGN_JUSTIFIED = "qj";
+ /** constant for align distributed */
+ public static final String ALIGN_DISTRIBUTED = "qd";
/** RtfText attributes: border attributes */
//added by Chris Scott
- public static String BDR_BOTTOM_SINGLE = "brdrb\\brsp40\\brdrs";
- public static String BDR_BOTTOM_DOUBLE = "brdrb\\brsp40\\brdrdb";
- public static String BDR_BOTTOM_EMBOSS = "brdrb\\brsp40\\brdremboss";
- public static String BDR_BOTTOM_DOTTED = "brdrb\\brsp40\\brdrdot";
- public static String BDR_BOTTOM_DASH = "brdrb\\brsp40\\brdrdash";
+ /** constant for bottom single border */
+ public static final String BDR_BOTTOM_SINGLE = "brdrb\\brsp40\\brdrs";
+ /** constant for bottom double border */
+ public static final String BDR_BOTTOM_DOUBLE = "brdrb\\brsp40\\brdrdb";
+ /** constant for bottom embossed border */
+ public static final String BDR_BOTTOM_EMBOSS = "brdrb\\brsp40\\brdremboss";
+ /** constant for bottom dotted border */
+ public static final String BDR_BOTTOM_DOTTED = "brdrb\\brsp40\\brdrdot";
+ /** constant for bottom dashed border */
+ public static final String BDR_BOTTOM_DASH = "brdrb\\brsp40\\brdrdash";
/** 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";
+ /** constant for field */
+ public static final String RTF_FIELD = "field";
+ /** constant for field page */
+ public static final String RTF_FIELD_PAGE = "fldinst { PAGE }";
+ /** constant for field result */
+ public static final String RTF_FIELD_RESULT = "fldrslt";
/**RtfText attributes: indentation attributes */
//added by Chris Scott
- public static String LEFT_INDENT_BODY = "li";
- public static String LEFT_INDENT_FIRST = "fi-";
-
- public static String TAB_CENTER = "tqc\\tx";
- public static String TAB_RIGHT = "tqr\\tx";
- public static String TAB_LEADER_DOTS = "tldot";
- public static String TAB_LEADER_HYPHEN = "tlhyph";
- public static String TAB_LEADER_UNDER = "tlul";
- public static String TAB_LEADER_THICK = "tlth";
- public static String TAB_LEADER_EQUALS = "tleq";
+ /** constant for left indent body */
+ public static final String LEFT_INDENT_BODY = "li";
+ /** constant for left indent first */
+ public static final String LEFT_INDENT_FIRST = "fi-";
+
+ /** constant for center tab */
+ public static final String TAB_CENTER = "tqc\\tx";
+ /** constant for right tab */
+ public static final String TAB_RIGHT = "tqr\\tx";
+ /** constant for tab leader dots */
+ public static final String TAB_LEADER_DOTS = "tldot";
+ /** constant for tab leader hyphens */
+ public static final String TAB_LEADER_HYPHEN = "tlhyph";
+ /** constant for tab leader underscores */
+ public static final String TAB_LEADER_UNDER = "tlul";
+ /** constant for tab leader thick */
+ public static final String TAB_LEADER_THICK = "tlth";
+ /** constant for tab leader equals */
+ public static final String TAB_LEADER_EQUALS = "tleq";
/** Space before/after a paragraph */
//these lines were added by Boris Pouderous
public static final String SPACE_BEFORE = "sb";
+ /** Space after a paragraph */
public static final String SPACE_AFTER = "sa";
/** RtfText attributes: this must contain all allignment attributes names */
- public static String[] ALIGNMENT = new String []
+ public static final String[] ALIGNMENT = new String []
{
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_JUSTIFIED, ALIGN_DISTRIBUTED
};
/** RtfText attributes:: this must contain all border attribute names*/
//this line added by Chris Scott, Westinghouse
- public static String[] BORDER = new String []
+ public static final String[] BORDER = new String []
{
BDR_BOTTOM_SINGLE, BDR_BOTTOM_DOUBLE, BDR_BOTTOM_EMBOSS, BDR_BOTTOM_DOTTED,
BDR_BOTTOM_DASH
};
- public static String[] INDENT = new String []
+ /** String array of indent constants */
+ public static final String[] INDENT = new String []
{
LEFT_INDENT_BODY, LEFT_INDENT_FIRST
};
- public static String[] TABS = new String []
+ /** String array of tab constants */
+ public static final String[] TABS = new String []
{
TAB_CENTER, TAB_RIGHT, TAB_LEADER_DOTS, TAB_LEADER_HYPHEN, TAB_LEADER_UNDER,
TAB_LEADER_THICK, TAB_LEADER_EQUALS
@@ -178,18 +210,21 @@
RtfText(IRtfTextContainer parent, Writer w, String str, RtfAttributes attr)
throws IOException {
super((RtfContainer)parent, w);
- m_text = str;
- m_attr = attr;
+ text = str;
+ this.attr = attr;
}
- /** write our text to the RTF stream */
+ /**
+ * Write our text to the RTF stream
+ * @throws IOException for I/O problems
+ */
public void writeRtfContent() throws IOException {
writeChars: {
//these lines were added by Boris Pouderous
- if (m_attr != null) {
- writeAttributes(m_attr, new String[] {RtfText.SPACE_BEFORE});
- writeAttributes(m_attr, new String[] {RtfText.SPACE_AFTER});
+ if (attr != null) {
+ writeAttributes(attr, new String[] {RtfText.SPACE_BEFORE});
+ writeAttributes(attr, new String[] {RtfText.SPACE_AFTER});
}
if (isTab()) {
@@ -204,10 +239,10 @@
// could be written without group marks
} else {
writeGroupMark(true);
- if (m_attr != null && mustWriteAttributes()) {
- writeAttributes(m_attr, RtfText.ATTR_NAMES);
+ if (attr != null && mustWriteAttributes()) {
+ writeAttributes(attr, RtfText.ATTR_NAMES);
}
- RtfStringConverter.getInstance().writeRtfString(writer, m_text);
+ RtfStringConverter.getInstance().writeRtfString(writer, text);
writeGroupMark(false);
}
@@ -230,12 +265,12 @@
/** direct access to our text */
String getText() {
- return m_text;
+ return text;
}
/** direct access to our text */
void setText(String str) {
- m_text = str;
+ text = str;
}
/**
@@ -245,7 +280,7 @@
* false m_text is set
*/
public boolean isEmpty () {
- return m_text == null || m_text.trim().length() == 0;
+ return text == null || text.trim().length() == 0;
}
/**
@@ -258,36 +293,46 @@
*/
public boolean isNbsp () {
if (!isEmpty ()) {
- if (m_text.trim ().length () == 1 && m_text.charAt (0) == CHAR_NBSP) {
+ if (text.trim ().length () == 1 && text.charAt (0) == CHAR_NBSP) {
return true;
}
}
return false;
}
+ /**
+ * @return true if the text is a tab character
+ */
public boolean isTab() {
- if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_TAB) {
+ if (text.trim().length() == 1 && text.charAt(0) == CHAR_TAB) {
return true;
} else {
return false;
}
}
+ /**
+ * @return true if text is a newline character
+ */
public boolean isNewLine() {
- if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_NEW_LINE) {
+ if (text.trim().length() == 1 && text.charAt(0) == CHAR_NEW_LINE) {
return true;
} else {
return false;
}
}
+ /**
+ * @param isStart set to true if processing the start of the text (??)
+ * @return true if text is bold
+ */
public boolean isBold(boolean isStart) {
if (isStart) {
- if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_BOLD_START)
{
+ if (text.trim().length() == 1 && text.charAt(0) == CHAR_BOLD_START) {
return true;
}
} else {
- if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_BOLD_END) {
+ if (text.trim().length() == 1 && text.charAt(0) == CHAR_BOLD_END) {
return true;
} else {
return false;
@@ -298,6 +343,6 @@
/** @return the attributes of our text */
public RtfAttributes getTextAttributes() {
- return m_attr;
+ return attr;
}
}
1.7 +4 -1
xml-fop/src/java/org/apache/fop/rtf/rtflib/tools/ImageConstants.java
Index: ImageConstants.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/tools/ImageConstants.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ImageConstants.java 30 Jun 2003 22:01:02 -0000 1.6
+++ ImageConstants.java 4 Jul 2003 07:04:50 -0000 1.7
@@ -85,8 +85,11 @@
"emfblip", "pngblip", "jpegblip"
};
+ /** constant for image conversion basis (??) */
public static final int I_TO_CONVERT_BASIS = 50;
+ /** Integer equivalent for GIF */
public static final int I_GIF = 50;
+ /** Integer equivalent for JPEG C (??) */
public static final int I_JPG_C = 51;
/** Defines the types for converting rtf supported image types */
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]