svn commit: r15162 - trunk/src/argouml-app/src: org/argouml/application/helpers org/argouml/cognitive org/argouml/ui templates

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-07-04 10:54:45-0700
New Revision: 15162

Modified:
   trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java
   trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java
   trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java
   trunk/src/argouml-app/src/templates/ArgoVersion.template

Log:
Fix for issue 5204, part 2 and 3: Version number updates for V0.26.

Changed the code to have the version number solely centralised in ArgoVersion.template.

And the URLs are in ApplicationVersion.

Modified: trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java?view=diff&rev=15162&p1=trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java&p2=trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java&r1=15161&r2=15162
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java	2008-07-04 10:54:45-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -26,6 +26,7 @@
 
 /**
  * Receives the version of the application at initialisation time.
+ * Also knows about website locations that depend on the version of ArgoUML.
  *
  * @author Michiel
  */
@@ -34,6 +35,7 @@
      * Version number.
      */
     private static String version;
+    private static String stableVersion;
 
     /**
      * Retrieve the version number of the application.
@@ -43,6 +45,45 @@
     public static String getVersion() {
         return version;
     }
+    
+    /**
+     * Retrieve the online HTML manual of ArgoUML for a critic. 
+     * You need to append the critic class-name.
+     * This syntax is synchronized with:
+     * <ol>
+     * <li>Tags in the manual.
+     * <li>Name of the ArgoUML site.
+     * <li>How the manual is deployed on the site.
+     * </ol>
+     * so this must be updated when any of these change.
+     *
+     * @return the URL
+     */
+    public static String getManualForCritic() {
+        return "http://argouml-stats.tigris.org/documentation/"
+            + "manual-" 
+            + stableVersion
+            + "-single/argomanual.html#critics.";
+    }
+
+    /**
+     * Retrieve the URL of the online manual of ArgoUML.
+     * 
+     * @return the URL
+     */
+    public static String getOnlineManual() {
+        return "http://argouml-stats.tigris.org/nonav/documentation/"
+                + "manual-" + stableVersion + "/";
+    }
+
+    /**
+     * Retrieve the URL of the location for online support for ArgoUML.
+     * 
+     * @return the URL
+     */
+    public static String getOnlineSupport() {
+        return "http://argouml.tigris.org/nonav/support.html";
+    }
 
     /**
      * Don't allow instantiation.
@@ -52,9 +93,12 @@
 
     /**
      * @param v The version to set.
+     * @param sv The stable version to set.
      */
-    public static void init(String v) {
+    public static void init(String v, String sv) {
         assert version == null;
         version = v;
+        assert stableVersion == null;
+        stableVersion = sv;
     }
 }

Modified: trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java?view=diff&rev=15162&p1=trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java&r1=15161&r2=15162
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java	2008-07-04 10:54:45-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -33,6 +33,7 @@
 import javax.swing.Icon;
 
 import org.apache.log4j.Logger;
+import org.argouml.application.helpers.ApplicationVersion;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.cognitive.critics.SnoozeOrder;
 import org.argouml.cognitive.critics.Wizard;
@@ -148,23 +149,15 @@
 	Translator.localize("misc.knowledge.tool");
 
     /**
-     * This function calculates the default url to describe this critic.
-     * This syntax is synchronized with:
-     * <ol>
-     * <li>Tags in the manual.
-     * <li>Name of the ArgoUML site.
-     * <li>How the manual is deployed on the site.
-     * </ol>
-     * so this must be updated when any of these change.
+     * This function calculates the default URL to describe this critic.
      *
-     * @return the url in string format
+     * @return the URL in string format
      */
     public final String defaultMoreInfoURL() {
 	String clsName = getClass().getName();
 	clsName = clsName.substring(clsName.lastIndexOf(".") + 1);
-	return "http://argouml-stats.tigris.org/documentation/"
-	    + "manual-0.24-single/argomanual.html"
-	    + "#critics." + clsName;
+	return ApplicationVersion.getManualForCritic()
+	    + clsName;
     }
 
     ////////////////////////////////////////////////////////////////

Modified: trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java?view=diff&rev=15162&p1=trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java&p2=trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java&r1=15161&r2=15162
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/HelpBox.java	2008-07-04 10:54:45-0700
@@ -39,6 +39,7 @@
 import javax.swing.event.HyperlinkListener;
 
 import org.apache.log4j.Logger;
+import org.argouml.application.helpers.ApplicationVersion;
 
 /**
  * This is what you see after you activate the "Help->Help" menu-item.
@@ -61,11 +62,10 @@
      * The names and URLs for the pages.
      */
     private String pages[][] = {{"Manual",
-            "http://argouml-stats.tigris.org/nonav/documentation/"
-                + "manual-0.24/" ,
+            ApplicationVersion.getOnlineManual() ,
             "The ArgoUML online manual"},
         {"Support",
-            "http://argouml.tigris.org/nonav/support.html",
+            ApplicationVersion.getOnlineSupport(),
             "The ArgoUML support page" }};
 
 

Modified: trunk/src/argouml-app/src/templates/ArgoVersion.template
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/templates/ArgoVersion.template?view=diff&rev=15162&p1=trunk/src/argouml-app/src/templates/ArgoVersion.template&p2=trunk/src/argouml-app/src/templates/ArgoVersion.template&r1=15161&r2=15162
==============================================================================
--- trunk/src/argouml-app/src/templates/ArgoVersion.template	(original)
+++ trunk/src/argouml-app/src/templates/ArgoVersion.template	2008-07-04 10:54:45-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -44,12 +44,13 @@
      * Version number.
      */
     private static final String VERSION = "@ARGO_RELEASE_VERSION@";
+    private static final String STABLE_VERSION = "0.26";
 
     /**
      * Make the version of ArgoUML public. 
      */
     static void init() {
-        ApplicationVersion.init(VERSION);
+        ApplicationVersion.init(VERSION, STABLE_VERSION);
     }
 
     /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.