public void closeDocument() {

        // remove re-size listener.
        documentViewScrollPane.removeComponentListener(this);

        // dispose the view
        if (documentView != null) {
            documentViewScrollPane.remove(documentView);
            documentView.dispose();
            documentView = null;
        }

        // close current document
        if (documentViewModel != null) {
            documentViewModel.dispose();
            documentViewModel = null;
        }


//        setFitMode(PAGE_FIT_NONE);
        setCurrentPageIndex(0);
        setZoom(1);
        setRotation(0);
//        setToolMode(DocumentViewModelImpl.DISPLAY_TOOL_NONE);
        setViewCursor(DocumentViewControllerImpl.CURSOR_DEFAULT);

    }