mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-13 01:13:10 +00:00
6929298: The SynthSliderUI#calculateTickRect method should be removed
Reviewed-by: peterz
This commit is contained in:
parent
0a231a50e2
commit
2dd1ee93df
@ -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
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user