Skip to content

Commit e9eac49

Browse files
committed
fix: correct hint of invalid "at"
1 parent bae28ac commit e9eac49

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/main/java/cn/rocket/assaignmark/gui/Controller.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@
4444
* @since 1.0.8
4545
*/
4646
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+
4755
private final Properties properties = new Properties();
4856
private final FileChooser chooser;
4957
private boolean confirmation;
@@ -241,19 +249,19 @@ public void handle(AMEvent event, String msg) {
241249
if (index < AMEvent.DONE.getIndex()) {
242250
progressBar.setProgress((double) (index + 1) / max);
243251
progressLabel.setText(String.format("%d/%d", index + 1, max));
244-
statusLabel.setText(Processor.MSG_ARR[index]);
252+
statusLabel.setText(MSG_ARR[index]);
245253

246254
} else if (index == AMEvent.DONE.getIndex()) {
247255
progressBar.setProgress(1);
248256
progressLabel.setText(String.format("%d/%d", max, max));
249-
statusLabel.setText(Processor.MSG_ARR[index]);
257+
statusLabel.setText(MSG_ARR[index]);
250258

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);
252260
alert.setEventHandler(null, null);
253261
alert.show();
254262

255263
} else if (index <= AMEvent.getLastEvent().getIndex()) {
256-
String message = Processor.MSG_ARR[event.ordinal()]; // 事件信息
264+
String message = MSG_ARR[event.ordinal()]; // 事件信息
257265
boolean unexpected = false;
258266
if (msg != null) {
259267
message += "\n";

0 commit comments

Comments
 (0)