public class BasicScrollPaneUI extends javax.swing.plaf.ScrollPaneUI implements javax.swing.ScrollPaneConstants
JScrollPane component.| Modifier and Type | Class and Description |
|---|---|
class |
BasicScrollPaneUI.HSBChangeListener
Listens for changes in the state of the horizontal scrollbar's model and
updates the scrollpane accordingly.
|
protected class |
BasicScrollPaneUI.MouseWheelHandler
Listens for mouse wheel events and update the scrollpane accordingly.
|
class |
BasicScrollPaneUI.PropertyChangeHandler
Listens for property changes on the scrollpane and update the view
accordingly.
|
class |
BasicScrollPaneUI.ViewportChangeHandler
Listens for changes of the viewport's extent size and updates the
scrollpane accordingly.
|
class |
BasicScrollPaneUI.VSBChangeListener
Listens for changes in the state of the vertical scrollbar's model and
updates the scrollpane accordingly.
|
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.event.ChangeListener |
hsbChangeListener
The horizontal scrollbar listener.
|
protected javax.swing.JScrollPane |
scrollpane
The Scrollpane for which the UI is provided by this class.
|
protected java.beans.PropertyChangeListener |
spPropertyChangeListener
The scrollpane property change listener.
|
protected javax.swing.event.ChangeListener |
viewportChangeListener
The viewport listener.
|
protected javax.swing.event.ChangeListener |
vsbChangeListener
The vertical scrollbar listener.
|
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 and Description |
|---|
BasicScrollPaneUI() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.swing.event.ChangeListener |
createHSBChangeListener()
Creates and returns the change listener for the horizontal scrollbar.
|
protected java.awt.event.MouseWheelListener |
createMouseWheelListener()
Creates and returns the mouse wheel listener for the scrollpane.
|
protected java.beans.PropertyChangeListener |
createPropertyChangeListener()
Creates and returns the property change listener for the scrollpane.
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c) |
protected javax.swing.event.ChangeListener |
createViewportChangeListener()
Creates and returns the change listener for the viewport.
|
protected javax.swing.event.ChangeListener |
createVSBChangeListener()
Creates and returns the change listener for the vertical scrollbar.
|
java.awt.Dimension |
getMinimumSize(javax.swing.JComponent c)
Determines the minimum size of a component.
|
protected void |
installDefaults(javax.swing.JScrollPane p) |
protected void |
installKeyboardActions(javax.swing.JScrollPane sp)
Installs additional keyboard actions on the scrollpane.
|
protected void |
installListeners(javax.swing.JScrollPane sp)
Installs the listeners on the scrollbars, the viewport and the scrollpane.
|
void |
installUI(javax.swing.JComponent c)
Sets up the specified component so it conforms the the design
guidelines of the implemented look and feel.
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints the component according to the design guidelines
of the look and feel.
|
protected void |
syncScrollPaneWithViewport()
Synchronizes the scrollbar and header settings positions and extent
with the viewport's view position and extent.
|
protected void |
uninstallDefaults(javax.swing.JScrollPane p) |
protected void |
uninstallKeyboardActions(javax.swing.JScrollPane sp)
Uninstalls all keyboard actions from the JScrollPane that have been
installed by
installKeyboardActions(javax.swing.JScrollPane). |
protected void |
uninstallListeners(javax.swing.JComponent c)
Uninstalls all the listeners that have been installed in
installListeners(JScrollPane). |
void |
uninstallUI(javax.swing.JComponent c)
Puts the specified component into the state it had before
ComponentUI.installUI(javax.swing.JComponent) was called. |
protected void |
updateColumnHeader(java.beans.PropertyChangeEvent ev)
Receives notification when the
columnHeader property has
changed on the scrollpane. |
protected void |
updateRowHeader(java.beans.PropertyChangeEvent ev)
Receives notification when the
rowHeader property has changed
on the scrollpane. |
protected void |
updateScrollBarDisplayPolicy(java.beans.PropertyChangeEvent ev)
Receives notification when the
scrollBarDisplayPolicy
property has changed on the scrollpane. |
protected void |
updateViewport(java.beans.PropertyChangeEvent ev)
Receives notification when the
viewport property has changed
on the scrollpane. |
protected javax.swing.JScrollPane scrollpane
protected javax.swing.event.ChangeListener hsbChangeListener
protected javax.swing.event.ChangeListener vsbChangeListener
protected javax.swing.event.ChangeListener viewportChangeListener
protected java.beans.PropertyChangeListener spPropertyChangeListener
public BasicScrollPaneUI()
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
protected void installDefaults(javax.swing.JScrollPane p)
protected void uninstallDefaults(javax.swing.JScrollPane p)
public void installUI(javax.swing.JComponent c)
javax.swing.plaf.ComponentUIComponentUI delegate is created.
The delegate object then receives an installUI
message.
This method should perform the following tasks:
UIResource marker
interface, such as BorderUIResource or ColorUIResource.LayoutManager.JSplitPane might install a special
component for the divider.installUI in class javax.swing.plaf.ComponentUIc - the component for which this delegate will provide
services.ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()protected void installListeners(javax.swing.JScrollPane sp)
sp - the scrollpane on which to install the listenersprotected void installKeyboardActions(javax.swing.JScrollPane sp)
sp - the scrollpane to install keyboard actions onprotected void uninstallKeyboardActions(javax.swing.JScrollPane sp)
installKeyboardActions(javax.swing.JScrollPane). This is a hook method
provided to subclasses to add their own keyboard actions.sp - the scrollpane to uninstall keyboard actions fromprotected javax.swing.event.ChangeListener createHSBChangeListener()
protected javax.swing.event.ChangeListener createVSBChangeListener()
protected javax.swing.event.ChangeListener createViewportChangeListener()
protected java.beans.PropertyChangeListener createPropertyChangeListener()
protected java.awt.event.MouseWheelListener createMouseWheelListener()
public void uninstallUI(javax.swing.JComponent c)
javax.swing.plaf.ComponentUIComponentUI.installUI(javax.swing.JComponent) was called.uninstallUI in class javax.swing.plaf.ComponentUIc - the component for which this delegate has provided
services.ComponentUI.installUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()protected void uninstallListeners(javax.swing.JComponent c)
installListeners(JScrollPane).c - the scrollpane from which to uninstall the listenerspublic java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
javax.swing.plaf.ComponentUIComponentUI.getPreferredSize(javax.swing.JComponent), but subclasses
might want to override this.getMinimumSize in class javax.swing.plaf.ComponentUIc - the component for which this delegate performs services.null to indicate that
c’s layout manager should be asked
to calculate the minimum size.public void paint(java.awt.Graphics g, javax.swing.JComponent c)
javax.swing.plaf.ComponentUIpaint in class javax.swing.plaf.ComponentUIg - the graphics for painting.c - the component for which this delegate performs
services.protected void syncScrollPaneWithViewport()
protected void updateColumnHeader(java.beans.PropertyChangeEvent ev)
columnHeader property has
changed on the scrollpane.ev - the property change eventprotected void updateRowHeader(java.beans.PropertyChangeEvent ev)
rowHeader property has changed
on the scrollpane.ev - the property change eventprotected void updateScrollBarDisplayPolicy(java.beans.PropertyChangeEvent ev)
scrollBarDisplayPolicy
property has changed on the scrollpane.ev - the property change eventprotected void updateViewport(java.beans.PropertyChangeEvent ev)
viewport property has changed
on the scrollpane.
This method sets removes the viewportChangeListener from the old viewport
and adds it to the new viewport.ev - the property change event