use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.
the class TrainTypeCategory method addRow.
public void addRow(PenaltyTableRow row) {
ListIterator<PenaltyTableRow> i = penaltyRows.listIterator();
while (i.hasNext()) {
PenaltyTableRow currentRow = i.next();
if (row.getSpeed() < currentRow.getSpeed()) {
i.previous();
i.add(row);
listenerSupport.fireEvent(new Event(this, Event.Type.ADDED, row));
return;
} else if (row.getSpeed() == currentRow.getSpeed()) {
i.set(row);
listenerSupport.fireEvent(new Event(this, Event.Type.REPLACED, row, ListData.createData(currentRow, row)));
return;
}
}
penaltyRows.add(row);
listenerSupport.fireEvent(new Event(this, Event.Type.ADDED, row));
}
use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.
the class TrainTypeCategory method removeRowForSpeed.
public PenaltyTableRow removeRowForSpeed(int speed) {
for (Iterator<PenaltyTableRow> i = penaltyRows.iterator(); i.hasNext(); ) {
PenaltyTableRow row = i.next();
if (row.getSpeed() == speed) {
i.remove();
listenerSupport.fireEvent(new Event(this, Event.Type.REMOVED, row));
return row;
}
}
return null;
}
use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.
the class TrainTypeCategory method removeRow.
public PenaltyTableRow removeRow(int position) {
PenaltyTableRow row = penaltyRows.remove(position);
listenerSupport.fireEvent(new Event(this, Event.Type.REMOVED, row));
return row;
}
use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.
the class TrainNameDelegate method refreshName.
private void refreshName() {
String oldName = _cachedName.getValue();
String newName = this.getNameImpl(NameType.NORMAL);
if (_cachedName.set(newName)) {
train.fireEvent(new Event(train, new AttributeChange(ATTR_NAME, oldName, newName)));
}
}
use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.
the class TrainsData method setTrainSortPattern.
public void setTrainSortPattern(SortPattern trainSortPattern) {
SortPattern oldValue = this.trainSortPattern;
this.trainSortPattern = trainSortPattern;
this.trainComparator = null;
this.diagram.fireEvent(new Event(diagram, new AttributeChange(TrainDiagram.ATTR_TRAIN_SORT_PATTERN, oldValue, this.trainSortPattern)));
}
Aggregations