+ bool GPortController::OnLeftButtonDown()
+ {
+
+ int state = _view->getState();
+
+ //Evaluate new state
+ if(state == HIGHLIGHTED)
+ {
+ _isLeftClickDown=true;
+ }
+ return true;
+ }
+ //=========================================================================
+ bool GPortController::OnLeftButtonUp()
+ {
+ int state = _view->getState();
+ if(_isLeftClickDown)
+ {
+ if(state==HIGHLIGHTED)
+ {
+ int portType = ((GPortModel*)_model)->getPortType();
+
+ //Evaluate new state
+ if(portType==GOUTPUTPORT)
+ {
+ _model->notifyObservers(getId(),INIT_CREATION_CONTOUR);
+ }
+ else if (portType==GINPUTPORT)
+ {
+ _model->notifyObservers(getId(),FIN_CREATION_CONTOUR);
+ }
+ }
+ else
+ {
+ _view->setState(NOTHING_HAPPENS);
+ }
+ _isLeftClickDown=false;
+ }
+
+ return true;
+ }