svn commit: r19578 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-07-02 04:28:12-0700
New Revision: 19578

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java

Log:
Defect 6307 - make sure the first letter of the icon name is upper case

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java?view=diff&pathrev=19578&r1=19577&r2=19578
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java	2011-07-02 04:28:12-0700
@@ -37,6 +37,7 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.model.ModelManagementHelper;
+import org.argouml.model.PseudostateKind;
 import org.argouml.profile.Profile;
 import org.argouml.profile.ProfileException;
 import org.argouml.ui.targetmanager.TargetManager;
@@ -1233,61 +1234,69 @@
          * configurable way to replace.
          */
         public List<Command> getAdditionalCommands(Object modelElement) {
-        	final List<Command> commands = new ArrayList<Command>(6);
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getFork()));
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getJoin()));
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getChoice()));
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getDeepHistory()));
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getShallowHistory()));
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getInitial()));
-        	commands.add(new NewPseudoStateCommand(
-        			modelElement, Model.getPseudostateKind().getJunction()));
-        	return commands;
-        }
-        
-        private class NewPseudoStateCommand extends NonUndoableCommand implements IconIdentifiable, Named {
-
-        	private final String label;
-        	private final Object kind;
-        	private final Icon icon;
-        	private final Object target;
+            final List<Command> commands = new ArrayList<Command>(6);
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement, Model.getPseudostateKind().getFork()));
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement, Model.getPseudostateKind().getJoin()));
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement, Model.getPseudostateKind().getChoice()));
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement,
+        	    Model.getPseudostateKind().getDeepHistory()));
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement,
+        	    Model.getPseudostateKind().getShallowHistory()));
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement, Model.getPseudostateKind().getInitial()));
+            commands.add(new NewPseudoStateCommand(
+        	    modelElement, Model.getPseudostateKind().getJunction()));
+            return commands;
+        }
+        
+        private class NewPseudoStateCommand extends NonUndoableCommand
+        	implements IconIdentifiable, Named {
+
+            private final String label;
+            private final Object kind;
+            private final Icon icon;
+            private final Object target;
         	
-        	/**
-        	 * A Command to create a new pseudostate inside some target model
-        	 * element.
-        	 * @param target the target model element the pseudo state should
-        	 * belong to
-        	 * @param kind the required kind of pseudostate
-        	 */
-        	NewPseudoStateCommand(Object target, Object kind) {
-        		this.target = target;
-        		this.kind = kind;
-                if (kind == Model.getPseudostateKind().getFork()) {
-                    label = Translator.localize("label.pseudostate.fork");
-                } else if (kind == Model.getPseudostateKind().getJoin()) {
-                    label = Translator.localize("label.pseudostate.join");
-                } else if (kind == Model.getPseudostateKind().getChoice()) {
-                	label = Translator.localize("label.pseudostate.choice");
-                } else if (kind == Model.getPseudostateKind().getDeepHistory()) {
-                	label = Translator.localize("label.pseudostate.deephistory");
-                } else if (kind == Model.getPseudostateKind().getShallowHistory()) {
-                	label = Translator.localize("label.pseudostate.shallowhistory");
-                } else if (kind == Model.getPseudostateKind().getInitial()) {
-                	label = Translator.localize("label.pseudostate.initial");
-                } else if (kind == Model.getPseudostateKind().getJunction()) {
-                	label = Translator.localize("label.pseudostate.junction");
+            /**
+             * A Command to create a new pseudostate inside some target
+             * model element.
+             * @param target the target model element the pseudo state
+             * should belong to
+             * @param kind the required kind of pseudostate
+    s         */
+            NewPseudoStateCommand(Object target, Object kind) {
+                this.target = target;
+                this.kind = kind;
+                final String key;
+                PseudostateKind kinds = Model.getPseudostateKind();
+                if (kind == kinds.getFork()) {
+                    key = "label.pseudostate.fork";
+                } else if (kind == kinds.getJoin()) {
+                    key = "label.pseudostate.join";
+                } else if (kind == kinds.getChoice()) {
+                    key = "label.pseudostate.choice";
+                } else if (kind == kinds.getDeepHistory()) {
+                    key = "label.pseudostate.deephistory";
+                } else if (kind == kinds.getShallowHistory()) {
+                    key = "label.pseudostate.shallowhistory";
+                } else if (kind == kinds.getInitial()) {
+                    key = "label.pseudostate.initial";
+                } else if (kind == kinds.getJunction()) {
+                    key = "label.pseudostate.junction";
                 } else {
-                	throw new IllegalArgumentException(
+                    throw new IllegalArgumentException(
                 			kind + " is not a known PseudostateKind");
                 }
-                icon = ResourceLoaderWrapper.lookupIcon(
-                		Model.getFacade().getName(kind));
+                label = Translator.localize(key);
+                final String name =
+                    Model.getFacade().getName(kind).substring(0,1).toUpperCase()
+                    + Model.getFacade().getName(kind).substring(1);
+                icon = ResourceLoaderWrapper.lookupIcon(name);
             }
         	
 			@Override

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2783276

To unsubscribe from this discussion, e-mail: [[email protected]].
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.