GFXTextAttr.java
4.8 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.gfx;
import com.adobe.xfa.gfx.GFXAttr;
import com.adobe.xfa.gfx.GFXColour;
import com.adobe.xfa.gfx.GFXDecorationInfo;
import com.adobe.xfa.gfx.GFXTextContext;
public class GFXTextAttr
extends GFXAttr {
public static final int UNDER_TYPE = 15;
public static final int UNDER_UNKNOWN = 0;
public static final int UNDER_NONE = 1;
public static final int UNDER_ALL = 2;
public static final int UNDER_WORD = 3;
public static final int UNDER_STYLE = 240;
public static final int UNDER_SINGLE = 16;
public static final int UNDER_DOUBLE = 32;
public static final int LINETHROUGH_TYPE = 15;
public static final int LINETHROUGH_UNKNOWN = 0;
public static final int LINETHROUGH_NONE = 1;
public static final int LINETHROUGH_ALL = 2;
public static final int LINETHROUGH_WORD = 3;
public static final int LINETHROUGH_STYLE = 240;
public static final int LINETHROUGH_SINGLE = 16;
public static final int LINETHROUGH_DOUBLE = 32;
public static final int OVER_TYPE = 15;
public static final int OVER_UNKNOWN = 0;
public static final int OVER_NONE = 1;
public static final int OVER_ALL = 2;
public static final int OVER_WORD = 3;
public static final int OVER_STYLE = 240;
public static final int OVER_SINGLE = 16;
public static final int OVER_DOUBLE = 32;
public static final int STRIKEOUT_UNKNOWN = 0;
public static final int STRIKEOUT_NONE = 1;
public static final int STRIKEOUT_SINGLE = 18;
public static final int STRIKEOUT_DOUBLE = 34;
public static final GFXTextAttr defaultTextAttr = new GFXTextAttr(1, 2, GFXAttr.defaultShadeScale(), GFXColour.black(), GFXColour.white());
private int mnUnderline;
private int mnOverline;
private int mnStrikeout;
private GFXTextContext mpoContext;
public GFXTextAttr() {
this.mnUnderline = 1;
this.mnOverline = 1;
this.mnStrikeout = 1;
}
public GFXTextAttr(GFXTextAttr oSource) {
this.copyFrom(oSource);
}
public GFXTextAttr(int nNewUnderline, int nNewStyle, int lNewShade, GFXColour oNewColour, GFXColour oNewColourBg) {
super(nNewStyle, lNewShade, oNewColour, oNewColourBg);
this.mnUnderline = nNewUnderline;
this.mnOverline = 1;
this.mnStrikeout = 1;
}
public GFXTextAttr(int nNewUnderline, int nNewStyle, int lNewShade, GFXColour oNewColour, GFXColour oNewColourBg, int nNewStrikeout, int nNewOverline) {
this(nNewUnderline, nNewStyle, lNewShade, oNewColour, oNewColourBg);
this.mnUnderline = nNewUnderline;
this.mnStrikeout = nNewStrikeout;
}
public static GFXTextAttr defaultText() {
return defaultTextAttr;
}
public int underline() {
return this.mnUnderline;
}
public void underline(int nNewUnderline) {
this.mnUnderline = nNewUnderline;
}
public int overline() {
return this.mnOverline;
}
public void overline(int nNewOverline) {
this.mnOverline = nNewOverline;
}
public int strikeout() {
return this.mnStrikeout;
}
public void strikeout(int nNewStrikeout) {
this.mnStrikeout = nNewStrikeout;
}
public GFXTextContext textContext() {
return this.mpoContext;
}
public void textContext(GFXTextContext poTextContext) {
this.mpoContext = poTextContext;
}
public boolean equivalent(GFXTextAttr oCompare) {
return super.equivalent(oCompare) && this.mnOverline == oCompare.mnOverline && this.mnUnderline == oCompare.mnUnderline && this.mnStrikeout == oCompare.mnStrikeout && GFXTextContext.match(this.mpoContext, oCompare.mpoContext);
}
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!(object instanceof GFXTextAttr)) {
return false;
}
return this.equivalent((GFXTextAttr)object);
}
@Override
public int hashCode() {
int hash = 41;
hash = hash * 31 ^ super.hashCode();
hash = hash * 31 ^ this.mnOverline;
hash = hash * 31 ^ this.mnUnderline;
hash = hash * 31 ^ this.mnStrikeout;
hash = hash * 31 ^ this.mpoContext.hashCode();
return hash;
}
public boolean notEqual(Object oCompare) {
return !this.equals(oCompare);
}
public void copyFrom(GFXTextAttr oSource) {
if (this != oSource) {
super.copyFrom(oSource);
this.mnOverline = oSource.mnOverline;
this.mnUnderline = oSource.mnUnderline;
this.mnStrikeout = oSource.mnStrikeout;
this.mpoContext = oSource.mpoContext;
}
}
public static GFXDecorationInfo extractDecoration(int nDecoration) {
return GFXDecorationInfo.extractDecoration(nDecoration);
}
}