PDFAnnotation3D.java
12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.cos.CosObject
* com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.types.ASMatrix
* com.adobe.internal.pdftoolkit.core.types.ASName
* com.adobe.internal.pdftoolkit.core.types.ASString
*/
package com.adobe.internal.pdftoolkit.pdf.interactive.annotation;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.types.ASMatrix;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import com.adobe.internal.pdftoolkit.core.types.ASString;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosDictionary;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosObject;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosStream;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
import com.adobe.internal.pdftoolkit.pdf.graphics.PDFRectangle;
import com.adobe.internal.pdftoolkit.pdf.interactive.annotation.PDFAnnotation;
import com.adobe.internal.pdftoolkit.pdf.interactive.annotation.PDFMultimediaUtil;
public class PDFAnnotation3D
extends PDFAnnotation {
private PDFAnnotation3D(CosObject cosObject) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
super(cosObject);
}
private PDFAnnotation3D(PDFDocument pdfDoc) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
super(pdfDoc);
this.setSubtype(ASName.k_3D);
}
public static PDFAnnotation3D newInstance(PDFDocument pdfDocument, PDFCosDictionary key_3DDictOrStream) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
PDFMultimediaUtil.checkParameterType("com.adobe.internal.pdftoolkit.pdf.multimedia.PDF3DDDict", key_3DDictOrStream);
if (key_3DDictOrStream == null) {
throw new PDFInvalidParameterException("3DDictOrStream is required when creating newInstance of PDFAnnot3D.");
}
PDFAnnotation3D pdfObject = new PDFAnnotation3D(pdfDocument);
pdfObject.set3DDictOrStream(key_3DDictOrStream);
try {
pdfObject.setStyle(ASName.k_Embedded);
}
catch (PDFInvalidParameterException e) {
// empty catch block
}
return pdfObject;
}
public static PDFAnnotation3D getInstance(CosObject cosObject) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (PDFCosObject.checkNullCosObject(cosObject) == null) {
return null;
}
PDFAnnotation3D pdfObject = PDFCosObject.getCachedInstance(cosObject, PDFAnnotation3D.class);
if (pdfObject == null) {
pdfObject = new PDFAnnotation3D(cosObject);
}
return pdfObject;
}
public static PDFAnnotation3D newInstance(PDFDocument pdfDocument) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return new PDFAnnotation3D(pdfDocument);
}
public PDFCosDictionary get3DA() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFMultimediaUtil.createPDFMultimediaObject("PDF3DADict", this.getDictionaryCosObjectValue(ASName.k_3DA));
}
public void set3DA(PDFCosDictionary value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
PDFMultimediaUtil.checkParameterType("com.adobe.internal.pdftoolkit.pdf.multimedia.PDF3DADict", value);
if (value == null) {
this.removeValue(ASName.k_3DA);
} else {
this.setDictionaryValue(ASName.k_3DA, value);
}
}
public PDFCosDictionary procure3DA() throws PDFInvalidParameterException, PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (!this.has3DA()) {
return PDFMultimediaUtil.createPDFMultimediaObject("PDF3DADict", this.getPDFDocument());
}
return this.get3DA();
}
public boolean has3DA() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_3DA);
}
public boolean getInteractive() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryBooleanValue(ASName.k_3DI);
}
public void setInteractive(boolean value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryBooleanValue(ASName.k_3DI, value);
}
public boolean hasInteractive() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_3DI);
}
public PDFRectangle getBox() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosObject cosObject = this.getDictionaryValue(ASName.k_3DB);
return PDFRectangle.getInstance(cosObject);
}
public void setBox(PDFRectangle value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.setDictionaryValue(ASName.k_3DB, value);
}
public boolean hasBox() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_3DB);
}
public int get3DViewAsInteger() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryIntValue(ASName.k_3DV);
}
public void set3DView(int value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryIntValue(ASName.k_3DV, value);
}
public ASString get3DViewAsString() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryStringValue(ASName.k_3DV);
}
public void set3DView(ASString value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.setDictionaryASStringValue(ASName.k_3DV, value);
}
public void set3DView(byte[] value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.setDictionaryByteArrayValue(ASName.k_3DV, value);
}
public ASName get3DViewAsName() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryNameValue(ASName.k_3DV);
}
public void set3DView(ASName value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.setDictionaryNameValue(ASName.k_3DV, value);
}
public PDFCosDictionary get3DViewAsDict() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFMultimediaUtil.createPDFMultimediaObject("PDF3DVDict", this.getDictionaryCosObjectValue(ASName.k_3DV));
}
public void set3DView(PDFCosDictionary value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.setDictionaryValue(ASName.k_3DV, value);
}
public boolean has3DView() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_3DV);
}
public PDFCosDictionary get3DDictOrStreamAsDict() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFMultimediaUtil.createPDFMultimediaObject("PDF3DDDict", this.getDictionaryCosObjectValue(ASName.k_3DD));
}
public void set3DDictOrStream(PDFCosDictionary value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
PDFMultimediaUtil.checkParameterType("com.adobe.internal.pdftoolkit.pdf.multimedia.PDF3DDDict", value);
if (value == null) {
throw new PDFInvalidParameterException("3DDictOrStream is a required key therefore cannot be removed.");
}
this.setDictionaryValue(ASName.k_3DD, value);
}
public PDFCosStream get3DDictOrStreamAsStream() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return (PDFCosStream)PDFMultimediaUtil.createPDFMultimediaObject("PDF3DDStream", this.getDictionaryCosObjectValue(ASName.k_3DD));
}
public void set3DDictOrStream(PDFCosStream value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
PDFMultimediaUtil.checkParameterType("com.adobe.internal.pdftoolkit.pdf.multimedia.PDF3DDStream", value);
if (value == null) {
throw new PDFInvalidParameterException("3DDictOrStream is a required key therefore cannot be removed.");
}
this.setDictionaryValue(ASName.k_3DD, value);
}
public boolean has3DDictOrStream() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_3DD);
}
public void transform(ASMatrix matrix, double rotationAngle) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.transformRect(matrix);
this.transformAppearances(matrix, rotationAngle);
}
public PDFCosDictionary get3DU() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFMultimediaUtil.createPDFMultimediaObject("PDF3DUDict", this.getDictionaryCosObjectValue(ASName.k_3DU));
}
public void set3DU(PDFCosDictionary value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
PDFMultimediaUtil.checkParameterType("com.adobe.internal.pdftoolkit.pdf.multimedia.PDF3DUDict", value);
this.setDictionaryValue(ASName.k_3DU, value);
}
public boolean has3DU() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_3DU);
}
public ASName getStyle() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryNameValue(ASName.k_Style);
}
public void setStyle(ASName value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
if (value != null && !value.equals((Object)ASName.k_Embedded) && !value.equals((Object)ASName.k_Windowed)) {
throw new PDFInvalidParameterException("Style value is not valid. " + (Object)ASName.k_Embedded + " or " + (Object)ASName.k_Windowed + " is expected.");
}
this.setDictionaryNameValue(ASName.k_Style, value);
}
public boolean hasStyle() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_Style);
}
public PDFCosDictionary getWindow() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFMultimediaUtil.createPDFMultimediaObject("PDFRichMediaWindow", this.getDictionaryCosObjectValue(ASName.k_Window));
}
public void setWindow(PDFCosDictionary value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
PDFMultimediaUtil.checkParameterType("com.adobe.internal.pdftoolkit.pdf.multimedia.PDFRichMediaWindow", value);
this.setDictionaryValue(ASName.k_Window, value);
}
public boolean hasWindow() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_Window);
}
public boolean getTransparent() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryBooleanValue(ASName.k_Transparent);
}
public void setTransparent(boolean value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryBooleanValue(ASName.k_Transparent, value);
}
public boolean hasTransparent() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_Transparent);
}
}