1 51 package org.apache.fop.extensions; 52 53 import org.apache.fop.apps.FOPException; 54 import org.apache.fop.datatypes.IDReferences; 55 import org.apache.fop.fo.FObj; 56 import org.apache.fop.fo.FONode; 57 import org.apache.fop.fo.PropertyList; 58 import org.apache.fop.fo.Status; 59 import org.apache.fop.layout.Area; 60 import org.apache.fop.layout.AreaTree; 61 62 66 public class ContinuedLabel extends ExtensionObj { 67 68 private FObj containingTable=null; 69 70 public static class Maker extends FObj.Maker { 71 public FObj make(FObj parent, PropertyList propertyList, 72 String systemId, int line, int column) 73 throws FOPException { 74 return new ContinuedLabel(parent, propertyList, 75 systemId, line, column); 76 } 77 78 } 79 80 public static FObj.Maker maker() { 81 return new ContinuedLabel.Maker(); 82 } 83 84 public ContinuedLabel(FObj parent, PropertyList propertyList, 85 String systemId, int line, int column) { 86 super(parent, propertyList, systemId, line, column); 87 88 for (; parent!=null ; parent = parent.getParent()) { 90 if (parent.getName().equals("fo:table")) { 91 this.containingTable=parent; 92 break; 93 } 94 } 95 } 96 97 98 public String getName() { 99 return "fop:continued-label"; 100 } 101 102 103 111 public int layout(Area area) throws FOPException { 112 if (this.marker == START) { 113 this.marker = 0; 114 } 115 116 if (containingTable!=null && containingTable.areasGenerated > 0) { 120 int numChildren = this.children.size(); 121 for (int i = this.marker; i < numChildren; i++) { 122 FONode fo = (FONode)children.get(i); 123 int status; 124 if (Status.isIncomplete(status = fo.layout(area))) { 125 this.marker = i; 126 return status; 127 } 128 } 129 } 130 return Status.OK; 131 } 132 133 136 public void format(AreaTree areaTree) throws FOPException { 137 } 138 139 147 public void removeID(IDReferences idReferences) { 148 int numChildren = this.children.size(); 149 for (int i = 0; i < numChildren; i++) { 150 FONode child = (FONode)children.get(i); 151 if ((child instanceof FObj)) { 152 ((FObj)child).removeID(idReferences); 153 } 154 } 155 } 156 } 157 | Popular Tags |