diff options
author | Glen Mazza <gmazza@apache.org> | 2004-11-24 21:07:31 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-11-24 21:07:31 +0000 |
commit | 632222604a21482c3443b4a7d45589803c72fe20 (patch) | |
tree | e196b62b1883862881596d7b98811178943a6077 /src/java/org/apache/fop/render/rtf | |
parent | faa67e299ce5bf80b14094acbc26fb7f177c94aa (diff) | |
download | xmlgraphics-fop-632222604a21482c3443b4a7d45589803c72fe20.tar.gz xmlgraphics-fop-632222604a21482c3443b4a7d45589803c72fe20.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
1.) Removed unneeded enumeration interfaces from fo.Constants.
2.) Appended EN_ to enumeration constants to make them better S&R'able throughout app.
3.) Added an EN_INHERIT enumeration constant (although not currently used in the system.)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198175 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/rtf')
4 files changed, 31 insertions, 31 deletions
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index bbb4ad279..21e2ad33b 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -960,7 +960,7 @@ public class RTFHandler extends FOEventHandler { newGraphic.setURL(eg.getSrc()); //get scaling - if (eg.getScaling() == Constants.UNIFORM) { + if (eg.getScaling() == Constants.EN_UNIFORM) { newGraphic.setScaling ("uniform"); } diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java index 25da7bdff..6f2000e02 100644 --- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java @@ -177,22 +177,22 @@ public class TableAttributesConverter { //check for keep-together row attribute - if (fobj.getKeepTogether().getWithinPage().getEnum() == Constants.ALWAYS) { + if (fobj.getKeepTogether().getWithinPage().getEnum() == Constants.EN_ALWAYS) { attrib.set(ITableAttributes.ROW_KEEP_TOGETHER); } //Check for keep-with-next row attribute. - if (fobj.getKeepWithNext().getWithinPage().getEnum() == Constants.ALWAYS) { + if (fobj.getKeepWithNext().getWithinPage().getEnum() == Constants.EN_ALWAYS) { attrib.set(ITableAttributes.ROW_KEEP_WITH_NEXT); } //Check for keep-with-previous row attribute. - if (fobj.getKeepWithPrevious().getWithinPage().getEnum() == Constants.ALWAYS) { + if (fobj.getKeepWithPrevious().getWithinPage().getEnum() == Constants.EN_ALWAYS) { attrib.set(ITableAttributes.ROW_KEEP_WITH_PREVIOUS); } //Check for height row attribute. - if (fobj.getHeight().getEnum() != Constants.AUTO) { + if (fobj.getHeight().getEnum() != Constants.EN_AUTO) { attrib.set(ITableAttributes.ROW_HEIGHT, fobj.getHeight().getValue() / (1000 / 20)); } @@ -221,7 +221,7 @@ public class TableAttributesConverter { /* ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_TOP_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_TOP, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\" @@ -229,7 +229,7 @@ public class TableAttributesConverter { isBorderPresent = true; } ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_BOTTOM_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_BOTTOM, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\" @@ -237,7 +237,7 @@ public class TableAttributesConverter { isBorderPresent = true; } ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_LEFT_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_LEFT, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\" @@ -245,7 +245,7 @@ public class TableAttributesConverter { isBorderPresent = true; } ep = (EnumProperty)fobj.getProperty(Constants.PR_BORDER_RIGHT_STYLE); - if (ep != null && ep.getEnum() != Constants.NONE) { + if (ep != null && ep.getEnum() != Constants.EN_NONE) { attrib.set(ITableAttributes.ROW_BORDER_RIGHT, "\\" + convertAttributetoRtf(ep.getEnum())); attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\" @@ -291,19 +291,19 @@ public class TableAttributesConverter { public static String convertAttributetoRtf(int iBorderStyle) { // Added by Normand Masse // "solid" is interpreted like "thin" - if (iBorderStyle == Constants.SOLID) { + if (iBorderStyle == Constants.EN_SOLID) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; -/* } else if (iBorderStyle==Constants.THIN) { +/* } else if (iBorderStyle==Constants.EN_THIN) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; - } else if (iBorderStyle==Constants.THICK) { + } else if (iBorderStyle==Constants.EN_THICK) { return BorderAttributesConverter.BORDER_DOUBLE_THICKNESS; - } else if (iBorderStyle==Constants. value.equals("shadowed")) { + } else if (iBorderStyle==Constants.EN_ value.equals("shadowed")) { return BorderAttributesConverter.BORDER_SHADOWED;*/ - } else if (iBorderStyle == Constants.DOUBLE) { + } else if (iBorderStyle == Constants.EN_DOUBLE) { return BorderAttributesConverter.BORDER_DOUBLE; - } else if (iBorderStyle == Constants.DOTTED) { + } else if (iBorderStyle == Constants.EN_DOTTED) { return BorderAttributesConverter.BORDER_DOTTED; - } else if (iBorderStyle == Constants.DASHED) { + } else if (iBorderStyle == Constants.EN_DASHED) { return BorderAttributesConverter.BORDER_DASH; /* } else if (iBorderStyle==Constants value.equals("hairline")) { return BorderAttributesConverter.BORDER_HAIRLINE;*/ diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java index a297b6425..316d379d5 100644 --- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java @@ -166,7 +166,7 @@ class TextAttributesConverter { private static void attrTextDecoration(int textDecoration, RtfAttributes rtfAttr) { - if (textDecoration == Constants.UNDERLINE) { + if (textDecoration == Constants.EN_UNDERLINE) { rtfAttr.set(RtfText.ATTR_UNDERLINE, 1); } else { rtfAttr.set(RtfText.ATTR_UNDERLINE, 0); @@ -186,11 +186,11 @@ class TextAttributesConverter { /* private static void attrBlockDimension(FObj fobj, FOPRtfAttributes rtfAttr) { Length ipd = fobj.getProperty(Constants.PR_INLINE_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); - if (ipd.getEnum() != Constants.AUTO) { + if (ipd.getEnum() != Constants.EN_AUTO) { rtfAttr.set(RtfText.FRAME_WIDTH, ipd); } Length bpd = fobj.getProperty(Constants.PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength(); - if (bpd.getEnum() != Constants.AUTO) { + if (bpd.getEnum() != Constants.EN_AUTO) { rtfAttr.set(RtfText.FRAME_HEIGHT, bpd); } } @@ -199,13 +199,13 @@ class TextAttributesConverter { private static void attrBlockTextAlign(int alignment, RtfAttributes rtfAttr) { String rtfValue = null; switch (alignment) { - case Constants.CENTER: + case Constants.EN_CENTER: rtfValue = RtfText.ALIGN_CENTER; break; - case Constants.END: + case Constants.EN_END: rtfValue = RtfText.ALIGN_RIGHT; break; - case Constants.JUSTIFY: + case Constants.EN_JUSTIFY: rtfValue = RtfText.ALIGN_JUSTIFIED; break; default: diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java index 0416f3e1d..4eca61954 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java @@ -119,7 +119,7 @@ public class BorderAttributesConverter { public static void makeBorder(CommonBorderPaddingBackground border, int side, RtfAttributes attributes, String controlWord) { int styleEnum = border.getBorderStyle(side); - if (styleEnum != Constants.NONE) { + if (styleEnum != Constants.EN_NONE) { FOPRtfAttributes attrs = new FOPRtfAttributes(); attrs.set(BORDER_COLOR, border.getBorderColor(side)); attrs.set(convertAttributetoRtf(styleEnum)); @@ -136,21 +136,21 @@ public class BorderAttributesConverter { public static String convertAttributetoRtf(int iBorderStyle) { // Added by Normand Masse // "solid" is interpreted like "thin" - if (iBorderStyle == Constants.NONE) { + if (iBorderStyle == Constants.EN_NONE) { return BorderAttributesConverter.BORDER_NIL; - } else if (iBorderStyle == Constants.SOLID) { + } else if (iBorderStyle == Constants.EN_SOLID) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; -/* } else if (iBorderStyle==Constants.THIN) { +/* } else if (iBorderStyle==Constants.EN_THIN) { return BorderAttributesConverter.BORDER_SINGLE_THICKNESS; - } else if (iBorderStyle==Constants.THICK) { + } else if (iBorderStyle==Constants.EN_THICK) { return BorderAttributesConverter.BORDER_DOUBLE_THICKNESS; - } else if (iBorderStyle==Constants. value.equals("shadowed")) { + } else if (iBorderStyle==Constants.EN_ value.equals("shadowed")) { return BorderAttributesConverter.BORDER_SHADOWED;*/ - } else if (iBorderStyle == Constants.DOUBLE) { + } else if (iBorderStyle == Constants.EN_DOUBLE) { return BorderAttributesConverter.BORDER_DOUBLE; - } else if (iBorderStyle == Constants.DOTTED) { + } else if (iBorderStyle == Constants.EN_DOTTED) { return BorderAttributesConverter.BORDER_DOTTED; - } else if (iBorderStyle == Constants.DASHED) { + } else if (iBorderStyle == Constants.EN_DASHED) { return BorderAttributesConverter.BORDER_DASH; /* } else if (iBorderStyle==Constants value.equals("hairline")) { return BorderAttributesConverter.BORDER_HAIRLINE;*/ |