1 17 18 19 20 package org.apache.fop.layoutmgr; 21 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 import org.apache.fop.traits.MinOptMax; 25 26 30 public abstract class UnresolvedListElementWithLength extends UnresolvedListElement { 31 32 33 protected static Log log = LogFactory.getLog(UnresolvedListElementWithLength.class); 34 35 private MinOptMax length; 36 private boolean conditional; 37 private RelSide side; 38 private boolean isFirst; 39 private boolean isLast; 40 41 50 public UnresolvedListElementWithLength(Position position, MinOptMax length, 51 RelSide side, 52 boolean conditional, boolean isFirst, boolean isLast) { 53 super(position); 54 this.length = length; 55 this.side = side; 56 this.conditional = conditional; 57 this.isFirst = isFirst; 58 this.isLast = isLast; 59 } 60 61 62 public boolean isConditional() { 63 return this.conditional; 64 } 65 66 67 public MinOptMax getLength() { 68 return this.length; 69 } 70 71 72 public RelSide getSide() { 73 return this.side; 74 } 75 76 77 public boolean isFirst() { 78 return this.isFirst; 79 } 80 81 82 public boolean isLast() { 83 return this.isLast; 84 } 85 86 92 public abstract void notifyLayoutManager(MinOptMax effectiveLength); 93 94 95 public String toString() { 96 StringBuffer sb = new StringBuffer (); 97 sb.append(getSide().getName()).append(", "); 98 sb.append(this.length.toString()); 99 if (isConditional()) { 100 sb.append("[discard]"); 101 } else { 102 sb.append("[RETAIN]"); 103 } 104 if (isFirst()) { 105 sb.append("[first]"); 106 } 107 if (isLast()) { 108 sb.append("[last]"); 109 } 110 return sb.toString(); 111 } 112 113 } 114 | Popular Tags |