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