Package jmri.jmrit.roster
Class UpdateDecoderDefinitionAction
java.lang.Object
javax.swing.AbstractAction
jmri.util.swing.JmriAbstractAction
jmri.jmrit.roster.UpdateDecoderDefinitionAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
Update the decoder definitions in the roster.
When required, provides a user GUI to assist with replacing multiple-match definitions.
When required, provides a user GUI to assist with replacing multiple-match definitions.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) JButton(package private) CombinedLocoSelTreePane(package private) int(package private) int(package private) DecoderIndexFile(package private) JDialog(package private) FocusListener(package private) boolean(package private) boolean(package private) JLabelDisplays the last-selected filter action.(package private) final ProgModeSelectorstatic final StringThe prefix string used to specify a query in decoder definition file replacementFamily and replacementModel elements.static final String(package private) JToggleButton(package private) StringThereplacementFamilyattribute from the decoder definition file.(package private) String(package private) List<DecoderFile>AListbased on the combination of any replacementFamily and replacementModel suggestions.(package private) StringThereplacementModelattribute from the decoder definition file.(package private) String(package private) JLabel(package private) RosterEntryA temporary roster entry used in matching and replacement.(package private) JToggleButton(package private) List<DecoderFile>The 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, wiFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionUpdate the decoder definitions in the roster.UpdateDecoderDefinitionAction(String name, Icon i, WindowInterface wi) Update the decoder definitions in the roster.Update the decoder definitions in the roster. -
Method Summary
Modifier and TypeMethodDescriptionvoid(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) JOptionPanegetOptionPane(JComponent source) Fetch theJOptionPaneassociated with thisJComponent.(package private) voidmakeMatchLists(RosterEntry theEntry) Creates twoArrayListsfor decoder matching.Never invoked, because we overrode actionPerformed above.(package private) intmultiReplacementDialog(String text, boolean missing) Creates the "Multiple Replacements Found" dialog box with custom buttons and tooltips.(package private) voidsetLastActionDisplay(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, toStringMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
QRY_PREFIX
The prefix string used to specify a query in decoder definition file replacementFamily and replacementModel elements.- See Also:
-
QRY_SEPARATOR
- See Also:
-
replacementFamily
ThereplacementFamilyattribute from the decoder definition file. -
replacementFamilyString
-
hasReplacementFamilyQuery
boolean hasReplacementFamilyQuery -
replacementModel
ThereplacementModelattribute from the decoder definition file. -
replacementModelString
-
hasReplacementModelQuery
boolean hasReplacementModelQuery -
cV7Value
int cV7Value -
cV8Value
int cV8Value -
lastActionDisplay
Displays the last-selected filter action. -
tempRe
A temporary roster entry used in matching and replacement. -
replacementList
AListbased on the combination of any replacementFamily and replacementModel suggestions. -
versionMatchList
The subset of thereplacementListthat also matches both theIdentifyDecodermanufacturerID stored in CV8 and theIdentifyDecoderversionID stored in CV7. -
di
-
fListener
-
statusLabel
-
f
-
modePane
-
cancelButton
-
versionButton
-
replacementButton
-
combinedLocoSelTree
-
-
Constructor Details
-
UpdateDecoderDefinitionAction
Update the decoder definitions in the roster.- Parameters:
name- the name (Action.NAME) for the action; a value ofnullis ignored
-
UpdateDecoderDefinitionAction
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
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 Details
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJmriAbstractAction
-
getOptionPane
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
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
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
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
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
Updates theversionButtonandreplacementButtonavailability and tooltips, depending on whetherversionMatchListandreplacementListare empty or not.- Parameters:
theEntry- an existing roster entry that needs replacement
-
makePanel
Never invoked, because we overrode actionPerformed above.- Specified by:
makePanelin classJmriAbstractAction- Returns:
- never because it deliberately throws an
IllegalArgumentException
-