Package jmri.jmrit.roster
Class UpdateDecoderDefinitionAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.util.swing.JmriAbstractAction
-
- jmri.jmrit.roster.UpdateDecoderDefinitionAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action
public class UpdateDecoderDefinitionAction extends JmriAbstractAction
Update the decoder definitions in the roster.
When required, provides a user GUI to assist with replacing multiple-match definitions.- See Also:
XmlFile, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JButtoncancelButton(package private) CombinedLocoSelTreePanecombinedLocoSelTree(package private) intcV7Value(package private) intcV8Value(package private) DecoderIndexFiledi(package private) javax.swing.JDialogf(package private) java.awt.event.FocusListenerfListener(package private) booleanhasReplacementFamilyQuery(package private) booleanhasReplacementModelQuery(package private) javax.swing.JLabellastActionDisplayDisplays the last-selected filter action.(package private) ProgModeSelectormodePanestatic java.lang.StringQRY_PREFIXThe prefix string used to specify a query in decoder definition file replacementFamily and replacementModel elements.static java.lang.StringQRY_SEPARATORTheregexseparator tosplititems in replacementFamily and replacementModel elements.(package private) javax.swing.JToggleButtonreplacementButton(package private) java.lang.StringreplacementFamilyThereplacementFamilyattribute from the decoder definition file.(package private) java.lang.StringreplacementFamilyString(package private) java.util.List<DecoderFile>replacementListAListbased on the combination of any replacementFamily and replacementModel suggestions.(package private) java.lang.StringreplacementModelThereplacementModelattribute from the decoder definition file.(package private) java.lang.StringreplacementModelString(package private) javax.swing.JLabelstatusLabel(package private) RosterEntrytempReA temporary roster entry used in matching and replacement.(package private) javax.swing.JToggleButtonversionButton(package private) java.util.List<DecoderFile>versionMatchListThe subset of thereplacementListthat also matches both theIdentifyDecodermanufacturerID stored in CV8 and theIdentifyDecoderversionID stored in CV7.-
Fields inherited from class jmri.util.swing.JmriAbstractAction
context, hint, wi
-
-
Constructor Summary
Constructors Constructor Description UpdateDecoderDefinitionAction(java.lang.String name)Update the decoder definitions in the roster.UpdateDecoderDefinitionAction(java.lang.String name, javax.swing.Icon i, WindowInterface wi)Update the decoder definitions in the roster.UpdateDecoderDefinitionAction(java.lang.String name, WindowInterface wi)Update the decoder definitions in the roster.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)(package private) voiddecoderSelectionPane(RosterEntry theEntry)Creates the "Replacement Definition" pane, which is similar in appearance toCreate New Locopane, likewise utilizing a customized instance ofCombinedLocoSelTreePane.(package private) javax.swing.JOptionPanegetOptionPane(javax.swing.JComponent source)Fetch theJOptionPaneassociated with thisJComponent.(package private) voidmakeMatchLists(RosterEntry theEntry)Creates twoArrayListsfor decoder matching.JmriPanelmakePanel()Never invoked, because we overrode actionPerformed above.(package private) intmultiReplacementDialog(java.lang.String text, boolean missing)Creates the "Multiple Replacements Found" dialog box with custom buttons and tooltips.(package private) voidsetLastActionDisplay(java.lang.String propertyName)Updates thelastActionDisplayJLabelto be the text fetched by the key named "TextLastAction", after inclusion of the text fetched by the key named "propertyName".(package private) voidupdateMatchButtons(RosterEntry theEntry)Updates theversionButtonandreplacementButtonavailability and tooltips, depending on whetherversionMatchListandreplacementListare empty or not.-
Methods inherited from class jmri.util.swing.JmriAbstractAction
dispose, setContext, setHint, setName, setParameter, setParameter, setWindowInterface, toString
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
QRY_PREFIX
public static final java.lang.String QRY_PREFIX
The prefix string used to specify a query in decoder definition file replacementFamily and replacementModel elements.- See Also:
- Constant Field Values
-
QRY_SEPARATOR
public static final java.lang.String QRY_SEPARATOR
Theregexseparator tosplititems in replacementFamily and replacementModel elements.- See Also:
- Constant Field Values
-
replacementFamily
java.lang.String replacementFamily
ThereplacementFamilyattribute from the decoder definition file.
-
replacementFamilyString
java.lang.String replacementFamilyString
-
hasReplacementFamilyQuery
boolean hasReplacementFamilyQuery
-
replacementModel
java.lang.String replacementModel
ThereplacementModelattribute from the decoder definition file.
-
replacementModelString
java.lang.String replacementModelString
-
hasReplacementModelQuery
boolean hasReplacementModelQuery
-
cV7Value
int cV7Value
-
cV8Value
int cV8Value
-
lastActionDisplay
javax.swing.JLabel lastActionDisplay
Displays the last-selected filter action.
-
tempRe
transient volatile RosterEntry tempRe
A temporary roster entry used in matching and replacement.
-
replacementList
transient volatile java.util.List<DecoderFile> replacementList
AListbased on the combination of any replacementFamily and replacementModel suggestions.
-
versionMatchList
transient volatile java.util.List<DecoderFile> versionMatchList
The subset of thereplacementListthat also matches both theIdentifyDecodermanufacturerID stored in CV8 and theIdentifyDecoderversionID stored in CV7.
-
di
transient volatile DecoderIndexFile di
-
fListener
transient volatile java.awt.event.FocusListener fListener
-
statusLabel
transient volatile javax.swing.JLabel statusLabel
-
f
transient volatile javax.swing.JDialog f
-
modePane
final ProgModeSelector modePane
-
cancelButton
javax.swing.JButton cancelButton
-
versionButton
javax.swing.JToggleButton versionButton
-
replacementButton
javax.swing.JToggleButton replacementButton
-
combinedLocoSelTree
CombinedLocoSelTreePane combinedLocoSelTree
-
-
Constructor Detail
-
UpdateDecoderDefinitionAction
public UpdateDecoderDefinitionAction(java.lang.String name)
Update the decoder definitions in the roster.- Parameters:
name- the name (Action.NAME) for the action; a value ofnullis ignored
-
UpdateDecoderDefinitionAction
public UpdateDecoderDefinitionAction(java.lang.String name, WindowInterface wi)
Update the decoder definitions in the roster.- Parameters:
name- the name (Action.NAME) for the action; a value ofnullis ignoredwi- the window interface controlling how this action is displayed
-
UpdateDecoderDefinitionAction
public UpdateDecoderDefinitionAction(java.lang.String name, javax.swing.Icon i, WindowInterface wi)
Update the decoder definitions in the roster.- Parameters:
name- the name (Action.NAME) for the action; a value ofnullis ignoredi- the small icon (Action.SMALL_ICON) for the action; a value ofnullis ignoredwi- the window interface controlling how this action is displayed
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Overrides:
actionPerformedin classJmriAbstractAction
-
getOptionPane
javax.swing.JOptionPane getOptionPane(javax.swing.JComponent source)
Fetch theJOptionPaneassociated with thisJComponent.
Note that:- The
sourcemust be within (or itself be) aJOptionPane. - If
sourceis aJOptionPane, the returned element will besource
- Parameters:
source- theJComponent- Returns:
- the
JOptionPaneassociated withsource
- The
-
multiReplacementDialog
int multiReplacementDialog(java.lang.String text, boolean missing)
Creates the "Multiple Replacements Found" dialog box with custom buttons and tooltips.- Parameters:
text- the explanatory text to displaymissing- if true, displays a "missing definition" title rather than a "multiple replacements" title- Returns:
- sequence number of the button selected
-
decoderSelectionPane
void decoderSelectionPane(RosterEntry theEntry)
Creates the "Replacement Definition" pane, which is similar in appearance toCreate New Locopane, likewise utilizing a customized instance ofCombinedLocoSelTreePane.- Parameters:
theEntry- an existing roster entry that needs replacement
-
setLastActionDisplay
void setLastActionDisplay(java.lang.String propertyName)
Updates thelastActionDisplayJLabelto be the text fetched by the key named "TextLastAction", after inclusion of the text fetched by the key named "propertyName".- Parameters:
propertyName- the name of aResourceBundlekey
-
makeMatchLists
void makeMatchLists(RosterEntry theEntry)
Creates twoArrayListsfor decoder matching.
They are:-
A
replacementListbased on the combination of anyreplacementFamilyandreplacementModelsuggestions. -
A
versionMatchListthat is the subset ofreplacementListthat also matches both a manufacturerID (fromIdentifyDecodermfgID) stored in CV8 and a versionID (fromIdentifyDecodermodelID) stored in CV7.
- Parameters:
theEntry- an existing roster entry that needs replacement
-
A
-
updateMatchButtons
void updateMatchButtons(RosterEntry theEntry)
Updates theversionButtonandreplacementButtonavailability and tooltips, depending on whetherversionMatchListandreplacementListare empty or not.- Parameters:
theEntry- an existing roster entry that needs replacement
-
makePanel
public JmriPanel makePanel()
Never invoked, because we overrode actionPerformed above.- Specified by:
makePanelin classJmriAbstractAction- Returns:
- never because it deliberately throws an
IllegalArgumentException
-
-