Author: gadams
Date: Fri Mar  2 20:10:46 2012
New Revision: 1296432

URL: http://svn.apache.org/viewvc?rev=1296432&view=rev
Log:
enable DefaultComesLast rule; fix violations

Modified:
    xmlgraphics/fop/trunk/checkstyle-5.5.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPBorderPainter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPRectanglePainter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionAfter.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBefore.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionEnd.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionStart.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java

Modified: xmlgraphics/fop/trunk/checkstyle-5.5.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/checkstyle-5.5.xml?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/checkstyle-5.5.xml (original)
+++ xmlgraphics/fop/trunk/checkstyle-5.5.xml Fri Mar  2 20:10:46 2012
@@ -74,7 +74,7 @@
     <!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... -->
 
     <!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... -->
-    <!-- <module name="DefaultComesLast"/> produces 9 new errors -->
+    <module name="DefaultComesLast"/>
     <!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... -->
 
     <!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ... ... -->

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPBorderPainter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPBorderPainter.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPBorderPainter.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPBorderPainter.java Fri 
Mar  2 20:10:46 2012
@@ -60,13 +60,6 @@ public class AFPBorderPainter extends Ab
         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 Ab
             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();

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPRectanglePainter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPRectanglePainter.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPRectanglePainter.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPRectanglePainter.java 
Fri Mar  2 20:10:46 2012
@@ -58,14 +58,6 @@ public class AFPRectanglePainter extends
         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
             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);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java Fri Mar  2 
20:10:46 2012
@@ -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

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionAfter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionAfter.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionAfter.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionAfter.java 
Fri Mar  2 20:10:46 2012
@@ -56,18 +56,18 @@ public class RegionAfter extends RegionB
 
         // [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) {

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBefore.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBefore.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBefore.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBefore.java 
Fri Mar  2 20:10:46 2012
@@ -60,17 +60,17 @@ public class RegionBefore extends Region
         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);

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBody.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBody.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBody.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBody.java 
Fri Mar  2 20:10:46 2012
@@ -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);

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionEnd.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionEnd.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionEnd.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionEnd.java 
Fri Mar  2 20:10:46 2012
@@ -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;

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionStart.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionStart.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionStart.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionStart.java 
Fri Mar  2 20:10:46 2012
@@ -55,11 +55,6 @@ public class RegionStart extends RegionS
         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 RegionS
             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;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java?rev=1296432&r1=1296431&r2=1296432&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java Fri 
Mar  2 20:10:46 2012
@@ -62,14 +62,6 @@ public final class WritingMode extends T
         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 T
             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 );



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to