@Override protected void unregisterListeners() { for (IViewer<Node> viewer : getDomain().getViewers().values()) { viewer.viewerFocusedProperty().removeListener(viewerFocusChangeListeners.remove(viewer)); Scene scene = viewer.getRootPart().getVisual().getScene(); if (pressedFilterMap.containsKey(scene)) { scene.removeEventFilter(KeyEvent.KEY_PRESSED, pressedFilterMap.remove(scene)); } if (releasedFilterMap.containsKey(scene)) { scene.removeEventFilter(KeyEvent.KEY_RELEASED, releasedFilterMap.remove(scene)); } if (typedFilterMap.containsKey(scene)) { scene.removeEventFilter(KeyEvent.KEY_TYPED, typedFilterMap.remove(scene)); } } }
/** Method that loads all necessary information and initiates the views, the keyhandlers etc. */ public void loadProgramDataFromPdb() { // Extract nucleotide information rnaSequence3D = new RNASequence(getModel().getPdbfile()); // Extract base-sequence and compute watson-crick bonds getModel().setSequence(rnaSequence3D.extractString()); getModel().setBonds(rnaSequence3D.computeWCBonds()); // Init selection Model initSelectionModel(); // Init the Views initPrimaryView(); initSecondaryView(); initTertiaryView(); // init focus selection listener initSelectionListener(); selectionFocusBinding(); // init keyhandler if (keyPressedEventHandler != null) scene.removeEventFilter(KeyEvent.KEY_PRESSED, keyPressedEventHandler); initKeyEventHandler(); scene.addEventFilter(KeyEvent.KEY_PRESSED, keyPressedEventHandler); }
public void unregister(Scene scene) { scene.removeEventFilter(KeyEvent.KEY_PRESSED, keyEventHandler); scene.removeEventFilter(KeyEvent.KEY_TYPED, keyEventHandler); scene.removeEventFilter(KeyEvent.KEY_RELEASED, keyEventHandler); }