1 51 package org.apache.fop.layout; 52 53 import org.apache.fop.apps.FOPException; 55 import org.apache.fop.apps.StreamRenderer; 56 import org.apache.fop.datatypes.IDReferences; 57 import org.apache.fop.extensions.ExtensionObj; 58 import org.apache.fop.fo.pagination.PageSequence; 59 60 import java.io.IOException ; 62 import java.util.ArrayList ; 63 64 75 76 public class AreaTree { 77 78 82 FontInfo fontInfo; 83 84 87 ArrayList rootExtensions = null; 88 89 private StreamRenderer streamRenderer; 90 91 public AreaTree(StreamRenderer streamRenderer) { 92 this.streamRenderer = streamRenderer; 93 } 94 95 public void setFontInfo(FontInfo fontInfo) { 96 this.fontInfo = fontInfo; 97 } 98 99 public FontInfo getFontInfo() { 100 return this.fontInfo; 101 } 102 103 public void addPage(Page page) 104 throws FOPException { 105 try { 106 page.setExtensions(rootExtensions); 107 rootExtensions = null; 108 streamRenderer.queuePage(page); 109 } catch (IOException e) { 110 throw new FOPException(e); 111 } 112 } 113 114 public IDReferences getIDReferences() { 115 return streamRenderer.getIDReferences(); 116 } 117 118 public void addExtension(ExtensionObj obj) { 119 if(rootExtensions ==null) { 120 rootExtensions = new ArrayList (); 121 } 122 rootExtensions.add(obj); 123 } 124 125 public ArrayList getDocumentMarkers() { 127 return streamRenderer.getDocumentMarkers(); 128 } 129 130 public PageSequence getCurrentPageSequence() { 132 return streamRenderer.getCurrentPageSequence(); 133 } 134 135 public ArrayList getCurrentPageSequenceMarkers() { 137 return streamRenderer.getCurrentPageSequenceMarkers(); 138 } 139 } 140 | Popular Tags |