Search in sources :

Example 1 with CoordinateEdit

use of jmri.jmrit.display.CoordinateEdit in project JMRI by JMRI.

the class ControlPanelEditor method pasteItems.

void pasteItems() {
    if (_selectionGroup != null) {
        for (Positionable pos : _selectionGroup) {
            if (pos instanceof PositionableIcon) {
                jmri.NamedBean bean = pos.getNamedBean();
                if (bean != null) {
                    ((PositionableIcon) pos).displayState(bean.getState());
                }
            }
            putItem(pos);
            log.debug("Add {}", pos.getNameString());
        }
        if (_selectionGroup.get(0) instanceof LocoIcon) {
            LocoIcon p = (LocoIcon) _selectionGroup.get(0);
            CoordinateEdit f = new CoordinateEdit();
            f.init("Train Name", p, false);
            f.initText();
            f.setVisible(true);
            f.setLocationRelativeTo(p);
        }
    }
    _pastePending = false;
}
Also used : LocoIcon(jmri.jmrit.display.LocoIcon) PositionableIcon(jmri.jmrit.display.PositionableIcon) CoordinateEdit(jmri.jmrit.display.CoordinateEdit) Positionable(jmri.jmrit.display.Positionable)

Aggregations

CoordinateEdit (jmri.jmrit.display.CoordinateEdit)1 LocoIcon (jmri.jmrit.display.LocoIcon)1 Positionable (jmri.jmrit.display.Positionable)1 PositionableIcon (jmri.jmrit.display.PositionableIcon)1