Commit 54390ce6 authored by Piotr Wendykier's avatar Piotr Wendykier

Added a build number to VisNow project.

parent 31211734
#Build Number for ANT. Do not edit!
#Tue May 09 13:19:51 CEST 2017
build.number=1300022
......@@ -845,6 +845,7 @@ is divided into following sections:
<fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
<customize/>
</manifest>
</copylibs>
......@@ -942,7 +943,9 @@ is divided into following sections:
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile">
<buildnumber/>
</target>
<target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
......
......@@ -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.VERSION + " build "+ VisNow.get().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-Pro"/>
<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.VERSION + " build "+ VisNow.get().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-Pro");
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;
......@@ -301,13 +304,41 @@ 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 String getBuildNumber()
{
try (JarInputStream jarStream = new JarInputStream(new FileInputStream(jarPath))) {
Manifest mf = jarStream.getManifest();
Attributes mainAttribs = mf.getMainAttributes();
return mainAttribs.getValue("Implementation-Version");
} catch (IOException ex) {
return null;
}
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" FRAME ">
private MainWindow mainFrame;
......@@ -413,9 +444,7 @@ public class VisNow
// javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
// javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
// javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.synth.SynthLookAndFeel");
// javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
if (getOsType() == OsType.OS_MAC)
javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
......@@ -654,9 +683,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()
......@@ -671,7 +700,7 @@ public class VisNow
protected String args[];
protected boolean frameVisible;
private void init(final String args[], final boolean frameVisible, final boolean disableStartupViewers) throws VNSystemException
{
this.args = args;
......@@ -713,24 +742,24 @@ public class VisNow
File f = new File(arg);
mainFrame.getMainMenu().betaOpenFile(f);
applicationLoaded = true;
}
}
}
}
if (!applicationLoaded) {
Application app = new Application(
"Untitled(" + mainFrame.getMainMenu().nextUntitled() + ")",
disableStartupViewers);
"Untitled(" + mainFrame.getMainMenu().nextUntitled() + ")",
disableStartupViewers);
mainFrame.getApplicationsPanel().addApplication(app);
if (args.length != 0) {
for (String arg : args) {
// Initializing with the default reader when called with a .vnf filename as a parameter
if (arg.endsWith(".vnf") || arg.endsWith(".VNF")) {
app.addModuleByName("VisNow field reader",
"pl.edu.icm.visnow.lib.basic.readers.ReadVisNowField.ReadVisNowField",
// Initializing with the default reader when called with a .vnf filename as a parameter
if (arg.endsWith(".vnf") || arg.endsWith(".VNF")) {
app.addModuleByName("VisNow field reader",
"pl.edu.icm.visnow.lib.basic.readers.ReadVisNowField.ReadVisNowField",
new Point(100, 20));
ReadVisNowField reader = (ReadVisNowField)app.getEngine().getModule("VisNow field reader").getCore();
ReadVisNowField reader = (ReadVisNowField) app.getEngine().getModule("VisNow field reader").getCore();
reader.getParameters().setValue("File name", arg);
}
}
}
}
}
......@@ -928,9 +957,9 @@ public class VisNow
*/
public void userMessageSend(UserMessage message)
{
if(userMessageDispatcher == null)
if (userMessageDispatcher == null)
return;
userMessageDispatcher.dispatch(message);
}
......@@ -1492,28 +1521,32 @@ public class VisNow
return Runtime.getRuntime().availableProcessors();
return VisNow.get().getMainConfig().getNAvailableThreads();
}
public static String javaVersionString() {
public static String javaVersionString()
{
return System.getProperty("java.version");
}
public static int getJavaVersion() {
public static int getJavaVersion()
{
String jv = System.getProperty("java.version");
jv = jv.substring(0, 5);
int jVersion0 = 0;
int jVersion1 = 0;
int jVersion2 = 0;
int jVersion2 = 0;
jVersion0 = Integer.parseInt(jv.substring(0, 1));
jVersion1 = Integer.parseInt(jv.substring(2, 3));
jVersion2 = Integer.parseInt(jv.substring(4, 5));
return jVersion1;
}
public static String getJava3DVersionString() {
public static String getJava3DVersionString()
{
return (String) javax.media.j3d.VirtualUniverse.getProperties().get("j3d.version");
}
public static int getJava3DVersion() {
public static int getJava3DVersion()
{
Map<String, Object> vuMap = javax.media.j3d.VirtualUniverse.getProperties();
String j3dVersion = (String) vuMap.get("j3d.version");
j3dVersion = j3dVersion.substring(0, 5);
......@@ -1525,7 +1558,6 @@ public class VisNow
j3dVersion2 = Integer.parseInt(j3dVersion.substring(4, 5));
return j3dVersion1;
}
public int getPerformance()
{
......
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