You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PageMaster.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package org.apache.xml.fop.layout;
  2. public class PageMaster {
  3. private int width;
  4. private int height;
  5. private Region body;
  6. private Region before;
  7. private Region after;
  8. private Region start;
  9. private Region end;
  10. public PageMaster(int pageWidth, int pageHeight) {
  11. this.width = pageWidth;
  12. this.height = pageHeight;
  13. }
  14. public void addAfter(Region region) {
  15. this.after = region;
  16. }
  17. public void addBefore(Region region) {
  18. this.before = region;
  19. }
  20. public void addBody(Region region) {
  21. this.body = region;
  22. }
  23. public void addEnd(Region region) {
  24. this.end = region;
  25. }
  26. public void addStart(Region region) {
  27. this.start = region;
  28. }
  29. public int getHeight() {
  30. return this.height;
  31. }
  32. public int getWidth() {
  33. return this.width;
  34. }
  35. public Page makePage(AreaTree areaTree) {
  36. Page p = new Page(areaTree, this.height, this.width);
  37. if (this.body != null) {
  38. p.addBody(body.makeAreaContainer());
  39. }
  40. if (this.before != null) {
  41. p.addBefore(before.makeAreaContainer());
  42. }
  43. if (this.after != null) {
  44. p.addAfter(after.makeAreaContainer());
  45. }
  46. if (this.start != null) {
  47. p.addStart(start.makeAreaContainer());
  48. }
  49. if (this.end != null) {
  50. p.addEnd(end.makeAreaContainer());
  51. }
  52. return p;
  53. }
  54. }