classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: various fixes for BasicSplitPaneUI


From: Roman Kennke
Subject: [cp-patches] FYI: various fixes for BasicSplitPaneUI
Date: Wed, 08 Jun 2005 15:40:11 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

I committed various small fixes for BasicSplitPaneUI which make JSplitPane more usable.

2005-06-08  Roman Kennke  <address@hidden>

   * javax/swing/plaf/basic/BasicSplitPaneUI.java
   (installDefaults): Call resetLayoutManager() _after_ the divider
   is created to prevent NPE.
   (paint): Removed check for valid divider location. This is done
   in resetComponentAt(index).
   (resetLayoutManager): Call layout.updateComponents _after_ the
   layout has been installed. Otherwise it has no effect.

/Roman

Index: javax/swing/plaf/basic/BasicSplitPaneUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicSplitPaneUI.java
--- javax/swing/plaf/basic/BasicSplitPaneUI.java        4 Jun 2005 19:16:11 
-0000       1.9
+++ javax/swing/plaf/basic/BasicSplitPaneUI.java        8 Jun 2005 13:34:16 
-0000
@@ -990,8 +990,8 @@
    */
   protected void installDefaults()
   {
-    resetLayoutManager();
     divider = createDefaultDivider();
+    resetLayoutManager();
     nonContinuousLayoutDivider = createDefaultNonContinuousLayoutDivider();
     splitPane.add(divider, JSplitPane.DIVIDER);

@@ -1384,11 +1384,6 @@
    */
   public void paint(Graphics g, JComponent jc)
   {
-    // Make sure that the location is valid
-    int divLoc = splitPane.getDividerLocation();
-    int valLoc = validLocation(divLoc);
-    if (divLoc != valLoc)
-      splitPane.setDividerLocation(valLoc);
   }

   /**
@@ -1449,9 +1444,8 @@
       layoutManager = new BasicHorizontalLayoutManager();
     else
       layoutManager = new BasicVerticalLayoutManager();
-    layoutManager.invalidateLayout(splitPane);
-    layoutManager.updateComponents();
     getSplitPane().setLayout(layoutManager);
+    layoutManager.updateComponents();

     // invalidating by itself does not invalidate the layout.
     getSplitPane().revalidate();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]