Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

PDFContext.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.svg;
  19. import org.apache.fop.pdf.PDFPage;
  20. /**
  21. * Context class which holds state information which should remain in sync over multiple instances
  22. * of PDFDocumentGraphics2D.
  23. */
  24. public class PDFContext {
  25. private PDFPage currentPage;
  26. /** number of pages generated */
  27. private int pagecount;
  28. /** @return true if a page is set up for painting. */
  29. public boolean isPagePending() {
  30. return this.currentPage != null;
  31. }
  32. /**
  33. * After this call, there's no current page.
  34. */
  35. public void clearCurrentPage() {
  36. currentPage = null;
  37. }
  38. /** @return the current page or null if there is none */
  39. public PDFPage getCurrentPage() {
  40. return this.currentPage;
  41. }
  42. /**
  43. * Sets the current page
  44. * @param page the page
  45. */
  46. public void setCurrentPage(PDFPage page) {
  47. this.currentPage = page;
  48. }
  49. /** Notifies the context to increase the page count. */
  50. public void increasePageCount() {
  51. this.pagecount++;
  52. }
  53. }