Package jmri.jmrit.symbolicprog
Class TcsExportAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.symbolicprog.TcsExportAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class TcsExportAction extends javax.swing.AbstractAction
Action to export the RosterEntry values to a TCS-format data file.TODO: Note: This first does an update of the RosterEntry from the GUI, then writes out from the Roster entry. This means that they (RE and GUI) now agree, which has the side effect of erasing the dirty state. Better would be to do the export directly from the GUI.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JFileChooser
fileChooser
(package private) PaneProgFrame
frame
(package private) CvTableModel
mModel
CvTableModel to load(package private) RosterEntry
rosterEntry
(package private) VariableTableModel
vModel
VariableTableModel to load
-
Constructor Summary
Constructors Constructor Description TcsExportAction(java.lang.String actionName, CvTableModel mModel, VariableTableModel vModel, RosterEntry rosterEntry, PaneProgFrame pParent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
static void
formatTcsVirtualNodeDefinition(java.io.PrintStream str, RosterEntry rosterEntry, CvTableModel model, VariableTableModel vModel)
Format the contents of the locomotive definition.(package private) static int
intFromFunctionString(java.lang.String fn)
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
fileChooser
javax.swing.JFileChooser fileChooser
-
frame
PaneProgFrame frame
-
rosterEntry
RosterEntry rosterEntry
-
mModel
CvTableModel mModel
CvTableModel to load
-
vModel
VariableTableModel vModel
VariableTableModel to load
-
-
Constructor Detail
-
TcsExportAction
public TcsExportAction(java.lang.String actionName, CvTableModel mModel, VariableTableModel vModel, RosterEntry rosterEntry, PaneProgFrame pParent)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
formatTcsVirtualNodeDefinition
public static void formatTcsVirtualNodeDefinition(java.io.PrintStream str, RosterEntry rosterEntry, CvTableModel model, VariableTableModel vModel)
Format the contents of the locomotive definition. This method is public static so it can be used elsewhere for e.g. direct writing to a node.- Parameters:
str
- receives the formatted definition StringrosterEntry
- defines the information to storemodel
- provides CV contents as availablevModel
- provides variable contents as available
-
intFromFunctionString
static int intFromFunctionString(java.lang.String fn)
-
-