60 |
import java.util.Dictionary; |
import java.util.Dictionary; |
61 |
import java.util.Enumeration; |
import java.util.Enumeration; |
62 |
|
|
63 |
|
import javax.swing.AbstractAction; |
64 |
import javax.swing.BoundedRangeModel; |
import javax.swing.BoundedRangeModel; |
65 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
66 |
import javax.swing.JLabel; |
import javax.swing.JLabel; |
67 |
import javax.swing.JSlider; |
import javax.swing.JSlider; |
68 |
|
import javax.swing.LookAndFeel; |
69 |
import javax.swing.SwingUtilities; |
import javax.swing.SwingUtilities; |
70 |
import javax.swing.Timer; |
import javax.swing.Timer; |
|
import javax.swing.UIDefaults; |
|
71 |
import javax.swing.UIManager; |
import javax.swing.UIManager; |
72 |
import javax.swing.event.ChangeEvent; |
import javax.swing.event.ChangeEvent; |
73 |
import javax.swing.event.ChangeListener; |
import javax.swing.event.ChangeListener; |
471 |
} |
} |
472 |
} |
} |
473 |
|
|
474 |
|
/** |
475 |
|
* This class is no longer used as of JDK1.3. |
476 |
|
*/ |
477 |
|
public class ActionScroller extends AbstractAction |
478 |
|
{ |
479 |
|
/** |
480 |
|
* Not used. |
481 |
|
* |
482 |
|
* @param slider not used |
483 |
|
* @param dir not used |
484 |
|
* @param block not used |
485 |
|
*/ |
486 |
|
public ActionScroller(JSlider slider, int dir, boolean block) |
487 |
|
{ |
488 |
|
// Not used. |
489 |
|
} |
490 |
|
|
491 |
|
/** |
492 |
|
* Not used. |
493 |
|
* |
494 |
|
* @param event not used |
495 |
|
*/ |
496 |
|
public void actionPerformed(ActionEvent event) |
497 |
|
{ |
498 |
|
// Not used. |
499 |
|
} |
500 |
|
} |
501 |
|
|
502 |
/** Listener for changes from the model. */ |
/** Listener for changes from the model. */ |
503 |
protected ChangeListener changeListener; |
protected ChangeListener changeListener; |
504 |
|
|
709 |
*/ |
*/ |
710 |
protected void installDefaults(JSlider slider) |
protected void installDefaults(JSlider slider) |
711 |
{ |
{ |
712 |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
LookAndFeel.installColors(slider, "Slider.background", |
713 |
|
"Slider.foreground"); |
714 |
slider.setForeground(defaults.getColor("Slider.foreground")); |
LookAndFeel.installBorder(slider, "Slider.border"); |
715 |
slider.setBackground(defaults.getColor("Slider.background")); |
shadowColor = UIManager.getColor("Slider.shadow"); |
716 |
shadowColor = defaults.getColor("Slider.shadow"); |
highlightColor = UIManager.getColor("Slider.highlight"); |
717 |
highlightColor = defaults.getColor("Slider.highlight"); |
focusColor = UIManager.getColor("Slider.focus"); |
718 |
focusColor = defaults.getColor("Slider.focus"); |
focusInsets = UIManager.getInsets("Slider.focusInsets"); |
|
slider.setBorder(defaults.getBorder("Slider.border")); |
|
719 |
slider.setOpaque(true); |
slider.setOpaque(true); |
|
focusInsets = defaults.getInsets("Slider.focusInsets"); |
|
720 |
} |
} |
721 |
|
|
722 |
/** |
/** |
1492 |
// FIXME: Move this to propertyChangeEvent handler, when we get those. |
// FIXME: Move this to propertyChangeEvent handler, when we get those. |
1493 |
leftToRightCache = slider.getComponentOrientation() != ComponentOrientation.RIGHT_TO_LEFT; |
leftToRightCache = slider.getComponentOrientation() != ComponentOrientation.RIGHT_TO_LEFT; |
1494 |
// FIXME: This next line is only here because the above line is here. |
// FIXME: This next line is only here because the above line is here. |
1495 |
calculateThumbLocation(); |
calculateGeometry(); |
1496 |
|
|
1497 |
if (slider.getPaintTrack()) |
if (slider.getPaintTrack()) |
1498 |
paintTrack(g); |
paintTrack(g); |
1985 |
public void paintThumb(Graphics g) |
public void paintThumb(Graphics g) |
1986 |
{ |
{ |
1987 |
Color saved_color = g.getColor(); |
Color saved_color = g.getColor(); |
1988 |
|
|
1989 |
Point a = new Point(thumbRect.x, thumbRect.y); |
Point a = new Point(thumbRect.x, thumbRect.y); |
1990 |
Point b = new Point(a); |
Point b = new Point(a); |
1991 |
Point c = new Point(a); |
Point c = new Point(a); |