1 51 package org.apache.fop.fo.flow; 52 53 import org.apache.fop.fo.*; 55 import org.apache.fop.layout.Area; 56 import org.apache.fop.layout.AreaClass; 57 import org.apache.fop.apps.FOPException; 58 import org.apache.fop.layout.*; 59 60 public class FootnoteBody extends FObj { 61 62 int align; 63 int alignLast; 64 int lineHeight; 65 int startIndent; 66 int endIndent; 67 int textIndent; 68 69 public static class Maker extends FObj.Maker { 70 public FObj make(FObj parent, PropertyList propertyList, 71 String systemId, int line, int column) 72 throws FOPException { 73 return new FootnoteBody(parent, propertyList, 74 systemId, line, column); 75 } 76 77 } 78 79 public static FObj.Maker maker() { 80 return new FootnoteBody.Maker(); 81 } 82 83 public FootnoteBody(FObj parent, PropertyList propertyList, 84 String systemId, int line, int column) 85 throws FOPException { 86 super(parent, propertyList, systemId, line, column); 87 this.areaClass = AreaClass.setAreaClass(AreaClass.XSL_FOOTNOTE); 88 } 89 90 public String getName() { 91 return "fo:footnote-body"; 92 } 93 94 public int layout(Area area) throws FOPException { 95 if (this.marker == START) { 96 this.marker = 0; 97 } 98 BlockArea blockArea = 99 new BlockArea(propMgr.getFontState(area.getFontInfo()), 100 area.getAllocationWidth(), area.spaceLeft(), 101 startIndent, endIndent, textIndent, align, 102 alignLast, lineHeight); 103 blockArea.setGeneratedBy(this); 104 blockArea.isFirst(true); 105 blockArea.setParent(area); 106 blockArea.setPage(area.getPage()); 107 blockArea.start(); 108 109 blockArea.setAbsoluteHeight(area.getAbsoluteHeight()); 110 blockArea.setIDReferences(area.getIDReferences()); 111 112 blockArea.setTableCellXOffset(area.getTableCellXOffset()); 113 114 int numChildren = this.children.size(); 115 for (int i = this.marker; i < numChildren; i++) { 116 FONode fo = (FONode)children.get(i); 117 int status; 118 if (Status.isIncomplete((status = fo.layout(blockArea)))) { 119 this.resetMarker(); 120 return status; 121 } 122 } 123 blockArea.end(); 124 area.addChild(blockArea); 125 area.increaseHeight(blockArea.getHeight()); 126 blockArea.isLast(true); 127 return Status.OK; 128 } 129 130 } 131 | Popular Tags |