KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > svg > PDFContext


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
18 /* $Id: PDFContext.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.svg;
21
22 import java.util.List JavaDoc;
23
24 import org.apache.fop.pdf.PDFPage;
25
26 /**
27  * Context class which holds state information which should remain in sync over multiple instances
28  * of PDFDocumentGraphics2D.
29  */

30 public class PDFContext {
31
32     private PDFPage currentPage;
33     private List JavaDoc fontList;
34
35     /** number of pages generated */
36     private int pagecount;
37     
38     /**
39      * Sets the font list as creates by the FontSetup class.
40      * @param list the font list
41      */

42     public void setFontList(List JavaDoc list) {
43         this.fontList = list;
44     }
45
46     /** @return the font list */
47     public List JavaDoc getFontList() {
48         return this.fontList;
49     }
50
51     /** @return true if a page is set up for painting. */
52     public boolean isPagePending() {
53         return this.currentPage != null;
54     }
55
56     /**
57      * After this call, there's no current page.
58      */

59     public void clearCurrentPage() {
60         currentPage = null;
61     }
62
63     /** @return the current page or null if there is none */
64     public PDFPage getCurrentPage() {
65         return this.currentPage;
66     }
67
68     /**
69      * Sets the current page
70      * @param page the page
71      */

72     public void setCurrentPage(PDFPage page) {
73         this.currentPage = page;
74     }
75
76     /** Notifies the context to increase the page count. */
77     public void increasePageCount() {
78         this.pagecount++;
79     }
80
81 }
82
Popular Tags