svn commit: r17643 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/LabelledComponent.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-12-11 11:05:49-0800
New Revision: 17643

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/LabelledComponent.java

Log:
Make it so that a combo cannot be resized

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/LabelledComponent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/LabelledComponent.java?view=diff&pathrev=17643&r1=17642&r2=17643
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/LabelledComponent.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/LabelledComponent.java	2009-12-11 11:05:49-0800
@@ -25,7 +25,9 @@
 package org.argouml.core.propertypanels.ui;
 
 import java.awt.BorderLayout;
+import java.awt.Dimension;
 
+import javax.swing.JComboBox;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
@@ -48,6 +50,8 @@
      */
     private final JLabel label;
     
+    private final JComponent component;
+    
     /**
      * Construct a new LabelledComponent
      * @param name the name of the label to create
@@ -55,6 +59,7 @@
      */
     public LabelledComponent(final String name, final JComponent component) {
         super(new BorderLayout());
+        this.component = component;
         setName(name);
         add(component, BorderLayout.CENTER);
         
@@ -76,4 +81,12 @@
     JLabel getLabel() {
         return label;
     }
+    
+    public Dimension getPreferredSize() {
+        if (component instanceof JComboBox) {
+            return null;
+        } else {
+            return super.getPreferredSize();
+        }
+    }
 }

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

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.