GFXLineAttr.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
/*
* 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.ut.UnitSpan;
public class GFXLineAttr
extends GFXAttr {
public static final UnitSpan DEFAULT_LINEWIDTH = new UnitSpan(3, 720);
public static final GFXLineAttr BLACK_LINE = new GFXLineAttr(DEFAULT_LINEWIDTH, 2, 100, GFXColour.BLACK, GFXColour.WHITE);
public static final GFXLineAttr WHITE_LINE = new GFXLineAttr(DEFAULT_LINEWIDTH, 2, 100, GFXColour.WHITE, GFXColour.WHITE);
public static final GFXLineAttr LIGHTGRAY_LINE = new GFXLineAttr(DEFAULT_LINEWIDTH, 2, 100, GFXColour.LIGHTGRAY, GFXColour.WHITE);
public static final GFXLineAttr GRAY_LINE = new GFXLineAttr(DEFAULT_LINEWIDTH, 2, 100, GFXColour.GRAY, GFXColour.WHITE);
public static final GFXLineAttr DARKGRAY_LINE = new GFXLineAttr(DEFAULT_LINEWIDTH, 2, 100, GFXColour.DARKGRAY, GFXColour.WHITE);
public static final int HAND_LEFT = 0;
public static final int HAND_RIGHT = 1;
public static final int HAND_EVEN = 2;
public static final int CAP_BUTT = 0;
public static final int CAP_ROUND = 1;
public static final int CAP_SQUARE = 2;
private UnitSpan moWidth;
private int moHand;
private int moCap;
public GFXLineAttr() {
this.moWidth = DEFAULT_LINEWIDTH;
this.moHand = 2;
this.moCap = 2;
}
public GFXLineAttr(GFXLineAttr oSource) {
this.copyFrom(oSource);
}
public GFXLineAttr(UnitSpan oNewWidth, int nNewStyle, int lNewShade, GFXColour oNewColour, GFXColour oNewColourBg) {
super(nNewStyle, lNewShade, oNewColour, oNewColourBg);
this.moWidth = oNewWidth;
this.moHand = 2;
this.moCap = 2;
}
public GFXLineAttr defaultLine() {
return BLACK_LINE;
}
public GFXLineAttr blackLine() {
return BLACK_LINE;
}
public GFXLineAttr whiteLine() {
return WHITE_LINE;
}
public GFXLineAttr lightGrayLine() {
return LIGHTGRAY_LINE;
}
public GFXLineAttr grayLine() {
return GRAY_LINE;
}
public GFXLineAttr darkGrayLine() {
return DARKGRAY_LINE;
}
public UnitSpan width() {
return this.moWidth;
}
public void width(UnitSpan oNewWidth) {
this.moWidth = oNewWidth;
}
public int hand() {
return this.moHand;
}
public void hand(int oNewCode) {
this.moHand = oNewCode;
}
public int cap() {
return this.moCap;
}
public void cap(int oNewCode) {
this.moCap = oNewCode;
}
public boolean equivalent(GFXLineAttr oCompare) {
return super.equivalent(oCompare) && this.moWidth == oCompare.moWidth && this.moHand == oCompare.moHand && this.moCap == oCompare.moCap;
}
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!super.equals(object)) {
return false;
}
return this.equivalent((GFXLineAttr)object);
}
@Override
public int hashCode() {
int hash = 37;
hash = hash * 31 ^ super.hashCode();
hash = hash * 31 ^ this.moWidth.hashCode();
hash = hash * 31 ^ this.moHand;
hash = hash * 31 ^ this.moCap;
return hash;
}
public void copyFrom(GFXLineAttr oSource) {
if (this != oSource) {
super.copyFrom(oSource);
this.moWidth = oSource.moWidth;
this.moHand = oSource.moHand;
this.moCap = oSource.moCap;
}
}
}