|
44 | 44 | * @since 1.0.8 |
45 | 45 | */ |
46 | 46 | public class Controller { |
| 47 | + private static final String[] MSG_ARR; |
| 48 | + |
| 49 | + static { |
| 50 | + MSG_ARR = new String[Processor.MSG_ARR.length]; |
| 51 | + System.arraycopy(Processor.MSG_ARR, 0, MSG_ARR, 0, MSG_ARR.length); |
| 52 | + MSG_ARR[AMEvent.ERR_INVALID_AT.ordinal()] = "错误: 未经验证的赋分表!请使用打开文件按钮右边的导出按钮生成赋分表"; |
| 53 | + } |
| 54 | + |
47 | 55 | private final Properties properties = new Properties(); |
48 | 56 | private final FileChooser chooser; |
49 | 57 | private boolean confirmation; |
@@ -241,19 +249,19 @@ public void handle(AMEvent event, String msg) { |
241 | 249 | if (index < AMEvent.DONE.getIndex()) { |
242 | 250 | progressBar.setProgress((double) (index + 1) / max); |
243 | 251 | progressLabel.setText(String.format("%d/%d", index + 1, max)); |
244 | | - statusLabel.setText(Processor.MSG_ARR[index]); |
| 252 | + statusLabel.setText(MSG_ARR[index]); |
245 | 253 |
|
246 | 254 | } else if (index == AMEvent.DONE.getIndex()) { |
247 | 255 | progressBar.setProgress(1); |
248 | 256 | progressLabel.setText(String.format("%d/%d", max, max)); |
249 | | - statusLabel.setText(Processor.MSG_ARR[index]); |
| 257 | + statusLabel.setText(MSG_ARR[index]); |
250 | 258 |
|
251 | | - Alert alert = new Alert(Processor.MSG_ARR[index], ctrler, HintType.DONE, false); |
| 259 | + Alert alert = new Alert(MSG_ARR[index], ctrler, HintType.DONE, false); |
252 | 260 | alert.setEventHandler(null, null); |
253 | 261 | alert.show(); |
254 | 262 |
|
255 | 263 | } else if (index <= AMEvent.getLastEvent().getIndex()) { |
256 | | - String message = Processor.MSG_ARR[event.ordinal()]; // 事件信息 |
| 264 | + String message = MSG_ARR[event.ordinal()]; // 事件信息 |
257 | 265 | boolean unexpected = false; |
258 | 266 | if (msg != null) { |
259 | 267 | message += "\n"; |
|
0 commit comments