use of jmri.jmrit.display.palette.MultiSensorItemPanel in project JMRI by JMRI.
the class MultiSensorIcon method editItem.
protected void editItem() {
makePaletteFrame(Bundle.getMessage("EditItem", Bundle.getMessage("MultiSensor")));
_itemPanel = new MultiSensorItemPanel(_paletteFrame, "MultiSensor", _iconFamily, PickListModel.multiSensorPickModelInstance(), _editor);
ActionListener updateAction = (ActionEvent a) -> {
updateItem();
};
// duplicate _iconMap map with unscaled and unrotated icons
HashMap<String, NamedIcon> map = new HashMap<>();
map.put("SensorStateInactive", inactive);
map.put("BeanStateInconsistent", inconsistent);
map.put("BeanStateUnknown", unknown);
for (int i = 0; i < entries.size(); i++) {
map.put(MultiSensorItemPanel.getPositionName(i), entries.get(i).icon);
}
_itemPanel.init(updateAction, map);
for (int i = 0; i < entries.size(); i++) {
_itemPanel.setSelection(entries.get(i).namedSensor.getBean());
}
_itemPanel.setUpDown(getUpDown());
_paletteFrame.add(_itemPanel);
_paletteFrame.pack();
_paletteFrame.setVisible(true);
}
Aggregations