private TabLabel findMostOverlapping(Axis measurer, TabLabel... labels) {
    double freeSpace;

    if (measurer.getMinValue(dragRec) < measurer.getMinValue(dragOriginalRec)) {
      freeSpace = measurer.getMaxValue(dragOriginalRec) - measurer.getMaxValue(dragRec);
    }
    else {
      freeSpace = measurer.getMinValue(dragRec) - measurer.getMinValue(dragOriginalRec);
    }


    int max = -1;
    TabLabel maxLabel = null;
    for (TabLabel each : labels) {
      if (each == null) continue;

      final Rectangle eachBounds = each.getBounds();
      if (measurer.getSize(eachBounds) > freeSpace + freeSpace *0.3) continue;

      Rectangle intersection = dragRec.intersection(eachBounds);
      int size = intersection.width * intersection.height;
      if (size > max) {
        max = size;
        maxLabel = each;
      }
    }

    return maxLabel;
  }
private TabLabel findMostOverlapping(Axis measurer, TabLabel... labels)