aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-11-24 21:07:31 +0000
committerGlen Mazza <gmazza@apache.org>2004-11-24 21:07:31 +0000
commit632222604a21482c3443b4a7d45589803c72fe20 (patch)
treee196b62b1883862881596d7b98811178943a6077 /src/java/org/apache/fop/render
parentfaa67e299ce5bf80b14094acbc26fb7f177c94aa (diff)
downloadxmlgraphics-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')
-rw-r--r--src/java/org/apache/fop/render/awt/AWTRenderer.java2
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFRenderer.java22
-rw-r--r--src/java/org/apache/fop/render/ps/PSRenderer.java2
-rw-r--r--src/java/org/apache/fop/render/rtf/RTFHandler.java2
-rw-r--r--src/java/org/apache/fop/render/rtf/TableAttributesConverter.java30
-rw-r--r--src/java/org/apache/fop/render/rtf/TextAttributesConverter.java12
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/BorderAttributesConverter.java18
-rw-r--r--src/java/org/apache/fop/render/svg/SVGRenderer.java12
-rw-r--r--src/java/org/apache/fop/render/xml/XMLRenderer.java12
9 files changed, 56 insertions, 56 deletions
diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java
index e6ce03acb..3d87c43b8 100644
--- a/src/java/org/apache/fop/render/awt/AWTRenderer.java
+++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java
@@ -377,7 +377,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
ImageFactory fact = ImageFactory.getInstance();
FopImage fopimage = fact.getImage(back.getURL(), userAgent);
if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) {
- if (back.getRepeat() == BackgroundRepeat.REPEAT) {
+ if (back.getRepeat() == EN_REPEAT) {
// create a pattern for the image
} else {
// place once
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index 13d1edb1a..aa37362ae 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -550,7 +550,7 @@ public class PDFRenderer extends PrintRenderer {
ImageFactory fact = ImageFactory.getInstance();
FopImage fopimage = fact.getImage(back.getURL(), userAgent);
if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) {
- if (back.getRepeat() == BackgroundRepeat.REPEAT) {
+ if (back.getRepeat() == EN_REPEAT) {
// create a pattern for the image
} else {
// place once
@@ -621,10 +621,10 @@ public class PDFRenderer extends PrintRenderer {
private void updateLineStyle(int style) {
switch (style) {
- case Constants.DASHED:
+ case Constants.EN_DASHED:
currentStream.add("[3] 0 d\n");
break;
- case Constants.DOTTED:
+ case Constants.EN_DOTTED:
currentStream.add("[1 7] 0 d\n");
break;
default:
@@ -1259,18 +1259,18 @@ public class PDFRenderer extends PrintRenderer {
int style = area.getRuleStyle();
boolean alt = false;
switch(style) {
- case RuleStyle.SOLID:
+ case EN_SOLID:
currentStream.add("[] 0 d\n");
break;
- case RuleStyle.DOTTED:
+ case EN_DOTTED:
currentStream.add("[2] 0 d\n");
break;
- case RuleStyle.DASHED:
+ case EN_DASHED:
currentStream.add("[6 4] 0 d\n");
break;
- case RuleStyle.DOUBLE:
- case RuleStyle.GROOVE:
- case RuleStyle.RIDGE:
+ case EN_DOUBLE:
+ case EN_GROOVE:
+ case EN_RIDGE:
alt = true;
break;
}
@@ -1281,7 +1281,7 @@ public class PDFRenderer extends PrintRenderer {
currentStream.add(area.getRuleThickness() / 1000f + " w\n");
drawLine(startx, starty, endx, starty);
} else {
- if (style == RuleStyle.DOUBLE) {
+ if (style == EN_DOUBLE) {
float third = area.getRuleThickness() / 3000f;
currentStream.add(third + " w\n");
drawLine(startx, starty, endx, starty);
@@ -1297,7 +1297,7 @@ public class PDFRenderer extends PrintRenderer {
currentStream.add(startx + " " + (starty + 2 * half) + " l\n");
currentStream.add("h\n");
currentStream.add("f\n");
- if (style == RuleStyle.GROOVE) {
+ if (style == EN_GROOVE) {
currentStream.add("0 g\n");
currentStream.add(startx + " " + starty + " m\n");
currentStream.add(endx + " " + starty + " l\n");
diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java
index b0a62cb57..52c433b9d 100644
--- a/src/java/org/apache/fop/render/ps/PSRenderer.java
+++ b/src/java/org/apache/fop/render/ps/PSRenderer.java
@@ -693,7 +693,7 @@ public class PSRenderer extends PrintRenderer {
ImageFactory fact = ImageFactory.getInstance();
FopImage fopimage = fact.getImage(back.getURL(), userAgent);
if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) {
- if (back.getRepeat() == BackgroundRepeat.REPEAT) {
+ if (back.getRepeat() == EN_REPEAT) {
// create a pattern for the image
} else {
// place once
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;*/
diff --git a/src/java/org/apache/fop/render/svg/SVGRenderer.java b/src/java/org/apache/fop/render/svg/SVGRenderer.java
index 4e7cb6fc7..25ea983d6 100644
--- a/src/java/org/apache/fop/render/svg/SVGRenderer.java
+++ b/src/java/org/apache/fop/render/svg/SVGRenderer.java
@@ -360,19 +360,19 @@ public class SVGRenderer extends AbstractRenderer implements XMLHandler {
String style = "stroke:black;stroke-width:"
+ (area.getRuleThickness() / 1000) + ";";
switch (area.getRuleStyle()) {
- case RuleStyle.DOTTED:
+ case EN_DOTTED:
style += "stroke-dasharray:1,1";
break;
- case RuleStyle.DASHED:
+ case EN_DASHED:
style += "stroke-dasharray:5,1";
break;
- case RuleStyle.SOLID:
+ case EN_SOLID:
break;
- case RuleStyle.DOUBLE:
+ case EN_DOUBLE:
break;
- case RuleStyle.GROOVE:
+ case EN_GROOVE:
break;
- case RuleStyle.RIDGE:
+ case EN_RIDGE:
break;
}
Element line = SVGUtilities.createLine(svgDocument,
diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java
index ba1459099..dcc8d1f13 100644
--- a/src/java/org/apache/fop/render/xml/XMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java
@@ -450,21 +450,21 @@ public class XMLRenderer extends AbstractRenderer {
protected void renderLeader(Leader area) {
String style = "solid";
switch (area.getRuleStyle()) {
- case RuleStyle.DOTTED:
+ case EN_DOTTED:
style = "dotted";
break;
- case RuleStyle.DASHED:
+ case EN_DASHED:
style = "dashed";
break;
- case RuleStyle.SOLID:
+ case EN_SOLID:
break;
- case RuleStyle.DOUBLE:
+ case EN_DOUBLE:
style = "double";
break;
- case RuleStyle.GROOVE:
+ case EN_GROOVE:
style = "groove";
break;
- case RuleStyle.RIDGE:
+ case EN_RIDGE:
style = "ridge";
break;
}