Program: 108441
Project: 108441
Buggy source:
/** 
 * Creates all required listeners
 */
private void initializeListeners(){
  canvas.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent arg0){
      if (arg0.button == 1) {
        final ARXNode node=getNode(arg0.x,arg0.y);
        if (node != null) {
          actionButtonClicked1(node);
        }
      }
 else       if (arg0.button == 3) {
        final ARXNode node=getNode(arg0.x,arg0.y);
        if (node != null) {
          Point display=canvas.toDisplay(arg0.x,arg0.y);
          actionButtonClicked3(node,display.x,display.y);
        }
      }
    }
  }
);
  canvas.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent arg0){
      dragX=arg0.x;
      dragY=arg0.y;
      dragStartX=arg0.x;
      dragStartY=arg0.y;
      if (dragType == DragType.NONE) {
        if (arg0.button == 1) {
          dragType=DragType.MOVE;
        }
 else         if (arg0.button == 3) {
          dragType=DragType.ZOOM;
        }
      }
    }
    @Override public void mouseUp(    MouseEvent arg0){
      dragType=DragType.NONE;
    }
  }
);
  canvas.addMouseMoveListener(new MouseMoveListener(){
    @Override public void mouseMove(    MouseEvent arg0){
      if (arg0.button != 1 && arg0.button != 2) {
        dragType=DragType.NONE;
      }
      if (dragType != DragType.NONE) {
        final int deltaX=arg0.x - dragX;
        final int deltaY=arg0.y - dragY;
        if (dragType == DragType.MOVE) {
          for (          final ARXNode node : lattice) {
            final Bounds dbounds=(Bounds)node.getAttributes().get(ATTRIBUTE_BOUNDS);
            dbounds.centerX+=deltaX;
            dbounds.centerY+=deltaY;
            dbounds.x+=deltaX;
            dbounds.y+=deltaY;
          }
        }
 else         if (dragType == DragType.ZOOM) {
          double zoom=-((double)deltaY / (double)screen.y) * ZOOM_SPEED;
          final double newWidth=nodeWidth + (zoom * nodeWidth);
          if (newWidth > screen.x) {
            zoom=(screen.x - nodeWidth) / nodeWidth;
          }
          if (newWidth < MIN_WIDTH) {
            zoom=(MIN_WIDTH - nodeWidth) / nodeWidth;
          }
          final double newHeight=nodeHeight + (zoom * nodeHeight);
          if (newHeight > screen.y) {
            zoom=(screen.y - nodeHeight) / nodeHeight;
          }
          if (newHeight < MIN_HEIGHT) {
            zoom=(MIN_HEIGHT - nodeHeight) / nodeHeight;
          }
          nodeWidth+=zoom * nodeWidth;
          nodeHeight+=zoom * nodeHeight;
          for (          final ARXNode node : lattice) {
            final Bounds dbounds=(Bounds)node.getAttributes().get(ATTRIBUTE_BOUNDS);
            dbounds.centerX-=dragStartX;
            dbounds.centerX+=zoom * dbounds.centerX;
            dbounds.centerX+=dragStartX;
            dbounds.centerY-=dragStartY;
            dbounds.centerY+=zoom * dbounds.centerY;
            dbounds.centerY+=dragStartY;
            dbounds.x-=dragStartX;
            dbounds.x+=zoom * dbounds.x;
            dbounds.x+=dragStartX;
            dbounds.y-=dragStartY;
            dbounds.y+=zoom * dbounds.y;
            dbounds.y+=dragStartY;
          }
        }
        dragX+=deltaX;
        dragY+=deltaY;
        canvas.redraw();
      }
    }
  }
);
  canvas.addMouseMoveListener(new MouseMoveListener(){
    public void mouseMove(    MouseEvent arg0){
      tooltipX=arg0.x;
      tooltipY=arg0.y;
    }
  }
);
  canvas.addListener(SWT.MouseExit,new Listener(){
    public void handleEvent(    Event e){
      tooltipX=-1;
      tooltipY=-1;
    }
  }
);
  canvas.addControlListener(new ControlAdapter(){
    @Override public void controlResized(    ControlEvent arg0){
      screen=canvas.getSize();
      initializeCanvas();
      canvas.redraw();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates all required listeners
 */
private void initializeListeners(){
  canvas.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent arg0){
      dragX=arg0.x;
      dragY=arg0.y;
      dragStartX=arg0.x;
      dragStartY=arg0.y;
      if (dragType == DragType.NONE) {
        if (arg0.button == 1) {
          dragType=DragType.MOVE;
        }
 else         if (arg0.button == 3) {
          dragType=DragType.ZOOM;
        }
      }
    }
    @Override public void mouseUp(    MouseEvent arg0){
      dragType=DragType.NONE;
    }
  }
);
  canvas.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent arg0){
      if (arg0.button == 1) {
        final ARXNode node=getNode(arg0.x,arg0.y);
        if (node != null) {
          actionButtonClicked1(node);
        }
      }
 else       if (arg0.button == 3) {
        final ARXNode node=getNode(arg0.x,arg0.y);
        if (node != null) {
          Point display=canvas.toDisplay(arg0.x,arg0.y);
          actionButtonClicked3(node,display.x,display.y);
        }
      }
    }
  }
);
  canvas.addMouseMoveListener(new MouseMoveListener(){
    @Override public void mouseMove(    MouseEvent arg0){
      if (dragType != DragType.NONE) {
        final int deltaX=arg0.x - dragX;
        final int deltaY=arg0.y - dragY;
        if (dragType == DragType.MOVE) {
          for (          final ARXNode node : lattice) {
            final Bounds dbounds=(Bounds)node.getAttributes().get(ATTRIBUTE_BOUNDS);
            dbounds.centerX+=deltaX;
            dbounds.centerY+=deltaY;
            dbounds.x+=deltaX;
            dbounds.y+=deltaY;
          }
        }
 else         if (dragType == DragType.ZOOM) {
          double zoom=-((double)deltaY / (double)screen.y) * ZOOM_SPEED;
          final double newWidth=nodeWidth + (zoom * nodeWidth);
          if (newWidth > screen.x) {
            zoom=(screen.x - nodeWidth) / nodeWidth;
          }
          if (newWidth < MIN_WIDTH) {
            zoom=(MIN_WIDTH - nodeWidth) / nodeWidth;
          }
          final double newHeight=nodeHeight + (zoom * nodeHeight);
          if (newHeight > screen.y) {
            zoom=(screen.y - nodeHeight) / nodeHeight;
          }
          if (newHeight < MIN_HEIGHT) {
            zoom=(MIN_HEIGHT - nodeHeight) / nodeHeight;
          }
          nodeWidth+=zoom * nodeWidth;
          nodeHeight+=zoom * nodeHeight;
          for (          final ARXNode node : lattice) {
            final Bounds dbounds=(Bounds)node.getAttributes().get(ATTRIBUTE_BOUNDS);
            dbounds.centerX-=dragStartX;
            dbounds.centerX+=zoom * dbounds.centerX;
            dbounds.centerX+=dragStartX;
            dbounds.centerY-=dragStartY;
            dbounds.centerY+=zoom * dbounds.centerY;
            dbounds.centerY+=dragStartY;
            dbounds.x-=dragStartX;
            dbounds.x+=zoom * dbounds.x;
            dbounds.x+=dragStartX;
            dbounds.y-=dragStartY;
            dbounds.y+=zoom * dbounds.y;
            dbounds.y+=dragStartY;
          }
        }
        dragX+=deltaX;
        dragY+=deltaY;
        canvas.redraw();
      }
    }
  }
);
  canvas.addMouseMoveListener(new MouseMoveListener(){
    public void mouseMove(    MouseEvent arg0){
      tooltipX=arg0.x;
      tooltipY=arg0.y;
    }
  }
);
  canvas.addListener(SWT.MouseExit,new Listener(){
    public void handleEvent(    Event e){
      tooltipX=-1;
      tooltipY=-1;
    }
  }
);
  canvas.addControlListener(new ControlAdapter(){
    @Override public void controlResized(    ControlEvent arg0){
      screen=canvas.getSize();
      initializeCanvas();
      canvas.redraw();
    }
  }
);
}