APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.metal

public Class MetalScrollBarUI

extends BasicScrollBarUI
Class Inheritance
Imports
java.awt.Color, .Dimension, .Graphics, .Rectangle, java.beans.PropertyChangeEvent, .PropertyChangeListener, javax.swing.JButton, .JComponent, .JScrollBar, .UIManager, javax.swing.plaf.ComponentUI, javax.swing.plaf.basic.BasicScrollBarUI

Implementation of ScrollBarUI for the Metal Look and Feel
Authors
Tom Santos, Steve Wilson

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private MetalBumps
bumps

The metal bumps.

private static Color
protected MetalScrollButton
decreaseButton

The decrease button.

public static final String
FREE_STANDING_PROP

The property JScrollBar.isFreeStanding.

private static Color
protected MetalScrollButton
increaseButton

The increase button.

protected boolean
isFreeStanding

The value of the property JScrollBar.isFreeStanding.

protected int
private static Color
private static Color
private static Color
private static Color
Inherited from javax.swing.plaf.basic.BasicScrollBarUI:
buttonListenerdecrButtonDECREASE_HIGHLIGHTdecrGapincrButtonINCREASE_HIGHLIGHTincrGapisDraggingmaximumThumbSizeminimumThumbSizemodelListenerNO_HIGHLIGHTpropertyChangeListenerscrollbarscrollListenerscrollTimerthumbDarkShadowColorthumbLightShadowColorthumbRecttrackColortrackHighlighttrackHighlightColortrackListenertrackRect

Constructor Summary

AccessConstructor and Description
public
MetalScrollBarUI()

Constructs a MetalScrollBarUI.

Method Summary

Modifier and TypeMethod and Description
protected void
protected JButton
createDecreaseButton(int orientation)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.createDecreaseButton.

Returns the view that represents the decrease view.

protected JButton
createIncreaseButton(int orientation)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.createIncreaseButton.

Returns the view that represents the increase view.

protected PropertyChangeListener
public static ComponentUI

Returns:

a new MetalScrollBarUI instance
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.basic.BasicScrollBarUI.createUI.

Constructs a new MetalScrollBarUI instance.

protected Dimension
getMinimumThumbSize()

Overrides javax.swing.plaf.basic.BasicScrollBarUI.getMinimumThumbSize.

Returns the smallest acceptable size for the thumb.

public Dimension
getPreferredSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.getPreferredSize.

A vertical scrollbar's preferred width is the maximum of preferred widths of the (non null) increment/decrement buttons, and the minimum width of the thumb.

protected void
protected void
private void
protected void
protected void
protected void
setThumbBounds(int x, int y, int width, int height)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.setThumbBounds.

This is overridden only to increase the invalid area.

Inherited from javax.swing.plaf.basic.BasicScrollBarUI:
addLayoutComponentcreateArrowButtonListenercreateModelListenercreateScrollListenercreateTrackListenergetMaximumSizegetMaximumThumbSizegetSupportsAbsolutePositioninggetThumbBoundsgetTrackBoundsinstallComponentsinstallKeyboardActionsinstallUIisThumbRolloverlayoutContainerlayoutHScrollbarlayoutVScrollbarminimumLayoutSizepaintpaintDecreaseHighlightpaintIncreaseHighlightpreferredLayoutSizeremoveLayoutComponentscrollByBlockscrollByUnitsetThumbRolloveruninstallComponentsuninstallDefaultsuninstallKeyboardActionsuninstallListenersuninstallUI

Field Detail

bumpsback to summary
private MetalBumps bumps

The metal bumps.

darkShadowColorback to summary
private static Color darkShadowColor
decreaseButtonback to summary
protected MetalScrollButton decreaseButton

The decrease button.

FREE_STANDING_PROPback to summary
public static final String FREE_STANDING_PROP

The property JScrollBar.isFreeStanding.

highlightColorback to summary
private static Color highlightColor
increaseButtonback to summary
protected MetalScrollButton increaseButton

The increase button.

isFreeStandingback to summary
protected boolean isFreeStanding

The value of the property JScrollBar.isFreeStanding.

