FileDocCategorySizeDatePackage
BasicSplitPaneUI.javaAPI DocJava SE 5 API71148Fri Aug 26 14:58:06 BST 2005javax.swing.plaf.basic

BasicSplitPaneUI

public class BasicSplitPaneUI extends SplitPaneUI
A Basic L&F implementation of the SplitPaneUI.
version
1.80 05/18/04
author
Scott Violet
author
Steve Wilson
author
Ralph Kar

Fields Summary
protected static final String
NON_CONTINUOUS_DIVIDER
The divider used for non-continuous layout is added to the split pane with this object.
protected static int
KEYBOARD_DIVIDER_MOVE_OFFSET
How far (relative) the divider does move when it is moved around by the cursor keys on the keyboard.
protected JSplitPane
splitPane
JSplitPane instance this instance is providing the look and feel for.
protected BasicHorizontalLayoutManager
layoutManager
LayoutManager that is created and placed into the split pane.
protected BasicSplitPaneDivider
divider
Instance of the divider for this JSplitPane.
protected PropertyChangeListener
propertyChangeListener
Instance of the PropertyChangeListener for this JSplitPane.
protected FocusListener
focusListener
Instance of the FocusListener for this JSplitPane.
private Handler
handler
private static Set
managingFocusForwardTraversalKeys
Keys to use for forward focus traversal when the JComponent is managing focus.
private static Set
managingFocusBackwardTraversalKeys
Keys to use for backward focus traversal when the JComponent is managing focus.
protected int
dividerSize
The size of the divider while the dragging session is valid.
protected Component
nonContinuousLayoutDivider
Instance for the shadow of the divider when non continuous layout is being used.
protected boolean
draggingHW
Set to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights.
protected int
beginDragDividerLocation
Location of the divider when the dragging session began.
protected KeyStroke
upKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected KeyStroke
downKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected KeyStroke
leftKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected KeyStroke
rightKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected KeyStroke
homeKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected KeyStroke
endKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected KeyStroke
dividerResizeToggleKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected ActionListener
keyboardUpLeftListener
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected ActionListener
keyboardDownRightListener
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected ActionListener
keyboardHomeListener
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected ActionListener
keyboardEndListener
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
protected ActionListener
keyboardResizeToggleListener
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
private int
orientation
private int
lastDragLocation
private boolean
continuousLayout
private boolean
dividerKeyboardResize
private boolean
dividerLocationIsSet
private Color
dividerDraggingColor
private boolean
rememberPaneSizes
private boolean
keepHidden
boolean
painted
Indicates that we have painted once.
boolean
ignoreDividerLocationChange
If true, setDividerLocation does nothing.
Constructors Summary
Methods Summary
private voidaddHeavyweightDivider()

        if(nonContinuousLayoutDivider != null && splitPane != null) {

            /* Needs to remove all the components and re-add them! YECK! */
	    // This is all done so that the nonContinuousLayoutDivider will
	    // be drawn on top of the other components, without this, one
	    // of the heavyweights will draw over the divider!
            Component             leftC = splitPane.getLeftComponent();
            Component             rightC = splitPane.getRightComponent();
	    int                   lastLocation = splitPane.
		                              getDividerLocation();

            if(leftC != null)
                splitPane.setLeftComponent(null);
            if(rightC != null)
                splitPane.setRightComponent(null);
            splitPane.remove(divider);
            splitPane.add(nonContinuousLayoutDivider, BasicSplitPaneUI.
                          NON_CONTINUOUS_DIVIDER,
                          splitPane.getComponentCount());
            splitPane.setLeftComponent(leftC);
            splitPane.setRightComponent(rightC);
            splitPane.add(divider, JSplitPane.DIVIDER);
            if(rememberPaneSizes) {
		splitPane.setDividerLocation(lastLocation);
	    } 
        }
 
    
public javax.swing.plaf.basic.BasicSplitPaneDividercreateDefaultDivider()
Creates the default divider.

        return new BasicSplitPaneDivider(this);
    
