Browse Source

REPORT-39338 【回归】内置服务器启动进度条会先展示上次的进度再初始化

1. 更新修改方案:确定了一直维护同一个进度条dialog没有特殊意义之后,选择在每一次关闭服务器或者服务器启动完成后dialog废弃掉,然后在每一次需要打开对话框的时候,新建一个
feature/big-screen
Yvan 4 years ago
parent
commit
a5caa2b1c8
  1. 4
      designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java
  2. 18
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  3. 9
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java

4
designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java

@ -103,8 +103,4 @@ public class ProgressDialog extends UIDialog {
} }
this.text.setText(text); this.text.setText(text);
} }
public void repaintProgressBar() {
progressBar.update(progressBar.getGraphics());
}
} }

18
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -1269,20 +1269,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
return progressDialog; return progressDialog;
} }
public void showProgressDialog() { public void openProgressDialog() {
progressDialog = new ProgressDialog(this);
progressDialog.setVisible(true); progressDialog.setVisible(true);
} }
/**
* 隐藏进度框
*/
public void hideProgressDialog() {
progressDialog.setVisible(false);
}
/** /**
* 更新进度框进度 * 更新进度框进度
* *
@ -1310,10 +1302,4 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
return designerOpened; return designerOpened;
} }
/**
* 刷新进度框的UI部分
*/
public void repaintProgressDialog() {
progressDialog.repaintProgressBar();
}
} }

9
designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java

@ -47,7 +47,7 @@ public class FineEmbedServerMonitor {
@Override @Override
public void on(Event event, Null aNull) { public void on(Event event, Null aNull) {
getInstance().reset(); getInstance().reset();
DesignerContext.getDesignerFrame().hideProgressDialog(); DesignerContext.getDesignerFrame().disposeProgressDialog();
} }
}); });
} }
@ -92,14 +92,11 @@ public class FineEmbedServerMonitor {
public void run() { public void run() {
if (isComplete()) { if (isComplete()) {
scheduler.shutdown(); scheduler.shutdown();
// 在进度条满了之后,将进度条置0并清空进度,不然下一次打开进度条会先显示上一次的进度 DesignerContext.getDesignerFrame().disposeProgressDialog();
DesignerContext.getDesignerFrame().updateProgress(0);
DesignerContext.getDesignerFrame().repaintProgressDialog();
DesignerContext.getDesignerFrame().hideProgressDialog();
return; return;
} }
if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) {
DesignerContext.getDesignerFrame().showProgressDialog(); DesignerContext.getDesignerFrame().openProgressDialog();
//如果为韩文则改变字体 //如果为韩文则改变字体
LocaleCenter.buildAction(new LocaleAction() { LocaleCenter.buildAction(new LocaleAction() {
@Override @Override

Loading…
Cancel
Save