public boolean intersects(Dimension d) {

        int x1 = (int) from.drawx;

        int y1 = (int) from.drawy;

        int x2 = (int) to.drawx;

        int y2 = (int) to.drawy;



        return (((x1>0 || x2>0) && (x1<d.width  || x2<d.width)) &&

                  ((y1>0 || y2>0) && (y1<d.height || y2<d.height) ));



    }