Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ScrollPaneUI
javax.swing.plaf.basic.BasicScrollPaneUI
JScrollPane
component.
Nested Class Summary | |
class |
|
protected class |
|
class |
|
class |
|
class |
|
Field Summary | |
protected ChangeListener |
|
protected JScrollPane |
|
protected PropertyChangeListener |
|
protected ChangeListener |
|
protected ChangeListener |
|
Method Summary | |
protected ChangeListener |
|
protected MouseWheelListener |
|
protected PropertyChangeListener |
|
static ComponentUI |
|
protected ChangeListener |
|
protected ChangeListener |
|
Dimension |
|
protected void | |
protected void |
|
protected void |
|
void |
|
void |
|
protected void |
|
protected void | |
protected void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
Methods inherited from class javax.swing.plaf.ComponentUI | |
contains , createUI , getAccessibleChild , getAccessibleChildrenCount , getMaximumSize , getMinimumSize , getPreferredSize , installUI , paint , uninstallUI , update |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected JScrollPane scrollpane
The Scrollpane for which the UI is provided by this class.
protected PropertyChangeListener spPropertyChangeListener
The scrollpane property change listener.
protected ChangeListener createHSBChangeListener()
Creates and returns the change listener for the horizontal scrollbar.
- Returns:
- the change listener for the horizontal scrollbar
protected MouseWheelListener createMouseWheelListener()
Creates and returns the mouse wheel listener for the scrollpane.
- Returns:
- the mouse wheel listener for the scrollpane
- Since:
- 1.4
protected PropertyChangeListener createPropertyChangeListener()
Creates and returns the property change listener for the scrollpane.
- Returns:
- the property change listener for the scrollpane
public static ComponentUI createUI(JComponent c)
Creates a delegate object for the specified component. Users should use thecreateUI
method of a suitable subclass. The implementation ofComponentUI
always throws an error.
- Overrides:
- createUI in interface ComponentUI
- Parameters:
c
- the component for which a UI delegate is requested.
protected ChangeListener createVSBChangeListener()
Creates and returns the change listener for the vertical scrollbar.
- Returns:
- the change listener for the vertical scrollbar
protected ChangeListener createViewportChangeListener()
Creates and returns the change listener for the viewport.
- Returns:
- the change listener for the viewport
public Dimension getMinimumSize(JComponent c)
Determines the minimum size of a component. The default implementation callsComponentUI.getPreferredSize(JComponent)
, but subclasses might want to override this.
- Overrides:
- getMinimumSize in interface ComponentUI
- Parameters:
c
- the component for which this delegate performs services.
- Returns:
- the minimum size, or
null
to indicate thatc
’s layout manager should be asked to calculate the minimum size.
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
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
public void installUI(JComponent c)
Sets up the specified component so it conforms the the design guidelines of the implemented look and feel. When the look and feel changes, aComponentUI
delegate is created. The delegate object then receives aninstallUI
message.This method should perform the following tasks:
- Set visual properties such as borders, fonts, colors, or icons. However, no change should be performed for those properties whose values have been directly set by the client application. To allow the distinction, LookAndFeels are expected to use values that implement the
UIResource
marker interface, such asBorderUIResource
orColorUIResource
.- If necessary, install a
LayoutManager
.- Embed custom sub-components. For instance, the UI delegate for a
JSplitPane
might install a special component for the divider.- Register event listeners.
- Set up properties related to keyborad navigation, such as mnemonics or focus traversal policies.
- Overrides:
- installUI in interface ComponentUI
- Parameters:
c
- the component for which this delegate will provide services.
public void paint(Graphics g, JComponent c)
Paints the component according to the design guidelines of the look and feel. Most subclasses will want to override this method.
- Overrides:
- paint in interface ComponentUI
- Parameters:
g
- the graphics for painting.c
- the component for which this delegate performs services.
protected void syncScrollPaneWithViewport()
Synchronizes the scrollbar and header settings positions and extent with the viewport's view position and extent.
protected void uninstallKeyboardActions(JScrollPane sp)
Uninstalls all keyboard actions from the JScrollPane that have been installed byinstallKeyboardActions(JScrollPane)
. This is a hook method provided to subclasses to add their own keyboard actions.
- Parameters:
sp
- the scrollpane to uninstall keyboard actions from
protected void uninstallListeners(JComponent c)
Uninstalls all the listeners that have been installed ininstallListeners(JScrollPane)
.
- Parameters:
c
- the scrollpane from which to uninstall the listeners
public void uninstallUI(JComponent c)
Puts the specified component into the state it had beforeComponentUI.installUI(JComponent)
was called.
- Overrides:
- uninstallUI in interface ComponentUI
- Parameters:
c
- the component for which this delegate has provided services.
protected void updateColumnHeader(PropertyChangeEvent ev)
Receives notification when thecolumnHeader
property has changed on the scrollpane.
- Parameters:
ev
- the property change event
protected void updateRowHeader(PropertyChangeEvent ev)
Receives notification when therowHeader
property has changed on the scrollpane.
- Parameters:
ev
- the property change event
protected void updateScrollBarDisplayPolicy(PropertyChangeEvent ev)
Receives notification when thescrollBarDisplayPolicy
property has changed on the scrollpane.
- Parameters:
ev
- the property change event
protected void updateViewport(PropertyChangeEvent ev)
Receives notification when theviewport
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