RegionFrame.java
3.52 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.text;
import com.adobe.xfa.text.TraditionalFrame;
import com.adobe.xfa.ut.UnitSpan;
class RegionFrame
extends TraditionalFrame {
private UnitSpan moMinWidth;
private UnitSpan moMinHeight;
private UnitSpan moMaxWidth;
private UnitSpan moMaxHeight;
private UnitSpan moAlignmentWidth;
private UnitSpan moAlignmentHeight;
private boolean mbTestFitSize;
private static final UnitSpan DEFAULT_SIZE = new UnitSpan(3, 72000);
RegionFrame() {
this.mbTestFitSize = true;
}
RegionFrame(RegionFrame oSource) {
this.copyFrom(oSource);
}
void setMinWidth(UnitSpan oMinWidth) {
this.moMinWidth = oMinWidth;
}
void setMinHeight(UnitSpan oMinHeight) {
this.moMinHeight = oMinHeight;
}
void setMaxWidth(UnitSpan oMaxWidth) {
this.moMaxWidth = oMaxWidth;
}
void setMaxHeight(UnitSpan oMaxHeight) {
this.moMaxHeight = oMaxHeight;
}
void setAlignmentWidth(UnitSpan oAlignmentWidth) {
this.moAlignmentWidth = oAlignmentWidth;
}
void setAlignmentHeight(UnitSpan oAlignmentHeight) {
this.moAlignmentHeight = oAlignmentHeight;
}
void setTestFitSize(boolean bTestFitSize) {
this.mbTestFitSize = bTestFitSize;
}
@Override
public UnitSpan minWidth() {
return this.moMinWidth == null ? DEFAULT_SIZE : this.moMinWidth;
}
@Override
public UnitSpan minHeight() {
return this.moMinHeight == null ? DEFAULT_SIZE : this.moMinHeight;
}
@Override
public UnitSpan maxWidth() {
return this.moMaxWidth == null ? DEFAULT_SIZE : this.moMaxWidth;
}
@Override
public UnitSpan maxHeight() {
return this.moMaxHeight == null ? DEFAULT_SIZE : this.moMaxHeight;
}
@Override
UnitSpan alignmentWidth() {
return this.moAlignmentWidth;
}
@Override
boolean enforceAlignmentWidth() {
return this.moAlignmentWidth != null;
}
@Override
UnitSpan alignmentHeight() {
return this.moAlignmentHeight;
}
@Override
boolean enforceAlignmentHeight() {
return this.moAlignmentHeight != null;
}
@Override
boolean testFitSize() {
return this.mbTestFitSize;
}
@Override
boolean enforceDisplayExtent() {
return true;
}
void copyFrom(RegionFrame oSource) {
if (this != oSource) {
this.moMinWidth = oSource.moMinWidth;
this.moMinHeight = oSource.moMinHeight;
this.moMaxWidth = oSource.moMaxWidth;
this.moMaxHeight = oSource.moMaxHeight;
this.moAlignmentWidth = oSource.moAlignmentWidth;
this.moAlignmentHeight = oSource.moAlignmentHeight;
this.mbTestFitSize = oSource.mbTestFitSize;
}
}
boolean equals(RegionFrame oCompare) {
return RegionFrame.compareUnits(this.moMinWidth, oCompare.moMinWidth) && RegionFrame.compareUnits(this.moMinHeight, oCompare.moMinHeight) && RegionFrame.compareUnits(this.moMaxWidth, oCompare.moMaxWidth) && RegionFrame.compareUnits(this.moMaxHeight, oCompare.moMaxHeight) && RegionFrame.compareUnits(this.moAlignmentWidth, oCompare.moAlignmentWidth) && RegionFrame.compareUnits(this.moAlignmentHeight, oCompare.moAlignmentHeight);
}
private static boolean compareUnits(UnitSpan a, UnitSpan b) {
if (a == b) {
return true;
}
if (a == null || b == null) {
return false;
}
return a.equals(b);
}
}