88package toe ;
99
1010import java .awt .Desktop ;
11- import java .io .FileInputStream ;
1211import java .io .IOException ;
1312import java .io .InputStream ;
1413import java .io .InputStreamReader ;
2524 */
2625public class AboutPanel extends javax .swing .JPanel implements HyperlinkListener {
2726
27+ String linkToVersion = "https://github.com/ChristophBodenstein/TimeNETOptimizationEnvironment/commit/" ;
28+
2829 /**
2930 * Creates new form AboutPanel
3031 */
@@ -41,6 +42,7 @@ public AboutPanel() {
4142 versionInformation .load (ddlStream );
4243 ddlStream .close ();
4344 this .jLabelVersion .setText ("Version: " + versionInformation .getProperty ("version" , "" ));
45+ this .linkToVersion +=versionInformation .getProperty ("shorthash" , "" );
4446 } catch (Exception e ) {
4547 support .log ("Could not load Version.properties." , typeOfLogLevel .ERROR );
4648 }
@@ -111,6 +113,12 @@ private void initComponents() {
111113
112114 jLabelVersion .setHorizontalAlignment (javax .swing .SwingConstants .CENTER );
113115 jLabelVersion .setText ("Version: x.x.xxx" );
116+ jLabelVersion .setCursor (new java .awt .Cursor (java .awt .Cursor .HAND_CURSOR ));
117+ jLabelVersion .addMouseListener (new java .awt .event .MouseAdapter () {
118+ public void mouseClicked (java .awt .event .MouseEvent evt ) {
119+ jLabelVersionMouseClicked (evt );
120+ }
121+ });
114122
115123 jLabel3 .setHorizontalAlignment (javax .swing .SwingConstants .CENTER );
116124 jLabel3 .setText ("A Tool for exploring SCPN Designspaces and doing Optimization runs within." );
@@ -152,6 +160,14 @@ private void initComponents() {
152160 );
153161 }// </editor-fold>//GEN-END:initComponents
154162
163+ private void jLabelVersionMouseClicked (java .awt .event .MouseEvent evt ) {//GEN-FIRST:event_jLabelVersionMouseClicked
164+ try {
165+ Desktop .getDesktop ().browse (new URL (this .linkToVersion ).toURI ());
166+ } catch (Exception ex ) {
167+ support .log ("Could not open link to current version on Github." , typeOfLogLevel .ERROR );
168+ }
169+ }//GEN-LAST:event_jLabelVersionMouseClicked
170+
155171 // Variables declaration - do not modify//GEN-BEGIN:variables
156172 private javax .swing .JEditorPane jEditorPaneRequirments ;
157173 private javax .swing .JLabel jLabel1 ;
0 commit comments