Search in sources :

Example 16 with AttributeChange

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);
        }
    }
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange)

Example 17 with AttributeChange

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)));
    }
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 18 with AttributeChange

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));
    }
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange)

Aggregations

AttributeChange (net.parostroj.timetable.model.events.AttributeChange)18 Event (net.parostroj.timetable.model.events.Event)12