private void updateMode(final int mode) {
//    try { throw new Exception("updateMode("+mode+")"); } catch(final Throwable exp) { exp.printStackTrace(DjVuOptions.err); }
        switch (mode) {
            case DjVuBean.TEXT_MODE:
                textMode.setSelected(true);

                if (panMode.isSelected()) {
                    panMode.setSelected(false);
                }

                if (zoomMode.isSelected()) {
                    zoomMode.setSelected(false);
                }

                setZoomEnabled(false);

                break;
            case DjVuBean.ZOOM_MODE:
                zoomMode.setSelected(true);

                if (panMode.isSelected()) {
                    panMode.setSelected(false);
                }

                if (textMode.isSelected()) {
                    textMode.setSelected(false);
                }

                setZoomEnabled(true);

                break;
            case DjVuBean.PAN_MODE:
            default:
                panMode.setSelected(true);

                if (zoomMode.isSelected()) {
                    zoomMode.setSelected(false);
                }

                if (textMode.isSelected()) {
                    textMode.setSelected(false);
                }

                setZoomEnabled(true);

                break;
        }
    }