java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.ScrollPaneUI javax.swing.plaf.basic.BasicScrollPaneUI
public class BasicScrollPaneUI
A default L&F implementation of ScrollPaneUI.
Nested Class Summary | |
---|---|
class |
BasicScrollPaneUI.HSBChangeListener
Horizontal scrollbar listener. |
protected class |
BasicScrollPaneUI.MouseWheelHandler
MouseWheelHandler is an inner class which implements the MouseWheelListener interface. |
class |
BasicScrollPaneUI.PropertyChangeHandler
|
class |
BasicScrollPaneUI.ViewportChangeHandler
Listener for viewport events. |
class |
BasicScrollPaneUI.VSBChangeListener
Vertical scrollbar listener. |
Field Summary | |
---|---|
protected ChangeListener |
hsbChangeListener
|
protected JScrollPane |
scrollpane
|
protected PropertyChangeListener |
spPropertyChangeListener
|
protected ChangeListener |
viewportChangeListener
|
protected ChangeListener |
vsbChangeListener
|
Fields inherited from interface javax.swing. ScrollPaneConstants |
---|
COLUMN_HEADER , HORIZONTAL_SCROLLBAR , HORIZONTAL_SCROLLBAR_ALWAYS , HORIZONTAL_SCROLLBAR_AS_NEEDED , HORIZONTAL_SCROLLBAR_NEVER , HORIZONTAL_SCROLLBAR_POLICY , LOWER_LEADING_CORNER , LOWER_LEFT_CORNER , LOWER_RIGHT_CORNER , LOWER_TRAILING_CORNER , ROW_HEADER , UPPER_LEADING_CORNER , UPPER_LEFT_CORNER , UPPER_RIGHT_CORNER , UPPER_TRAILING_CORNER , VERTICAL_SCROLLBAR , VERTICAL_SCROLLBAR_ALWAYS , VERTICAL_SCROLLBAR_AS_NEEDED , VERTICAL_SCROLLBAR_NEVER , VERTICAL_SCROLLBAR_POLICY , VIEWPORT |
Constructor Summary | |
---|---|
BasicScrollPaneUI
() |
Method Summary | |
---|---|
protected ChangeListener |
createHSBChangeListener
() |
protected MouseWheelListener |
createMouseWheelListener
() Creates an instance of MouseWheelListener, which is added to the JScrollPane by installUI(). |
protected PropertyChangeListener |
createPropertyChangeListener
() Creates an instance of PropertyChangeListener that's added to the JScrollPane by installUI(). |
static ComponentUI |
createUI
(
JComponent
x) |
protected ChangeListener |
createViewportChangeListener
() |
protected ChangeListener |
createVSBChangeListener
() |
int |
getBaseline
(
JComponent
Returns the baseline. |
Component.BaselineResizeBehavior |
getBaselineResizeBehavior
(
JComponent
Returns an enum indicating how the baseline of the component changes as the size changes. |
Dimension |
getMaximumSize
(
JComponent
c) Returns the specified component's maximum size appropriate for the look and feel. |
protected void |
installDefaults
(
JScrollPane
scrollpane) |
protected void |
installKeyboardActions
(
JScrollPane
c) |
protected void |
installListeners
(
JScrollPane
c) |
void |
installUI
(
JComponent
x) Configures the specified component appropriate for the look and feel. |
void |
paint
(
Graphics
g,
JComponent
c) Paints the specified component appropriate for the look and feel. |
protected void |
syncScrollPaneWithViewport
() |
protected void |
uninstallDefaults
(
JScrollPane
c) |
protected void |
uninstallKeyboardActions
(
JScrollPane
c) |
protected void |
uninstallListeners
(
JComponent
c) |
void |
uninstallUI
(
JComponent
c) Reverses configuration which was done on the specified component during installUI. |
protected void |
updateColumnHeader
(
PropertyChangeEvent
e) |
protected void |
updateRowHeader
(
PropertyChangeEvent
e) |
protected void |
updateScrollBarDisplayPolicy
(
PropertyChangeEvent
e) |
protected void |
updateViewport
(
PropertyChangeEvent
e) |
Methods inherited from class javax.swing.plaf. ComponentUI |
---|
contains , getAccessibleChild , getAccessibleChildrenCount , getMinimumSize , getPreferredSize , update |
Methods inherited from class java.lang. Object |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Field Detail |
---|
protected JScrollPane scrollpane
protected ChangeListener vsbChangeListener
protected ChangeListener hsbChangeListener
protected ChangeListener viewportChangeListener
protected PropertyChangeListener spPropertyChangeListener
Constructor Detail |
---|
public BasicScrollPaneUI()
Method Detail |
---|
public static ComponentUI createUI(JComponent x)
public void paint(Graphics g, JComponent c)
public Dimension getMaximumSize(JComponent c)
protected void installDefaults(JScrollPane scrollpane)
protected void installListeners(JScrollPane c)
protected void installKeyboardActions(JScrollPane c)
public void installUI(JComponent x)
protected void uninstallDefaults(JScrollPane c)
protected void uninstallListeners(JComponent c)
protected void uninstallKeyboardActions(JScrollPane c)
public void uninstallUI(JComponent c)
protected void syncScrollPaneWithViewport()
public int getBaseline ( JComponent c, int width, int height)
public Component.BaselineResizeBehaviorgetBaselineResizeBehavior ( JComponent c)
protected ChangeListener createViewportChangeListener()
protected ChangeListener createHSBChangeListener()
protected ChangeListener createVSBChangeListener()
protected MouseWheelListener createMouseWheelListener()
protected void updateScrollBarDisplayPolicy(PropertyChangeEvent e)
protected void updateViewport(PropertyChangeEvent e)
protected void updateRowHeader(PropertyChangeEvent e)
protected void updateColumnHeader(PropertyChangeEvent e)
protected PropertyChangeListener createPropertyChangeListener()
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); } } }