Added simple version information to JAR. Commited the new release of HyperCon.

Former-commit-id: 7b690b726926c4237bafde8c84ee9c73f95856c4
This commit is contained in:
T. van der Zwan 2013-11-08 20:20:12 +01:00
parent 85c8ba0100
commit 6160be229d
4 changed files with 18 additions and 2 deletions

View File

@ -1 +1 @@
31c7e1854b15c73ce492d394e16ee27bb5b69c30
03fb2204d7c3a13dd4a2c5c55336c259bf314026

View File

@ -1,5 +1,8 @@
<?xml version="1.0"?>
<project default="main" basedir=".">
<tstamp/>
<property name="version" value="1.0" />
<property name="deploy.dir" value="${basedir}/../../../deploy" />
<target name="main" depends="make_deploy_dir, build" description="Build HyperCon, the Hyperion configuration file builder" />
@ -8,6 +11,13 @@
<jar destfile="HyperCon.jar">
<manifest>
<attribute name="Main-Class" value="org.hyperion.hypercon.Main" />
<attribute name="Specification-Title" value="HyperCon"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="Hyperion Team"/>
<attribute name="Implementation-Title" value="org.hyperion"/>
<attribute name="Implementation-Version" value="${version} - ${TODAY}"/>
<attribute name="Implementation-Vendor" value="Hyperion Team"/>
</manifest>
<fileset dir="classes" />

View File

@ -23,6 +23,7 @@ public class Main {
* @param pArgs HyperCon does not have command line arguments
*/
public static void main(String[] pArgs) {
final String versionStr = Main.class.getPackage().getImplementationVersion();
final LedString ledString = new LedString();
try {
@ -32,7 +33,8 @@ public class Main {
// Create a frame for the configuration panel
JFrame frame = new JFrame();
frame.setTitle("Hyperion configuration Tool");
String title = "Hyperion configuration Tool" + ((versionStr != null && !versionStr.isEmpty())? (" (" + versionStr + ")") : "");
frame.setTitle(title);
frame.setSize(1300, 700);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setIconImage(new ImageIcon(Main.class.getResource("HyperConIcon_64.png")).getImage());

View File

@ -3,6 +3,7 @@ package org.hyperion.hypercon.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.util.Observable;
import java.util.Observer;
@ -34,6 +35,9 @@ public class ConfigPanel extends JPanel {
/** Action for write the Hyperion deamon configuration file */
private final Action mSaveConfigAction = new AbstractAction("Create Hyperion Configuration") {
JFileChooser fileChooser = new JFileChooser();
{
fileChooser.setSelectedFile(new File("hyperion.config.json"));
}
@Override
public void actionPerformed(ActionEvent e) {
if (fileChooser.showSaveDialog(ConfigPanel.this) != JFileChooser.APPROVE_OPTION) {