]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DPDFRenderingHints.java
Sync git svn branch with SVN repository r33269.
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / G2DPDFRenderingHints.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.scenegraph.g2d;\r
13 \r
14 import java.awt.RenderingHints.Key;\r
15 \r
16 import com.lowagie.text.pdf.FontMapper;\r
17 import com.lowagie.text.pdf.PdfContentByte;\r
18 import com.lowagie.text.pdf.PdfWriter;\r
19 \r
20 /**\r
21  * @author Toni Kalajainen\r
22  */\r
23 public final class G2DPDFRenderingHints {\r
24 \r
25     /** A rendering hint for storing the ExportPdfWriter object. */\r
26     public static final Key KEY_EXPORT_PDF_WRITER = new Key(2003) {\r
27         @Override\r
28         public boolean isCompatibleValue(Object val) {\r
29             return val.getClass().getName().equals("org.simantics.export.core.pdf.ExportPdfWriter");\r
30         }\r
31     };\r
32         \r
33     /**\r
34      * A rendering hint for storing the root PDF ByteContent on which the scene\r
35      * graph is rendered within a Graphics2D instance.\r
36      */\r
37     public static final Key KEY_PDF_BYTECONTENT = new Key(2000) {\r
38         @Override\r
39         public boolean isCompatibleValue(Object val) {\r
40             return val instanceof PdfContentByte;\r
41         }\r
42     };\r
43 \r
44     /**\r
45      * A rendering hint for storing the root PDF writer on which the scene\r
46      * graph is rendered within a Graphics2D instance.\r
47      */\r
48     public static final Key KEY_PDF_WRITER = new Key(2001) {\r
49         @Override\r
50         public boolean isCompatibleValue(Object val) {\r
51             return val instanceof PdfWriter;\r
52         }\r
53     };\r
54     \r
55     /**\r
56      * A rendering hint for storing the root PDF Font Mapper on which the scene\r
57      * graph is rendered within a Graphics2D instance.\r
58      */\r
59     public static final Key KEY_PDF_FONTMAPPER = new Key(2002) {\r
60         @Override\r
61         public boolean isCompatibleValue(Object val) {\r
62             return val instanceof FontMapper;\r
63         }\r
64     };\r
65     \r
66 \r
67 }