aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-04-25 14:20:19 +0200
committerJiri Vanek <[email protected]>2013-04-25 14:20:19 +0200
commit0cc135f35c17bb59428a28d3cfee2bc2f65c5528 (patch)
tree9a3060303c908d66a49e7800a038bcade87e72bd /netx/net/sourceforge/jnlp
parent7b41471de413b4fe7e8cb2d2551b44541aea3fd7 (diff)
Splashscreen now strip commit id from released versions
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r--netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java
index 8bef868..2b14085 100644
--- a/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java
@@ -371,6 +371,17 @@ public class BasePainter implements Observer {
return tt;
}
+ static String stripCommitFromVersion(String version) {
+ if (version.contains("pre+")) {
+ return version;
+ }
+ int i = version.indexOf("+");
+ if (i < 0) {
+ return version;
+ }
+ return version.substring(0, version.indexOf("+"));
+ }
+
private final class MovingTextRunner extends Observable implements Runnable {
private static final int MAX_ANIMATION_VALUE = 10000;
@@ -499,11 +510,12 @@ public class BasePainter implements Observer {
g2d.setColor(plainTextColor);
FontMetrics fm = g2d.getFontMetrics();
if (version != null) {
- int y = master.getSplashWidth() - fm.stringWidth(version + " ");
+ String niceVersion=stripCommitFromVersion(version);
+ int y = master.getSplashWidth() - fm.stringWidth(niceVersion + " ");
if (y < 0) {
y = 0;
}
- g2d.drawString(version, y, fm.getHeight());
+ g2d.drawString(niceVersion, y, fm.getHeight());
}
return fm;
}