src/share/classes/javax/swing/JSlider.java
Print this page
*** 136,146 ****
/**
* {@code Dictionary} of what labels to draw at which values
*/
! private Dictionary<Integer, JComponent> labelTable;
/**
* The changeListener (no suffix) is the listener we add to the
* slider's model. This listener is initialized to the
--- 136,146 ----
/**
* {@code Dictionary} of what labels to draw at which values
*/
! private Dictionary<Integer, ? extends JComponent> labelTable;
/**
* The changeListener (no suffix) is the listener we add to the
* slider's model. This listener is initialized to the
*** 771,781 ****
if (!isShowing()) {
return false;
}
// Check that there is a label with such image
! Enumeration<JComponent> elements = labelTable.elements();
while (elements.hasMoreElements()) {
JComponent component = elements.nextElement();
if (component instanceof JLabel) {
--- 771,781 ----
if (!isShowing()) {
return false;
}
// Check that there is a label with such image
! Enumeration<? extends JComponent> elements = labelTable.elements();
while (elements.hasMoreElements()) {
JComponent component = elements.nextElement();
if (component instanceof JLabel) {
*** 795,805 ****
* Returns the dictionary of what labels to draw at which values.
*
* @return the <code>Dictionary</code> containing labels and
* where to draw them
*/
! public Dictionary<Integer, JComponent> getLabelTable() {
/*
if ( labelTable == null && getMajorTickSpacing() > 0 ) {
setLabelTable( createStandardLabels( getMajorTickSpacing() ) );
}
*/
--- 795,805 ----
* Returns the dictionary of what labels to draw at which values.
*
* @return the <code>Dictionary</code> containing labels and
* where to draw them
*/
! public Dictionary<Integer, ? extends JComponent> getLabelTable() {
/*
if ( labelTable == null && getMajorTickSpacing() > 0 ) {
setLabelTable( createStandardLabels( getMajorTickSpacing() ) );
}
*/
*** 828,839 ****
* hidden: true
* bound: true
* attribute: visualUpdate true
* description: Specifies what labels will be drawn for any given value.
*/
! public void setLabelTable( Dictionary<Integer, JComponent> labels ) {
! Dictionary<Integer, JComponent> oldTable = labelTable;
labelTable = labels;
updateLabelUIs();
firePropertyChange("labelTable", oldTable, labelTable );
if (labels != oldTable) {
revalidate();
--- 828,839 ----
* hidden: true
* bound: true
* attribute: visualUpdate true
* description: Specifies what labels will be drawn for any given value.
*/
! public void setLabelTable( Dictionary<Integer, ? extends JComponent> labels ) {
! Dictionary<Integer, ? extends JComponent> oldTable = labelTable;
labelTable = labels;
updateLabelUIs();
firePropertyChange("labelTable", oldTable, labelTable );
if (labels != oldTable) {
revalidate();
*** 850,860 ****
*
* @see #setLabelTable
* @see JComponent#updateUI
*/
protected void updateLabelUIs() {
! Dictionary<Integer, JComponent> labelTable = getLabelTable();
if (labelTable == null) {
return;
}
Enumeration<Integer> labels = labelTable.keys();
--- 850,860 ----
*
* @see #setLabelTable
* @see JComponent#updateUI
*/
protected void updateLabelUIs() {
! Dictionary<Integer, ? extends JComponent> labelTable = getLabelTable();
if (labelTable == null) {
return;
}
Enumeration<Integer> labels = labelTable.keys();
*** 864,876 ****
component.setSize(component.getPreferredSize());
}
}
private void updateLabelSizes() {
! Dictionary<Integer, JComponent> labelTable = getLabelTable();
if (labelTable != null) {
! Enumeration<JComponent> labels = labelTable.elements();
while (labels.hasMoreElements()) {
JComponent component = labels.nextElement();
component.setSize(component.getPreferredSize());
}
}
--- 864,876 ----
component.setSize(component.getPreferredSize());
}
}
private void updateLabelSizes() {
! Dictionary<Integer, ? extends JComponent> labelTable = getLabelTable();
if (labelTable != null) {
! Enumeration<? extends JComponent> labels = labelTable.elements();
while (labels.hasMoreElements()) {
JComponent component = labels.nextElement();
component.setSize(component.getPreferredSize());
}
}
*** 1015,1025 ****
}
}
SmartHashtable table = new SmartHashtable( increment, start );
! Dictionary<Integer, JComponent> labelTable = getLabelTable();
if (labelTable != null && (labelTable instanceof PropertyChangeListener)) {
removePropertyChangeListener((PropertyChangeListener) labelTable);
}
--- 1015,1025 ----
}
}
SmartHashtable table = new SmartHashtable( increment, start );
! Dictionary<Integer, ? extends JComponent> labelTable = getLabelTable();
if (labelTable != null && (labelTable instanceof PropertyChangeListener)) {
removePropertyChangeListener((PropertyChangeListener) labelTable);
}