protected void updateDefaultLocation()
    {
        //Récupération des centres
        int centrex1 = (elem1.getX() + elem1.getWidth() / 2);
        int centrey1 = (elem1.getY() + elem1.getHeight() / 2);
        int centrex2 = (elem2.getX() + elem2.getWidth() / 2);
        int centrey2 = (elem2.getY() + elem2.getHeight() / 2);

        int hauteur = centrex2 - centrex1;
        int largeur = centrey2 - centrey1;

        if (Math.abs(hauteur) > Math.abs(largeur)) {
            x1 = hauteur > 0 ? elem1.getX() + elem1.getWidth() : elem1.getX();
            y1 = elem1.getY() + elem1.getHeight() / 2;
            x2 = hauteur < 0 ? elem2.getX() + elem2.getWidth() : elem2.getX();
            y2 = elem2.getY() + elem2.getHeight() / 2;
        } else {
            x1 = elem1.getX() + elem1.getWidth() / 2;
            y1 = largeur > 0 ? elem1.getY() + elem1.getHeight() : elem1.getY();
            x2 = elem2.getX() + elem2.getWidth() / 2;
            y2 = largeur < 0 ? elem2.getY() + elem2.getHeight() : elem2.getY();
        }
    }