DrawParm.java
4.09 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.text;
import com.adobe.xfa.gfx.GFXDriver;
import com.adobe.xfa.gfx.GFXEnv;
import com.adobe.xfa.text.ABXY;
import com.adobe.xfa.text.LineHeight;
import com.adobe.xfa.text.TextDrawInfo;
import com.adobe.xfa.text.TextSelection;
import com.adobe.xfa.text.Units;
import com.adobe.xfa.ut.CoordPair;
import com.adobe.xfa.ut.Rect;
import com.adobe.xfa.ut.UnitSpan;
class DrawParm {
private final TextDrawInfo moDrawInfo;
private GFXDriver mpoDriver;
private Rect moInvalid;
private float moInvalidAMin;
private float moInvalidAMax;
private UnitSpan moInvalidBMin;
private UnitSpan moInvalidBMax;
private Rect mpoTruncate;
private float moTruncateAMin;
private float moTruncateAMax;
private UnitSpan moTruncateBMin;
private UnitSpan moTruncateBMax;
private UnitSpan moOffsetText;
private UnitSpan moOffsetVertText;
private UnitSpan moShiftSize;
private int mpnCharIndex = -1;
public DrawParm(TextDrawInfo oDrawInfo) {
this.moDrawInfo = oDrawInfo;
}
public TextDrawInfo drawInfo() {
return this.moDrawInfo;
}
GFXEnv env() {
return this.moDrawInfo.getGfxEnv();
}
GFXDriver driver() {
return this.mpoDriver;
}
void setDriver(GFXDriver poDriver) {
this.mpoDriver = poDriver;
}
Rect invalid() {
return this.moInvalid;
}
void setInvalid(Rect oInvalid) {
this.moInvalid = oInvalid;
this.setInvalidExtents(oInvalid);
}
float invalidAMin() {
return this.moInvalidAMin;
}
float invalidAMax() {
return this.moInvalidAMax;
}
UnitSpan invalidBMin() {
return this.moInvalidBMin;
}
UnitSpan invalidBMax() {
return this.moInvalidBMax;
}
Rect truncate() {
return this.mpoTruncate;
}
void setTruncate(Rect poTruncate) {
this.mpoTruncate = poTruncate;
if (poTruncate != null) {
this.setTruncateExtents(poTruncate);
}
}
float truncateAMin() {
return this.moTruncateAMin;
}
float truncateAMax() {
return this.moTruncateAMax;
}
UnitSpan truncateBMin() {
return this.moTruncateBMin;
}
UnitSpan truncateBMax() {
return this.moTruncateBMax;
}
void translate(CoordPair oXYOrigin, int eOrientation) {
this.setInvalidExtents(ABXY.toAB(oXYOrigin, this.moInvalid, eOrientation));
if (this.mpoTruncate != null) {
this.setTruncateExtents(ABXY.toAB(oXYOrigin, this.mpoTruncate, eOrientation));
}
}
void setDispHeight(LineHeight oDispHeight) {
this.moOffsetText = Units.toUnitSpan(oDispHeight.textOffset(0));
this.moOffsetVertText = Units.toUnitSpan(oDispHeight.textOffset(1));
this.moShiftSize = Units.toUnitSpan(oDispHeight.size());
}
UnitSpan offsetText() {
return this.moOffsetText;
}
UnitSpan offsetVertText() {
return this.moOffsetVertText;
}
UnitSpan shiftSize() {
return this.moShiftSize;
}
public Rect page() {
return this.moDrawInfo.getPage();
}
public TextSelection primary() {
return this.moDrawInfo.getPrimary();
}
public TextSelection secondary() {
return this.moDrawInfo.getSecondary();
}
public int charIndex() {
return this.mpnCharIndex;
}
public void setCharIndex(int pnCharIndex) {
this.mpnCharIndex = pnCharIndex;
}
private void setInvalidExtents(Rect oInvalid) {
this.moInvalidAMin = Units.toFloat(oInvalid.left());
this.moInvalidAMax = Units.toFloat(oInvalid.right());
this.moInvalidBMin = oInvalid.top();
this.moInvalidBMax = oInvalid.bottom();
}
private void setTruncateExtents(Rect poTruncate) {
if (poTruncate != null) {
this.moTruncateAMin = Units.toFloat(poTruncate.left());
this.moTruncateAMax = Units.toFloat(poTruncate.right());
this.moTruncateBMin = poTruncate.top();
this.moTruncateBMax = poTruncate.bottom();
}
}
}