This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.plaf.basic
class BasicScrollPaneUI

java.lang.Object extended by javax.swing.plaf.ComponentUI extended by javax.swing.plaf.ScrollPaneUI extended by javax.swing.plaf.basic.BasicScrollPaneUI
All Implemented Interfaces:
ScrollPaneConstants
Direct Known Subclasses:
MetalScrollPaneUI

public class BasicScrollPaneUI
extends ScrollPaneUI
implements ScrollPaneConstants

A default L&F implementation of ScrollPaneUI.


Nested Class Summary
 class

           Horizontal scrollbar listener.
protected class

           MouseWheelHandler is an inner class which implements the MouseWheelListener interface.
 class

          
 class

           Listener for viewport events.
 class

           Vertical scrollbar listener.
 
Field Summary
protected ChangeListener hsbChangeListener
          
protected JScrollPane scrollpane
          
protected PropertyChangeListener spPropertyChangeListener
          
protected ChangeListener viewportChangeListener
          
protected ChangeListener vsbChangeListener
          
 
Constructor Summary

          
 
Method Summary
protected ChangeListener

          
protected MouseWheelListener

          Creates an instance of MouseWheelListener, which is added to the JScrollPane by installUI().
protected PropertyChangeListener

          Creates an instance of PropertyChangeListener that's added to the JScrollPane by installUI().
static ComponentUI

          
protected ChangeListener

          
protected ChangeListener

          
 int
getBaseline(JComponent c, int width, int height)

          Returns the baseline.
 Component.BaselineResizeBehavior

          Returns an enum indicating how the baseline of the component changes as the size changes.
 Dimension

          Returns the specified component's maximum size appropriate for the look and feel.
protected void

          
protected void

          
protected void

          
 void

          Configures the specified component appropriate for the look and feel.
 void

          Paints the specified component appropriate for the look and feel.
protected void

          
protected void

          
protected void

          
protected void

          
 void

          Reverses configuration which was done on the specified component during installUI.
protected void

          
protected void

          
protected void

          
protected void

          
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hsbChangeListener

protected ChangeListener hsbChangeListener

scrollpane

protected JScrollPane scrollpane

spPropertyChangeListener

protected PropertyChangeListener spPropertyChangeListener

viewportChangeListener

protected ChangeListener viewportChangeListener

vsbChangeListener

protected ChangeListener vsbChangeListener
Constructor Detail

BasicScrollPaneUI

public BasicScrollPaneUI()
Method Detail

createHSBChangeListener

protected ChangeListener createHSBChangeListener()

createMouseWheelListener

protected MouseWheelListener createMouseWheelListener()
Creates an instance of MouseWheelListener, which is added to the JScrollPane by installUI(). The returned MouseWheelListener is used to handle mouse wheel-driven scrolling.

Returns:
MouseWheelListener which implements wheel-driven scrolling

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()
Creates an instance of PropertyChangeListener that's added to the JScrollPane by installUI(). Subclasses can override this method to return a custom PropertyChangeListener, e.g.
 class MyScrollPaneUI extends BasicScrollPaneUI {
    protected PropertyChangeListener createPropertyChangeListener() {
        return new MyPropertyChangeListener();
    }
    public class MyPropertyChangeListener extends PropertyChangeListener {
        public void propertyChange(PropertyChangeEvent e) {
            if (e.getPropertyName().equals("viewport")) {
                // do some extra work when the viewport changes
            }
            super.propertyChange(e);
        }
    }
 }
 


createUI

public static ComponentUI createUI(JComponent x)
Parameters:
x

createViewportChangeListener

protected ChangeListener createViewportChangeListener()

createVSBChangeListener

protected ChangeListener createVSBChangeListener()

getBaseline

public int getBaseline(JComponent c,
                       int width,
                       int height)
Returns the baseline.

Overrides:
getBaseline in class ComponentUI
Parameters:
c
width
height

getBaselineResizeBehavior

public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
Returns an enum indicating how the baseline of the component changes as the size changes.

Overrides:
getBaselineResizeBehavior in class ComponentUI
Parameters:
c

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Overrides:
getMaximumSize in class ComponentUI
Parameters:
c
Returns:
new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)

installDefaults

protected void installDefaults(JScrollPane scrollpane)
Parameters:
scrollpane

installKeyboardActions

protected void installKeyboardActions(JScrollPane c)
Parameters:
c

installListeners

protected void installListeners(JScrollPane c)
Parameters:
c

installUI

public void installUI(JComponent x)
Overrides:
installUI in class ComponentUI
Parameters:
x

paint

public void paint(Graphics g,
                  JComponent c)
Overrides:
paint in class ComponentUI
Parameters:
g
c

syncScrollPaneWithViewport

protected void syncScrollPaneWithViewport()

uninstallDefaults

protected void uninstallDefaults(JScrollPane c)
Parameters:
c

uninstallKeyboardActions

protected void uninstallKeyboardActions(JScrollPane c)
Parameters:
c

uninstallListeners

protected void uninstallListeners(JComponent c)
Parameters:
c

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class ComponentUI
Parameters:
c

updateColumnHeader

protected void updateColumnHeader(PropertyChangeEvent e)
Parameters:
e

updateRowHeader

protected void updateRowHeader(PropertyChangeEvent e)
Parameters:
e

updateScrollBarDisplayPolicy

protected void updateScrollBarDisplayPolicy(PropertyChangeEvent e)
Parameters:
e

updateViewport

protected void updateViewport(PropertyChangeEvent e)
Parameters:
e


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.