svn commit: r15574 - branches/gsoc2008/feature4_5142_bszanto/src/org/argouml: ui uml/diagram/static_structure/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bszanto
Date: 2008-08-16 04:25:11-0700
New Revision: 15574

Modified:
   branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java
   branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java

Log:
Commit of the last review from Luis - corrects a missing comment for a public method, some typos and improves code for the getVisibilityKind(int index) method.

Modified: branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java?view=diff&rev=15574&p1=branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java&p2=branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java&r1=15573&r2=15574
==============================================================================
--- branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java	(original)
+++ branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/ui/CmdCreateNodeWizard.java	2008-08-16 04:25:11-0700
@@ -60,8 +60,6 @@
                         ResourceLoaderWrapper.getImageBinding(tooltip)));
         wizard = wiz;
         putValue(Action.SHORT_DESCRIPTION, Translator.localize(tooltip));
-        
-        System.out.println("done");
     }
     
     @Override
@@ -70,7 +68,7 @@
         // displays the wizard that returns the node to be created
         node = wizard.display();
         
-        // if the node is null, the acion was canceled
+        // if the node is null, the action was canceled
         if (node != null) {
             super.actionPerformed(e);
         } else {

Modified: branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java?view=diff&rev=15574&p1=branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java&p2=branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java&r1=15573&r2=15574
==============================================================================
--- branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java	(original)
+++ branches/gsoc2008/feature4_5142_bszanto/src/org/argouml/uml/diagram/static_structure/ui/ClassCreateWizard.java	2008-08-16 04:25:11-0700
@@ -156,7 +156,7 @@
     
     /**
      * When the OK button is pressed the new class is created, and the 
-     * attribtutes and operations are added.
+     * attributes and operations are added.
      */
     public void okPressed() {
         classNode = Model.getCoreFactory().createClass();
@@ -197,7 +197,7 @@
     /** Type field */
     private UMLComboBox2 type;
     
-    /** The newly created attribue */
+    /** The newly created attribute */
     private Object attribute = null;
 
     /**
@@ -251,9 +251,18 @@
         return attribute;
     }
     
+    /**
+     * Determines the VisibilityKind corresponding to the index parameter.
+     * If the index is out of the valid range, a default VisibilityKind is 
+     * used.
+     * 
+     * @param index the selected index, with 0 <= index <= 3.
+     * @return the VisibilityKind corresponding to the index. The default 
+     * VisibilityKind is Private.
+     */
     public static Object getVisibilityKind(int index) {
         VisibilityKind vk = Model.getVisibilityKind();
-        Object vis;
+        Object vis = vk.getPrivate();
         switch (index) {
         case 0:
             vis = vk.getPublic();
@@ -264,8 +273,10 @@
         case 2:
             vis = vk.getProtected();
             break;
-        default:
+        case 3:
             vis = vk.getPrivate();
+        default:
+            assert false : "Invalid value of index: " + index + ".";
         }
         return vis;
     }
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.