if (e.getId() == MapEvent.REMOVE) {
removeFromHistory(e);
}
for (EventListener eventListener : listenerList.getListeners(ProcedureListener.class)) {
ProcedureListener listener = (ProcedureListener) eventListener;
switch (e.getId()) {
case MapEvent.ADD:
listener.procedureAdded(e);
break;
case MapEvent.CHANGE:
listener.procedureChanged(e);
break;
case MapEvent.REMOVE:
listener.procedureRemoved(e);
break;
default:
throw new IllegalArgumentException("Invalid ProcedureEvent type: " + e.getId());
}
}