LayoutManager
, SwingConstants
public class MetalScrollBarUI extends BasicScrollBarUI
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListener
Modifier and Type | Field | Description |
---|---|---|
protected MetalScrollButton |
decreaseButton |
The decrease button.
|
static String |
FREE_STANDING_PROP |
The property
JScrollBar.isFreeStanding . |
protected MetalScrollButton |
increaseButton |
The increase button.
|
protected boolean |
isFreeStanding |
The value of the property
JScrollBar.isFreeStanding . |
protected int |
scrollBarWidth |
The width of the scroll bar.
|
buttonListener, decrButton, DECREASE_HIGHLIGHT, decrGap, incrButton, INCREASE_HIGHLIGHT, incrGap, isDragging, maximumThumbSize, minimumThumbSize, modelListener, NO_HIGHLIGHT, propertyChangeListener, scrollbar, scrollListener, scrollTimer, thumbDarkShadowColor, thumbLightShadowColor, thumbRect, trackColor, trackHighlight, trackHighlightColor, trackListener, trackRect
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor | Description |
---|---|
MetalScrollBarUI() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
configureScrollBarColors() |
Configures the scroll bar colors.
|
protected JButton |
createDecreaseButton(int orientation) |
Returns the view that represents the decrease view.
|
protected JButton |
createIncreaseButton(int orientation) |
Returns the view that represents the increase view.
|
protected PropertyChangeListener |
createPropertyChangeListener() |
Creates a property change listener.
|
static ComponentUI |
createUI(JComponent c) |
Constructs a new
MetalScrollBarUI instance. |
protected Dimension |
getMinimumThumbSize() |
Returns the smallest acceptable size for the thumb.
|
Dimension |
getPreferredSize(JComponent c) |
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 |
installDefaults() |
Installs the defaults.
|
protected void |
installListeners() |
Installs the listeners.
|
protected void |
paintThumb(Graphics g,
JComponent c,
Rectangle thumbBounds) |
Paints the thumb.
|
protected void |
paintTrack(Graphics g,
JComponent c,
Rectangle trackBounds) |
Paints the track.
|
protected void |
setThumbBounds(int x,
int y,
int width,
int height) |
This is overridden only to increase the invalid area.
|
addLayoutComponent, createArrowButtonListener, createModelListener, createScrollListener, createTrackListener, getMaximumSize, getMaximumThumbSize, getSupportsAbsolutePositioning, getThumbBounds, getTrackBounds, installComponents, installKeyboardActions, installUI, isThumbRollover, layoutContainer, layoutHScrollbar, layoutVScrollbar, minimumLayoutSize, paint, paintDecreaseHighlight, paintIncreaseHighlight, preferredLayoutSize, removeLayoutComponent, scrollByBlock, scrollByUnit, setThumbRollover, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, update
protected MetalScrollButton increaseButton
protected MetalScrollButton decreaseButton
protected int scrollBarWidth
public static final String FREE_STANDING_PROP
JScrollBar.isFreeStanding
.protected boolean isFreeStanding
JScrollBar.isFreeStanding
.public static ComponentUI createUI(JComponent c)
MetalScrollBarUI
instance.c
- a componentMetalScrollBarUI
instanceprotected void installDefaults()
BasicScrollBarUI
installDefaults
in class BasicScrollBarUI
protected void installListeners()
BasicScrollBarUI
installListeners
in class BasicScrollBarUI
protected PropertyChangeListener createPropertyChangeListener()
BasicScrollBarUI
createPropertyChangeListener
in class BasicScrollBarUI
protected void configureScrollBarColors()
BasicScrollBarUI
configureScrollBarColors
in class BasicScrollBarUI
public Dimension getPreferredSize(JComponent c)
BasicScrollBarUI
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.
getPreferredSize
in class BasicScrollBarUI
c
- the JScrollBar
that's delegating this method to usBasicScrollBarUI.getMaximumSize(javax.swing.JComponent)
,
ComponentUI.getMinimumSize(javax.swing.JComponent)
protected JButton createDecreaseButton(int orientation)
createDecreaseButton
in class BasicScrollBarUI
orientation
- the orientationprotected JButton createIncreaseButton(int orientation)
createIncreaseButton
in class BasicScrollBarUI
orientation
- the orientationprotected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
BasicScrollBarUI
paintTrack
in class BasicScrollBarUI
g
- the graphicsc
- the componenttrackBounds
- the track boundsprotected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
BasicScrollBarUI
paintThumb
in class BasicScrollBarUI
g
- the graphicsc
- the componentthumbBounds
- the thumb boundsprotected Dimension getMinimumThumbSize()
BasicScrollBarUI
Warning : the value returned by this method should not be be modified, it's a shared static constant.
getMinimumThumbSize
in class BasicScrollBarUI
BasicScrollBarUI.getMaximumThumbSize()
protected void setThumbBounds(int x, int y, int width, int height)
setThumbBounds
in class BasicScrollBarUI
x
- set the x location of the thumby
- set the y location of the thumbwidth
- set the width of the thumbheight
- set the height of the thumbBasicScrollBarUI.getThumbBounds()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-internal+0-adhoc.mlchung.jdk9-jdeps