javax.swing.plaf.metal
public class MetalScrollBarUI extends BasicScrollBarUI
Field Summary | |
---|---|
protected MetalScrollButton | decreaseButton The button that decreases the value in the scroll bar. |
static String | FREE_STANDING_PROP The name for the 'free standing' property. |
protected MetalScrollButton | increaseButton The button that increases the value in the scroll bar. |
protected boolean | isFreeStanding
A flag that indicates whether the scroll bar is "free standing", which
means it has complete borders and can be used anywhere in the UI. |
protected int | scrollBarWidth
The scroll bar width. |
Constructor Summary | |
---|---|
MetalScrollBarUI()
Constructs a new instance of MetalScrollBarUI , with no
specific initialisation. |
Method Summary | |
---|---|
protected JButton | createDecreaseButton(int orientation)
Creates a new button to use as the control at the lower end of the
{@link JScrollBar}. |
protected JButton | createIncreaseButton(int orientation)
Creates a new button to use as the control at the upper end of the
{@link JScrollBar}. |
protected PropertyChangeListener | createPropertyChangeListener()
Creates a property change listener for the delegate to use. |
static ComponentUI | createUI(JComponent component)
Returns a new instance of MetalScrollBarUI .
|
protected Dimension | getMinimumThumbSize()
Returns the minimum thumb size. |
Dimension | getPreferredSize(JComponent c)
Returns the preferredSize for the specified scroll bar.
|
protected void | installDefaults()
Installs the defaults. |
protected void | paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
Paints the slider button of the ScrollBar.
|
protected void | paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
Paints the track for the scrollbar.
|
MetalScrollBarUI
, with no
specific initialisation.ScrollBar.width
setting in the UI defaults.
Parameters: orientation the orientation of the button ({@link #NORTH}, {@link #SOUTH}, {@link #EAST} or {@link #WEST}).
Returns: The button.
ScrollBar.width
setting in the UI defaults.
Parameters: orientation the orientation of the button ({@link #NORTH}, {@link #SOUTH}, {@link #EAST} or {@link #WEST}).
Returns: The button.
JScrollBar.isFreeStanding
property.
Returns: A property change listener.
MetalScrollBarUI
.
Parameters: component the component for which we return an UI instance
Returns: An instance of MetalScrollBarUI
17 x 17
pixels, whereas for a non free
standing scroll bar the minimum size is 15 x 15
pixels.
Returns: The minimum thumb size.
preferredSize
for the specified scroll bar.
For a vertical scrollbar the height is the sum of the preferred heights
of the buttons plus 30
. The width is fetched from the
UIManager
property ScrollBar.width
.
For horizontal scrollbars the width is the sum of the preferred widths
of the buttons plus 30
. The height is fetched from the
UIManager
property ScrollBar.height
.
Parameters: c the scrollbar for which to calculate the preferred size
Returns: the preferredSize
for the specified scroll bar
Parameters: g the Graphics context to use c the JComponent on which we paint thumbBounds the rectangle that is the slider button
Parameters: g the graphics device. c the component. trackBounds the track bounds.