javax.swing.plaf.basic

Class BasicScrollPaneUI

public class BasicScrollPaneUI extends ScrollPaneUI implements ScrollPaneConstants

A UI delegate for the {@link JScrollPane} component.
Nested Class Summary
classBasicScrollPaneUI.HSBChangeListener
Listens for changes in the state of the horizontal scrollbar's model and updates the scrollpane accordingly.
protected classBasicScrollPaneUI.MouseWheelHandler
Listens for mouse wheel events and update the scrollpane accordingly.
classBasicScrollPaneUI.PropertyChangeHandler
Listens for property changes on the scrollpane and update the view accordingly.
classBasicScrollPaneUI.ViewportChangeHandler
Listens for changes of the viewport's extent size and updates the scrollpane accordingly.
classBasicScrollPaneUI.VSBChangeListener
Listens for changes in the state of the vertical scrollbar's model and updates the scrollpane accordingly.
Field Summary
protected ChangeListenerhsbChangeListener
The horizontal scrollbar listener.
protected JScrollPanescrollpane
The Scrollpane for which the UI is provided by this class.
protected PropertyChangeListenerspPropertyChangeListener
The scrollpane property change listener.
protected ChangeListenerviewportChangeListener
The viewport listener.
protected ChangeListenervsbChangeListener
The vertical scrollbar listener.
Method Summary
protected ChangeListenercreateHSBChangeListener()
Creates and returns the change listener for the horizontal scrollbar.
protected MouseWheelListenercreateMouseWheelListener()
Creates and returns the mouse wheel listener for the scrollpane.
protected PropertyChangeListenercreatePropertyChangeListener()
Creates and returns the property change listener for the scrollpane.
static ComponentUIcreateUI(JComponent c)
protected ChangeListenercreateViewportChangeListener()
Creates and returns the change listener for the viewport.
protected ChangeListenercreateVSBChangeListener()
Creates and returns the change listener for the vertical scrollbar.
DimensiongetMinimumSize(JComponent c)
protected voidinstallDefaults(JScrollPane p)
protected voidinstallKeyboardActions(JScrollPane sp)
Installs additional keyboard actions on the scrollpane.
protected voidinstallListeners(JScrollPane sp)
Installs the listeners on the scrollbars, the viewport and the scrollpane.
voidinstallUI(JComponent c)
voidpaint(Graphics g, JComponent c)
protected voidsyncScrollPaneWithViewport()
Synchronizes the scrollbar and header settings positions and extent with the viewport's view position and extent.
protected voiduninstallDefaults(JScrollPane p)
protected voiduninstallKeyboardActions(JScrollPane sp)
Uninstalls all keyboard actions from the JScrollPane that have been installed by {@link #installKeyboardActions}.
protected voiduninstallListeners(JComponent c)
Uninstalls all the listeners that have been installed in {@link #installListeners(JScrollPane)}.
voiduninstallUI(JComponent c)
protected voidupdateColumnHeader(PropertyChangeEvent ev)
Receives notification when the columnHeader property has changed on the scrollpane.
protected voidupdateRowHeader(PropertyChangeEvent ev)
Receives notification when the rowHeader property has changed on the scrollpane.
protected voidupdateScrollBarDisplayPolicy(PropertyChangeEvent ev)
Receives notification when the scrollBarDisplayPolicy property has changed on the scrollpane.
protected voidupdateViewport(PropertyChangeEvent ev)
Receives notification when the viewport property has changed on the scrollpane.

Field Detail

hsbChangeListener

protected ChangeListener hsbChangeListener
The horizontal scrollbar listener.

scrollpane

protected JScrollPane scrollpane
The Scrollpane for which the UI is provided by this class.

spPropertyChangeListener

protected PropertyChangeListener spPropertyChangeListener
The scrollpane property change listener.

viewportChangeListener

protected ChangeListener viewportChangeListener
The viewport listener.

vsbChangeListener

protected ChangeListener vsbChangeListener
The vertical scrollbar listener.

Method Detail

createHSBChangeListener

protected ChangeListener createHSBChangeListener()
Creates and returns the change listener for the horizontal scrollbar.

Returns: the change listener for the horizontal scrollbar

createMouseWheelListener

protected MouseWheelListener createMouseWheelListener()
Creates and returns the mouse wheel listener for the scrollpane.

Returns: the mouse wheel listener for the scrollpane

Since: 1.4

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()
Creates and returns the property change listener for the scrollpane.

Returns: the property change listener for the scrollpane

createUI

public static ComponentUI createUI(JComponent c)

createViewportChangeListener

protected ChangeListener createViewportChangeListener()
Creates and returns the change listener for the viewport.

Returns: the change listener for the viewport

createVSBChangeListener

protected ChangeListener createVSBChangeListener()
Creates and returns the change listener for the vertical scrollbar.

Returns: the change listener for the vertical scrollbar

getMinimumSize

public Dimension getMinimumSize(JComponent c)

installDefaults

protected void installDefaults(JScrollPane p)

installKeyboardActions

protected void installKeyboardActions(JScrollPane sp)
Installs additional keyboard actions on the scrollpane. This is a hook method provided to subclasses in order to install their own keyboard actions.

Parameters: sp the scrollpane to install keyboard actions on

installListeners

protected void installListeners(JScrollPane sp)
Installs the listeners on the scrollbars, the viewport and the scrollpane.

Parameters: sp the scrollpane on which to install the listeners

installUI

public void installUI(JComponent c)

paint

public void paint(Graphics g, JComponent c)

syncScrollPaneWithViewport

protected void syncScrollPaneWithViewport()
Synchronizes the scrollbar and header settings positions and extent with the viewport's view position and extent.

uninstallDefaults

protected void uninstallDefaults(JScrollPane p)

uninstallKeyboardActions

protected void uninstallKeyboardActions(JScrollPane sp)
Uninstalls all keyboard actions from the JScrollPane that have been installed by {@link #installKeyboardActions}. This is a hook method provided to subclasses to add their own keyboard actions.

Parameters: sp the scrollpane to uninstall keyboard actions from

uninstallListeners

protected void uninstallListeners(JComponent c)
Uninstalls all the listeners that have been installed in {@link #installListeners(JScrollPane)}.

Parameters: c the scrollpane from which to uninstall the listeners

uninstallUI

public void uninstallUI(JComponent c)

updateColumnHeader

protected void updateColumnHeader(PropertyChangeEvent ev)
Receives notification when the columnHeader property has changed on the scrollpane.

Parameters: ev the property change event

updateRowHeader

protected void updateRowHeader(PropertyChangeEvent ev)
Receives notification when the rowHeader property has changed on the scrollpane.

Parameters: ev the property change event

updateScrollBarDisplayPolicy

protected void updateScrollBarDisplayPolicy(PropertyChangeEvent ev)
Receives notification when the scrollBarDisplayPolicy property has changed on the scrollpane.

Parameters: ev the property change event

updateViewport

protected void updateViewport(PropertyChangeEvent ev)
Receives notification when the viewport property has changed on the scrollpane. This method sets removes the viewportChangeListener from the old viewport and adds it to the new viewport.

Parameters: ev the property change event