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);
}
}
}
}
Aggregations