6929298: The SynthSliderUI#calculateTickRect method should be removed
Reviewed-by: peterz
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java Sat Feb 27 16:03:05 2010 +0300
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java Sat Feb 27 16:14:43 2010 +0300
@@ -43,7 +43,7 @@
/**
* Provides the Synth L&F UI delegate for
- * {@link javax.swing.JSlider}.
+ * {@link JSlider}.
*
* @author Joshua Outwater
* @since 1.7
@@ -65,7 +65,7 @@
* 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 @@
*/
@Override
protected void calculateGeometry() {
+ calculateThumbSize();
layout();
calculateThumbLocation();
}
@@ -350,10 +351,6 @@
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);
@@ -557,39 +554,6 @@
* @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
- */
- @Override
public void setThumbLocation(int x, int y) {
super.setThumbLocation(x, y);
// Value rect is tied to the thumb location. We need to repaint when