protected java.awt.ComponentcreateDefaultNonContinuousLayoutDivider()
Returns the default non continuous layout divider, which is an instanceof Canvas that fills the background in dark gray.

        return new Canvas() {
            public void paint(Graphics g) {
                if(!isContinuousLayout() && getLastDragLocation() != -1) {
                    Dimension      size = splitPane.getSize();

                    g.setColor(dividerDraggingColor);
                    if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                        g.fillRect(0, 0, dividerSize - 1, size.height - 1);
                    } else {
                        g.fillRect(0, 0, size.width - 1, dividerSize - 1);
                    }
                }
            }
        };
    
protected java.awt.event.FocusListenercreateFocusListener()
Creates a FocusListener for the JSplitPane UI.

        return getHandler();
    
protected java.awt.event.ActionListenercreateKeyboardDownRightListener()
As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

Creates a ActionListener for the JSplitPane UI that listens for specific key presses.

deprecated
As of Java 2 platform v1.3.

        return new KeyboardDownRightHandler();
    
protected java.awt.event.ActionListenercreateKeyboardEndListener()
As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

Creates a ActionListener for the JSplitPane UI that listens for specific key presses.

deprecated
As of Java 2 platform v1.3.

        return new KeyboardEndHandler();
    
protected java.awt.event.ActionListenercreateKeyboardHomeListener()
As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

Creates a ActionListener for the JSplitPane UI that listens for specific key presses.

deprecated
As of Java 2 platform v1.3.

        return new KeyboardHomeHandler();
    
protected java.awt.event.ActionListenercreateKeyboardResizeToggleListener()
As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

Creates a ActionListener for the JSplitPane UI that listens for specific key presses.

deprecated
As of Java 2 platform v1.3.

        return new KeyboardResizeToggleHandler();
    
protected java.awt.event.ActionListenercreateKeyboardUpLeftListener()
As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

Creates a ActionListener for the JSplitPane UI that listens for specific key presses.

deprecated
As of Java 2 platform v1.3.

        return new KeyboardUpLeftHandler();
    
protected java.beans.PropertyChangeListenercreatePropertyChangeListener()
Creates a PropertyChangeListener for the JSplitPane UI.

        return getHandler();
    
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent x)
Creates a new BasicSplitPaneUI instance



              
         
        return new BasicSplitPaneUI();
    
protected voiddragDividerTo(int location)
Messaged during a dragging session to move the divider to the passed in location. If continuousLayout is true the location is reset and the splitPane validated.

        if(getLastDragLocation() != location) {
            if(isContinuousLayout()) {
		splitPane.setDividerLocation(location);
                setLastDragLocation(location);
            } else {
                int lastLoc = getLastDragLocation();

                setLastDragLocation(location);
                if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                    if(draggingHW) {
                        nonContinuousLayoutDivider.setLocation(
                            getLastDragLocation(), 0);
                    } else {
			int   splitHeight = splitPane.getHeight();
                        splitPane.repaint(lastLoc, 0, dividerSize,
                                          splitHeight);
                        splitPane.repaint(location, 0, dividerSize,
                                          splitHeight);
                    }
                } else {
                    if(draggingHW) {
                        nonContinuousLayoutDivider.setLocation(0,
                            getLastDragLocation());
                    } else {
			int    splitWidth = splitPane.getWidth();

                        splitPane.repaint(0, lastLoc, splitWidth,
                                          dividerSize);
                        splitPane.repaint(0, location, splitWidth,
                                          dividerSize);
                    }
                }
            }
        }
    
protected voidfinishDraggingTo(int location)
Messaged to finish the dragging session. If not continuous display the dividers location will be reset.

        dragDividerTo(location);
        setLastDragLocation(-1);
        if(!isContinuousLayout()) {
            Component   leftC = splitPane.getLeftComponent();
            Rectangle   leftBounds = leftC.getBounds();

	    if (draggingHW) {
		if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                    nonContinuousLayoutDivider.setLocation(-dividerSize, 0);
		}
		else {
                    nonContinuousLayoutDivider.setLocation(0, -dividerSize);
		}
		splitPane.remove(nonContinuousLayoutDivider);
	    }
	    splitPane.setDividerLocation(location);
        }
    
