use of jmri.jmrit.display.palette.SignalHeadItemPanel in project JMRI by JMRI.
the class SignalHeadIcon method editItem.
protected void editItem() {
makePaletteFrame(java.text.MessageFormat.format(Bundle.getMessage("EditItem"), Bundle.getMessage("BeanNameSignalHead")));
_itemPanel = new SignalHeadItemPanel(_paletteFrame, "SignalHead", getFamily(), PickListModel.signalHeadPickModelInstance(), //NOI18N
_editor);
ActionListener updateAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent a) {
updateItem();
}
};
// _iconMap keys with local names - Let SignalHeadItemPanel figure this out
// duplicate _iconMap map with unscaled and unrotated icons
HashMap<String, NamedIcon> map = new HashMap<String, NamedIcon>();
Iterator<Entry<String, NamedIcon>> it = _iconMap.entrySet().iterator();
while (it.hasNext()) {
Entry<String, NamedIcon> entry = it.next();
NamedIcon oldIcon = entry.getValue();
NamedIcon newIcon = cloneIcon(oldIcon, this);
newIcon.rotate(0, this);
newIcon.scale(1.0, this);
newIcon.setRotation(4, this);
map.put(entry.getKey(), newIcon);
}
_itemPanel.init(updateAction, map);
_itemPanel.setSelection(getSignalHead());
_paletteFrame.add(_itemPanel);
_paletteFrame.pack();
_paletteFrame.setVisible(true);
}
Aggregations