|
|
@ -32,7 +32,7 @@ public class FineEmbedServerMonitor { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static final int STEP_HEARTBEAT = 40; |
|
|
|
private static final int STEP_HEARTBEAT = 40; |
|
|
|
private static volatile FineEmbedServerMonitor monitor; |
|
|
|
private static volatile FineEmbedServerMonitor monitor; |
|
|
|
private static ProgressDialog progressBar = DesignerContext.getDesignerFrame().getProgressDialog(); |
|
|
|
private static ProgressDialog progressDialog = new ProgressDialog(DesignerContext.getDesignerFrame()); |
|
|
|
//由于默认值的字体不支持韩文,所以要对韩文单独生成字体
|
|
|
|
//由于默认值的字体不支持韩文,所以要对韩文单独生成字体
|
|
|
|
private FRFont font = null; |
|
|
|
private FRFont font = null; |
|
|
|
private static final int FONT_RGB = 333334; |
|
|
|
private static final int FONT_RGB = 333334; |
|
|
@ -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(); |
|
|
|
progressDialog.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -64,7 +64,7 @@ public class FineEmbedServerMonitor { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getProgress() { |
|
|
|
public int getProgress() { |
|
|
|
if (progress == progressBar.getProgressMaximum()) { |
|
|
|
if (progress == progressDialog.getProgressMaximum()) { |
|
|
|
return progress; |
|
|
|
return progress; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
progress += STEP; |
|
|
|
progress += STEP; |
|
|
@ -73,7 +73,7 @@ public class FineEmbedServerMonitor { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setComplete() { |
|
|
|
public void setComplete() { |
|
|
|
this.progress = progressBar.getProgressMaximum(); |
|
|
|
this.progress = progressDialog.getProgressMaximum(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void reset() { |
|
|
|
public void reset() { |
|
|
@ -81,7 +81,7 @@ public class FineEmbedServerMonitor { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isComplete() { |
|
|
|
public boolean isComplete() { |
|
|
|
return this.progress >= progressBar.getProgressMaximum(); |
|
|
|
return this.progress >= progressDialog.getProgressMaximum(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void monitor() { |
|
|
|
public void monitor() { |
|
|
@ -92,11 +92,12 @@ public class FineEmbedServerMonitor { |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
if (isComplete()) { |
|
|
|
if (isComplete()) { |
|
|
|
scheduler.shutdown(); |
|
|
|
scheduler.shutdown(); |
|
|
|
DesignerContext.getDesignerFrame().hideProgressDialog(); |
|
|
|
progressDialog.dispose(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { |
|
|
|
if (!progressDialog.isVisible()) { |
|
|
|
DesignerContext.getDesignerFrame().showProgressDialog(); |
|
|
|
progressDialog = new ProgressDialog(DesignerContext.getDesignerFrame()); |
|
|
|
|
|
|
|
progressDialog.setVisible(true); |
|
|
|
//如果为韩文则改变字体
|
|
|
|
//如果为韩文则改变字体
|
|
|
|
LocaleCenter.buildAction(new LocaleAction() { |
|
|
|
LocaleCenter.buildAction(new LocaleAction() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -105,9 +106,9 @@ public class FineEmbedServerMonitor { |
|
|
|
} |
|
|
|
} |
|
|
|
}, SupportLocaleImpl.SUPPORT_KOREA); |
|
|
|
}, SupportLocaleImpl.SUPPORT_KOREA); |
|
|
|
String text = Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); |
|
|
|
String text = Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); |
|
|
|
DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); |
|
|
|
progressDialog.updateLoadingText(text, font); |
|
|
|
} |
|
|
|
} |
|
|
|
DesignerContext.getDesignerFrame().updateProgress(getProgress()); |
|
|
|
progressDialog.setProgressValue(getProgress()); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 0, STEP_HEARTBEAT, TimeUnit.MILLISECONDS); |
|
|
|
}, 0, STEP_HEARTBEAT, TimeUnit.MILLISECONDS); |
|
|
|
|
|
|
|
|
|
|
|