]> _ Git - cubeextranet.git/blob
9eb87bd51f148b94d7e1f776ebb6501d9f030c86
[cubeextranet.git] /
1 /*\r
2  * Licensed to the Apache Software Foundation (ASF) under one or more\r
3  * contributor license agreements.  See the NOTICE file distributed with\r
4  * this work for additional information regarding copyright ownership.\r
5  * The ASF licenses this file to You under the Apache License, Version 2.0\r
6  * (the "License"); you may not use this file except in compliance with\r
7  * the License.  You may obtain a copy of the License at\r
8  *\r
9  *      http://www.apache.org/licenses/LICENSE-2.0\r
10  *\r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 package org.apache.pdfbox.pdmodel.interactive.annotation;\r
18 \r
19 import org.apache.pdfbox.cos.COSDictionary;\r
20 import org.apache.pdfbox.cos.COSName;\r
21 \r
22 /**\r
23  * This is the class that represents a rubber stamp annotation.\r
24  * Introduced in PDF 1.3 specification\r
25  *\r
26  * @author Paul King\r
27  * @version $Revision: 1.2 $\r
28  */\r
29 public class PDAnnotationRubberStamp extends PDAnnotationMarkup\r
30 {\r
31 \r
32     /*\r
33      * The various values of the rubber stamp as defined in\r
34      * the PDF 1.6 reference Table 8.28\r
35      */\r
36 \r
37     /**\r
38      * Constant for the name of a rubber stamp.\r
39      */\r
40     public static final String NAME_APPROVED = "Approved";\r
41     /**\r
42      * Constant for the name of a rubber stamp.\r
43      */\r
44     public static final String NAME_EXPERIMENTAL = "Experimental";\r
45     /**\r
46      * Constant for the name of a rubber stamp.\r
47      */\r
48     public static final String NAME_NOT_APPROVED = "NotApproved";\r
49     /**\r
50      * Constant for the name of a rubber stamp.\r
51      */\r
52     public static final String NAME_AS_IS = "AsIs";\r
53     /**\r
54      * Constant for the name of a rubber stamp.\r
55      */\r
56     public static final String NAME_EXPIRED = "Expired";\r
57     /**\r
58      * Constant for the name of a rubber stamp.\r
59      */\r
60     public static final String NAME_NOT_FOR_PUBLIC_RELEASE = "NotForPublicRelease";\r
61     /**\r
62      * Constant for the name of a rubber stamp.\r
63      */\r
64     public static final String NAME_FOR_PUBLIC_RELEASE = "ForPublicRelease";\r
65     /**\r
66      * Constant for the name of a rubber stamp.\r
67      */\r
68     public static final String NAME_DRAFT = "Draft";\r
69     /**\r
70      * Constant for the name of a rubber stamp.\r
71      */\r
72     public static final String NAME_FOR_COMMENT = "ForComment";\r
73     /**\r
74      * Constant for the name of a rubber stamp.\r
75      */\r
76     public static final String NAME_TOP_SECRET = "TopSecret";\r
77     /**\r
78      * Constant for the name of a rubber stamp.\r
79      */\r
80     public static final String NAME_DEPARTMENTAL = "Departmental";\r
81     /**\r
82      * Constant for the name of a rubber stamp.\r
83      */\r
84     public static final String NAME_CONFIDENTIAL = "Confidential";\r
85     /**\r
86      * Constant for the name of a rubber stamp.\r
87      */\r
88     public static final String NAME_FINAL = "Final";\r
89     /**\r
90      * Constant for the name of a rubber stamp.\r
91      */\r
92     public static final String NAME_SOLD = "Sold";\r
93 \r
94     /**\r
95      * The type of annotation.\r
96      */\r
97     public static final String SUB_TYPE = "Stamp";\r
98 \r
99     /**\r
100      * Constructor.\r
101      */\r
102     public PDAnnotationRubberStamp()\r
103     {\r
104         super();\r
105         getDictionary().setItem( COSName.SUBTYPE, COSName.getPDFName( SUB_TYPE ) );\r
106     }\r
107 \r
108     /**\r
109      * Creates a Rubber Stamp annotation from a COSDictionary, expected to be\r
110      * a correct object definition.\r
111      *\r
112      * @param field the PDF objet to represent as a field.\r
113      */\r
114     public PDAnnotationRubberStamp(COSDictionary field)\r
115     {\r
116         super( field );\r
117     }\r
118 \r
119     /**\r
120      * This will set the name (and hence appearance, AP taking precedence)\r
121      * For this annotation.   See the NAME_XXX constants for valid values.\r
122      *\r
123      * @param name The name of the rubber stamp.\r
124      */\r
125     public void setName( String name )\r
126     {\r
127         getDictionary().setName(COSName.NAME, name);\r
128     }\r
129 \r
130     /**\r
131      * This will retrieve the name (and hence appearance, AP taking precedence)\r
132      * For this annotation.  The default is DRAFT.\r
133      *\r
134      * @return The name of this rubber stamp, see the NAME_XXX constants.\r
135      */\r
136     public String getName()\r
137     {\r
138         return getDictionary().getNameAsString(COSName.NAME, NAME_DRAFT);\r
139     }\r
140 }\r