提交 7246ce3a 编写于 作者: R rupashka

6929298: The SynthSliderUI#calculateTickRect method should be removed

Reviewed-by: peterz
上级 70f12748
......@@ -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
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册