version available in class file
Stefan Schuermans

Stefan Schuermans commited on 2011-09-10 17:22:44
Showing 4 changed files, with 24 additions and 2 deletions.

... ...
@@ -3,6 +3,10 @@ Copyright (C) 2004-2011: Stefan Schuermans <stefan@schuermans.info>
3 3
 Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
4 4
 a blinkenarea.org project
5 5
 
6
+1.3.9 2011-09-10
7
+----------------
8
+version information available in class file
9
+
6 10
 1.3.8 2009-11-21
7 11
 ----------------
8 12
 fixed a resizing bug in BlinkenLib
... ...
@@ -5,6 +5,10 @@
5 5
 
6 6
 BLINKEN_LIB=../BlinkenLibJava/BlinkenLib.jar
7 7
 
8
+VERSION_MAJOR=1
9
+VERSION_MINOR=3
10
+VERSION_REVISION=9
11
+
8 12
 JAVAC=javac
9 13
 JAR=jar
10 14
 KEYTOOL=keytool
... ...
@@ -18,7 +22,7 @@ CLASSPATH=.:$(BLINKEN_LIB)
18 22
 CLASS_FILES=$(P)/BlinkenFileFilter.class $(P)/BlinkenFrameDisplay.class \
19 23
             $(P)/BlinkenFrameDisplayListener.class $(P)/BlinkenFrameDisplayInterceptor.class \
20 24
             $(P)/BlinkenFrameEditor.class $(P)/BlinkenFrameEditorListener.class \
21
-            $(P)/Blimp.class
25
+            $(P)/Blimp.class $(P)/Version.class
22 26
 
23 27
 IMAGE_FILES=$(IMG)/ColorPicker.png $(IMG)/Dot.png $(IMG)/Line.png \
24 28
             $(IMG)/Rectangle.png $(IMG)/FilledRectangle.png \
... ...
@@ -36,13 +40,21 @@ IMAGE_FILES=$(IMG)/ColorPicker.png $(IMG)/Dot.png $(IMG)/Line.png \
36 40
 all: jar
37 41
 
38 42
 clean:
39
-	rm -f $(CLASS_FILES) BlinkenLib.jar Blimp.jar
43
+	rm -f $(P)/Version.java $(CLASS_FILES) BlinkenLib.jar Blimp.jar
40 44
 
41 45
 jar: Blimp.jar
42 46
 
43 47
 run: Blimp.jar
44 48
 	$(JAVA) -jar Blimp.jar
45 49
 
50
+$(P)/Version.java: Makefile
51
+	echo "package org.blinkenarea.Blimp;" >$@
52
+	echo "public class Version {" >>$@
53
+	echo "  public static int Major = $(VERSION_MAJOR);" >>$@
54
+	echo "  public static int Minor = $(VERSION_MINOR);" >>$@
55
+	echo "  public static int Revision = $(VERSION_REVISION);" >>$@
56
+	echo "}" >>$@
57
+
46 58
 %.class: %.java
47 59
 	$(JAVAC) -classpath $(CLASSPATH) $<
48 60
 
... ...
@@ -1 +1,2 @@
1 1
 *.class
2
+Version.java
... ...
@@ -213,6 +213,7 @@ public class Blimp extends JApplet
213 213
     labelStatus.setText( "new movie..." );
214 214
     curFile = null;
215 215
     curMovie = new BlinkenMovie( defHeight, defWidth, defChannels, defMaxval );
216
+    curMovie.insertInfo( 0, "creator", String.format( "Blimp (version %d.%d.%d)", Version.Major, Version.Minor, Version.Revision ) );
216 217
     curMovie.insertFrame( 0, new BlinkenFrame( defHeight, defWidth, defChannels, defMaxval, defDuration ) );
217 218
     curMovieChanged = false;
218 219
 
... ...
@@ -1084,6 +1085,7 @@ public class Blimp extends JApplet
1084 1085
   {
1085 1086
     JOptionPane.showMessageDialog( dialogParent,
1086 1087
                                    "BlinkenLightsInteractiveMovieProgram\n" +
1088
+                                   String.format( "version %d.%d.%d\n", Version.Major, Version.Minor, Version.Revision ) +
1087 1089
                                    "Copyright (C) 2004-2011: Stefan Schuermans <stefan@schuermans.info>\n" +
1088 1090
                                    "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n" +
1089 1091
                                    "a blinkenarea.org project",
... ...
@@ -2079,6 +2081,7 @@ public class Blimp extends JApplet
2079 2081
     //initialize current movie, frame
2080 2082
     curDir = new File( "." );
2081 2083
     curMovie = new BlinkenMovie( defHeight, defWidth, defChannels, defMaxval );
2084
+    curMovie.insertInfo( 0, "creator", String.format( "Blimp (version %d.%d.%d)", Version.Major, Version.Minor, Version.Revision ) );
2082 2085
     curMovie.insertFrame( 0, new BlinkenFrame( defHeight, defWidth, defChannels, defMaxval, defDuration ) );
2083 2086
     curFrame = null;
2084 2087
 
... ...
@@ -2733,6 +2736,7 @@ public class Blimp extends JApplet
2733 2736
 
2734 2737
     //running as command line tool
2735 2738
     System.out.println( "BlinkenLightsInteractiveMovieProgram\n" +
2739
+                        String.format( "Blimp (version %d.%d.%d)", Version.Major, Version.Minor, Version.Revision ) +
2736 2740
                         "Copyright (C) 2004-2011: Stefan Schuermans <stefan@schuermans.info>\n" +
2737 2741
                         "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n" +
2738 2742
                         "a blinkenarea.org project\n" );
... ...
@@ -2743,6 +2747,7 @@ public class Blimp extends JApplet
2743 2747
 
2744 2748
     //get initial movie
2745 2749
     movie = new BlinkenMovie( defHeight, defWidth, defChannels, defMaxval );
2750
+    movie.insertInfo( 0, "creator", String.format( "Blimp (version %d.%d.%d)", Version.Major, Version.Minor, Version.Revision ) );
2746 2751
     movie.insertFrame( 0, new BlinkenFrame( defHeight, defWidth, defChannels, defMaxval, defDuration ) );
2747 2752
 
2748 2753
     //process parameters
2749 2754