public voidfinishedPaintingChildren(javax.swing.JSplitPane jc, java.awt.Graphics g)
Messaged after the JSplitPane the receiver is providing the look and feel for paints its children.

        if(jc == splitPane && getLastDragLocation() != -1 &&
           !isContinuousLayout() && !draggingHW) {
            Dimension      size = splitPane.getSize();

            g.setColor(dividerDraggingColor);
            if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                g.fillRect(getLastDragLocation(), 0, dividerSize - 1,
                           size.height - 1);
            } else {
                g.fillRect(0, lastDragLocation, size.width - 1,
                           dividerSize - 1);
            }
        }
    
public javax.swing.plaf.basic.BasicSplitPaneDividergetDivider()
Returns the divider between the top Components.

        return divider;
    
protected intgetDividerBorderSize()
As of Java 2 platform v1.3 this method is no longer used. Instead you should set the border on the divider.

Returns the width of one side of the divider border.

deprecated
As of Java 2 platform v1.3, instead set the border on the divider.

        return 1;
    
public intgetDividerLocation(javax.swing.JSplitPane jc)
Returns the location of the divider, which may differ from what the splitpane thinks the location of the divider is.

        if(orientation == JSplitPane.HORIZONTAL_SPLIT)
            return divider.getLocation().x;
        return divider.getLocation().y;
    
private javax.swing.plaf.basic.BasicSplitPaneUI$HandlergetHandler()

        if (handler == null) {
            handler = new Handler();
        }
        return handler;
    
javax.swing.InputMapgetInputMap(int condition)

	if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) {
	    return (InputMap)DefaultLookup.get(splitPane, this,
                                               "SplitPane.ancestorInputMap");
	}
	return null;
    
public java.awt.InsetsgetInsets(javax.swing.JComponent jc)
Returns the insets. The insets are returned from the border insets of the current border.

        return null;
    
private booleangetKeepHidden()
The value returned indicates if one of the splitpane sides is expanded.

return
true if one of the splitpane sides is expanded, false otherwise.

	return keepHidden;
    
intgetKeyboardMoveIncrement()

return
increment via keyboard methods.

	return KEYBOARD_DIVIDER_MOVE_OFFSET;
    
public intgetLastDragLocation()
Returns the last drag location of the JSplitPane.

        return lastDragLocation;
    
public intgetMaximumDividerLocation(javax.swing.JSplitPane jc)
Gets the maximum location of the divider.

        Dimension splitPaneSize = splitPane.getSize();
        int       maxLoc = 0;
        Component rightC = splitPane.getRightComponent();

        if (rightC != null) {
            Insets    insets = splitPane.getInsets();
            Dimension minSize = new Dimension(0, 0);
            if (rightC.isVisible()) {
                minSize = rightC.getMinimumSize();
            }
            if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                maxLoc = splitPaneSize.width - minSize.width;
            } else {
                maxLoc = splitPaneSize.height - minSize.height; 
            }
            maxLoc -= dividerSize;
            if(insets != null) {
                if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                    maxLoc -= insets.right;
                } else {
                    maxLoc -= insets.top;
                }
            }
        }
        return Math.max(getMinimumDividerLocation(splitPane), maxLoc);
    
public java.awt.DimensiongetMaximumSize(javax.swing.JComponent jc)
Returns the maximum size for the passed in component, This is passed off to the current layoutmanager.

        if(splitPane != null)
            return layoutManager.maximumLayoutSize(splitPane);
        return new Dimension(0, 0);
    
