Program: 58702
Project: 58702
Buggy source:
@Override protected void handleEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
switch (ePickingType) {
case HIER_HEAT_MAP_GENES_GROUP:
switch (pickingMode) {
case CLICKED:
      contentVA.getGroupList().get(iExternalID).toggleSelectionType();
    bActivateDraggingGenes=true;
  setDisplayListDirty();
break;
case DRAGGED:
if (bActivateDraggingGenes == false) return;
if (bDragDropGeneGroup == false) {
bDragDropGeneGroup=true;
bDragDropExpGroup=false;
iGeneGroupToDrag=iExternalID;
}
setDisplayListDirty();
break;
case RIGHT_CLICKED:
boolean bEnableInterchange=false;
boolean bEnableMerge=false;
int iNrSelectedGroups=0;
IGroupList tempGroupList=contentVA.getGroupList();
for (Group group : tempGroupList) {
if (group.getSelectionType() == ESelectionType.SELECTION) iNrSelectedGroups++;
}
if (iNrSelectedGroups >= 2) {
bEnableMerge=true;
if (iNrSelectedGroups == 2) bEnableInterchange=true;
GroupContextMenuItemContainer groupContextMenuItemContainer=new GroupContextMenuItemContainer();
groupContextMenuItemContainer.setContextMenuFlags(true,bEnableMerge,bEnableInterchange);
contextMenu.addItemContanier(groupContextMenuItemContainer);
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_EXPERIMENTS_GROUP:
switch (pickingMode) {
case CLICKED:
storageVA.getGroupList().get(iExternalID).toggleSelectionType();
deactivateAllDraggingCursor();
bActivateDraggingExperiments=true;
setDisplayListDirty();
break;
case DRAGGED:
if (bActivateDraggingExperiments == false) return;
if (bDragDropExpGroup == false) {
bDragDropExpGroup=true;
bDragDropGeneGroup=false;
iExpGroupToDrag=iExternalID;
}
setDisplayListDirty();
break;
case RIGHT_CLICKED:
boolean bEnableInterchange=false;
boolean bEnableMerge=false;
int iNrSelectedGroups=0;
IGroupList tempGroupList=storageVA.getGroupList();
for (Group group : tempGroupList) {
if (group.getSelectionType() == ESelectionType.SELECTION) iNrSelectedGroups++;
}
if (iNrSelectedGroups >= 2) {
bEnableMerge=true;
if (iNrSelectedGroups == 2) bEnableInterchange=true;
GroupContextMenuItemContainer groupContextMenuItemContainer=new GroupContextMenuItemContainer();
groupContextMenuItemContainer.setContextMenuFlags(false,bEnableMerge,bEnableInterchange);
contextMenu.addItemContanier(groupContextMenuItemContainer);
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_INFOCUS_SELECTION:
switch (pickingMode) {
case CLICKED:
bIsHeatmapInFocus=bIsHeatmapInFocus == true ? false : true;
glHeatMapView.setDisplayListDirty();
setDisplayListDirty();
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_CURSOR_LEVEL1:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel1=true;
break;
case DRAGGED:
if (bDisableCursorDraggingLevel1) return;
if (bActivateDraggingLevel1 == false) return;
bIsDraggingActiveLevel1=true;
bDisableBlockDraggingLevel1=true;
iDraggedCursorLevel1=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_BLOCK_CURSOR_LEVEL1:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel1=true;
break;
case DRAGGED:
if (bDisableBlockDraggingLevel1) return;
if (bActivateDraggingLevel1 == false) return;
bIsDraggingWholeBlockLevel1=true;
bDisableCursorDraggingLevel1=true;
iDraggedCursorLevel1=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_CURSOR_LEVEL2:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel2=true;
break;
case DRAGGED:
if (bDisableCursorDraggingLevel2) return;
if (bActivateDraggingLevel2 == false) return;
bIsDraggingActiveLevel2=true;
bDisableBlockDraggingLevel2=true;
iDraggedCursorLevel2=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_BLOCK_CURSOR_LEVEL2:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel2=true;
break;
case DRAGGED:
if (bDisableBlockDraggingLevel2) return;
if (bActivateDraggingLevel2 == false) return;
bIsDraggingWholeBlockLevel2=true;
bDisableCursorDraggingLevel2=true;
iDraggedCursorLevel2=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_TEXTURE_SELECTION:
switch (pickingMode) {
case CLICKED:
pickingPointLevel1=pick.getPickedPoint();
setEmbeddedHeatMapData();
setDisplayListDirty();
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_FIELD_SELECTION:
switch (pickingMode) {
case CLICKED:
pickingPointLevel2=pick.getPickedPoint();
setEmbeddedHeatMapData();
setDisplayListDirty();
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_VIEW_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
case RIGHT_CLICKED:
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
break;
}
break;
}
}

Fixed version (ground truth):
@Override protected void handleEvents(EPickingType ePickingType,EPickingMode pickingMode,int iExternalID,Pick pick){
  if (detailLevel == EDetailLevel.VERY_LOW) {
    return;
  }
switch (ePickingType) {
case HIER_HEAT_MAP_GENES_GROUP:
switch (pickingMode) {
case CLICKED:
      contentVA.getGroupList().get(iExternalID).toggleSelectionType();
    deactivateAllDraggingCursor();
  bActivateDraggingGenes=true;
setDisplayListDirty();
break;
case DRAGGED:
if (bActivateDraggingGenes == false) return;
if (bDragDropGeneGroup == false) {
bDragDropGeneGroup=true;
bDragDropExpGroup=false;
iGeneGroupToDrag=iExternalID;
}
setDisplayListDirty();
break;
case RIGHT_CLICKED:
boolean bEnableInterchange=false;
boolean bEnableMerge=false;
int iNrSelectedGroups=0;
IGroupList tempGroupList=contentVA.getGroupList();
for (Group group : tempGroupList) {
if (group.getSelectionType() == ESelectionType.SELECTION) iNrSelectedGroups++;
}
if (iNrSelectedGroups >= 2) {
bEnableMerge=true;
if (iNrSelectedGroups == 2) bEnableInterchange=true;
GroupContextMenuItemContainer groupContextMenuItemContainer=new GroupContextMenuItemContainer();
groupContextMenuItemContainer.setContextMenuFlags(true,bEnableMerge,bEnableInterchange);
contextMenu.addItemContanier(groupContextMenuItemContainer);
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_EXPERIMENTS_GROUP:
switch (pickingMode) {
case CLICKED:
storageVA.getGroupList().get(iExternalID).toggleSelectionType();
deactivateAllDraggingCursor();
bActivateDraggingExperiments=true;
setDisplayListDirty();
break;
case DRAGGED:
if (bActivateDraggingExperiments == false) return;
if (bDragDropExpGroup == false) {
bDragDropExpGroup=true;
bDragDropGeneGroup=false;
iExpGroupToDrag=iExternalID;
}
setDisplayListDirty();
break;
case RIGHT_CLICKED:
boolean bEnableInterchange=false;
boolean bEnableMerge=false;
int iNrSelectedGroups=0;
IGroupList tempGroupList=storageVA.getGroupList();
for (Group group : tempGroupList) {
if (group.getSelectionType() == ESelectionType.SELECTION) iNrSelectedGroups++;
}
if (iNrSelectedGroups >= 2) {
bEnableMerge=true;
if (iNrSelectedGroups == 2) bEnableInterchange=true;
GroupContextMenuItemContainer groupContextMenuItemContainer=new GroupContextMenuItemContainer();
groupContextMenuItemContainer.setContextMenuFlags(false,bEnableMerge,bEnableInterchange);
contextMenu.addItemContanier(groupContextMenuItemContainer);
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
}
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_INFOCUS_SELECTION:
switch (pickingMode) {
case CLICKED:
bIsHeatmapInFocus=bIsHeatmapInFocus == true ? false : true;
glHeatMapView.setDisplayListDirty();
setDisplayListDirty();
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_CURSOR_LEVEL1:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel1=true;
break;
case DRAGGED:
if (bDisableCursorDraggingLevel1) return;
if (bActivateDraggingLevel1 == false) return;
bIsDraggingActiveLevel1=true;
bDisableBlockDraggingLevel1=true;
iDraggedCursorLevel1=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_BLOCK_CURSOR_LEVEL1:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel1=true;
break;
case DRAGGED:
if (bDisableBlockDraggingLevel1) return;
if (bActivateDraggingLevel1 == false) return;
bIsDraggingWholeBlockLevel1=true;
bDisableCursorDraggingLevel1=true;
iDraggedCursorLevel1=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_CURSOR_LEVEL2:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel2=true;
break;
case DRAGGED:
if (bDisableCursorDraggingLevel2) return;
if (bActivateDraggingLevel2 == false) return;
bIsDraggingActiveLevel2=true;
bDisableBlockDraggingLevel2=true;
iDraggedCursorLevel2=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_BLOCK_CURSOR_LEVEL2:
switch (pickingMode) {
case CLICKED:
deactivateAllDraggingCursor();
bActivateDraggingLevel2=true;
break;
case DRAGGED:
if (bDisableBlockDraggingLevel2) return;
if (bActivateDraggingLevel2 == false) return;
bIsDraggingWholeBlockLevel2=true;
bDisableCursorDraggingLevel2=true;
iDraggedCursorLevel2=iExternalID;
setDisplayListDirty();
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_TEXTURE_SELECTION:
switch (pickingMode) {
case CLICKED:
pickingPointLevel1=pick.getPickedPoint();
setEmbeddedHeatMapData();
setDisplayListDirty();
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_FIELD_SELECTION:
switch (pickingMode) {
case CLICKED:
pickingPointLevel2=pick.getPickedPoint();
setEmbeddedHeatMapData();
setDisplayListDirty();
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
}
break;
case HIER_HEAT_MAP_VIEW_SELECTION:
switch (pickingMode) {
case CLICKED:
break;
case DRAGGED:
break;
case MOUSE_OVER:
break;
case RIGHT_CLICKED:
contextMenu.setLocation(pick.getPickedPoint(),getParentGLCanvas().getWidth(),getParentGLCanvas().getHeight());
contextMenu.setMasterGLView(this);
break;
}
break;
}
}