private void setViewType() {

        // check if there is current view, if so dispose it
        if (documentView != null) {
            documentViewScrollPane.remove(documentView);
            documentViewScrollPane.validate();
            documentView.dispose();
        }

        if (documentViewModel == null) {
            return;
        }

        // create the desired view with the current viewModel.
        if (viewType == ONE_COLUMN_VIEW) {
            documentView =
                    new OneColumnPageView(this, documentViewScrollPane, documentViewModel);
        } else if (viewType == ONE_PAGE_VIEW) {
            documentView =
                    new OnePageView(this, documentViewScrollPane, documentViewModel);
        } else if (viewType == TWO_COLUMN_LEFT_VIEW) {
            documentView =
                    new TwoColumnPageView(this, documentViewScrollPane,
                            documentViewModel,
                            DocumentView.LEFT_VIEW);
        } else if (viewType == TWO_PAGE_LEFT_VIEW) {
            documentView =
                    new TwoPageView(this, documentViewScrollPane,
                            documentViewModel,
                            DocumentView.LEFT_VIEW);
        } else if (viewType == TWO_COLUMN_RIGHT_VIEW) {
            documentView =
                    new TwoColumnPageView(this, documentViewScrollPane,
                            documentViewModel,
                            DocumentView.RIGHT_VIEW);
        } else if (viewType == TWO_PAGE_RIGHT_VIEW) {
            documentView =
                    new TwoPageView(this, documentViewScrollPane,
                            documentViewModel,
                            DocumentView.RIGHT_VIEW);
        } else {
            documentView =
                    new OneColumnPageView(this, documentViewScrollPane, documentViewModel);
        }

        // add the new view the scroll pane
        documentViewScrollPane.setViewportView(documentView);
        documentViewScrollPane.validate();

        // re-apply the fit mode
        viewerController.setPageFitMode(viewportFitMode, true);

        // set current page
        setCurrentPageIndex(documentViewModel.getViewCurrentPageIndex());

    }