[cp-patches] FYI: More scrolling fixes

Roman Kennke roman.kennke at aicas.com
Wed Oct 18 18:49:18 UTC 2006

This fixes a couple more issues with scrolling:
- In JTree I found a thinko in the Scrollable implementation, sometimes
causing a 'round-trip' scrolling when scrolling down.
- Sometimes the JTree cause an NPE in JComponent.repaint() when it
passed a null Rectangle in there. However, the
JTree.TreeSelectionRedirector class shouldn't paint at all, it only
redirects selection events. JTrees are still painted correctly.

- I moved some code around in BasicScrollBarUI and BasicScrollPaneUI to
avoid duplication of scrolling code in the wheel scroller.
- Also I added a check to only allow wheel scrolling when the
appropriate property in JScrollPane is set.


2006-10-18  Roman Kennke  <kennke at aicas.com>

	PR 28769
	* javax/swing/JScrollPane.java
	(viewportBorder): Made field private.
	(wheelScrollingEnabled): Made field private.
	(JScrollPane): Enabled wheel scrolling by default.
	* javax/swing/JTree.java
	(TreeSelectionRedirector.valueChanged): Don't repaint anything
	(getScrollableUnitIncrement): Fixed thinko.
	* javax/swing/plaf/basic/BasicScrollBarUI.java
	(static scrollByBlock): New static method to avoid code duplication
	for the BasicScrollPane wheel scrolling.
	(static scrollByUnits): New static method to avoid code duplication
	for the BasicScrollPane wheel scrolling.
	(scrollByBlock): Delegate to static helper method.
	(scrollByUnit): Delegate to static helper method.
	* javax/swing/plaf/basic/BasicScrollPaneUI.java
	(MouseWheelHandler.mouseWheelMoved): Delegate to BasicScrollBarUI
	static helper methods to avoid code duplication.
	(MouseWheelHandler.bounds): Removed.
	(MouseWheelHandler.getValue): Removed.
	(MouseWheelHandler.scroll): Removed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 16716 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20061018/7daadccd/patch-0001.bin

More information about the Classpath-patches mailing list