1 51 package org.apache.fop.layout; 52 53 public class PageMaster { 54 55 private int width; 56 private int height; 57 58 private BodyRegionArea body; 59 private RegionArea before; 60 private RegionArea after; 61 private RegionArea start; 62 private RegionArea end; 63 64 public PageMaster(int pageWidth, int pageHeight) { 65 this.width = pageWidth; 66 this.height = pageHeight; 67 } 68 69 public void addAfter(RegionArea region) { 70 this.after = region; 71 } 72 73 public void addBefore(RegionArea region) { 74 this.before = region; 75 } 76 77 public void addBody(BodyRegionArea region) { 78 this.body = region; 79 } 80 81 public void addEnd(RegionArea region) { 82 this.end = region; 83 } 84 85 public void addStart(RegionArea region) { 86 this.start = region; 87 } 88 89 public int getHeight() { 90 return this.height; 91 } 92 93 public int getWidth() { 94 return this.width; 95 } 96 97 public Page makePage(AreaTree areaTree) { 98 Page p = new Page(areaTree, this.height, this.width); 99 if (this.body != null) { 100 p.addBody(body.makeBodyAreaContainer()); 101 } 102 if (this.before != null) { 103 p.addBefore(before.makeAreaContainer()); 104 } 105 if (this.after != null) { 106 p.addAfter(after.makeAreaContainer()); 107 } 108 if (this.start != null) { 109 p.addStart(start.makeAreaContainer()); 110 } 111 if (this.end != null) { 112 p.addEnd(end.makeAreaContainer()); 113 } 114 115 return p; 116 } 117 118 } 119 | Popular Tags |