public intgetMinimumDividerLocation(javax.swing.JSplitPane jc)
Gets the minimum location of the divider.

        int       minLoc = 0;
        Component leftC = splitPane.getLeftComponent();

        if ((leftC != null) && (leftC.isVisible())) {
            Insets    insets = splitPane.getInsets();
            Dimension minSize = leftC.getMinimumSize();
            if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                minLoc = minSize.width;
            } else {
                minLoc = minSize.height;
            }
            if(insets != null) {
                if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                    minLoc += insets.left;
                } else {
                    minLoc += insets.top;
                }
            }
        }
        return minLoc;
    
public java.awt.DimensiongetMinimumSize(javax.swing.JComponent jc)
Returns the minimum size for the passed in component, This is passed off to the current layoutmanager.

        if(splitPane != null)
            return layoutManager.minimumLayoutSize(splitPane);
        return new Dimension(0, 0);
    
public java.awt.ComponentgetNonContinuousLayoutDivider()
Returns the divider to use when the splitPane is configured to not continuously layout. This divider will only be used during a dragging session.

        return nonContinuousLayoutDivider;
    
public intgetOrientation()
Returns the orientation for the JSplitPane.

        return orientation;
    
public java.awt.DimensiongetPreferredSize(javax.swing.JComponent jc)
Returns the preferred size for the passed in component, This is passed off to the current layoutmanager.

        if(splitPane != null)
            return layoutManager.preferredLayoutSize(splitPane);
        return new Dimension(0, 0);
    
public javax.swing.JSplitPanegetSplitPane()
Returns the splitpane this instance is currently contained in.

        return splitPane;
    
protected voidinstallDefaults()
Installs the UI defaults.

 
        LookAndFeel.installBorder(splitPane, "SplitPane.border");
        LookAndFeel.installColors(splitPane, "SplitPane.background",
                                  "SplitPane.foreground");
        LookAndFeel.installProperty(splitPane, "opaque", Boolean.TRUE);

        if (divider == null) divider = createDefaultDivider();
        divider.setBasicSplitPaneUI(this);

	Border    b = divider.getBorder();

	if (b == null || !(b instanceof UIResource)) {
	    divider.setBorder(UIManager.getBorder("SplitPaneDivider.border"));
	}

	dividerDraggingColor = UIManager.getColor("SplitPaneDivider.draggingColor");

        setOrientation(splitPane.getOrientation());

	// This plus 2 here is to provide backwards consistancy. Previously,
	// the old size did not include the 2 pixel border around the divider,
	// it now does.
        LookAndFeel.installProperty(splitPane, "dividerSize", 
				    UIManager.get("SplitPane.dividerSize"));

        divider.setDividerSize(splitPane.getDividerSize());
	dividerSize = divider.getDividerSize();
        splitPane.add(divider, JSplitPane.DIVIDER);

        setContinuousLayout(splitPane.isContinuousLayout());

        resetLayoutManager();

        /* Install the nonContinuousLayoutDivider here to avoid having to
        add/remove everything later. */
        if(nonContinuousLayoutDivider == null) {
            setNonContinuousLayoutDivider(
                                createDefaultNonContinuousLayoutDivider(),
                                true);
        } else {
            setNonContinuousLayoutDivider(nonContinuousLayoutDivider, true);
        }

	// focus forward traversal key
	if (managingFocusForwardTraversalKeys==null) {
	    managingFocusForwardTraversalKeys = new TreeSet();
	    managingFocusForwardTraversalKeys.add(
		KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
	}
	splitPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
					managingFocusForwardTraversalKeys);
	// focus backward traversal key
	if (managingFocusBackwardTraversalKeys==null) {
	    managingFocusBackwardTraversalKeys = new TreeSet();
	    managingFocusBackwardTraversalKeys.add(
		KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
	}
	splitPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
					managingFocusBackwardTraversalKeys);
    
