Link Here
|
20 |
package org.apache.fop.fo.pagination; |
20 |
package org.apache.fop.fo.pagination; |
21 |
|
21 |
|
22 |
// Java |
22 |
// Java |
|
|
23 |
import java.util.Iterator; |
24 |
import java.util.List; |
23 |
import java.util.Map; |
25 |
import java.util.Map; |
24 |
|
26 |
|
25 |
import org.xml.sax.Locator; |
27 |
import org.xml.sax.Locator; |
26 |
|
28 |
|
|
|
29 |
import org.apache.fop.accessibility.StructureElement; |
27 |
import org.apache.fop.apps.FOPException; |
30 |
import org.apache.fop.apps.FOPException; |
28 |
import org.apache.fop.fo.FONode; |
31 |
import org.apache.fop.fo.FONode; |
29 |
import org.apache.fop.fo.PropertyList; |
32 |
import org.apache.fop.fo.PropertyList; |
Link Here
|
49 |
|
52 |
|
50 |
/** Map of flows to their flow name (flow-name, Flow) */ |
53 |
/** Map of flows to their flow name (flow-name, Flow) */ |
51 |
private Map<String, Flow> flowMap; |
54 |
private Map<String, Flow> flowMap; |
|
|
55 |
private List<Flow> flowList; |
56 |
private StructureElement structTree; |
52 |
|
57 |
|
53 |
/** |
58 |
/** |
54 |
* The currentSimplePageMaster is either the page master for the |
59 |
* The currentSimplePageMaster is either the page master for the |
Link Here
|
97 |
protected void startOfNode() throws FOPException { |
102 |
protected void startOfNode() throws FOPException { |
98 |
super.startOfNode(); |
103 |
super.startOfNode(); |
99 |
flowMap = new java.util.HashMap<String, Flow>(); |
104 |
flowMap = new java.util.HashMap<String, Flow>(); |
|
|
105 |
flowList = new java.util.ArrayList<Flow>(); |
100 |
|
106 |
|
101 |
this.simplePageMaster |
107 |
this.simplePageMaster |
102 |
= getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference); |
108 |
= getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference); |
Link Here
|
116 |
if (mainFlow == null) { |
122 |
if (mainFlow == null) { |
117 |
missingChildElementError("(title?,static-content*,flow)"); |
123 |
missingChildElementError("(title?,static-content*,flow)"); |
118 |
} |
124 |
} |
119 |
|
125 |
if (getUserAgent().isAccessibilityEnabled()) { |
|
|
126 |
structTree = createStructureElement(); |
127 |
for(int i=0;i<flowList.size();i++) |
128 |
flowList.get(i).addStructureElements(structTree); |
129 |
if (mainFlow != null) |
130 |
mainFlow.addStructureElements(structTree); |
131 |
} |
120 |
getFOEventHandler().endPageSequence(this); |
132 |
getFOEventHandler().endPageSequence(this); |
121 |
} |
133 |
} |
122 |
|
134 |
|
Link Here
|
168 |
case FO_STATIC_CONTENT: |
180 |
case FO_STATIC_CONTENT: |
169 |
addFlow((StaticContent)child); |
181 |
addFlow((StaticContent)child); |
170 |
flowMap.put(((Flow)child).getFlowName(), (Flow)child); |
182 |
flowMap.put(((Flow)child).getFlowName(), (Flow)child); |
|
|
183 |
flowList.add((Flow)child); |
171 |
break; |
184 |
break; |
172 |
default: |
185 |
default: |
173 |
super.addChildNode(child); |
186 |
super.addChildNode(child); |
Link Here
|
328 |
return this.language; |
341 |
return this.language; |
329 |
} |
342 |
} |
330 |
|
343 |
|
|
|
344 |
/** {@inheritDoc} */ |
345 |
public StructureElement getStructureTree() { |
346 |
return structTree; |
347 |
} |
348 |
|
331 |
/** |
349 |
/** |
332 |
* Releases a page-sequence's children after the page-sequence has been fully processed. |
350 |
* Releases a page-sequence's children after the page-sequence has been fully processed. |
333 |
*/ |
351 |
*/ |
334 |
public void releasePageSequence() { |
352 |
public void releasePageSequence() { |
335 |
this.mainFlow = null; |
353 |
this.mainFlow = null; |
336 |
this.flowMap.clear(); |
354 |
this.flowMap.clear(); |
|
|
355 |
this.flowList.clear(); |
356 |
this.structTree = null; |
337 |
} |
357 |
} |
338 |
|
358 |
|
339 |
} |
359 |
} |