def getdownResourceDir = project.ext.getdownResourceDir
def getdownAppDir = project.ext.getdownAppDir
def getdownResourceFilenames = []
+
+ copy {
+ from "$classes/$buildPropertiesFile"
+ rename(buildPropertiesFile, getdown_install_build_properties)
+ into project.ext.getdownWebsiteDir
+ }
+ getdownResourceFilenames += getdown_current_build_properties
+
doFirst {
// go through properties looking for getdown_txt_...
def props = project.properties.sort { it.key }
props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
+ props.put("getdown_txt_resource", "$classes/$buildPropertiesFile")
if (getdown_local == "true") {
getdown_app_base = file(getdownWebsiteDir).toURI().toString()
}
} else {
// file values rationalised
- if (val.indexOf('/') > -1) {
+ if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
def r = null
if (val.indexOf('/') == 0) {
// absolute path
getdownResourceFilenames += r.getPath()
}
}
- def line = prop.substring(12) + " = " + val + "\n"
- getdownTextString += line
+ if (! prop.startsWith("getdown_txt_resource")) {
+ def line = prop.substring(12) + " = " + val + "\n"
+ getdownTextString += line
+ }
}
}
}
def getdown_txt = file(project.ext.getdownWebsiteDir + "/getdown.txt")
getdown_txt.write(getdownTextString)
+
+ def launch_jvl = file(project.ext.getdownWebsiteDir + "/" + getdown_launch_jvl)
+ launch_jvl.write("appbase="+props.get("getdown_txt_appbase"))
copy {
from getdown_txt
+ from launch_jvl
+ from project.ext.getdownWebsiteDir+"/"+getdown_current_build_properties
+ from project.ext.getdownWebsiteDir+"/"+getdown_install_build_properties
into project.ext.getdownFilesDir
}
/** The paths (relative to the appdir) of images for the window icon. */
public final List<String> iconImages;
+ /** The path (relative to the appdir) to a single background image to appear first. */
+ public final String instantBackgroundImage;
+
/** The path (relative to the appdir) to a single background image. */
public final String backgroundImage;
/** Whether progress text should be hidden or not. */
public final boolean hideProgressText;
+ /** Whether the splash screen should retain focus. */
+ public final boolean keepOnTop;
+
+ /** Whether to display the appbase. */
+ public final boolean displayAppbase;
+
/** The minimum number of seconds to display the GUI. This is to prevent the GUI from
* flashing up on the screen and immediately disappearing, which can be confusing to the
* user. */
@Override
public String toString ()
{
- return "[name=" + name + ", bg=" + background + ", bg=" + backgroundImage +
+ return "[name=" + name + ", bg=" + background + ", bg=" + backgroundImage + ", instant_bg=" + instantBackgroundImage +
", pi=" + progressImage + ", prect=" + progress + ", pt=" + progressText +
", pb=" + progressBar + ", srect=" + status + ", st=" + statusText +
", shadow=" + textShadow + ", err=" + installError + ", nrect=" + patchNotes +
", notes=" + patchNotesUrl + ", stepPercentages=" + stepPercentages +
- ", hideProgressText" + hideProgressText + ", minShow=" + minShowSeconds + "]";
+ ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", minShow=" + minShowSeconds + "]";
}
public UpdateInterface (Config config)
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.keepOnTop = config.getBoolean("ui.keep_on_top");
+ this.displayAppbase = config.getBoolean("ui.display_appbase");
this.minShowSeconds = config.getInt("ui.min_show_seconds", 5);
this.progressBar = config.getColor("ui.progress_bar", 0x6699CC);
this.status = config.getRect("ui.status", new Rectangle(5, 25, 500, 100));
this.textShadow = config.getColor("ui.text_shadow", Color.CLEAR);
this.hideDecorations = config.getBoolean("ui.hide_decorations");
this.backgroundImage = config.getString("ui.background_image");
+ this.instantBackgroundImage = config.getString("ui.instant_background_image");
// default to black or white bg color, depending on the brightness of the progressText
int defaultBackground = (0.5f < Color.brightness(this.progressText)) ?
Color.BLACK : Color.WHITE;
return locatorConfig;
}
+ public String getAppbase() {
+ return _appbase;
+ }
+
protected final EnvConfig _envc;
protected File _config;
protected Digest _digest;
Config config = _app.init(true);
if (preloads) doPredownloads(_app.getResources());
_ifc = new Application.UpdateInterface(config);
+ _status.setAppbase(_app.getAppbase());
}
/**
} else {
proc = _app.createProcess(false);
}
-
+
// close standard in to avoid choking standard out of the launched process
proc.getInputStream().close();
// close standard out, since we're not going to write to anything to it anyway
}
}
+ _container.setVisible(true);
+ _container.validate();
+
// if we have a UI open and we haven't been around for at least 5 seconds (the default
// for min_show_seconds), don't stick a fork in ourselves straight away but give our
// lovely user a chance to see what we're doing
try {
readConfig(false);
Graphics g = _container.getGraphics();
- String imageFile = _ifc.backgroundImage;
- BufferedImage bgImage = loadImage(_ifc.backgroundImage);
- int bwidth = bgImage.getWidth();
- int bheight = bgImage.getHeight();
-
- instantSplashPane = new JPanel() {
- @Override
- protected void paintComponent(Graphics g)
- {
- super.paintComponent(g);
- // attempt to draw a background image...
- if (bgImage != null) {
- g.drawImage(bgImage, 0, 0, this);
- }
- }
- };
-
- instantSplashPane.setSize(bwidth,bheight);
- instantSplashPane.setPreferredSize(new Dimension(bwidth,bheight));
-
- _layers.add(instantSplashPane, Integer.valueOf(0));
-
- _container.setPreferredSize(new Dimension(bwidth,bheight));
+ BufferedImage iBgImage = loadImage(_ifc.instantBackgroundImage);
+ boolean ibg = true;
+ if (iBgImage == null) {
+ iBgImage = loadImage(_ifc.backgroundImage);
+ ibg = false;
+ }
+ if (iBgImage != null) {
+ final BufferedImage bgImage = iBgImage;
+ int bwidth = bgImage.getWidth();
+ int bheight = bgImage.getHeight();
+
+ log.info("Displaying instant background image", ibg?"instant_background_image":"background_image");
+
+ instantSplashPane = new JPanel() {
+ @Override
+ protected void paintComponent(Graphics g)
+ {
+ super.paintComponent(g);
+ // attempt to draw a background image...
+ if (bgImage != null) {
+ g.drawImage(bgImage, 0, 0, this);
+ }
+ }
+ };
+
+ instantSplashPane.setSize(bwidth,bheight);
+ instantSplashPane.setPreferredSize(new Dimension(bwidth,bheight));
+
+ _layers.add(instantSplashPane, Integer.valueOf(0));
+
+ _container.setPreferredSize(new Dimension(bwidth,bheight));
+ }
} catch (Exception e) {
- log.warning("Failed to set instant background image", "bg", _ifc.backgroundImage);
+ log.warning("Failed to set instant background image", "ibg", _ifc.instantBackgroundImage);
}
-
-
_container.add(_layers, BorderLayout.CENTER);
_patchNotes = new JButton(new AbstractAction(_msgs.getString("m.patch_notes")) {
_status.init(_ifc, _background, getProgressImage());
Dimension size = _status.getPreferredSize();
_status.setSize(size);
+ //_status.updateStatusLabel();
_layers.setPreferredSize(size);
_patchNotes.setBounds(_ifc.patchNotes.x, _ifc.patchNotes.y,
}
if (abort) System.exit(-1);
- log.info("Starting ....");
+ log.info("Starting .....");
try
{
jalview.bin.StartupNotificationListener.setListener();
handleWindowClose();
}
});
+
+ // keep_on_top
+ try {
+ readConfig(false);
+ } catch (Exception e) {
+ log.warning("Error reading config for keep_on_top");
+ }
+ // 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() {
+ @Override
+ public void run() {
+ _frame.toFront();
+ _frame.repaint();
+ }
+ });
+ _frame.setAlwaysOnTop(true);
+ }
+
// handle close on ESC
String cancelId = "Cancel"; // $NON-NLS-1$
_frame.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
status += " .";
}
}
- _newlab = createLabel(status, new Color(_ifc.statusText, true));
+
+ StringBuilder labelText = new StringBuilder();
+ if (_ifc.displayAppbase) {
+ labelText.append(" appbase: "+_appbase);
+ labelText.append("\n");
+ }
+ labelText.append(status);
+
+ _newlab = createLabel(labelText.toString(), new Color(_ifc.statusText, true));
// set the width of the label to the width specified
int width = _ifc.status.width;
if (width == 0) {
return key;
}
}
+
+ public void setAppbase(String appbase) {
+ _appbase = appbase;
+ }
protected Image _barimg;
protected RotatingBackgrounds _bg;
protected Throttle _rthrottle = new Throttle(1, 1000L);
protected static final Font FONT = new Font("SansSerif", Font.BOLD, 12);
+
+ public String _appbase;
}
getdown_launcher = getdown/lib/getdown-launcher.jar
getdown_launcher_new = getdown-launcher-new.jar
getdown_core = getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar
-getdown_base_txt = getdown/files/getdown.txt
+getdown_launch_jvl = channel_launch.jvl
+getdown_current_build_properties = build_properties
+getdown_install_build_properties = build_properties.install
getdown_txt_title = Jalview
getdown_channel_base = http://www.jalview.org/getdown/jalview
getdown_channel_name = TEST
getdown_txt_strict_comments = true
getdown_txt_title = Jalview
getdown_txt_ui.name = Jalview
+getdown_txt_ui.keep_on_top = true
+getdown_txt_ui.display_appbase = true
getdown_txt_ui.background = FFFFFF
getdown_txt_ui.background_image = resources/images/jalview_logo_background_getdown-640x480.png
+getdown_txt_ui.instant_background_image = resources/images/jalview_logo_background_getdown_instant-640x480.png
getdown_txt_ui.error_background = resources/images/jetset_jalview_splash.png
getdown_txt_ui.progress_image = resources/images/jalview_logo_background_getdown-progress.png
getdown_txt_ui.icon = resources/images/JalviewLogo_Huge.png
getdown_txt_ui.progress_text = 000000
getdown_txt_ui.status = 20, 380, 600, 58
getdown_txt_ui.status_text = 000066
-getdown_txt_ui.text_shadow = EEEEFF
-getdown_txt_ui.install_error = http://www.jalview.org/download/error
+#getdown_txt_ui.text_shadow = FFFFFF
+getdown_txt_ui.install_error = http://www.jalview.org/faq/getdownerror
getdown_txt_ui.mac_dock_icon = resources/images/jalview_logos.ico
getdown_alt_java8_min_version = 01080000
getdown_alt_java11_min_version = 11000000