protected voidinstallKeyboardActions()
Installs the keyboard actions for the UI.

	InputMap km = getInputMap(JComponent.
				  WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

	SwingUtilities.replaceUIInputMap(splitPane, JComponent.
				       WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
				       km);
        LazyActionMap.installLazyActionMap(splitPane, BasicSplitPaneUI.class,
                                           "SplitPane.actionMap");
    
protected voidinstallListeners()
Installs the event listeners for the UI.

        if ((propertyChangeListener = createPropertyChangeListener()) !=
            null) {
            splitPane.addPropertyChangeListener(propertyChangeListener);
        }

        if ((focusListener = createFocusListener()) != null) {
            splitPane.addFocusListener(focusListener);
        }
    
public voidinstallUI(javax.swing.JComponent c)
Installs the UI.

        splitPane = (JSplitPane) c;
        dividerLocationIsSet = false;
        dividerKeyboardResize = false;
        keepHidden = false;
        installDefaults();
        installListeners();
        installKeyboardActions();
        setLastDragLocation(-1);
    
public booleanisContinuousLayout()
Determines wether the JSplitPane is set to use a continuous layout.

        return continuousLayout;
    
static voidloadActionMap(javax.swing.plaf.basic.LazyActionMap map)

        map.put(new Actions(Actions.NEGATIVE_INCREMENT));
	map.put(new Actions(Actions.POSITIVE_INCREMENT));
	map.put(new Actions(Actions.SELECT_MIN));
	map.put(new Actions(Actions.SELECT_MAX));
	map.put(new Actions(Actions.START_RESIZE));
	map.put(new Actions(Actions.TOGGLE_FOCUS));
	map.put(new Actions(Actions.FOCUS_OUT_FORWARD));
	map.put(new Actions(Actions.FOCUS_OUT_BACKWARD));
    
public voidpaint(java.awt.Graphics g, javax.swing.JComponent jc)
Messaged to paint the look and feel.

	if (!painted && splitPane.getDividerLocation()<0) {
	    ignoreDividerLocationChange = true;
	    splitPane.setDividerLocation(getDividerLocation(splitPane));
	}
	painted = true;
    
protected voidresetLayoutManager()
Resets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components.

        if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
            layoutManager = new BasicHorizontalLayoutManager(0);
        } else {
            layoutManager = new BasicHorizontalLayoutManager(1);
        }
        splitPane.setLayout(layoutManager);
        layoutManager.updateComponents();
        splitPane.revalidate();
        splitPane.repaint();
    
public voidresetToPreferredSizes(javax.swing.JSplitPane jc)
Messaged to reset the preferred sizes.

        if(splitPane != null) {
            layoutManager.resetToPreferredSizes();
            splitPane.revalidate();
	    splitPane.repaint();
        }
    
public voidsetContinuousLayout(boolean b)
Turn continuous layout on/off.

        continuousLayout = b;
    
public voidsetDividerLocation(javax.swing.JSplitPane jc, int location)
Sets the location of the divider to location.

	if (!ignoreDividerLocationChange) {
	    dividerLocationIsSet = true;
	    splitPane.revalidate();
	    splitPane.repaint();

            if (keepHidden) {		
		Insets insets = splitPane.getInsets();
		int orientation = splitPane.getOrientation(); 
		if ((orientation == JSplitPane.VERTICAL_SPLIT &&
		     location != insets.top &&
		     location != splitPane.getHeight()-divider.getHeight()-insets.top) ||
		    (orientation == JSplitPane.HORIZONTAL_SPLIT &&
		     location != insets.left &&
		     location != splitPane.getWidth()-divider.getWidth()-insets.left)) {
  		    setKeepHidden(false);
		}
	    }
	}
	else {
	    ignoreDividerLocationChange = false;
	}
    
voidsetKeepHidden(boolean keepHidden)
Set the value to indicate if one of the splitpane sides is expanded.

	this.keepHidden = keepHidden;
    
public voidsetLastDragLocation(int l)
Set the last drag location of the JSplitPane.

        lastDragLocation = l;
    