scrollBarWidthback to summary
protected int scrollBarWidth

Hides javax.swing.plaf.basic.BasicScrollBarUI.scrollBarWidth.

The width of the scroll bar.

shadowColorback to summary
private static Color shadowColor
thumbColorback to summary
private static Color thumbColor

Hides javax.swing.plaf.basic.BasicScrollBarUI.thumbColor.

thumbHighlightColorback to summary
private static Color thumbHighlightColor

Hides javax.swing.plaf.basic.BasicScrollBarUI.thumbHighlightColor.

thumbShadowback to summary
private static Color thumbShadow

Constructor Detail

MetalScrollBarUIback to summary
public MetalScrollBarUI()

Constructs a MetalScrollBarUI.

Method Detail

configureScrollBarColorsback to summary
protected void configureScrollBarColors()

Overrides javax.swing.plaf.basic.BasicScrollBarUI.configureScrollBarColors.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.configureScrollBarColors.

Configures the scroll bar colors.

createDecreaseButtonback to summary
protected JButton createDecreaseButton(int orientation)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.createDecreaseButton.

Returns the view that represents the decrease view.

createIncreaseButtonback to summary
protected JButton createIncreaseButton(int orientation)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.createIncreaseButton.

Returns the view that represents the increase view.

createPropertyChangeListenerback to summary
protected PropertyChangeListener createPropertyChangeListener()

Overrides javax.swing.plaf.basic.BasicScrollBarUI.createPropertyChangeListener.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.createPropertyChangeListener.

Creates a property change listener.

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.basic.BasicScrollBarUI.createUI.

Constructs a new MetalScrollBarUI instance.

Parameters
c:JComponent

a component

Returns:ComponentUI

a new MetalScrollBarUI instance

getMinimumThumbSizeback to summary
protected Dimension getMinimumThumbSize()

Overrides javax.swing.plaf.basic.BasicScrollBarUI.getMinimumThumbSize.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.getMinimumThumbSize.

Returns the smallest acceptable size for the thumb. If the scrollbar becomes so small that this size isn't available, the thumb will be hidden.

Warning

the value returned by this method should not be be modified, it's a shared static constant.

getPreferredSizeback to summary
public Dimension getPreferredSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.getPreferredSize.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.getPreferredSize.

A vertical scrollbar's preferred width is the maximum of preferred widths of the (non null) increment/decrement buttons, and the minimum width of the thumb. The preferred height is the sum of the preferred heights of the same parts. The basis for the preferred size of a horizontal scrollbar is similar.

The preferredSize is only computed once, subsequent calls to this method just return a cached size.

installDefaultsback to summary
protected void installDefaults()

Overrides javax.swing.plaf.basic.BasicScrollBarUI.installDefaults.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.installDefaults.

Installs the defaults.

installListenersback to summary
protected void installListeners()

Overrides javax.swing.plaf.basic.BasicScrollBarUI.installListeners.

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

Installs the listeners.

oceanPaintThumbback to summary
private void oceanPaintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
paintThumbback to summary
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.paintThumb.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.paintThumb.

Paints the thumb.

paintTrackback to summary
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.paintTrack.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.paintTrack.

Paints the track.

setThumbBoundsback to summary
protected void setThumbBounds(int x, int y, int width, int height)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.setThumbBounds.

This is overridden only to increase the invalid area. This ensures that the "Shadow" below the thumb is invalidated

javax.swing.plaf.metal back to summary

pack-priv Class MetalScrollBarUI.ScrollBarListener

extends PropertyChangeHandler
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
protected void
protected void

Constructor Detail

ScrollBarListenerback to summary
pack-priv ScrollBarListener()

Method Detail

handlePropertyChangeback to summary
public void handlePropertyChange(Object newValue)
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Overrides javax.swing.plaf.basic.BasicScrollBarUI.PropertyChangeHandler.propertyChange.

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from javax.swing.plaf.basic.BasicScrollBarUI.PropertyChangeHandler.propertyChange.

This method gets called when a bound property is changed.

toFlushback to summary
protected void toFlush()
toFreeStandingback to summary
protected void toFreeStanding()