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); } }
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(); }