protected voidsetNonContinuousLayoutDivider(java.awt.Component newDivider)
Sets the divider to use when the splitPane is configured to not continuously layout. This divider will only be used during a dragging session. It is recommended that the passed in component be a heavy weight.

        setNonContinuousLayoutDivider(newDivider, true);
    
protected voidsetNonContinuousLayoutDivider(java.awt.Component newDivider, boolean rememberSizes)
Sets the divider to use.

        rememberPaneSizes = rememberSizes;
        if(nonContinuousLayoutDivider != null && splitPane != null) {
            splitPane.remove(nonContinuousLayoutDivider);
        }
        nonContinuousLayoutDivider = newDivider;
    
public voidsetOrientation(int orientation)
Set the orientation for the JSplitPane.

        this.orientation = orientation;
    
protected voidstartDragging()
Should be messaged before the dragging session starts, resets lastDragLocation and dividerSize.

        Component       leftC = splitPane.getLeftComponent();
        Component       rightC = splitPane.getRightComponent();
        ComponentPeer   cPeer;

        beginDragDividerLocation = getDividerLocation(splitPane);
        draggingHW = false;
        if(leftC != null && (cPeer = leftC.getPeer()) != null &&
           !(cPeer instanceof LightweightPeer)) {
            draggingHW = true;
        } else if(rightC != null && (cPeer = rightC.getPeer()) != null
                  && !(cPeer instanceof LightweightPeer)) {
            draggingHW = true;
        }
        if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
            setLastDragLocation(divider.getBounds().x);
            dividerSize = divider.getSize().width;
            if(!isContinuousLayout() && draggingHW) {
                nonContinuousLayoutDivider.setBounds
                        (getLastDragLocation(), 0, dividerSize,
                         splitPane.getHeight());
		      addHeavyweightDivider();
            }
        } else {
            setLastDragLocation(divider.getBounds().y);
            dividerSize = divider.getSize().height;
            if(!isContinuousLayout() && draggingHW) {
                nonContinuousLayoutDivider.setBounds
                        (0, getLastDragLocation(), splitPane.getWidth(),
                         dividerSize);
		      addHeavyweightDivider();
            }
        }
    
protected voiduninstallDefaults()
Uninstalls the UI defaults.

        if(splitPane.getLayout() == layoutManager) {
            splitPane.setLayout(null);
        }

        if(nonContinuousLayoutDivider != null) {
            splitPane.remove(nonContinuousLayoutDivider);
        }

        LookAndFeel.uninstallBorder(splitPane);

	Border    b = divider.getBorder();

	if (b instanceof UIResource) {
	    divider.setBorder(null);
	}

        splitPane.remove(divider);
        divider.setBasicSplitPaneUI(null);
        layoutManager = null;
        divider = null;
        nonContinuousLayoutDivider = null;

        setNonContinuousLayoutDivider(null);

	// sets the focus forward and backward traversal keys to null
	// to restore the defaults
	splitPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
	splitPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
    
protected voiduninstallKeyboardActions()
Uninstalls the keyboard actions for the UI.

	SwingUtilities.replaceUIActionMap(splitPane, null);
	SwingUtilities.replaceUIInputMap(splitPane, JComponent.
				      WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
				      null);
    
protected voiduninstallListeners()
Uninstalls the event listeners for the UI.

        if (propertyChangeListener != null) {
            splitPane.removePropertyChangeListener(propertyChangeListener);
            propertyChangeListener = null;
        }
        if (focusListener != null) {
            splitPane.removeFocusListener(focusListener);
            focusListener = null;
        }

        keyboardUpLeftListener = null;
        keyboardDownRightListener = null;
        keyboardHomeListener = null;
        keyboardEndListener = null;
        keyboardResizeToggleListener = null;
        handler = null;
    
public voiduninstallUI(javax.swing.JComponent c)
Uninstalls the UI.

        uninstallKeyboardActions();
        uninstallListeners();
        uninstallDefaults();
        dividerLocationIsSet = false;
        dividerKeyboardResize = false;
        splitPane = null;