Skip to content

Commit

Permalink
ScrollBar: Parametrize scrollBarListener
Browse files Browse the repository at this point in the history
  • Loading branch information
weisJ committed Sep 17, 2021
1 parent c7ddc1d commit 11fe4b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ protected DarkScrollBarListener<DarkMacScrollBarUI> createScrollBarListener() {

private static class MacScrollBarListener extends DarkScrollBarListener<DarkMacScrollBarUI> {

private final int hideDelay;
private final Timer hideTimer;

public MacScrollBarListener(final JScrollBar scrollbar, final DarkMacScrollBarUI ui) {
super(scrollbar, ui);
hideDelay = getTrackFadeOutDelay();
int hideDelay = getTrackFadeOutDelay();
hideTimer = new Timer(hideDelay, e -> {
Point p = MouseInfo.getPointerInfo().getLocation();
SwingUtilities.convertPointFromScreen(p, scrollbar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class DarkScrollBarUI extends BasicScrollBarUI implements ScrollBarConstants {

protected static final AlphaComposite COMPOSITE = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
protected DarkScrollBarListener scrollBarListener;
protected DarkScrollBarListener<?> scrollBarListener;
protected Color thumbBorderColor;
protected Color thumbFadeStartColor;
protected Color thumbFadeEndColor;
Expand Down Expand Up @@ -88,8 +88,8 @@ protected void installListeners() {
scrollbar.addMouseWheelListener(scrollBarListener);
}

protected DarkScrollBarListener createScrollBarListener() {
return new DarkScrollBarListener(scrollbar, this);
protected DarkScrollBarListener<?> createScrollBarListener() {
return new DarkScrollBarListener<>(scrollbar, this);
}

@Override
Expand Down

0 comments on commit 11fe4b5

Please sign in to comment.