diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java index 6adb990000cf31d7cac3e18402fdd61577bc5f50..073026e2772ed2ded4e981273fccf8f3fdd6997a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java @@ -43,7 +43,7 @@ import sun.swing.SwingUtilities2; /** * Provides the Synth L&F UI delegate for - * {@link javax.swing.JSlider}. + * {@link JSlider}. * * @author Joshua Outwater * @since 1.7 @@ -65,7 +65,7 @@ public class SynthSliderUI extends BasicSliderUI * the slider has not changed sizes since being last layed out. If necessary * we recompute the layout. */ - private Dimension lastSize = null; + private Dimension lastSize; private int trackHeight; private int trackBorder; @@ -339,6 +339,7 @@ public class SynthSliderUI extends BasicSliderUI */ @Override protected void calculateGeometry() { + calculateThumbSize(); layout(); calculateThumbLocation(); } @@ -350,10 +351,6 @@ public class SynthSliderUI extends BasicSliderUI SynthContext context = getContext(slider); SynthGraphicsUtils synthGraphics = style.getGraphicsUtils(context); - // Set the thumb size. - Dimension size = getThumbSize(); - thumbRect.setSize(size.width, size.height); - // Get the insets for the track. Insets trackInsets = new Insets(0, 0, 0, 0); SynthContext trackContext = getContext(slider, Region.SLIDER_TRACK); @@ -553,39 +550,6 @@ public class SynthSliderUI extends BasicSliderUI } } - /** - * @inheritDoc - */ - @Override - protected void calculateTickRect() { - if (slider.getOrientation() == JSlider.HORIZONTAL) { - tickRect.x = trackRect.x; - tickRect.y = trackRect.y + trackRect.height + 2 + getTickLength(); - tickRect.width = trackRect.width; - tickRect.height = getTickLength(); - - if (!slider.getPaintTicks()) { - --tickRect.y; - tickRect.height = 0; - } - } else { - if (SynthLookAndFeel.isLeftToRight(slider)) { - tickRect.x = trackRect.x + trackRect.width; - tickRect.width = getTickLength(); - } else { - tickRect.width = getTickLength(); - tickRect.x = trackRect.x - tickRect.width; - } - tickRect.y = trackRect.y; - tickRect.height = trackRect.height; - - if (!slider.getPaintTicks()) { - --tickRect.x; - tickRect.width = 0; - } - } - } - /** * @inheritDoc */