提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 标题文本对齐方式 |
|
6 |
* @date 2022/05/23 08:51:37 |
|
7 |
*/ |
|
8 |
public enum EM_TITLE_TEXT_ALIGNTYPE { |
|
9 |
/** |
|
10 |
* 无效的对齐方式 |
|
11 |
*/ |
|
12 |
EM_TEXT_ALIGNTYPE_INVALID(0, "无效的对齐方式"), |
|
13 |
/** |
|
14 |
* 左对齐 |
|
15 |
*/ |
|
16 |
EM_TEXT_ALIGNTYPE_LEFT(1, "左对齐"), |
|
17 |
/** |
|
18 |
* X坐标中对齐 |
|
19 |
*/ |
|
20 |
EM_TEXT_ALIGNTYPE_XCENTER(2, "X坐标中对齐"), |
|
21 |
/** |
|
22 |
* Y坐标中对齐 |
|
23 |
*/ |
|
24 |
EM_TEXT_ALIGNTYPE_YCENTER(3, "Y坐标中对齐"), |
|
25 |
/** |
|
26 |
* 居中 |
|
27 |
*/ |
|
28 |
EM_TEXT_ALIGNTYPE_CENTER(4, "居中"), |
|
29 |
/** |
|
30 |
* 右对齐 |
|
31 |
*/ |
|
32 |
EM_TEXT_ALIGNTYPE_RIGHT(5, "右对齐"), |
|
33 |
/** |
|
34 |
* 按照顶部对齐 |
|
35 |
*/ |
|
36 |
EM_TEXT_ALIGNTYPE_TOP(6, "按照顶部对齐"), |
|
37 |
/** |
|
38 |
* 按照底部对齐 |
|
39 |
*/ |
|
40 |
EM_TEXT_ALIGNTYPE_BOTTOM(7, "按照底部对齐"), |
|
41 |
/** |
|
42 |
* 按照左上角对齐 |
|
43 |
*/ |
|
44 |
EM_TEXT_ALIGNTYPE_LEFTTOP(8, "按照左上角对齐"), |
|
45 |
/** |
|
46 |
* 换行对齐 |
|
47 |
*/ |
|
48 |
EM_TEXT_ALIGNTYPE_CHANGELINE(9, "换行对齐"); |
|
49 |
|
|
50 |
private int value; |
|
51 |
|
|
52 |
private String note; |
|
53 |
|
|
54 |
public String getNote() { |
|
55 |
return note; |
|
56 |
} |
|
57 |
|
|
58 |
public int getValue() { |
|
59 |
return value; |
|
60 |
} |
|
61 |
|
|
62 |
EM_TITLE_TEXT_ALIGNTYPE(int givenValue, String note) { |
|
63 |
this.value = givenValue; |
|
64 |
this.note = note; |
|
65 |
} |
|
66 |
|
|
67 |
public static String getNoteByValue(int givenValue) { |
|
68 |
for (EM_TITLE_TEXT_ALIGNTYPE enumType : EM_TITLE_TEXT_ALIGNTYPE.values()) { |
|
69 |
if (givenValue == enumType.getValue()) { |
|
70 |
return enumType.getNote(); |
|
71 |
} |
|
72 |
} |
|
73 |
return null; |
|
74 |
} |
|
75 |
|
|
76 |
public static int getValueByNote(String givenNote) { |
|
77 |
for (EM_TITLE_TEXT_ALIGNTYPE enumType : EM_TITLE_TEXT_ALIGNTYPE.values()) { |
|
78 |
if (givenNote.equals(enumType.getNote())) { |
|
79 |
return enumType.getValue(); |
|
80 |
} |
|
81 |
} |
|
82 |
return -1; |
|
83 |
} |
|
84 |
|
|
85 |
} |