From 6160be229d74d6ac4c048a07c10cac7dc25b6121 Mon Sep 17 00:00:00 2001 From: "T. van der Zwan" Date: Fri, 8 Nov 2013 20:20:12 +0100 Subject: [PATCH] Added simple version information to JAR. Commited the new release of HyperCon. Former-commit-id: 7b690b726926c4237bafde8c84ee9c73f95856c4 --- deploy/HyperCon.jar.REMOVED.git-id | 2 +- src/config-tool/ConfigTool/build.xml | 10 ++++++++++ .../ConfigTool/src/org/hyperion/hypercon/Main.java | 4 +++- .../src/org/hyperion/hypercon/gui/ConfigPanel.java | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/deploy/HyperCon.jar.REMOVED.git-id b/deploy/HyperCon.jar.REMOVED.git-id index 92a51b5b..4145ff49 100644 --- a/deploy/HyperCon.jar.REMOVED.git-id +++ b/deploy/HyperCon.jar.REMOVED.git-id @@ -1 +1 @@ -31c7e1854b15c73ce492d394e16ee27bb5b69c30 \ No newline at end of file +03fb2204d7c3a13dd4a2c5c55336c259bf314026 \ No newline at end of file diff --git a/src/config-tool/ConfigTool/build.xml b/src/config-tool/ConfigTool/build.xml index 084c4766..0dd72a19 100644 --- a/src/config-tool/ConfigTool/build.xml +++ b/src/config-tool/ConfigTool/build.xml @@ -1,5 +1,8 @@ + + + @@ -8,6 +11,13 @@ + + + + + + + diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java index 1c2c8eb1..e0fdc7e8 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java @@ -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()); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java index 615bc5ea..a9dbcd1f 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java @@ -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) {