Search in sources :

Example 1 with EngineClassPM

use of net.parostroj.timetable.gui.pm.EngineClassPM in project grafikon by jub77.

the class EngineClassesDialog method editButtonActionPerformed.

private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {
    if (!engineClassesList.isSelectionEmpty()) {
        int selected = engineClassesList.getSelectedIndex();
        EngineClass engineClass = listModel.getIndex(selected).getElement();
        EditEngineClassDialog dialog = new EditEngineClassDialog(this, true);
        dialog.setLocationRelativeTo(editButton);
        EngineClassPM pm = new EngineClassPM();
        pm.init(engineClass);
        dialog.setPresentationModel(pm);
        dialog.setVisible(true);
        dialog.dispose();
        listModel.refreshAll();
        Wrapper<EngineClass> selectedWrapper = listModel.getWrapperForObject(engineClass);
        engineClassesList.setSelectedValue(selectedWrapper, true);
    }
}
Also used : EngineClassPM(net.parostroj.timetable.gui.pm.EngineClassPM)

Aggregations

EngineClassPM (net.parostroj.timetable.gui.pm.EngineClassPM)1