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.

AreaTreeModel.java 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.area;
  18. // XML
  19. import org.xml.sax.SAXException;
  20. /**
  21. * This is the model for the area tree object.
  22. * The model implementation can handle the page sequence,
  23. * page and extensions.
  24. * The methods to access the page viewports can only
  25. * assume the PageViewport is valid as it remains for
  26. * the life of the area tree model.
  27. */
  28. public abstract class AreaTreeModel {
  29. /**
  30. * Start a page sequence on this model.
  31. * @param title the title of the new page sequence
  32. */
  33. public abstract void startPageSequence(LineArea title);
  34. /**
  35. * Add a page to this moel.
  36. * @param page the page to add to the model.
  37. */
  38. public abstract void addPage(PageViewport page);
  39. /**
  40. * Handle an area tree extension
  41. * @param ext the extension to handle
  42. * @param when when the extension should be handled
  43. */
  44. public abstract void handleExtension(TreeExt ext, int when);
  45. /**
  46. * Signal the end of the document for any processing.
  47. */
  48. public abstract void endDocument() throws SAXException;
  49. /**
  50. * Get the page sequence count.
  51. * @return the number of page sequences in the document.
  52. */
  53. public abstract int getPageSequenceCount();
  54. /**
  55. * Get the page count.
  56. * @param seq the page sequence to count.
  57. * @return returns the number of pages in a page sequence
  58. */
  59. public abstract int getPageCount(int seq);
  60. /**
  61. * Get the page for a position in the document.
  62. * @param seq the page sequence number
  63. * @param count the page count in the sequence
  64. * @return the PageViewport for the particular page
  65. */
  66. public abstract PageViewport getPage(int seq, int count);
  67. }