makers.put(Wrapper.class, new WrapperLayoutManagerMaker());
makers.put(Title.class, new InlineLayoutManagerMaker());
}
-
+
public void makeLayoutManagers(FONode node, List lms) {
Maker maker = (Maker) makers.get(node.getClass());
if (maker == null) {
return;
}
}
-
+
public static class FOTextLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
FOText foText = (FOText) node;
}
}
}
-
+
/*
public static class FObjMixedLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
}
}
}
-
+
public static class InlineLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
if (node.getChildNodes() != null) {
}
}
}
-
+
public static class FootnodeLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
Inline citation = ((Footnote) node).getInlineFO();
if (citation != null) {
lms.add(new InlineLayoutManager(citation));
}
- }
+ }
}
-
+
public static class InlineContainerLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
ArrayList childList = new ArrayList();
super.make(node, childList);
lms.add(new ICLayoutManager((InlineContainer) node, childList));
- }
+ }
}
-
+
public static class BasicLinkLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
lms.add(new BasicLinkLayoutManager((BasicLink) node));
}
}
-
+
public static class BlockLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
lms.add(new BlockLayoutManager((Block) node));
}
}
-
+
public static class LeaderLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
lms.add(new LeaderLayoutManager((Leader) node));
public static class PageNumberLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
lms.add(new PageNumberLayoutManager((PageNumber) node));
- }
+ }
}
public static class PageNumberCitationLayoutManagerMaker extends Maker {
ArrayList columnLMs = new ArrayList();
ListIterator iter = columns.listIterator();
while (iter.hasNext()) {
- columnLMs.add(new Column((TableColumn) node));
+ columnLMs.add(new Column((TableColumn) iter.next()));
}
tlm.setColumns(columnLMs);
}
/**
* @see org.apache.fop.render.Renderer#processOffDocumentItem(OffDocumentItem)
*/
- public void processOffDocumentItem(OffDocumentItem ext) {
- // render bookmark extension
- if (ext instanceof BookmarkData) {
- renderRootExtensions((BookmarkData)ext);
+ public void processOffDocumentItem(OffDocumentItem odi) {
+ // render Bookmark-Tree
+ if (odi instanceof BookmarkData) {
+ renderBookmarkTree((BookmarkData) odi);
}
}
/**
- * Renders the root extension elements
- * @param bookmarks the bookmarks to render
+ * Renders a Bookmark-Tree object
+ * @param bookmarks the BookmarkData object containing all the Bookmark-Items
*/
- protected void renderRootExtensions(BookmarkData bookmarks) {
+ protected void renderBookmarkTree(BookmarkData bookmarks) {
for (int i = 0; i < bookmarks.getCount(); i++) {
BookmarkData ext = bookmarks.getSubData(i);
- renderOutline(ext, null);
+ renderBookmarkItem(ext, null);
}
}
- private void renderOutline(BookmarkData outline, PDFOutline parentOutline) {
+ private void renderBookmarkItem(BookmarkData bookmarkItem,
+ PDFOutline parentBookmarkItem) {
PDFOutline pdfOutline = null;
- PageViewport pv = outline.getPageViewport();
+ PageViewport pv = bookmarkItem.getPageViewport();
if (pv != null) {
Rectangle2D bounds = pv.getViewArea();
double h = bounds.getHeight();
float yoffset = (float)h / 1000f;
String intDest = (String)pageReferences.get(pv.getKey());
- if (parentOutline == null) {
+ if (parentBookmarkItem == null) {
PDFOutline outlineRoot = pdfDoc.getOutlineRoot();
pdfOutline = pdfDoc.getFactory().makeOutline(outlineRoot,
- outline.getLabel(), intDest, yoffset);
+ bookmarkItem.getLabel(), intDest, yoffset);
} else {
- pdfOutline = pdfDoc.getFactory().makeOutline(parentOutline,
- outline.getLabel(), intDest, yoffset);
+ pdfOutline = pdfDoc.getFactory().makeOutline(parentBookmarkItem,
+ bookmarkItem.getLabel(), intDest, yoffset);
}
}
- for (int i = 0; i < outline.getCount(); i++) {
- renderOutline(outline.getSubData(i), pdfOutline);
+ for (int i = 0; i < bookmarkItem.getCount(); i++) {
+ renderBookmarkItem(bookmarkItem.getSubData(i), pdfOutline);
}
}