svn commit: r17509 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExpandableRowSelector.java

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

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

Log:
Compress the button so that it doesn't expand with the list control

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExpandableRowSelector.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExpandableRowSelector.java?view=diff&pathrev=17509&r1=17508&r2=17509
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExpandableRowSelector.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExpandableRowSelector.java	2009-11-20 12:02:34-0800
@@ -29,10 +29,13 @@
 import java.awt.event.ActionEvent;
 
 import javax.swing.AbstractAction;
+import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.ListModel;
+import javax.swing.plaf.basic.BasicTreeUI;
+import javax.swing.plaf.metal.MetalTreeUI;
 
 import org.tigris.toolbar.toolbutton.ToolButton;
 
@@ -65,7 +68,13 @@
      */
     public UMLExpandableRowSelector(UMLModelElementListModel model) {
         super(new BorderLayout());
-        add(new ToolButton(new ExpandAction()), BorderLayout.WEST);
+        
+        BasicTreeUI btu = new MetalTreeUI();
+        Icon expandedIcon = btu.getExpandedIcon();
+        Icon collapsedIcon = btu.getCollapsedIcon();
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(new ToolButton(new ExpandAction(expandedIcon)), BorderLayout.NORTH);
+        add(buttonPanel, BorderLayout.WEST);
         scroll = new ScrollList(model, 1);
         add(scroll);
         
@@ -119,8 +128,8 @@
     }
     
     private class ExpandAction extends AbstractAction {
-        ExpandAction() {
-            super();
+        ExpandAction(Icon icon) {
+            super(null, icon);
         }
 
         @Override

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

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.