diff options
author | Glenn Adams <gadams@apache.org> | 2012-03-02 20:10:46 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2012-03-02 20:10:46 +0000 |
commit | 39d6c01acbf36956d1da132b592f5c8e5ee44ba8 (patch) | |
tree | 04d3bc3d62fac6e84a778a27ce66dee1d9b670ab /src/java/org/apache | |
parent | 8882a49ac0c6d975d7f7b7694ac7eb79a1f99b1a (diff) | |
download | xmlgraphics-fop-39d6c01acbf36956d1da132b592f5c8e5ee44ba8.tar.gz xmlgraphics-fop-39d6c01acbf36956d1da132b592f5c8e5ee44ba8.zip |
enable DefaultComesLast rule; fix violations
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1296432 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/afp/AFPBorderPainter.java | 14 | ||||
-rw-r--r-- | src/java/org/apache/fop/afp/AFPRectanglePainter.java | 16 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/CTM.java | 12 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/RegionAfter.java | 18 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/RegionBefore.java | 12 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/RegionBody.java | 10 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/RegionEnd.java | 12 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/RegionStart.java | 10 | ||||
-rw-r--r-- | src/java/org/apache/fop/traits/WritingMode.java | 16 |
9 files changed, 60 insertions, 60 deletions
diff --git a/src/java/org/apache/fop/afp/AFPBorderPainter.java b/src/java/org/apache/fop/afp/AFPBorderPainter.java index 958a955b8..42c58aa7d 100644 --- a/src/java/org/apache/fop/afp/AFPBorderPainter.java +++ b/src/java/org/apache/fop/afp/AFPBorderPainter.java @@ -60,13 +60,6 @@ public class AFPBorderPainter extends AbstractAFPPainter { float y2 = unitConv.pt2units(borderPaintInfo.getY2()); switch (paintingState.getRotation()) { - default: - case 0: - x1 += at.getTranslateX(); - y1 += at.getTranslateY(); - x2 += at.getTranslateX(); - y2 += at.getTranslateY(); - break; case 90: x1 += at.getTranslateY(); y1 += (float) (pageWidth - at.getTranslateX()); @@ -85,6 +78,13 @@ public class AFPBorderPainter extends AbstractAFPPainter { x2 += x1; y2 += (float) at.getTranslateX(); break; + case 0: + default: + x1 += at.getTranslateX(); + y1 += at.getTranslateY(); + x2 += at.getTranslateX(); + y2 += at.getTranslateY(); + break; } AFPLineDataInfo lineDataInfo = new AFPLineDataInfo(); diff --git a/src/java/org/apache/fop/afp/AFPRectanglePainter.java b/src/java/org/apache/fop/afp/AFPRectanglePainter.java index 7b8a616da..38aa337ee 100644 --- a/src/java/org/apache/fop/afp/AFPRectanglePainter.java +++ b/src/java/org/apache/fop/afp/AFPRectanglePainter.java @@ -58,14 +58,6 @@ public class AFPRectanglePainter extends AbstractAFPPainter { lineDataInfo.setThickness ( Math.round(height) ); switch (lineDataInfo.getRotation()) { - default: - case 0: - lineDataInfo.setX1 ( Math.round((float)at.getTranslateX() + x) ); - yNew = Math.round((float)at.getTranslateY() + y); - lineDataInfo.setY1 ( yNew ); - lineDataInfo.setY2 ( yNew ); - lineDataInfo.setX2 ( Math.round((float)at.getTranslateX() + x + width) ); - break; case 90: lineDataInfo.setX1 ( Math.round((float)at.getTranslateY() + x) ); yNew = pageWidth - Math.round((float)at.getTranslateX()) + Math.round(y); @@ -87,6 +79,14 @@ public class AFPRectanglePainter extends AbstractAFPPainter { lineDataInfo.setY2 ( yNew ); lineDataInfo.setX2 ( pageHeight - Math.round((float)at.getTranslateY() - x - width) ); break; + case 0: + default: + lineDataInfo.setX1 ( Math.round((float)at.getTranslateX() + x) ); + yNew = Math.round((float)at.getTranslateY() + y); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); + lineDataInfo.setX2 ( Math.round((float)at.getTranslateX() + x + width) ); + break; } dataStream.createLine(lineDataInfo); } diff --git a/src/java/org/apache/fop/area/CTM.java b/src/java/org/apache/fop/area/CTM.java index 73943ed65..c247e6b76 100644 --- a/src/java/org/apache/fop/area/CTM.java +++ b/src/java/org/apache/fop/area/CTM.java @@ -335,17 +335,17 @@ public class CTM implements Serializable { */ switch ( writingMode.getEnumValue() ) { - default: - case EN_LR_TB: - case EN_RL_TB: - reldims.ipd = width; - reldims.bpd = height; - break; case EN_TB_LR: case EN_TB_RL: reldims.ipd = height; reldims.bpd = width; break; + case EN_LR_TB: + case EN_RL_TB: + default: + reldims.ipd = width; + reldims.bpd = height; + break; } // Set a rectangle to be the writing-mode relative version??? // Now transform for writing mode diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java index 3541c54be..da7ef812a 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java @@ -56,18 +56,18 @@ public class RegionAfter extends RegionBA { // [TBD] WRITING MODE ALERT switch ( getWritingMode().getEnumValue() ) { - default: - case Constants.EN_LR_TB: - case Constants.EN_RL_TB: - neighbourContext = pageWidthContext; - vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageHeightContext) - , reldims.ipd, getExtent().getValue(pageHeightContext)); - break; case Constants.EN_TB_LR: case Constants.EN_TB_RL: neighbourContext = pageHeightContext; - vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageWidthContext) - , getExtent().getValue(pageWidthContext), reldims.ipd); + vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageWidthContext), + getExtent().getValue(pageWidthContext), reldims.ipd); + break; + case Constants.EN_LR_TB: + case Constants.EN_RL_TB: + default: + neighbourContext = pageWidthContext; + vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageHeightContext), + reldims.ipd, getExtent().getValue(pageHeightContext)); break; } if (getPrecedence() == EN_FALSE) { diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java index 295f6dc1c..7d285f3d7 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java @@ -60,17 +60,17 @@ public class RegionBefore extends RegionBA { Rectangle vpRect; // [TBD] WRITING MODE ALERT switch ( getWritingMode().getEnumValue() ) { - default: - case Constants.EN_LR_TB: - case Constants.EN_RL_TB: - neighbourContext = pageWidthContext; - vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext)); - break; case Constants.EN_TB_LR: case Constants.EN_TB_RL: neighbourContext = pageHeightContext; vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.ipd); break; + case Constants.EN_LR_TB: + case Constants.EN_RL_TB: + default: + neighbourContext = pageWidthContext; + vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext)); + break; } if (getPrecedence() == EN_FALSE) { adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext); diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java index 9e6392337..9eb38c260 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java @@ -117,11 +117,6 @@ public class RegionBody extends Region { int end; // [TBD] WRITING MODE ALERT switch ( getWritingMode().getEnumValue() ) { - default: - case Constants.EN_LR_TB: - start = commonMarginBlock.marginLeft.getValue(pageWidthContext); - end = commonMarginBlock.marginRight.getValue(pageWidthContext); - break; case Constants.EN_RL_TB: start = commonMarginBlock.marginRight.getValue(pageWidthContext); end = commonMarginBlock.marginLeft.getValue(pageWidthContext); @@ -131,6 +126,11 @@ public class RegionBody extends Region { start = commonMarginBlock.marginTop.getValue(pageWidthContext); end = commonMarginBlock.marginBottom.getValue(pageWidthContext); break; + case Constants.EN_LR_TB: + default: + start = commonMarginBlock.marginLeft.getValue(pageWidthContext); + end = commonMarginBlock.marginRight.getValue(pageWidthContext); + break; } int before = commonMarginBlock.spaceBefore.getOptimum(pageHeightContext) .getLength().getValue(pageHeightContext); diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java index ce0258524..a0daf1776 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java +++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java @@ -55,12 +55,6 @@ public class RegionEnd extends RegionSE { Rectangle vpRect; // [TBD] WRITING MODE ALERT switch ( getWritingMode().getEnumValue() ) { - default: - case Constants.EN_LR_TB: - neighbourContext = pageHeightContext; - vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0, - getExtent().getValue(pageWidthContext), reldims.bpd); - break; case Constants.EN_RL_TB: neighbourContext = pageHeightContext; vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd); @@ -72,6 +66,12 @@ public class RegionEnd extends RegionSE { vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageHeightContext), 0, reldims.bpd, getExtent().getValue(pageHeightContext)); break; + case Constants.EN_LR_TB: + default: + neighbourContext = pageHeightContext; + vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0, + getExtent().getValue(pageWidthContext), reldims.bpd); + break; } adjustIPD(vpRect, getWritingMode(), neighbourContext); return vpRect; diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java index c2fc3fe17..afb9ff1a7 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionStart.java +++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java @@ -55,11 +55,6 @@ public class RegionStart extends RegionSE { Rectangle vpRect; // [TBD] WRITING MODE ALERT switch ( getWritingMode().getEnumValue() ) { - default: - case Constants.EN_LR_TB: - neighbourContext = pageHeightContext; - vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd); - break; case Constants.EN_RL_TB: neighbourContext = pageHeightContext; vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0, @@ -70,6 +65,11 @@ public class RegionStart extends RegionSE { neighbourContext = pageWidthContext; vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue(pageHeightContext)); break; + case Constants.EN_LR_TB: + default: + neighbourContext = pageHeightContext; + vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd); + break; } adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext); return vpRect; diff --git a/src/java/org/apache/fop/traits/WritingMode.java b/src/java/org/apache/fop/traits/WritingMode.java index 5b12bb127..2d87a4715 100644 --- a/src/java/org/apache/fop/traits/WritingMode.java +++ b/src/java/org/apache/fop/traits/WritingMode.java @@ -62,14 +62,6 @@ public final class WritingMode extends TraitEnum { Direction rowProgressionDirection; Direction shiftDirection; switch ( getEnumValue() ) { - default: - case Constants.EN_LR_TB: - inlineProgressionDirection = Direction.LR; - blockProgressionDirection = Direction.TB; - columnProgressionDirection = Direction.LR; - rowProgressionDirection = Direction.TB; - shiftDirection = Direction.BT; - break; case Constants.EN_RL_TB: inlineProgressionDirection = Direction.RL; blockProgressionDirection = Direction.TB; @@ -91,6 +83,14 @@ public final class WritingMode extends TraitEnum { rowProgressionDirection = Direction.RL; shiftDirection = Direction.LR; break; + case Constants.EN_LR_TB: + default: + inlineProgressionDirection = Direction.LR; + blockProgressionDirection = Direction.TB; + columnProgressionDirection = Direction.LR; + rowProgressionDirection = Direction.TB; + shiftDirection = Direction.BT; + break; } wms.setInlineProgressionDirection ( inlineProgressionDirection ); wms.setBlockProgressionDirection ( blockProgressionDirection ); |