Class RadianceScrollBarUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ScrollBarUI
-
- javax.swing.plaf.basic.BasicScrollBarUI
-
- org.pushingpixels.radiance.theming.internal.ui.RadianceScrollBarUI
-
- All Implemented Interfaces:
java.awt.LayoutManager
,javax.swing.SwingConstants
,TransitionAwareUI
public class RadianceScrollBarUI extends javax.swing.plaf.basic.BasicScrollBarUI implements TransitionAwareUI
UI for scroll bars in Radiance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
RadianceScrollBarUI.RadianceTrackListener
Track mouse drags.-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicScrollBarUI
javax.swing.plaf.basic.BasicScrollBarUI.ArrowButtonListener, javax.swing.plaf.basic.BasicScrollBarUI.ModelListener, javax.swing.plaf.basic.BasicScrollBarUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicScrollBarUI.ScrollListener, javax.swing.plaf.basic.BasicScrollBarUI.TrackListener
-
-
Field Summary
Fields Modifier and Type Field Description private StateTransitionTracker
compositeStateTransitionTracker
private BladeColorScheme
mutableBorderColorScheme
private BladeColorScheme
mutableFillColorScheme
private java.awt.event.AdjustmentListener
radianceAdjustmentListener
Listener on adjustments made to the scrollbar model.private java.beans.PropertyChangeListener
radiancePropertyListener
Property change listener.private RolloverControlListener
radianceThumbRolloverListener
Listener for thumb transition animations.private int
scrollBarWidth
Scroll bar width.private java.util.Set<RadianceThemingWidget<javax.swing.JComponent>>
themingWidgets
private static int
THUMB_DELTA
private javax.swing.ButtonModel
thumbModel
Surrogate button model for tracking the thumb transitions.-
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, thumbColor, thumbDarkShadowColor, thumbHighlightColor, thumbLightShadowColor, thumbRect, trackColor, trackHighlight, trackHighlightColor, trackListener, trackRect
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RadianceScrollBarUI(javax.swing.JComponent b)
Simple constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.plaf.basic.BasicScrollBarUI.ArrowButtonListener
createArrowButtonListener()
protected javax.swing.JButton
createDecreaseButton(int orientation)
protected javax.swing.JButton
createIncreaseButton(int orientation)
protected javax.swing.plaf.basic.BasicScrollBarUI.TrackListener
createTrackListener()
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent comp)
private void
drawThumbHorizontal(java.awt.Graphics2D g, java.awt.Rectangle thumbBounds)
private void
drawThumbVertical(java.awt.Graphics2D g, java.awt.Rectangle thumbBounds)
java.awt.Dimension
getPreferredSize(javax.swing.JComponent c)
StateTransitionTracker
getTransitionTracker()
Returns the model for tracking the transitions.protected void
installComponents()
protected void
installDefaults()
protected void
installListeners()
void
installUI(javax.swing.JComponent c)
boolean
isInside(java.awt.event.MouseEvent me)
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.protected void
layoutHScrollbar(javax.swing.JScrollBar sb)
protected void
layoutHScrollbarNone(javax.swing.JScrollBar sb)
protected void
layoutVScrollbar(javax.swing.JScrollBar sb)
protected void
layoutVScrollbarNone(javax.swing.JScrollBar sb)
void
paint(java.awt.Graphics g, javax.swing.JComponent c)
protected void
paintThumb(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle thumbBounds)
protected void
paintTrack(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle trackBounds)
void
scrollByBlock(int direction)
protected void
uninstallComponents()
protected void
uninstallDefaults()
protected void
uninstallListeners()
void
uninstallUI(javax.swing.JComponent c)
void
update(java.awt.Graphics g, javax.swing.JComponent c)
private void
updateThumbState(int x, int y)
Updates the thumb state based on the coordinates.-
Methods inherited from class javax.swing.plaf.basic.BasicScrollBarUI
addLayoutComponent, configureScrollBarColors, createModelListener, createPropertyChangeListener, createScrollListener, getMaximumSize, getMaximumThumbSize, getMinimumThumbSize, getSupportsAbsolutePositioning, getThumbBounds, getTrackBounds, installKeyboardActions, isThumbRollover, layoutContainer, minimumLayoutSize, paintDecreaseHighlight, paintIncreaseHighlight, preferredLayoutSize, removeLayoutComponent, scrollByUnit, setThumbBounds, setThumbRollover, uninstallKeyboardActions
-
-
-
-
Field Detail
-
thumbModel
private javax.swing.ButtonModel thumbModel
Surrogate button model for tracking the thumb transitions.
-
mutableFillColorScheme
private BladeColorScheme mutableFillColorScheme
-
mutableBorderColorScheme
private BladeColorScheme mutableBorderColorScheme
-
radianceThumbRolloverListener
private RolloverControlListener radianceThumbRolloverListener
Listener for thumb transition animations.
-
compositeStateTransitionTracker
private StateTransitionTracker compositeStateTransitionTracker
-
radiancePropertyListener
private java.beans.PropertyChangeListener radiancePropertyListener
Property change listener.
-
scrollBarWidth
private int scrollBarWidth
Scroll bar width.
-
radianceAdjustmentListener
private java.awt.event.AdjustmentListener radianceAdjustmentListener
Listener on adjustments made to the scrollbar model.
-
themingWidgets
private java.util.Set<RadianceThemingWidget<javax.swing.JComponent>> themingWidgets
-
THUMB_DELTA
private static int THUMB_DELTA
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
createDecreaseButton
protected javax.swing.JButton createDecreaseButton(int orientation)
- Overrides:
createDecreaseButton
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
createIncreaseButton
protected javax.swing.JButton createIncreaseButton(int orientation)
- Overrides:
createIncreaseButton
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
drawThumbVertical
private void drawThumbVertical(java.awt.Graphics2D g, java.awt.Rectangle thumbBounds)
-
drawThumbHorizontal
private void drawThumbHorizontal(java.awt.Graphics2D g, java.awt.Rectangle thumbBounds)
-
paintTrack
protected void paintTrack(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle trackBounds)
- Overrides:
paintTrack
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
paintThumb
protected void paintThumb(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle thumbBounds)
- Overrides:
paintThumb
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paint
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
installComponents
protected void installComponents()
- Overrides:
installComponents
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
uninstallComponents
protected void uninstallComponents()
- Overrides:
uninstallComponents
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
isInside
public boolean isInside(java.awt.event.MouseEvent me)
Description copied from interface:TransitionAwareUI
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInside
in interfaceTransitionAwareUI
- Parameters:
me
- Mouse event.- Returns:
true
if the mouse position of the specified event lies inside the area of the component designated for transition effects,false
otherwise.
-
getTransitionTracker
public StateTransitionTracker getTransitionTracker()
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Returns:
- Model for tracking the transitions.
-
scrollByBlock
public void scrollByBlock(int direction)
- Overrides:
scrollByBlock
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
layoutVScrollbar
protected void layoutVScrollbar(javax.swing.JScrollBar sb)
- Overrides:
layoutVScrollbar
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
layoutHScrollbar
protected void layoutHScrollbar(javax.swing.JScrollBar sb)
- Overrides:
layoutHScrollbar
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
layoutVScrollbarNone
protected void layoutVScrollbarNone(javax.swing.JScrollBar sb)
-
layoutHScrollbarNone
protected void layoutHScrollbarNone(javax.swing.JScrollBar sb)
-
createTrackListener
protected javax.swing.plaf.basic.BasicScrollBarUI.TrackListener createTrackListener()
- Overrides:
createTrackListener
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
createArrowButtonListener
protected javax.swing.plaf.basic.BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()
- Overrides:
createArrowButtonListener
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
updateThumbState
private void updateThumbState(int x, int y)
Updates the thumb state based on the coordinates.- Parameters:
x
- X coordinate.y
- Y coordinate.
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in classjavax.swing.plaf.basic.BasicScrollBarUI
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.ComponentUI
-
-