- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ScrollBarUI
-
- javax.swing.plaf.basic.BasicScrollBarUI
-
- javax.swing.plaf.metal.MetalScrollBarUI
-
- All Implemented Interfaces:
- LayoutManager, SwingConstants
public class MetalScrollBarUI extends BasicScrollBarUI
Implementation of ScrollBarUI for the Metal Look and Feel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicScrollBarUI
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListener
-
-
Field Summary
Fields Modifier and Type Field and Description protected javax.swing.plaf.metal.MetalBumps
bumps
protected MetalScrollButton
decreaseButton
static String
FREE_STANDING_PROP
protected MetalScrollButton
increaseButton
protected boolean
isFreeStanding
protected int
scrollBarWidth
-
Fields inherited from class javax.swing.plaf.basic.BasicScrollBarUI
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
-
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
-
Constructor Summary
Constructors Constructor and Description MetalScrollBarUI()
-
Method Summary
Methods Modifier and Type Method and Description protected void
configureScrollBarColors()
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()
static ComponentUI
createUI(JComponent c)
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 (nonnull
) increment/decrement buttons, and the minimum width of the thumb.protected void
installDefaults()
protected void
installListeners()
protected void
paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
protected void
paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
protected void
setThumbBounds(int x, int y, int width, int height)
This is overridden only to increase the invalid area.-
Methods inherited from class javax.swing.plaf.basic.BasicScrollBarUI
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
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, update
-
-
-
-
Field Detail
-
bumps
protected javax.swing.plaf.metal.MetalBumps bumps
-
increaseButton
protected MetalScrollButton increaseButton
-
decreaseButton
protected MetalScrollButton decreaseButton
-
scrollBarWidth
protected int scrollBarWidth
-
FREE_STANDING_PROP
public static final String FREE_STANDING_PROP
- See Also:
- Constant Field Values
-
isFreeStanding
protected boolean isFreeStanding
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classBasicScrollBarUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classBasicScrollBarUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListener
in classBasicScrollBarUI
-
configureScrollBarColors
protected void configureScrollBarColors()
- Overrides:
configureScrollBarColors
in classBasicScrollBarUI
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)
Description copied from class:BasicScrollBarUI
A vertical scrollbar's preferred width is the maximum of preferred widths of the (nonnull
) 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.- Overrides:
getPreferredSize
in classBasicScrollBarUI
- Parameters:
c
- theJScrollBar
that's delegating this method to us- Returns:
- the preferred size of a Basic JScrollBar
- See Also:
BasicScrollBarUI.getMaximumSize(javax.swing.JComponent)
,ComponentUI.getMinimumSize(javax.swing.JComponent)
-
createDecreaseButton
protected JButton createDecreaseButton(int orientation)
Returns the view that represents the decrease view.- Overrides:
createDecreaseButton
in classBasicScrollBarUI
-
createIncreaseButton
protected JButton createIncreaseButton(int orientation)
Returns the view that represents the increase view.- Overrides:
createIncreaseButton
in classBasicScrollBarUI
-
paintTrack
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
- Overrides:
paintTrack
in classBasicScrollBarUI
-
paintThumb
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
- Overrides:
paintThumb
in classBasicScrollBarUI
-
getMinimumThumbSize
protected Dimension getMinimumThumbSize()
Description copied from class:BasicScrollBarUI
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.
- Overrides:
getMinimumThumbSize
in classBasicScrollBarUI
- Returns:
- The smallest acceptable size for the thumb.
- See Also:
BasicScrollBarUI.getMaximumThumbSize()
-
setThumbBounds
protected void setThumbBounds(int x, int y, int width, int height)
This is overridden only to increase the invalid area. This ensures that the "Shadow" below the thumb is invalidated- Overrides:
setThumbBounds
in classBasicScrollBarUI
- See Also:
BasicScrollBarUI.getThumbBounds()
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/swing/plaf/metal/MetalScrollBarUI.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.