Package jmri.jmrit.throttle
Class LoadXmlThrottlesLayoutAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.throttle.LoadXmlThrottlesLayoutAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action
public class LoadXmlThrottlesLayoutAction extends javax.swing.AbstractAction
Load throttles from XML- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLoadXmlThrottlesLayoutAction.ThrottlePrefsAn extension of the abstract XmlFile.
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JFileChooserfileChooser
-
Constructor Summary
Constructors Constructor Description LoadXmlThrottlesLayoutAction()LoadXmlThrottlesLayoutAction(java.lang.String s)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)The action is performed.booleanloadThrottlesLayout(java.io.File f)Parse the XML file and create ThrottleFrames.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
fileChooser
javax.swing.JFileChooser fileChooser
-
-
Constructor Detail
-
LoadXmlThrottlesLayoutAction
public LoadXmlThrottlesLayoutAction(java.lang.String s)
Constructor- Parameters:
s- Name for the action.
-
LoadXmlThrottlesLayoutAction
public LoadXmlThrottlesLayoutAction()
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
The action is performed. Let the user choose the file to load from. Read XML for each ThrottleFrame.- Parameters:
e- The event causing the action.
-
loadThrottlesLayout
public boolean loadThrottlesLayout(java.io.File f) throws java.io.IOException
Parse the XML file and create ThrottleFrames.- Parameters:
f- The XML file containing throttles.- Returns:
- true if throttle loaded successfully, else false.
- Throws:
java.io.IOException- on error.
-
-