Program: 59102
Project: 59102
Buggy source:
protected void handleEvents(EPickingType pickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
switch (pickingType) {
case VIEW_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
      iMouseOverViewID=iExternalID;
    generalManager.getSingelton().getViewGLCanvasManager().getInfoAreaManager().setDataAboutView(iExternalID);
  break;
case CLICKED:
generalManager.getSingelton().getViewGLCanvasManager().getInfoAreaManager().setDataAboutView(iExternalID);
if (poolLayer.containsElement(iExternalID)) {
loadViewToUnderInteractionLayer(iExternalID);
}
break;
case DRAGGED:
if (!dragAndDrop.isDragActionRunning()) dragAndDrop.startDragAction(iExternalID);
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.VIEW_SELECTION);
break;
case BUCKET_LOCK_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_lock=iExternalID;
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_LOCK_ICON_SELECTION);
break;
case BUCKET_MOVE_IN_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
loadViewToUnderInteractionLayer(iExternalID);
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=iExternalID;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_IN_ICON_SELECTION);
break;
case BUCKET_MOVE_OUT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) break;
arSlerpActions.clear();
SlerpAction slerpActionTransition=new SlerpAction(iExternalID,stackLayer,poolLayer);
arSlerpActions.add(slerpActionTransition);
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=iExternalID;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_OUT_ICON_SELECTION);
break;
case BUCKET_MOVE_LEFT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) break;
arSlerpActions.clear();
int iDestinationPosIndex=stackLayer.getPositionIndexByElementId(iExternalID);
if (iDestinationPosIndex == 3) iDestinationPosIndex=0;
 else iDestinationPosIndex++;
if (stackLayer.getElementIdByPositionIndex(iDestinationPosIndex) == -1) {
SlerpAction slerpAction=new SlerpAction(iExternalID,stackLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(iExternalID,stackLayer,transitionLayer);
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLayer.getElementIdByPositionIndex(iDestinationPosIndex),stackLayer,stackLayer,stackLayer.getPositionIndexByElementId(iExternalID));
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(iExternalID,transitionLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=iExternalID;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_LEFT_ICON_SELECTION);
break;
case BUCKET_MOVE_RIGHT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) break;
arSlerpActions.clear();
int iDestinationPosIndex=stackLayer.getPositionIndexByElementId(iExternalID);
if (iDestinationPosIndex == 0) iDestinationPosIndex=3;
 else iDestinationPosIndex--;
if (stackLayer.getElementIdByPositionIndex(iDestinationPosIndex) == -1) {
SlerpAction slerpAction=new SlerpAction(iExternalID,stackLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(iExternalID,stackLayer,transitionLayer);
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLayer.getElementIdByPositionIndex(iDestinationPosIndex),stackLayer,stackLayer,stackLayer.getPositionIndexByElementId(iExternalID));
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(iExternalID,transitionLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=iExternalID;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_RIGHT_ICON_SELECTION);
break;
case MEMO_PAD_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
case DRAGGED:
int iDraggedObjectId=dragAndDrop.getDraggedObjectedId();
if (iExternalID == MEMO_PAD_TRASH_CAN_PICKING_ID) {
if (iDraggedObjectId != -1) {
memoLayer.removeElement(iDraggedObjectId);
underInteractionLayer.removeElement(iDraggedObjectId);
stackLayer.removeElement(iDraggedObjectId);
poolLayer.removeElement(iDraggedObjectId);
dragAndDrop.stopDragAction();
}
}
 else if (iExternalID == MEMO_PAD_PICKING_ID) {
if (iDraggedObjectId != -1) {
if (!memoLayer.containsElement(iDraggedObjectId)) {
memoLayer.addElement(iDraggedObjectId);
memoLayer.setElementVisibilityById(true,iDraggedObjectId);
}
dragAndDrop.stopDragAction();
}
}
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.MEMO_PAD_SELECTION);
break;
}
}

