/[classpath]/classpath/javax/swing/JSlider.java
ViewVC logotype

Diff of /classpath/javax/swing/JSlider.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10.2.1 by gnu_andrew, Sun Jan 16 15:15:13 2005 UTC revision 1.10.2.2 by gnu_andrew, Thu Jan 27 09:45:35 2005 UTC
# Line 1  Line 1 
1  /* JSlider.java --  /* JSlider.java --
2     Copyright (C) 2002, 2004 Free Software Foundation, Inc.     Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package javax.swing;  package javax.swing;
40    
41  import java.awt.Dimension;  import java.awt.Dimension;
# Line 54  import javax.swing.event.ChangeEvent; Line 55  import javax.swing.event.ChangeEvent;
55  import javax.swing.event.ChangeListener;  import javax.swing.event.ChangeListener;
56  import javax.swing.plaf.SliderUI;  import javax.swing.plaf.SliderUI;
57    
   
58  /**  /**
  * <p>  
59   * The JSlider is a Swing component that allows selection of a value within a   * The JSlider is a Swing component that allows selection of a value within a
60   * range by adjusting a thumb in a track. The values for the minimum,   * range by adjusting a thumb in a track. The values for the minimum,
61   * maximum, extent and value are stored in a {@link   * maximum, extent and value are stored in a {@link
62   * DefaultBoundedRangeModel}.   * DefaultBoundedRangeModel}.
  * </p>  
63   *   *
64   * <p>   * <p>
65   * JSliders have the following properties:   * JSliders have the following properties:
# Line 206  public class JSlider extends JComponent Line 204  public class JSlider extends JComponent
204      }      }
205    }    }
206    
   /** Fired in a PropertyChangeEvent when the "inverted" property changes. */  
   public static final String INVERTED_CHANGED_PROPERTY = "inverted";  
   
   /** Fired in a PropertyChangeEvent when the "labelTable" property changes. */  
   public static final String LABEL_TABLE_CHANGED_PROPERTY = "labelTable";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "majorTickSpacing" property  
    * changes.  
    */  
   public static final String MAJOR_TICK_SPACING_CHANGED_PROPERTY = "majorTickSpacing";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "minorTickSpacing" property  
    * changes.  
    */  
   public static final String MINOR_TICK_SPACING_CHANGED_PROPERTY = "minorTickSpacing";  
   
   /** Fired in a PropertyChangeEvent when the "model" property changes. */  
   public static final String MODEL_CHANGED_PROPERTY = "model";  
   
   /** Fired in a PropertyChangeEvent when the "orientation" property changes. */  
   public static final String ORIENTATION_CHANGED_PROPERTY = "orientation";  
   
   /** Fired in a PropertyChangeEvent when the "paintLabels" property changes. */  
   public static final String PAINT_LABELS_CHANGED_PROPERTY = "paintLabels";  
   
   /** Fired in a PropertyChangeEvent when the "paintTicks" property changes. */  
   public static final String PAINT_TICKS_CHANGED_PROPERTY = "paintTicks";  
     
207    /** Whether or not this slider paints its ticks. */    /** Whether or not this slider paints its ticks. */
208    private transient boolean paintTicks = false;    private transient boolean paintTicks = false;
209    
# Line 515  public class JSlider extends JComponent Line 483  public class JSlider extends JComponent
483          sliderModel = model;          sliderModel = model;
484          oldModel.removeChangeListener(changeListener);          oldModel.removeChangeListener(changeListener);
485          sliderModel.addChangeListener(changeListener);          sliderModel.addChangeListener(changeListener);
486          firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, sliderModel);          firePropertyChange("model", oldModel, sliderModel);
487        }        }
488    }    }
489    
# Line 624  public class JSlider extends JComponent Line 592  public class JSlider extends JComponent
592        {        {
593          int oldOrientation = this.orientation;          int oldOrientation = this.orientation;
594          this.orientation = orientation;          this.orientation = orientation;
595          firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,          firePropertyChange("orientation", oldOrientation,
596                             this.orientation);                             this.orientation);
597        }        }
598    }    }
# Line 650  public class JSlider extends JComponent Line 618  public class JSlider extends JComponent
618        {        {
619          Dictionary oldTable = labelTable;          Dictionary oldTable = labelTable;
620          labelTable = table;          labelTable = table;
621          firePropertyChange(LABEL_TABLE_CHANGED_PROPERTY, oldTable, labelTable);          firePropertyChange("labelTable", oldTable, labelTable);
622        }        }
623    }    }
624    
# Line 751  public class JSlider extends JComponent Line 719  public class JSlider extends JComponent
719        {        {
720          boolean oldInverted = isInverted;          boolean oldInverted = isInverted;
721          isInverted = inverted;          isInverted = inverted;
722          firePropertyChange(INVERTED_CHANGED_PROPERTY, oldInverted, isInverted);          firePropertyChange("inverted", oldInverted, isInverted);
723        }        }
724    }    }
725    
# Line 777  public class JSlider extends JComponent Line 745  public class JSlider extends JComponent
745        {        {
746          int oldSpacing = majorTickSpacing;          int oldSpacing = majorTickSpacing;
747          majorTickSpacing = spacing;          majorTickSpacing = spacing;
748          firePropertyChange(MAJOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing,          firePropertyChange("majorTickSpacing", oldSpacing,
749                             majorTickSpacing);                             majorTickSpacing);
750        }        }
751    }    }
# Line 804  public class JSlider extends JComponent Line 772  public class JSlider extends JComponent
772        {        {
773          int oldSpacing = minorTickSpacing;          int oldSpacing = minorTickSpacing;
774          minorTickSpacing = spacing;          minorTickSpacing = spacing;
775          firePropertyChange(MINOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing,          firePropertyChange("minorTickSpacing", oldSpacing,
776                             minorTickSpacing);                             minorTickSpacing);
777        }        }
778    }    }
# Line 864  public class JSlider extends JComponent Line 832  public class JSlider extends JComponent
832        {        {
833          boolean oldPaintTicks = paintTicks;          boolean oldPaintTicks = paintTicks;
834          paintTicks = paint;          paintTicks = paint;
835          firePropertyChange(PAINT_TICKS_CHANGED_PROPERTY, oldPaintTicks,          firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
                            paintTicks);  
836        }        }
837    }    }
838    
# Line 910  public class JSlider extends JComponent Line 877  public class JSlider extends JComponent
877        {        {
878          boolean oldPaintLabels = paintLabels;          boolean oldPaintLabels = paintLabels;
879          paintLabels = paint;          paintLabels = paint;
880          firePropertyChange(PAINT_LABELS_CHANGED_PROPERTY, oldPaintLabels,          firePropertyChange("paintLabels", oldPaintLabels, paintLabels);
                            paintLabels);  
881        }        }
882    }    }
883    

Legend:
Removed from v.1.10.2.1  
changed lines
  Added in v.1.10.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26