Commit e2248eab authored by Piotr Wendykier's avatar Piotr Wendykier

Merge feature/build_number into feature/InstallBuilder2

Conflicts:
	src/pl/edu/icm/visnow/system/framework/StartPagePanel.form
	src/pl/edu/icm/visnow/system/framework/StartPagePanel.java
parents 49eba77b 8eed8227
This diff is collapsed.
......@@ -276,8 +276,8 @@ public class MainMenu
{
JOptionPane.showMessageDialog(
null,
VisNow.TITLE + " v" + VisNow.VERSION + "\n\nCopyright 2014 ICM University of Warsaw",
VisNow.TITLE + " v" + VisNow.VERSION,
VisNow.TITLE + " v" + VisNow.getVersionNumber() + "\n\nCopyright 2014 onward ICM University of Warsaw",
VisNow.TITLE + " v" + VisNow.getVersionNumber(),
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon(getClass()
.getResource("/pl/edu/icm/visnow/gui/icons/big/visnow.png"))
......
......@@ -165,7 +165,7 @@ public class MainWindow extends javax.swing.JFrame
openTestDataMenu.setVisible(false);
VNSwingUtils.setFillerComponent(mainPanel, applicationsPanel);
setTitle(VisNow.TITLE + " v" + VisNow.VERSION);
setTitle(VisNow.TITLE + " v" + VisNow.getVersionNumber() + " build "+ VisNow.getBuildNumber());
userMessagePanelToggle(false);
}
......
......@@ -440,7 +440,7 @@
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="99" green="99" red="99" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="VisNow v1.3"/>
<Property name="text" type="java.lang.String" value="VisNow"/>
<Property name="verticalAlignment" type="int" value="3"/>
</Properties>
<Constraints>
......
......@@ -38,8 +38,10 @@ public class StartPagePanel extends javax.swing.JPanel
private void postInitComponents()
{
if (VisNow.get() != null)
if (VisNow.get() != null) {
showOnStartupCheckBox.setSelected(!VisNow.get().getMainConfig().isStartPageHidden());
jLabel2.setText(VisNow.TITLE + " v" + VisNow.getVersionNumber() + " build "+ VisNow.getBuildNumber());
}
}
/**
......@@ -303,7 +305,7 @@ public class StartPagePanel extends javax.swing.JPanel
jLabel2.setFont(jLabel2.getFont().deriveFont((float)10));
jLabel2.setForeground(new java.awt.Color(153, 153, 153));
jLabel2.setText("VisNow v1.3");
jLabel2.setText("VisNow");
jLabel2.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
......
......@@ -54,6 +54,9 @@ import java.util.*;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.jar.Attributes;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.regex.Pattern;
import javax.help.HelpBroker;
import javax.help.HelpSet;
......@@ -95,7 +98,6 @@ public class VisNow {
private static final Logger LOGGER = Logger.getLogger(VisNow.class);
public final static String MAIN_CLASS_NAME = "pl.edu.icm.visnow.system.main.VisNow";
public final static String TITLE = "VisNow";
public final static String VERSION = "1.3";
public final static String CONFIG_DIR = ".visnow";
public final static String CONFIG_VERSION = "0.75";
public final static String PROJECT_NAME = "VisNow";
......@@ -258,13 +260,52 @@ public class VisNow {
if (jarPath.endsWith("build/classes/")) { //RUNNING FROM NETBEANS
devel = true;
jarPath = jarPath.substring(0, jarPath.length() - 14);
return jarPath + "dist/" + PROJECT_NAME + ".jar";
File dir = new File(jarPath + "dist/");
File[] matches = dir.listFiles(new FilenameFilter()
{
@Override
public boolean accept(File dir, String name)
{
return name.startsWith(PROJECT_NAME) && name.endsWith(".jar");
}
});
if (matches != null && matches.length > 0) {
try {
return matches[0].getCanonicalPath();
} catch (IOException ex) {
return null;
}
} else {
return null;
}
} else { //RUNNING FROM JAR
devel = false;
return jarPath;
}
}
public static String getVersionNumber()
{
try (JarInputStream jarStream = new JarInputStream(new FileInputStream(findJarPath()))) {
Manifest mf = jarStream.getManifest();
Attributes mainAttribs = mf.getMainAttributes();
return mainAttribs.getValue("Implementation-Version");
} catch (IOException ex) {
return null;
}
}
public static String getBuildNumber()
{
try (JarInputStream jarStream = new JarInputStream(new FileInputStream(findJarPath()))) {
Manifest mf = jarStream.getManifest();
Attributes mainAttribs = mf.getMainAttributes();
return mainAttribs.getValue("Built-Date");
} catch (IOException ex) {
return null;
}
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" FRAME ">
private MainWindow mainFrame;
......@@ -371,7 +412,7 @@ public class VisNow {
return;
}
String helpJarPath = jarPath.substring(0, jarPath.lastIndexOf("/")) + "/doc/VisNowHelp.jar";
String helpJarPath = jarPath.substring(0, jarPath.lastIndexOf(File.separator)) + "/doc/VisNowHelp.jar";
File helpJarFile = new File(helpJarPath);
String helpHS = "vnhelp_HS.hs";
......@@ -624,9 +665,9 @@ public class VisNow {
JLabel jl = new JLabel("VisNow");
jl.setFont(new java.awt.Font("Tahoma", 1, 9));
jl.getFontMetrics(jl.getFont()).charsWidth(
jl.getText().toCharArray(),
0,
jl.getText().length());
jl.getText().toCharArray(),
0,
jl.getText().length());
}
private VisNow() {
......@@ -1310,7 +1351,7 @@ public class VisNow {
static final Font lowerLineFont = new Font("Dialog", Font.PLAIN, 10);
private static void renderSplashFrame(float progress, String loadText) {
renderSplashFrame(progress, loadText, TITLE + " v" + VERSION, "Interdisciplinary Centre for Mathematical and Computational Modelling, University of Warsaw");
renderSplashFrame(progress, loadText, TITLE + " v" + VisNow.getVersionNumber(), "Interdisciplinary Centre for Mathematical and Computational Modelling, University of Warsaw");
}
private static void renderSplashFrame(float progress, String loadText, String bottomTextUpperLine, String bottomTextLowerLine) {
......@@ -1415,7 +1456,8 @@ public class VisNow {
return jVersion1;
}
public static String getJava3DVersionString() {
public static String getJava3DVersionString()
{
return (String) javax.media.j3d.VirtualUniverse.getProperties().get("j3d.version");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment