Search in sources :

Example 1 with PenaltyTableRow

use of net.parostroj.timetable.model.PenaltyTableRow in project grafikon by jub77.

the class TrainTypesCategoriesDialog method newButtonActionPerformed.

private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {
    TrainTypesCategoriesNewDialog dialog = new TrainTypesCategoriesNewDialog(this);
    dialog.setLocationRelativeTo(this);
    dialog.setVisible(diagram);
    if (dialog.getNewCategory() != null) {
        TrainTypeCategory category = dialog.getNewCategory();
        listModel.addTrainTypeCategory(category);
        if (dialog.getTemplateCategory() != null) {
            TrainTypeCategory template = dialog.getTemplateCategory();
            // copy
            List<PenaltyTableRow> tRows = template.getPenaltyRows();
            for (PenaltyTableRow tRow : tRows) {
                PenaltyTableRow row = category.createPenaltyTableRow(tRow.getSpeed(), tRow.getAcceleration(), tRow.getDeceleration());
                category.addRow(row);
            }
        }
    }
}
Also used : PenaltyTableRow(net.parostroj.timetable.model.PenaltyTableRow) TrainTypeCategory(net.parostroj.timetable.model.TrainTypeCategory)

Aggregations

PenaltyTableRow (net.parostroj.timetable.model.PenaltyTableRow)1 TrainTypeCategory (net.parostroj.timetable.model.TrainTypeCategory)1