Top Description Fields Constructors Methods
javax.swing.plaf.metal

public Class MetalScrollPaneUI

extends BasicScrollPaneUI
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
javax.swing.*, javax.swing.event.*, javax.swing.border.*, javax.swing.plaf.*, javax.swing.plaf.basic.*, java.awt.*, java.beans.*, java.awt.event.*

A Metal L&F implementation of ScrollPaneUI.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Steve Wilson

Field Summary

Modifier and TypeField and Description
private PropertyChangeListener
Inherited from javax.swing.plaf.basic.BasicScrollPaneUI:
hsbChangeListenerscrollpanespPropertyChangeListenerviewportChangeListenervsbChangeListener

Constructor Summary

AccessConstructor and Description
public
MetalScrollPaneUI()

Constructs a MetalScrollPaneUI.

Method Summary

Modifier and TypeMethod and Description
protected PropertyChangeListener

Returns:

a new PropertyChangeListener for scroll bar swap events.
createScrollBarSwapListener
()

Returns a new PropertyChangeListener for scroll bar swap events.

public static ComponentUI

Returns:

a new MetalScrollPaneUI
createUI
(JComponent
a component
x
)

Hides javax.swing.plaf.basic.BasicScrollPaneUI.createUI.

Constructs a new MetalScrollPaneUI.
public void
installListeners(JScrollPane
an instance of JScrollPane
scrollPane
)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.installListeners.

Registers listeners.
public void
installUI(JComponent
the component where this UI delegate is being installed
c
)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.installUI.

Configures the specified component appropriately for the look and feel.
protected void
public void
uninstallListeners(JScrollPane
an instance of the JScrollPane
scrollPane
)

Deprecated - Replaced by uninstallListeners(JComponent)
public void
uninstallUI(JComponent
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
c
)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.
private void
updateScrollbarsFreeStanding()

If the border of the scrollpane is an instance of MetalBorders.ScrollPaneBorder, the client property FREE_STANDING_PROP of the scrollbars is set to false, otherwise it is set to true.

Inherited from javax.swing.plaf.basic.BasicScrollPaneUI:
createHSBChangeListenercreateMouseWheelListenercreatePropertyChangeListenercreateViewportChangeListenercreateVSBChangeListenergetBaselinegetBaselineResizeBehaviorgetMaximumSizeinstallDefaultsinstallKeyboardActionspaintsyncScrollPaneWithViewportuninstallDefaultsuninstallKeyboardActionsupdateColumnHeaderupdateRowHeaderupdateScrollBarDisplayPolicyupdateViewport

Field Detail

scrollBarSwapListenerback to summary
private PropertyChangeListener scrollBarSwapListener

Constructor Detail

MetalScrollPaneUIback to summary
public MetalScrollPaneUI()

Constructs a MetalScrollPaneUI.

Method Detail

createScrollBarSwapListenerback to summary
protected PropertyChangeListener createScrollBarSwapListener()

Returns a new PropertyChangeListener for scroll bar swap events.

Returns:PropertyChangeListener

a new PropertyChangeListener for scroll bar swap events.

createUIback to summary
public static ComponentUI createUI(JComponent x)

Hides javax.swing.plaf.basic.BasicScrollPaneUI.createUI.

Constructs a new MetalScrollPaneUI.

Parameters
x:JComponent

a component

Returns:ComponentUI

a new MetalScrollPaneUI

installListenersback to summary
public void installListeners(JScrollPane scrollPane)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.installListeners.

Doc from javax.swing.plaf.basic.BasicScrollPaneUI.installListeners.

Registers listeners.

Parameters
scrollPane:JScrollPane

an instance of JScrollPane

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.installUI.

Doc from javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel. This method is invoked when the 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:

  1. Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.
Parameters
c:JComponent

the component where this UI delegate is being installed

uninstallListenersback to summary
protected void uninstallListeners(JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.uninstallListeners.

Doc from javax.swing.plaf.basic.BasicScrollPaneUI.uninstallListeners.

Unregisters listeners.

Parameters
c:JComponent

a component

uninstallListenersback to summary
public void uninstallListeners(JScrollPane scrollPane)

Deprecated

- Replaced by uninstallListeners(JComponent)

Parameters
scrollPane:JScrollPane

an instance of the JScrollPane

Annotations
@Deprecated
uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.uninstallUI.

Doc from javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during 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:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.
Parameters
c:JComponent

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

updateScrollbarsFreeStandingback to summary
private void updateScrollbarsFreeStanding()

If the border of the scrollpane is an instance of MetalBorders.ScrollPaneBorder, the client property FREE_STANDING_PROP of the scrollbars is set to false, otherwise it is set to true.