public class BasicScrollPaneUI extends ScrollPaneUIimplements ScrollPaneConstants
| Modifier and Type | Class and Description |
|---|---|
class |
BasicScrollPaneUI
Horizontal scrollbar listener.
|
protected class |
BasicScrollPaneUI
MouseWheelHandler is an inner class which implements the MouseWheelListener interface.
|
class |
BasicScrollPaneUI
|
class |
BasicScrollPaneUI
Listener for viewport events.
|
class |
BasicScrollPaneUI
Vertical scrollbar listener.
|
| Modifier and Type | Field and Description |
|---|---|
protected ChangeListener |
hsbChangeListener
|
protected JScrollPane |
scrollpane
|
protected PropertyChangeListener |
spPropertyChangeListener
|
protected ChangeListener |
viewportChangeListener
|
protected ChangeListener |
vsbChangeListener
|
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 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
|
protected ChangeListener |
createViewportChangeListener()
|
protected ChangeListener |
createVSBChangeListener()
|
int |
getBaseline(JComponent
Returns the baseline.
|
Component |
getBaselineResizeBehavior(JComponent
Returns an enum indicating how the baseline of the component changes as the size changes.
|
Dimension |
getMaximumSize(JComponent
Returns the specified component's maximum size appropriate for the look and feel.
|
protected void |
installDefaults(JScrollPane
|
protected void |
installKeyboardActions(JScrollPane
|
protected void |
installListeners(JScrollPane
|
void |
installUI(JComponent
Configures the specified component appropriately for the look and feel.
|
void |
paint(Graphics
Paints the specified component appropriately for the look and feel.
|
protected void |
syncScrollPaneWithViewport()
|
protected void |
uninstallDefaults(JScrollPane
|
protected void |
uninstallKeyboardActions(JScrollPane
|
protected void |
uninstallListeners(JComponent
|
void |
uninstallUI(JComponent
Reverses configuration which was done on the specified component during
installUI.
|
protected void |
updateColumnHeader(PropertyChangeEvent
|
protected void |
updateRowHeader(PropertyChangeEvent
|
protected void |
updateScrollBarDisplayPolicy(PropertyChangeEvent
|
protected void |
updateViewport(PropertyChangeEvent
|
contains, getAccessibleChild, getAccessibleChildrenCount, getMinimumSize, getPreferredSize, updateprotected JScrollPanescrollpane
protected ChangeListenervsbChangeListener
protected ChangeListenerhsbChangeListener
protected ChangeListenerviewportChangeListener
protected PropertyChangeListenerspPropertyChangeListener
public static ComponentUIcreateUI(JComponent x)
public void paint(Graphicsg, JComponent c)
ComponentUI
ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified
Graphics object to render the content of the component.
paint in class
ComponentUI
g - the
Graphics context in which to paint
c - the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
public DimensiongetMaximumSize(JComponent c)
ComponentUI
null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes
getPreferredSize and returns that value.
getMaximumSize in class
ComponentUI
c - the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
JComponent.getMaximumSize() ,
LayoutManager2.maximumLayoutSize(java.awt.Container)
protected void installDefaults(JScrollPanescrollpane)
protected void installListeners(JScrollPanec)
protected void installKeyboardActions(JScrollPanec)
public void installUI(JComponentx)
ComponentUI
ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:
LayoutManager on the component if necessary. PropertyChangeListener on the component in order to detect and respond to component property changes appropriately. installUI in class
ComponentUI
x - the component where this UI delegate is being installed
ComponentUI.uninstallUI(javax.swing.JComponent) ,
JComponent.setUI(javax.swing.plaf.ComponentUI) ,
JComponent.updateUI()
protected void uninstallDefaults(JScrollPanec)
protected void uninstallListeners(JComponentc)
protected void uninstallKeyboardActions(JScrollPanec)
public void uninstallUI(JComponentc)
ComponentUI
installUI. This method is invoked when this
UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in
installUI, being careful to leave the
JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:
uninstallUI in class
ComponentUI
c - the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
ComponentUI.installUI(javax.swing.JComponent) ,
JComponent.updateUI()
protected void syncScrollPaneWithViewport()
public int getBaseline(JComponentc, int width, int height)
getBaseline in class
ComponentUI
c -
JComponent baseline is being requested for
width - the width to get the baseline for
height - the height to get the baseline for
NullPointerException - if
c is
null
IllegalArgumentException - if width or height is < 0
JComponent.getBaseline(int, int)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
getBaselineResizeBehavior in class
ComponentUI
c -
JComponent to return baseline resize behavior for
NullPointerException - if
c is
null
JComponent.getBaseline(int, int)
protected ChangeListenercreateViewportChangeListener()
protected ChangeListenercreateHSBChangeListener()
protected ChangeListenercreateVSBChangeListener()
protected MouseWheelListenercreateMouseWheelListener()
installUI(javax.swing.JComponent),
BasicScrollPaneUI.MouseWheelHandler
protected void updateScrollBarDisplayPolicy(PropertyChangeEvente)
protected void updateViewport(PropertyChangeEvente)
protected void updateRowHeader(PropertyChangeEvente)
protected void updateColumnHeader(PropertyChangeEvente)
protected PropertyChangeListenercreatePropertyChangeListener()
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);
}
}
}