svn commit: r17205 - trunk/src/argouml-app/src/org/argouml/ui/ShadowComboBox.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-08-01 10:12:53-0700
New Revision: 17205

Modified:
   trunk/src/argouml-app/src/org/argouml/ui/ShadowComboBox.java

Log:
Add a hack to a hack to fix issue 5834. We really need to split FigNodeModelElement as a clean fix for this.

Modified: trunk/src/argouml-app/src/org/argouml/ui/ShadowComboBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ShadowComboBox.java?view=diff&pathrev=17205&r1=17204&r2=17205
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ShadowComboBox.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ShadowComboBox.java	2009-08-01 10:12:53-0700
@@ -36,6 +36,7 @@
 import org.argouml.i18n.Translator;
 import org.argouml.uml.diagram.DiagramSettings;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.argouml.uml.diagram.ui.FigStereotypesGroup;
 
 /**
  * A ComboBox that contains the set of possible Shadow Width values.
@@ -44,6 +45,11 @@
  */
 public class ShadowComboBox extends JComboBox {
 
+    /**
+     * The UID.
+     */
+    private static final long serialVersionUID = 3440806802523267746L;
+    
     private static ShadowFig[]  shadowFigs;
 
     /**
@@ -70,10 +76,14 @@
      * Renders each combo box entry as a shadowed diagram figure with the
      * associated level of shadow.
      */
-    private class ShadowRenderer
-	extends JComponent
-	implements ListCellRenderer {
-
+    private class ShadowRenderer extends JComponent
+            implements ListCellRenderer {
+        
+        /**
+         * The UID.
+         */
+        private static final long serialVersionUID = 5939340501470674464L;
+        
         private ShadowFig  currentFig;
 
         /**
@@ -143,18 +153,23 @@
                 currentFig.paint(g);
             }
         }
-
-        /**
-         * The UID.
-         */
-        private static final long serialVersionUID = 5939340501470674464L;
     }
 
     /**
      * This Fig is never placed on a diagram. It is only used by the call
      * renderer so that pick list items look like diagram Figs.
+     * TODO: This Fig does not represent a model element and so it
+     * should not extend FigNodeModelElement. We should split
+     * FigNodeModelElement in two, one for base functionality for all nodes
+     * and one that is truly for model elements.
      */
     private static class ShadowFig extends FigNodeModelElement {
+
+        /**
+         * The UID.
+         */
+        private static final long serialVersionUID = 4999132551417131227L;
+
         /**
          * Constructor.
          */
@@ -181,17 +196,13 @@
             super.setShadowSizeFriend(size);
         }
         
-
         /**
-         * The UID.
+         * This isn't really a Fig representing a model element so
+         * there is always no stereotype.
+         * @return null
          */
-        private static final long serialVersionUID = 4999132551417131227L;
-
-
+        protected FigStereotypesGroup createStereotypeFig() {
+            return null;
+        }
     }
-
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = 3440806802523267746L;
 }

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

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.