use of jmri.jmrit.roster.RosterEntry in project JMRI by JMRI.
the class RosterTreeNode method initComponents.
/**
* Initialize the connection to the Roster.
* <p>
* Should be called before connecting the node to a JTree.
*/
public void initComponents() {
// title this node
setUserObject("Roster");
// add every roster entry
List<RosterEntry> list = Roster.getDefault().matchingList(null, null, null, null, null, null, null);
for (RosterEntry r : list) {
add(new DefaultMutableTreeNode(r.getId()));
}
}
use of jmri.jmrit.roster.RosterEntry in project JMRI by JMRI.
the class AttributeTableModel method getValueAt.
/**
* Provides the empty String if attribute doesn't exist.
*/
@Override
public Object getValueAt(int row, int col) {
// get column key
String key = getColumnName(col);
// get roster entry for row
RosterEntry re = Roster.getDefault().getEntry(row);
String retval = re.getAttribute(key);
if (retval != null) {
return retval;
}
return "";
}
use of jmri.jmrit.roster.RosterEntry in project JMRI by JMRI.
the class CombinedLocoSelPane method openKnownLoco.
/**
* Start with a locomotive selected, so we're opening an existing
* RosterEntry.
*/
protected void openKnownLoco() {
if (locoBox.getSelectedRosterEntries().length != 0) {
RosterEntry re = locoBox.getSelectedRosterEntries()[0];
if (log.isDebugEnabled()) {
log.debug("loco file: " + re.getFileName());
}
startProgrammer(null, re, (String) programmerBox.getSelectedItem());
} else {
log.error("No roster entry was selected to open.");
}
}
use of jmri.jmrit.roster.RosterEntry in project JMRI by JMRI.
the class NewLocoSelPane method openButton.
/**
* Handle pushing the open programmer button by finding names, then calling
* a template method
*/
protected void openButton() {
// find the decoderFile object
DecoderFile decoderFile = DecoderIndexFile.instance().fileFromTitle((String) decoderBox.getSelectedItem());
if (log.isDebugEnabled()) {
log.debug("decoder file: " + decoderFile.getFilename());
}
// create a dummy RosterEntry with the decoder info
RosterEntry re = new RosterEntry();
re.setDecoderFamily(decoderFile.getFamily());
re.setDecoderModel(decoderFile.getModel());
re.setId(Bundle.getMessage("LabelNewDecoder"));
// note we're leaving the filename information as null
// add the new roster entry to the in-memory roster
Roster.getDefault().addEntry(re);
startProgrammer(decoderFile, re);
}
use of jmri.jmrit.roster.RosterEntry in project JMRI by JMRI.
the class KnownLocoSelPane method openButton.
/**
* handle pushing the open programmer button by finding names, then calling
* a template method
*/
protected void openButton() {
if (locoBox.getSelectedRosterEntries().length != 0) {
RosterEntry re = locoBox.getSelectedRosterEntries()[0];
startProgrammer(null, re, (String) programmerBox.getSelectedItem());
} else {
JOptionPane.showMessageDialog(this, Bundle.getMessage("LocoMustSelected"), Bundle.getMessage("NoSelection"), JOptionPane.ERROR_MESSAGE);
}
}
Aggregations