public final boolean hideProgressText;
/** Whether the splash screen should retain focus. */
+ public final boolean progressSync;
+
+ /** Whether the splash screen should retain focus. */
public final boolean keepOnTop;
/** Whether to display the appbase. */
", pb=" + progressBar + ", srect=" + status + ", st=" + statusText +
", shadow=" + textShadow + ", err=" + installError + ", nrect=" + patchNotes +
", notes=" + patchNotesUrl + ", stepPercentages=" + stepPercentages +
- ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", minShow=" + minShowSeconds +
+ ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", progressSync=" + progressSync + ", minShow=" + minShowSeconds +
", displayAppbase=" + displayAppbase + ", displayVersion=" + displayVersion + "]";
}
this.progress = config.getRect("ui.progress", new Rectangle(5, 5, 300, 15));
this.progressText = config.getColor("ui.progress_text", Color.BLACK);
this.hideProgressText = config.getBoolean("ui.hide_progress_text");
+ this.progressSync = config.getBoolean("ui.progress_sync");
this.keepOnTop = config.getBoolean("ui.keep_on_top");
this.displayAppbase = config.getBoolean("ui.display_appbase");
this.displayVersion = config.getBoolean("ui.display_version");
Config config = _app.init(true);
if (preloads) doPredownloads(_app.getResources());
_ifc = new Application.UpdateInterface(config);
- _status.setAppbase(_app.getAppbase());
+ if (_status != null) {
+ _status.setAppbase(_app.getAppbase());
+ }
}
/**
// show the patch notes button, if applicable
if (!StringUtil.isBlank(_ifc.patchNotesUrl)) {
createInterfaceAsync(false);
- EventQueue.invokeLater(new Runnable() {
+ EQinvoke(new Runnable() {
public void run () {
_patchNotes.setVisible(true);
}
if (_silent || (_container != null && !reinit)) {
return;
}
-/*
- EventQueue.invokeLater(new Runnable() {
- public void run () {
-*/
- try {
- EventQueue.invokeAndWait(new Runnable() {
+
+ EQinvoke (new Runnable() {
public void run () {
if (_container == null || reinit) {
showContainer();
}
});
- } catch (Exception e) {
- e.printStackTrace();
- }
+
}
/**
createInterfaceAsync(false);
}
-/*
- EventQueue.invokeLater(new Runnable() {
- public void run () {
-*/
- try {
- EventQueue.invokeAndWait(new Runnable() {
+ EQinvoke(new Runnable() {
public void run () {
if (_status == null) {
}
}
});
- } catch (Exception e) {
- e.printStackTrace();
- }
}
protected void reportTrackingEvent (String event, int progress)
setStatusAsync(null, stepToGlobalPercent(percent), -1L, false);
}
};
+
+ // Asynchronous or synchronous progress updates
+ protected void EQinvoke(Runnable r) {
+ try {
+ readConfig(false);
+ if (_ifc.progressSync) {
+ EventQueue.invokeAndWait(r);
+ } else {
+ EventQueue.invokeLater(r);
+ }
+ } catch (Exception e) {
+ EventQueue.invokeLater(r);
+ }
+ }
protected Application _app;
protected Application.UpdateInterface _ifc = new Application.UpdateInterface(Config.EMPTY);
import java.awt.Color;
import java.awt.Container;
-import java.awt.EventQueue;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
// move window to top, always on top
if (_ifc.keepOnTop) {
log.info("Keep on top set to ", "keep_on_top", _ifc.keepOnTop);
- java.awt.EventQueue.invokeLater(new Runnable() {
+ EQinvoke(new Runnable() {
@Override
public void run() {
_frame.toFront();
super.fail(message);
// super.fail causes the UI to be created (if needed) on the next UI tick, so we
// want to wait until that happens before we attempt to redecorate the window
- EventQueue.invokeLater(new Runnable() {
+ EQinvoke(new Runnable() {
@Override
public void run() {
// if the frame was set to be undecorated, make window decoration available
getdown_txt_strict_comments = true
getdown_txt_title = Jalview
getdown_txt_ui.name = Jalview
+getdown_txt_ui.progress_sync = true
getdown_txt_ui.keep_on_top = true
getdown_txt_ui.display_appbase = true
getdown_txt_ui.display_version = true