public static void uninstall(JScrollPane scrollpane, Object listener) { if (scrollpane != null && listener != null && listener instanceof MouseWheelCurrentPageListener) { scrollpane.removeMouseWheelListener((MouseWheelCurrentPageListener) listener); } }
public static void uninstall(JScrollPane scrollpane, Object listener) { if (scrollpane != null && listener != null && listener instanceof MouseWheelListenerPageChanger) { scrollpane.removeMouseWheelListener((MouseWheelListenerPageChanger) listener); } }
/** * {@inheritDoc} */ @Override public synchronized void removeMouseWheelListener( final MouseWheelListener aListener ) { lazyInitListeners(); this.originalListeners.remove( aListener ); super.removeMouseWheelListener( aListener ); }
public void uninstallTool() { documentScrollPane.setWheelScrollingEnabled(true); documentScrollPane.removeMouseWheelListener(this); } }
public ToolHandler uninstallCurrentTool() { if (currentTool != null) { currentTool.uninstallTool(); removeMouseListener(currentTool); removeMouseMotionListener(currentTool); if (currentTool instanceof TextSelectionViewHandler) { documentScrollpane.removeMouseWheelListener((TextSelectionViewHandler) currentTool); } } return currentTool; }
jScrollPaneLinkingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneLinkingFeatures, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneLinkingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneGapClosingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneGapClosingFeatures, new GridBagConstraints(0, 12, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneGapClosingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneSplittingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneSplittingFeatures, new GridBagConstraints(0, 18, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneSplittingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneMergingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneMergingFeatures, new GridBagConstraints(0, 24, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneMergingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPaneLinkingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneLinkingFeatures, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneLinkingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneGapClosingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneGapClosingFeatures, new GridBagConstraints(0, 12, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneGapClosingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneSplittingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneSplittingFeatures, new GridBagConstraints(0, 18, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneSplittingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneMergingFeatures.removeMouseWheelListener(l[0]); this.add(jScrollPaneMergingFeatures, new GridBagConstraints(0, 24, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jScrollPaneMergingFeatures.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
if (listeners != null && listeners.length == 1) { final MouseWheelListener listener = listeners[0]; treeTableScrollPane.removeMouseWheelListener(listener); treeTableScrollPane.addMouseWheelListener(new MouseWheelListener() { public void mouseWheelMoved(MouseWheelEvent e) {
protected void uninstallListeners(JComponent c) { JViewport viewport = scrollpane.getViewport(); JScrollBar vsb = scrollpane.getVerticalScrollBar(); JScrollBar hsb = scrollpane.getHorizontalScrollBar(); if (viewport != null) { viewport.removeChangeListener(viewportChangeListener); } if (vsb != null) { vsb.getModel().removeChangeListener(vsbChangeListener); vsb.removePropertyChangeListener(vsbPropertyChangeListener); } if (hsb != null) { hsb.getModel().removeChangeListener(hsbChangeListener); hsb.removePropertyChangeListener(hsbPropertyChangeListener); } scrollpane.removePropertyChangeListener(spPropertyChangeListener); if (mouseScrollListener != null) { scrollpane.removeMouseWheelListener(mouseScrollListener); } vsbChangeListener = null; hsbChangeListener = null; viewportChangeListener = null; spPropertyChangeListener = null; mouseScrollListener = null; }
if (listeners != null && listeners.length == 1) { final MouseWheelListener listener = listeners[0]; tableScroll.removeMouseWheelListener(listener); tableScroll.addMouseWheelListener(new MouseWheelListener() { public void mouseWheelMoved(MouseWheelEvent e) {
scrollpane.removeMouseWheelListener(mouseScrollListener);
public void dispose() { currentDocument = null; // clean up scroll listeners documentViewController.getHorizontalScrollBar().removeAdjustmentListener(this); documentViewController.getVerticalScrollBar().removeAdjustmentListener(this); // remove custom handlers if (currentTool != null) { removeMouseListener(currentTool); removeMouseMotionListener(currentTool); } // mouse/wheel listener documentScrollpane.removeMouseWheelListener(mouseWheelZoom); removeMouseListener(this); // focus management removeFocusListener(this); // add a focus management listener. KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); focusManager.removePropertyChangeListener(this); }