Exemplo n.º 1
0
  public OneColumnPageView(
      DocumentViewController documentDocumentViewController,
      JScrollPane documentScrollpane,
      DocumentViewModelImpl documentViewModel) {

    super(documentDocumentViewController, documentScrollpane, documentViewModel);

    // used to redirect mouse events
    this.documentScrollpane = documentScrollpane;

    // put all the gui elements together
    buildGUI();

    // add the first of many tools need for this views and others like it.
    currentPageChanger =
        new CurrentPageChanger(documentScrollpane, this, documentViewModel.getPageComponents());

    // add page changing key listeners
    if (this.documentViewController.getParentController() instanceof SwingController) {
      keyListenerPageChanger =
          KeyListenerPageColumnChanger.install(
              (SwingController) this.documentViewController.getParentController(),
              this.documentScrollpane,
              this,
              currentPageChanger);
    }
  }
Exemplo n.º 2
0
  public void dispose() {
    disposing = true;
    // remove utilities
    if (currentPageChanger != null) {
      currentPageChanger.dispose();
    }
    if (keyListenerPageChanger != null) {
      keyListenerPageChanger.uninstall();
    }

    // trigger a re-layout
    pagesPanel.removeAll();
    pagesPanel.invalidate();

    // make sure we call super.
    super.dispose();
  }