PDFGeospatialMeasure.java
6.23 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.cos.CosArray
* com.adobe.internal.pdftoolkit.core.cos.CosDictionary
* 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.ASName
*/
package com.adobe.internal.pdftoolkit.pdf.interactive.geospatial;
import com.adobe.internal.pdftoolkit.core.cos.CosArray;
import com.adobe.internal.pdftoolkit.core.cos.CosDictionary;
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.ASName;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosDictionary;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosObject;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
import com.adobe.internal.pdftoolkit.pdf.interactive.geospatial.PDFCoordinateSystem;
import java.util.Arrays;
public class PDFGeospatialMeasure
extends PDFCosDictionary {
private PDFGeospatialMeasure(CosObject cosObject) throws PDFInvalidDocumentException {
super(cosObject);
}
public static PDFGeospatialMeasure newInstance(PDFDocument pdfDocument, PDFCoordinateSystem coordinateSystem, double[] gPTSArray) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
if (coordinateSystem == null) {
throw new PDFInvalidParameterException("projected or geographic coordinate system dictionary is required when creating newInstance of PDFGeospatialMeasure.");
}
if (gPTSArray == null) {
throw new PDFInvalidParameterException("GPTS is required when creating newInstance of PDFGeospatialMeasure.");
}
CosDictionary cosObject = PDFCosObject.newCosDictionary(pdfDocument);
PDFGeospatialMeasure pdfObject = new PDFGeospatialMeasure((CosObject)cosObject);
pdfObject.setGCS(coordinateSystem);
pdfObject.setGPTS(gPTSArray);
return pdfObject;
}
public static PDFGeospatialMeasure getInstance(CosObject cosObject) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (PDFCosObject.checkNullCosObject(cosObject) == null) {
return null;
}
PDFGeospatialMeasure pdfObject = PDFCosObject.getCachedInstance(cosObject, PDFGeospatialMeasure.class);
if (pdfObject == null) {
pdfObject = new PDFGeospatialMeasure(cosObject);
}
return pdfObject;
}
public CosArray getBounds() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosArray array = this.getDictionaryArrayValue(ASName.k_Bounds);
if (array == null) {
return PDFGeospatialMeasure.makeCosArray(this.getPDFDocument(), Arrays.asList(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0));
}
return array;
}
public void setBounds(CosArray bounds) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryArrayValue(ASName.k_Bounds, bounds);
}
public PDFCoordinateSystem getGCS() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFCoordinateSystem.getInstance(this.getDictionaryValue(ASName.k_GCS));
}
public void setGCS(PDFCoordinateSystem coordinateSystem) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
if (coordinateSystem == null) {
throw new PDFInvalidParameterException("projected or geographic coordinate system dictionary is required when creating newInstance of PDFGeospatialMeasure.");
}
this.setDictionaryValue(ASName.k_GCS, coordinateSystem);
}
public PDFCoordinateSystem getDCS() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFCoordinateSystem.getInstance(this.getDictionaryValue(ASName.k_DCS));
}
public void setDCS(PDFCoordinateSystem coordinateSystem) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryValue(ASName.k_DCS, coordinateSystem);
}
public ASName[] getProcSetList() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosArray pdu = this.getDictionaryArrayValue(ASName.k_PDU);
if (pdu != null) {
return pdu.getArrayName();
}
return null;
}
public void setProcSetList(ASName[] names) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryArrayValue(ASName.k_PDU, 0, names);
}
public double[] getGPTS() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosArray gpts = this.getDictionaryArrayValue(ASName.k_GPTS);
if (gpts != null) {
return gpts.getArrayDouble();
}
return null;
}
public void setGPTS(double[] value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
if (value == null) {
throw new PDFInvalidParameterException("GPTS is required when creating newInstance of PDFGeospatialMeasure.");
}
this.setDictionaryArrayValue(ASName.k_GPTS, 0, value);
}
public double[] getLPTS() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosArray lpts = this.getDictionaryArrayValue(ASName.k_LPTS);
if (lpts != null) {
return lpts.getArrayDouble();
}
return null;
}
public void setLPTS(double[] value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException, PDFInvalidParameterException {
this.setDictionaryArrayValue(ASName.k_LPTS, 0, value);
}
}