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.

Page.java 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  4. * For details on use and redistribution please refer to the
  5. * LICENSE file included with these sources.
  6. */
  7. package org.apache.fop.area;
  8. public class Page {
  9. // contains before, start, body, end and after regions
  10. RegionViewport regionBefore = null;
  11. RegionViewport regionStart = null;
  12. RegionViewport regionBody = null;
  13. RegionViewport regionEnd = null;
  14. RegionViewport regionAfter = null;
  15. public void setRegion(int areaclass, RegionViewport port) {
  16. if (areaclass == Region.BEFORE) {
  17. regionBefore = port;
  18. } else if (areaclass == Region.START) {
  19. regionStart = port;
  20. } else if (areaclass == Region.BODY) {
  21. regionBody = port;
  22. } else if (areaclass == Region.END) {
  23. regionEnd = port;
  24. } else if (areaclass == Region.AFTER) {
  25. regionAfter = port;
  26. }
  27. }
  28. public RegionViewport getRegion(int areaclass) {
  29. if (areaclass == Region.BEFORE) {
  30. return regionBefore;
  31. } else if (areaclass == Region.START) {
  32. return regionStart;
  33. } else if (areaclass == Region.BODY) {
  34. return regionBody;
  35. } else if (areaclass == Region.END) {
  36. return regionEnd;
  37. } else if (areaclass == Region.AFTER) {
  38. return regionAfter;
  39. }
  40. return null;
  41. }
  42. }