Search in sources :

Example 1 with AttributeChange

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

the class Attributes method remove.

public Object remove(String category, String name) {
    if (!this.mapExistsForCategory(category)) {
        return null;
    } else {
        Map<String, Object> map = this.getMapForCategory(category);
        Object o = map.get(name);
        if (o != null) {
            AttributeChange change = new AttributeChange(name, o, null, category);
            if (checker.check(this, change)) {
                map.remove(name);
                this.fireChange(change);
            } else {
                throw new GrafikonException("Cannot remove attribute " + name, GrafikonException.Type.ATTRIBUTE);
            }
        }
        return o;
    }
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange)

Example 2 with AttributeChange

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

the class Region method fireSubRegionsEvent.

private void fireSubRegionsEvent(Set<Region> old) {
    Event event = new Event(diagram, this, new AttributeChange(ATTR_SUB_REGIONS, old, subRegions));
    fireEvent(event);
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 3 with AttributeChange

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

the class Region method fireNodesEvent.

private void fireNodesEvent(Set<Node> old) {
    Event event = new Event(diagram, this, new AttributeChange(ATTR_NODES, old, nodes));
    fireEvent(event);
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 4 with AttributeChange

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

the class LineClass method setName.

public void setName(String name) {
    if (!ObjectsUtil.compareWithNull(name, this.name)) {
        String oldName = this.name;
        this.name = name;
        listenerSupport.fireEvent(new Event(this, new AttributeChange(ATTR_NAME, oldName, this.name)));
    }
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 5 with AttributeChange

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

the class LineTrack method setToStraightTrack.

public void setToStraightTrack(NodeTrack toStraightTrack) {
    NodeTrack oldTrack = this.toStraightTrack;
    if (!ObjectsUtil.compareWithNull(oldTrack, toStraightTrack)) {
        this.toStraightTrack = toStraightTrack;
        this.fireAttributeChanged(new AttributeChange(ATTR_TO_STRAIGHT, oldTrack, toStraightTrack));
    }
}
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