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