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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
package com.yanzuoguang.util.printer.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.BaseVo;
/**
* 打印项
*
* @author 颜佐光
*/
public class PrinterPagerItemData extends BaseVo {
/**
* 名称,用于识别
*/
@JSONField(name = "Name")
public String name;
/**
* 是否图片,打印项类型:PrinterPagerItemType
*/
@JSONField(name = "Type")
public int type;
/**
* 是否显示
*/
@JSONField(name = "IsVisible")
public boolean isVisible;
/**
* 左边距离
*/
@JSONField(name = "Left")
public double left;
/**
* 上面距离
*/
@JSONField(name = "Top")
public double top;
/**
* 宽度
*/
@JSONField(name = "Width")
public Object width;
/**
* 高度
*/
@JSONField(name = "Height")
public Object height;
/**
* 字体名称
*/
@JSONField(name = "Font")
public String font;
/**
* 对齐方式,参见类:ContentAlignment
*/
@JSONField(name = "TextAlign")
public int textAlign;
/**
* 格式化
*/
@JSONField(name = "Format")
public String format;
/**
* 构造函数
*/
public PrinterPagerItemData() {
this.name = StringHelper.EMPTY;
this.type = PrinterPagerItemType.None;
this.isVisible = true;
this.left = 0;
this.top = 0;
this.width = 100;
this.height = 20;
this.font = "微软雅黑,9pt,style=Bold";
this.format = StringHelper.EMPTY;
this.textAlign = ContentAlignment.TopLeft;
}
/**
* 复制到新属性
*
* @param to
*/
public void copyTo(PrinterPagerItemData to) {
to.name = this.name;
to.type = this.type;
to.isVisible = this.isVisible;
to.left = this.left;
to.top = this.top;
to.width = this.width;
to.height = this.height;
to.format = this.format;
to.font = this.font;
to.textAlign = this.textAlign;
}
/**
* 处理字体
*
* @return
*/
private String initFont() {
if (this.font != null && this.font.endsWith(",")) {
this.font = this.font.substring(0, this.font.length() - 1);
}
return font;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public boolean isVisible() {
return isVisible;
}
public void setVisible(boolean visible) {
isVisible = visible;
}
public double getLeft() {
return left;
}
public void setLeft(double left) {
this.left = left;
}
public double getTop() {
return top;
}
public void setTop(double top) {
this.top = top;
}
public Object getWidth() {
return width;
}
public void setWidth(Object width) {
this.width = width;
}
public Object getHeight() {
return height;
}
public void setHeight(Object height) {
this.height = height;
}
public String getFont() {
this.initFont();
return font;
}
public void setFont(String font) {
this.font = font;
}
public int getTextAlign() {
return textAlign;
}
public void setTextAlign(int textAlign) {
this.textAlign = textAlign;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
}