public void mouseDragged(MouseEvent e) {
        int cursorType = canvas.getCursor().getType();
        Point dstPoint = SwingUtilities.convertPoint(resizeObject, e.getPoint(), resizeObject.getParent());
        dstRect = new Rectangle();

        switch (cursorType) {
        case Cursor.W_RESIZE_CURSOR:
            wResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.N_RESIZE_CURSOR:
            nResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.NW_RESIZE_CURSOR:
            nwResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.E_RESIZE_CURSOR:
            eResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.NE_RESIZE_CURSOR:
            neResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.S_RESIZE_CURSOR:
            sResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.SE_RESIZE_CURSOR:
            seResize(dstPoint);
            resetObjectCellSize();
            break;
        case Cursor.SW_RESIZE_CURSOR:
            swResize(dstPoint);
            resetObjectCellSize();
            break;
        }

    }