Fixed version (ground truth):
protected void handleEvents(EPickingType pickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
switch (pickingType) {
case VIEW_SELECTION:
switch (pickingMode) {
case MOUSE_OVER:
      iMouseOverViewID=iExternalID;
    generalManager.getSingelton().getViewGLCanvasManager().getInfoAreaManager().setDataAboutView(iExternalID);
  break;
case CLICKED:
generalManager.getSingelton().getViewGLCanvasManager().getInfoAreaManager().setDataAboutView(iExternalID);
if (poolLayer.containsElement(iExternalID)) {
loadViewToUnderInteractionLayer(iExternalID);
}
if (!dragAndDrop.isDragActionRunning()) dragAndDrop.startDragAction(iExternalID);
break;
case DRAGGED:
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.VIEW_SELECTION);
break;
case BUCKET_LOCK_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_lock=iExternalID;
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_LOCK_ICON_SELECTION);
break;
case BUCKET_MOVE_IN_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
loadViewToUnderInteractionLayer(iExternalID);
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=iExternalID;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_IN_ICON_SELECTION);
break;
case BUCKET_MOVE_OUT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) break;
arSlerpActions.clear();
SlerpAction slerpActionTransition=new SlerpAction(iExternalID,stackLayer,poolLayer);
arSlerpActions.add(slerpActionTransition);
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=iExternalID;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_OUT_ICON_SELECTION);
break;
case BUCKET_MOVE_LEFT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) break;
arSlerpActions.clear();
int iDestinationPosIndex=stackLayer.getPositionIndexByElementId(iExternalID);
if (iDestinationPosIndex == 3) iDestinationPosIndex=0;
 else iDestinationPosIndex++;
if (stackLayer.getElementIdByPositionIndex(iDestinationPosIndex) == -1) {
SlerpAction slerpAction=new SlerpAction(iExternalID,stackLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(iExternalID,stackLayer,transitionLayer);
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLayer.getElementIdByPositionIndex(iDestinationPosIndex),stackLayer,stackLayer,stackLayer.getPositionIndexByElementId(iExternalID));
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(iExternalID,transitionLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=iExternalID;
iNavigationMouseOverViewID_right=-1;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_LEFT_ICON_SELECTION);
break;
case BUCKET_MOVE_RIGHT_ICON_SELECTION:
switch (pickingMode) {
case CLICKED:
if (iSlerpFactor > 0 && iSlerpFactor < SLERP_RANGE) break;
arSlerpActions.clear();
int iDestinationPosIndex=stackLayer.getPositionIndexByElementId(iExternalID);
if (iDestinationPosIndex == 0) iDestinationPosIndex=3;
 else iDestinationPosIndex--;
if (stackLayer.getElementIdByPositionIndex(iDestinationPosIndex) == -1) {
SlerpAction slerpAction=new SlerpAction(iExternalID,stackLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpAction);
}
 else {
SlerpAction slerpActionTransition=new SlerpAction(iExternalID,stackLayer,transitionLayer);
arSlerpActions.add(slerpActionTransition);
SlerpAction slerpAction=new SlerpAction(stackLayer.getElementIdByPositionIndex(iDestinationPosIndex),stackLayer,stackLayer,stackLayer.getPositionIndexByElementId(iExternalID));
arSlerpActions.add(slerpAction);
SlerpAction slerpActionTransitionReverse=new SlerpAction(iExternalID,transitionLayer,stackLayer,iDestinationPosIndex);
arSlerpActions.add(slerpActionTransitionReverse);
}
bEnableNavigationOverlay=false;
break;
case MOUSE_OVER:
iNavigationMouseOverViewID_left=-1;
iNavigationMouseOverViewID_right=iExternalID;
iNavigationMouseOverViewID_out=-1;
iNavigationMouseOverViewID_in=-1;
iNavigationMouseOverViewID_lock=-1;
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.BUCKET_MOVE_RIGHT_ICON_SELECTION);
break;
case MEMO_PAD_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
case DRAGGED:
int iDraggedObjectId=dragAndDrop.getDraggedObjectedId();
if (iExternalID == MEMO_PAD_TRASH_CAN_PICKING_ID) {
if (iDraggedObjectId != -1) {
memoLayer.removeElement(iDraggedObjectId);
underInteractionLayer.removeElement(iDraggedObjectId);
stackLayer.removeElement(iDraggedObjectId);
poolLayer.removeElement(iDraggedObjectId);
}
}
 else if (iExternalID == MEMO_PAD_PICKING_ID) {
if (iDraggedObjectId != -1) {
if (!memoLayer.containsElement(iDraggedObjectId)) {
memoLayer.addElement(iDraggedObjectId);
memoLayer.setElementVisibilityById(true,iDraggedObjectId);
}
}
}
dragAndDrop.stopDragAction();
break;
}
pickingManager.flushHits(iUniqueId,EPickingType.MEMO_PAD_SELECTION);
break;
}
}