1 17 18 19 20 package org.apache.fop.traits; 21 22 import org.apache.fop.datatypes.KeepValue; 23 import org.apache.fop.fo.Constants; 24 25 30 public class LayoutProps { 31 32 public int breakBefore; public int breakAfter; public KeepValue keepWithPrevious; 35 public KeepValue keepWithNext; 36 public KeepValue keepTogether; 37 public int orphans; 38 public int widows; 39 public int blockProgressionUnit; 40 public int lineStackingStrategy; 41 public boolean bIsSpan; 42 public SpaceVal spaceBefore; 43 public SpaceVal spaceAfter; 44 45 private static final int[] BREAK_PRIORITIES = 46 new int[]{ Constants.EN_AUTO, Constants.EN_COLUMN, Constants.EN_PAGE }; 47 48 49 public LayoutProps() { 50 breakBefore = breakAfter = Constants.EN_AUTO; 51 bIsSpan = false; 52 } 53 54 64 public void combineWithParent(LayoutProps parentLP) { 65 if (parentLP.breakBefore != breakBefore) { 66 for (int i = 0; i < BREAK_PRIORITIES.length; i++) { 67 int bp = BREAK_PRIORITIES[i]; 68 if (bp == breakBefore) { 69 breakBefore = parentLP.breakBefore; 70 break; 71 } else if (bp == parentLP.breakBefore) { 72 break; 73 } 74 } 75 } 76 bIsSpan = parentLP.bIsSpan; 78 } 79 80 public String toString() { 81 return "LayoutProps:\n" + 82 "breakBefore = " + breakBefore + "; breakAfter = " + breakAfter + "\n" + 83 "spaceBefore = " + ((spaceBefore != null) ? spaceBefore.toString() : "null") + "\n" + 84 "spaceAfter = " + ((spaceAfter != null) ? spaceAfter.toString() : "null") + "\n" + 85 "bIsSpan = " + bIsSpan + "\n"; 86 } 87 } 88 89 | Popular Tags |