From: <jac...@pr...> - 2004-01-26 14:22:59
|
Update of /cvsroot/jmri/jmri/jmrit/symbolicprog In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23211 Modified Files: SpeedTableVarValue.java Log Message: fix problem with not prompting to save file when closing window after changing a speed table entry, bug 881556. VariableTableModel listens for changes to variables to set fileDirty; this SpeedTableVariable wasnt firing propertyChange notifications Index: SpeedTableVarValue.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrit/symbolicprog/SpeedTableVarValue.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SpeedTableVarValue.java 24 Aug 2003 11:45:08 -0000 1.16 --- SpeedTableVarValue.java 24 Jan 2004 19:43:45 -0000 1.17 *************** *** 3,17 **** package jmri.jmrit.symbolicprog; ! import java.awt.*; ! import java.beans.*; ! import java.util.*; ! import javax.swing.*; ! import javax.swing.event.*; /** ! * SpeedTableVarValue.java *<P> ! *_value is a holdover from the LongAddrVariableValue, which this was copied from; it should * be removed. _maxVal, _minVal are also redundant. * --- 3,28 ---- package jmri.jmrit.symbolicprog; ! import java.awt.BorderLayout; ! import java.awt.Color; ! import java.awt.Component; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.beans.PropertyChangeListener; ! import java.util.Vector; ! import javax.swing.BoundedRangeModel; ! import javax.swing.DefaultBoundedRangeModel; ! import javax.swing.JButton; ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! import javax.swing.JSlider; ! import javax.swing.JTextField; ! import javax.swing.event.ChangeEvent; ! import javax.swing.event.ChangeListener; /** ! * Represent an entire speed table as a single Variable. *<P> ! * _value is a holdover from the LongAddrVariableValue, which this was copied from; it should * be removed. _maxVal, _minVal are also redundant. * *************** *** 19,23 **** * state of those CVs. *<P> The state of this variable has to be a composite of all the sliders, hence CVs. ! *The mapping is (in order): *<UL> *<LI>If any CVs are UNKNOWN, its UNKNOWN.. --- 30,34 ---- * state of those CVs. *<P> The state of this variable has to be a composite of all the sliders, hence CVs. ! * The mapping is (in order): *<UL> *<LI>If any CVs are UNKNOWN, its UNKNOWN.. *************** *** 28,39 **** *<LI>And if we get to here, something awful has happened. *</UL><P> ! *A similar pattern is used for a read or write request. Write writes them all; ! *Read reads any that aren't READ or WRITTEN. *<P> * Speed tables can have different numbers of entries; 28 is the default, and also the maximum. *<P> ! * Description: Extends VariableValue to represent a NMRA long address ! * @author Bob Jacobsen, Alex Shepherd Copyright (C) 2001 ! * @version $Revision$ * */ --- 39,49 ---- *<LI>And if we get to here, something awful has happened. *</UL><P> ! * A similar pattern is used for a read or write request. Write writes them all; ! * Read reads any that aren't READ or WRITTEN. *<P> * Speed tables can have different numbers of entries; 28 is the default, and also the maximum. *<P> ! * @author Bob Jacobsen, Alex Shepherd Copyright (C) 2001, 2004 ! * @version $Revision$ * */ *************** *** 83,88 **** } public void stateChanged(ChangeEvent e) { - // called for new values of a slider - set the CV(s) as needed // e.getSource() points to the JSlider object - find it in the list JSlider j = (JSlider) e.getSource(); --- 93,103 ---- } + /** + * Called for new values of a slider. + * <P> + * Sets the CV(s) as needed. + * @param e + */ public void stateChanged(ChangeEvent e) { // e.getSource() points to the JSlider object - find it in the list JSlider j = (JSlider) e.getSource(); *************** *** 96,100 **** } } ! } --- 111,116 ---- } } ! // notify that Value property changed ! prop.firePropertyChange("Value", null, j); } |