public void componentResized(ComponentEvent e) {
        Object src = e.getSource();
        if (src == null)
            return;
        // we need to update the document view, if fit width of fit height is
        // selected we need to adjust the zoom level appropriately.
        if (src == documentViewScrollPane) {
            setFitMode(getFitMode());
        }
    }