aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/FOPropertyMapping.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2010-09-30 11:51:08 +0000
committerJeremias Maerki <jeremias@apache.org>2010-09-30 11:51:08 +0000
commitba7f42b128a5265f443c401613378aaa504d727d (patch)
tree814718c081744d315598934ab7b6c3e806d4fffb /src/java/org/apache/fop/fo/FOPropertyMapping.java
parent1e510128c7dc3e1d049a9a26f1067d98c92b6b70 (diff)
downloadxmlgraphics-fop-ba7f42b128a5265f443c401613378aaa504d727d.tar.gz
xmlgraphics-fop-ba7f42b128a5265f443c401613378aaa504d727d.zip
Bugzilla #49913:
Initial code drop for support of rounded corners. Submitted by: Peter Hancock <peter.hancock.at.gmail.com> Changes to patch: - Java 1.5 methods eliminated - Some (not all!) Checkstyle violations fixed. - Fixed some excessive and missing whitespace - paintCornersAsBitmap() in AFPPainter was missing a call to ImageSize.calcPixelsFromSize() - Made AT representation of border traits cleaner - Added a TODO for table borders (inner and outer versions) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_RoundedCorners@1003020 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/FOPropertyMapping.java')
-rw-r--r--src/java/org/apache/fop/fo/FOPropertyMapping.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java
index c711a76c0..e79ed25b6 100644
--- a/src/java/org/apache/fop/fo/FOPropertyMapping.java
+++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java
@@ -29,6 +29,7 @@ import org.apache.fop.fo.flow.table.TableFObj.ColumnNumberPropertyMaker;
import org.apache.fop.fo.properties.BackgroundPositionShorthand;
import org.apache.fop.fo.properties.BorderSpacingShorthandParser;
import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
+import org.apache.fop.fo.properties.BoxCornerPropShorthandParser;
import org.apache.fop.fo.properties.BoxPropShorthandParser;
import org.apache.fop.fo.properties.CharacterProperty;
import org.apache.fop.fo.properties.ColorProperty;
@@ -97,6 +98,7 @@ public final class FOPropertyMapping implements Constants {
private PropertyMaker genericCondBorderWidth = null;
private PropertyMaker genericBorderWidth = null;
private PropertyMaker genericBorderStyle = null;
+ private PropertyMaker genericCondCornerRadius = null;
private PropertyMaker genericBreak = null;
private PropertyMaker genericSpace = null;
@@ -201,6 +203,15 @@ public final class FOPropertyMapping implements Constants {
genericBorderStyle.addEnum("outset", getEnumProperty(EN_OUTSET, "OUTSET"));
genericBorderStyle.setDefault("none");
+ // GenericCondCornerRadius
+ genericCondCornerRadius = new CondLengthProperty.Maker(0);
+ genericCondCornerRadius.useGeneric(genericCondLength);
+ genericCondCornerRadius.setInherited(false);
+ genericCondCornerRadius.getSubpropMaker(CP_LENGTH).setDefault("0pt");
+ genericCondCornerRadius.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
+ genericCondCornerRadius.addShorthand(generics[PR_X_BORDER_RADIUS]);
+
+
// GenericBreak
genericBreak = new EnumProperty.Maker(0);
genericBreak.setInherited(false);
@@ -2544,6 +2555,59 @@ public final class FOPropertyMapping implements Constants {
m.setDefault("");
addPropertyMaker("fox:alt-text", m);
+
+ // fox:border-*-radius-*
+
+ // border-before-radius-start
+ m = new CondLengthProperty.Maker(PR_X_BORDER_BEFORE_RADIUS_START);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+
+ addPropertyMaker("fox:border-before-radius-start", m);
+
+ // border-before-radius-end
+ m = new CondLengthProperty.Maker(PR_X_BORDER_BEFORE_RADIUS_END);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-before-radius-end", m);
+
+ // border-after-radius-start
+ m = new CondLengthProperty.Maker(PR_X_BORDER_AFTER_RADIUS_START);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-after-radius-start", m);
+
+ // border-after-radius-end
+ m = new CondLengthProperty.Maker(PR_X_BORDER_AFTER_RADIUS_END);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-after-radius-end", m);
+
+ // border-start-radius-before
+ m = new CondLengthProperty.Maker(PR_X_BORDER_START_RADIUS_START);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-start-radius-before", m);
+
+ // border-start-radius-after
+ m = new CondLengthProperty.Maker(PR_X_BORDER_START_RADIUS_END);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-start-radius-after", m);
+
+ // border-end-radius-before
+ m = new CondLengthProperty.Maker(PR_X_BORDER_END_RADIUS_START);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-end-radius-before", m);
+
+ // border-end-radius-after
+ m = new CondLengthProperty.Maker(PR_X_BORDER_END_RADIUS_END);
+ m.useGeneric(genericCondCornerRadius);
+ m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
+ addPropertyMaker("fox:border-end-radius-after", m);
+
+
// provisional-label-separation
m = new LengthProperty.Maker(PR_PROVISIONAL_LABEL_SEPARATION);
m.setInherited(true);
@@ -2696,6 +2760,13 @@ public final class FOPropertyMapping implements Constants {
m.setDatatypeParser(new BoxPropShorthandParser());
addPropertyMaker("border-width", m);
+ // fox:border-radius
+ m = new ListProperty.Maker(PR_X_BORDER_RADIUS);
+ m.setInherited(false);
+ m.setDatatypeParser(new BoxCornerPropShorthandParser());
+ m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
+ addPropertyMaker("fox:border-radius", m);
+
// cue
m = new ToBeImplementedProperty.Maker(PR_CUE);
m.setInherited(false);