public void update(Observable obs, Object arg) {
assert obs instanceof GeoReferencingCommand;
GeoReferencingCommand cmd = (GeoReferencingCommand) obs;
enableRunButton(cmd.canExectue());
enableSaveButton(cmd.canSave());
if (!(arg instanceof GeoreferencingCommandEventChange))
return;
GeoreferencingCommandEventChange cmdEvent = (GeoreferencingCommandEventChange) arg;
switch (cmdEvent.getEvent()) {
case MARK_ADDED:
enableSaveButton(true);
break;
case ALL_MARKS_DELETED:
enableSaveButton(false);
break;
case IMAGE_LOADED:
enableLoadButton(true);
break;
case MAP_CHANGE:
enableRunButton(false);
enableSaveButton(false);
enableLoadButton(false);
break;
case MAP_CHANGE_TO_ORIGINAL:
enableRunButton(cmd.canExectue());
enableSaveButton(cmd.canSave());
enableLoadButton(cmd.canLoad());
break;
default:
break;
}
}