DispTab.java
2.95 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.text;
import com.adobe.xfa.font.FontService;
import com.adobe.xfa.gfx.GFXEnv;
import com.adobe.xfa.text.TextAttr;
import com.adobe.xfa.text.TextContext;
import com.adobe.xfa.text.TextDisplay;
import com.adobe.xfa.text.TextEmbed;
import com.adobe.xfa.text.TextRegion;
import com.adobe.xfa.text.TextStream;
import com.adobe.xfa.text.Units;
import com.adobe.xfa.ut.UnitSpan;
class DispTab
extends TextEmbed {
private TextRegion mpoFillRegion;
private UnitSpan moWidth = UnitSpan.ZERO;
private UnitSpan moHeight = UnitSpan.ZERO;
private UnitSpan moFillWidth;
private boolean mbTrailing;
DispTab() {
}
void setWidth(float oWidth) {
this.setWidth(Units.toUnitSpan(oWidth));
}
void setWidth(UnitSpan oWidth) {
this.moWidth = oWidth;
}
void setFillWidth(float oWidth) {
this.moFillWidth = Units.toUnitSpan(oWidth);
}
UnitSpan getFillWidth() {
return this.moFillWidth == null ? this.moWidth : this.moFillWidth;
}
void setHeight(UnitSpan oHeight) {
this.moHeight = oHeight;
}
boolean isTrailing() {
return this.mbTrailing;
}
void setTrailing(boolean bTrailing) {
this.mbTrailing = bTrailing;
}
public void fill(TextContext poContext, TextAttr poMasterAttr, GFXEnv poGfxEnv) {
assert (poMasterAttr != null);
assert (poMasterAttr.leaderPatternEnable());
assert (poMasterAttr.leaderPattern() == 2 || poMasterAttr.leaderPattern() == 3);
assert (poMasterAttr.leaderContentEnable());
this.mpoFillRegion = null;
this.mpoFillRegion = new TextRegion();
this.mpoFillRegion.fontService(poMasterAttr.fontService());
this.mpoFillRegion.setContext(poContext);
this.mpoFillRegion.allowNewLines(false);
if (poMasterAttr.leaderPattern() == 2) {
this.mpoFillRegion.append(".");
} else {
this.mpoFillRegion.append(poMasterAttr.leaderContent());
}
this.mpoFillRegion.setMinWidth(UnitSpan.ZERO);
this.mpoFillRegion.setMinHeight(UnitSpan.ZERO);
UnitSpan oMax = new UnitSpan(3, -1);
this.mpoFillRegion.setMaxWidth(oMax);
this.mpoFillRegion.setMaxHeight(oMax);
this.mpoFillRegion.forceDisplay(poMasterAttr, poGfxEnv);
}
public TextRegion getFillRegion() {
return this.mpoFillRegion;
}
@Override
public boolean isEqual(TextEmbed poCompare) {
return true;
}
@Override
public UnitSpan width() {
return this.moWidth;
}
@Override
public UnitSpan height() {
return this.moHeight;
}
@Override
public TextEmbed cloneEmbed() {
return new DispTab();
}
@Override
public void gfxDraw(GFXEnv oEnv) {
}
@Override
public int embedAt() {
return 2;
}
public String toString() {
return "tab (" + this.moWidth.toString() + ")";
}
}