-
- std::map<int, GObjectController*>::iterator it = selected.end();
- it--;
- GObjectController* lastSelected = it->second;
- //GObjectController* lastSelected = selected[selected.size()-1];
- if( lastSelected )
- {
- vtkGObjectView* view = (vtkGObjectView*) lastSelected->getView();
- GBlackBoxModel *bbmodel = (GBlackBoxModel*) lastSelected->getModel();
- view->setState(HIGHLIGHTED);
- if (bbmodel->isExecutable()) {
- bbmodel->setExecutable(false);
- } else {
- bbmodel->setExecutable(true);
+ if( selected.empty() )
+ return false;
+ bool ret = false;
+ std::map<int, GObjectController*>::iterator it;
+ for (it = selected.begin(); it != selected.end(); ++it) {
+ GObjectController* lastSelected = it->second;
+ if (lastSelected) {
+ vtkGObjectView* view = (vtkGObjectView*) lastSelected->getView();
+ GBlackBoxModel *bbmodel =
+ (GBlackBoxModel*) lastSelected->getModel();
+ view->setState(HIGHLIGHTED);
+ if (bbmodel->isExecutable()) {
+ bbmodel->setExecutable(false);
+ } else {
+ bbmodel->setExecutable(true);
+ }
+ bbmodel->notifyObservers(lastSelected->getId());
+ ret = true;