use of net.parostroj.timetable.model.events.AttributeChange in project grafikon by jub77.
the class Attributes method set.
public void set(String category, String name, Object value) {
Map<String, Object> map = this.getMapForCategory(category);
Object oldValue = map.get(name);
if (!ObjectsUtil.compareWithNull(oldValue, value)) {
AttributeChange change = new AttributeChange(name, oldValue, value);
if (checker.check(this, change)) {
map.put(name, value);
this.fireChange(change);
} else {
throw new GrafikonException("Cannot change attribute " + name + " to " + value, GrafikonException.Type.ATTRIBUTE);
}
}
}
use of net.parostroj.timetable.model.events.AttributeChange in project grafikon by jub77.
the class PenaltyTableRow method setAcceleration.
public void setAcceleration(int acceleration) {
if (this.acceleration != acceleration) {
this.acceleration = acceleration;
category.fireEvent(new Event(category, this, new AttributeChange("penalty.info", null, null)));
}
}
use of net.parostroj.timetable.model.events.AttributeChange in project grafikon by jub77.
the class LineTrack method setFromStraightTrack.
public void setFromStraightTrack(NodeTrack fromStraightTrack) {
NodeTrack oldTrack = this.fromStraightTrack;
if (!ObjectsUtil.compareWithNull(oldTrack, fromStraightTrack)) {
this.fromStraightTrack = fromStraightTrack;
this.fireAttributeChanged(new AttributeChange(ATTR_FROM_STRAIGHT, oldTrack, fromStraightTrack));
}
}
Aggregations