@Override public void close() throws IOException { if(cmpt!=null && l!=null ){ cmpt.removeAdjustmentListener(l); cmpt = null; l = null; } }};
private void releaseImage() { view.setNavigator(null); scrollPane.getHorizontalScrollBar().removeAdjustmentListener(adjListener); scrollPane.getVerticalScrollBar().removeAdjustmentListener(adjListener); view = null; }
private void removeAutoScrollScrollbarAdjustmentListener() { JScrollPane scrollPane = getEnclosingScrollPane(); if (scrollPane != null && autoScrollScrollbarAdjustmentListener != null) { scrollPane.getVerticalScrollBar().removeAdjustmentListener(autoScrollScrollbarAdjustmentListener); autoScrollScrollbarAdjustmentListener = null; } }
@Override public void setVisible(boolean flag) { if (! flag) { scrollBar.removeAdjustmentListener(this); } else { if (! isVisible() && document != null) { scrollBar.addAdjustmentListener(this); } } super.setVisible(flag); }
public void dispose() { // remove standard mouse listeners documentView.removeMouseListener(this); scrollpane.getHorizontalScrollBar().removeAdjustmentListener(this); scrollpane.getHorizontalScrollBar().removeMouseListener(this); scrollpane.getVerticalScrollBar().removeAdjustmentListener(this); scrollpane.getVerticalScrollBar().removeMouseListener(this); // Remove wheel mouse listener MouseWheelCurrentPageListener.uninstall(scrollpane, mouseWheelCurrentPageListener); } }
public void disconnectTableFrame(TableFrameController tfc) { _openFramesConnectedToMe.remove(tfc); ConstraintView[] constraintDataToRemove = _constraintViewsModel.removeConstraintsForTable(tfc._tableName); ComponentAdapter compListenerToRemove = _compListenersToOtherFramesByFrameCtrlr.remove(tfc); if(null != compListenerToRemove) { tfc._frame.removeComponentListener(compListenerToRemove); } AdjustmentListener adjListenerToRemove = _scrollListenersToOtherFramesByFrameCtrlr.remove(tfc); if(null != adjListenerToRemove) { tfc._frame.scrollPane.getVerticalScrollBar().removeAdjustmentListener(adjListenerToRemove); } ColumnSortListener columnSortListener = _columnSortListenersToOtherFramesByFrameCtrlr.get(tfc); if(null != columnSortListener) { tfc.removeSortListener(columnSortListener); } _desktopController.removeConstraintViews(constraintDataToRemove, false); }
public void adjustmentValueChanged(AdjustmentEvent e) { JScrollBar rSB = rightScrollPane.getVerticalScrollBar(); JScrollBar lSB = leftScrollPane.getVerticalScrollBar(); JScrollBar cSB = centerScrollPane.getVerticalScrollBar(); rSB.removeAdjustmentListener(leftRightScrollBarAdjustementListener); lSB.removeAdjustmentListener(leftRightScrollBarAdjustementListener); rSB.setValue(verticalScrollBar.getValue()); lSB.setValue(verticalScrollBar.getValue()); cSB.setValue(verticalScrollBar.getValue()); rSB.addAdjustmentListener(leftRightScrollBarAdjustementListener); lSB.addAdjustmentListener(leftRightScrollBarAdjustementListener); } }
/** * Set the document displayed in this NaviView. * @param document the document to be displayed - cannot be null. */ public void setDocument(Document document) { scrollBar.removeAdjustmentListener(this); this.document = document; editorPane.setDocument(document); scrollBar.addAdjustmentListener(this); documentChangedLength(); }
private void scrollToBottom(JScrollPane scrollPane) { JScrollBar verticalBar = scrollPane.getVerticalScrollBar(); AdjustmentListener downScroller = new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable adjustable = e.getAdjustable(); adjustable.setValue(adjustable.getMaximum()); verticalBar.removeAdjustmentListener(this); } }; verticalBar.addAdjustmentListener(downScroller); }
tfc._frame.scrollPane.getVerticalScrollBar().removeAdjustmentListener(listenerToRemove);
/** * Scrolls a {@code scrollPane} all the way up or down. * * @param scrollPane the scrollPane that we want to scroll up or down * @param direction we scroll up if this is {@link ScrollDirection#UP}, or down if it's {@link ScrollDirection#DOWN} */ public static void scroll(JScrollPane scrollPane, ScrollDirection direction) { JScrollBar verticalBar = scrollPane.getVerticalScrollBar(); // If we want to scroll to the top set this value to the minimum, else to the maximum int topOrBottom = direction.equals(ScrollDirection.UP) ? verticalBar.getMinimum() : verticalBar.getMaximum(); AdjustmentListener scroller = new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable adjustable = e.getAdjustable(); adjustable.setValue(topOrBottom); // We have to remove the listener since otherwise the user would be unable to scroll afterwards verticalBar.removeAdjustmentListener(this); } }; verticalBar.addAdjustmentListener(scroller); } public enum ScrollDirection { UP, DOWN }
public void adjustmentValueChanged(AdjustmentEvent e) { JScrollBar rSB = rightScrollPane.getVerticalScrollBar(); verticalScrollBar.removeAdjustmentListener(verticalScrollBarAdjustementListener); verticalScrollBar.setMinimum(rSB.getMinimum()); verticalScrollBar.setMaximum(rSB.getMaximum()); verticalScrollBar.setBlockIncrement(rSB.getBlockIncrement()); verticalScrollBar.setUnitIncrement(rSB.getUnitIncrement()); verticalScrollBar.setVisibleAmount(rSB.getVisibleAmount()); verticalScrollBar.addAdjustmentListener(verticalScrollBarAdjustementListener); } }
@Override public void hierarchyChanged(final HierarchyEvent e) { if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) == HierarchyEvent.PARENT_CHANGED) { JViewport jViewport = getParentViewport(); if (jViewport != null) { Container container = getParentViewport().getParent(); if (container instanceof JScrollPane) { JScrollPane jScroll = (JScrollPane) container; //jScroll.getVerticalScrollBar().removeAdjustmentListener(this); jScroll.getHorizontalScrollBar().removeAdjustmentListener(this); //jScroll.getVerticalScrollBar().addAdjustmentListener(this); jScroll.getHorizontalScrollBar().addAdjustmentListener(this); } } } }
@Override protected void uninstallListeners() { if (scrollTimer != null) { // it is already called otherwise super.uninstallListeners(); } scrollbar.removeAdjustmentListener(myAdjustmentListener); scrollbar.removeMouseListener(myMouseListener); scrollbar.removeMouseMotionListener(myMouseMotionListener); scrollbar.removeHierarchyListener(myHierarchyListener); updateGlobalListeners(true); Disposer.dispose(myThumbFadeAnimator); Disposer.dispose(myMouseOverScrollbarExpandAnimator); Disposer.dispose(myMacScrollbarFadeTimer); Disposer.dispose(myMacScrollbarFadeAnimator); }
scrollBar.removeAdjustmentListener(this); value = maximum - extent; scrollBar.setValue(value);
public void visibleRangeChanged(String ref, Range r) { if (r.getLength() > ResolutionSettings.getVariantLowToHighThreshold()) { showMessage(ZOOM_MESSAGE); } else { try { // Detach the adjustment listeners so that setting the maximum doesn't fire an event. for (JScrollBar sb: scrollers) { sb.removeAdjustmentListener(scrollerListener); } for (JScrollBar sb: scrollers) { sb.setMaximum(LocationController.getInstance().getMaxRangeEnd()); sb.setValue(r.getFrom()); sb.setVisibleAmount(r.getLength()); sb.setBlockIncrement(r.getLength()); sb.repaint(); } } finally { // Reattach the adjustment listeners. for (JScrollBar sb: scrollers) { sb.addAdjustmentListener(scrollerListener); } } } rangeField.setText(String.format("%s:%d-%d", ref, r.getFrom(), r.getTo())); }
@Override protected void uninstallListeners() { // fix for defect 109 - memory leak on changing skin this.incrButton.removeMouseListener(this.substanceMouseListener); this.decrButton.removeMouseListener(this.substanceMouseListener); this.mySecondDecreaseButton .removeMouseListener(this.substanceMouseListener); this.mySecondIncreaseButton .removeMouseListener(this.substanceMouseListener); this.substanceMouseListener = null; this.scrollbar.removeMouseListener(this.substanceThumbRolloverListener); this.scrollbar .removeMouseMotionListener(this.substanceThumbRolloverListener); this.substanceThumbRolloverListener = null; this.scrollbar .removePropertyChangeListener(this.substancePropertyListener); this.substancePropertyListener = null; this.mySecondDecreaseButton.removeMouseListener(this.buttonListener); this.mySecondIncreaseButton.removeMouseListener(this.buttonListener); this.scrollbar .removeAdjustmentListener(this.substanceAdjustmentListener); this.substanceAdjustmentListener = null; super.uninstallListeners(); }
@Override protected void uninstallListeners() { // fix for defect 109 - memory leak on changing skin this.incrButton.removeMouseListener(this.substanceMouseListener); this.decrButton.removeMouseListener(this.substanceMouseListener); this.mySecondDecreaseButton .removeMouseListener(this.substanceMouseListener); this.mySecondIncreaseButton .removeMouseListener(this.substanceMouseListener); this.substanceMouseListener = null; this.scrollbar.removeMouseListener(this.substanceThumbRolloverListener); this.scrollbar .removeMouseMotionListener(this.substanceThumbRolloverListener); this.substanceThumbRolloverListener = null; this.scrollbar .removePropertyChangeListener(this.substancePropertyListener); this.substancePropertyListener = null; this.mySecondDecreaseButton.removeMouseListener(this.buttonListener); this.mySecondIncreaseButton.removeMouseListener(this.buttonListener); this.scrollbar .removeAdjustmentListener(this.substanceAdjustmentListener); this.substanceAdjustmentListener = null; super.uninstallListeners(); }
componentHandler); this.graphComponent.getHorizontalScrollBar() .removeAdjustmentListener(adjustmentHandler); this.graphComponent.getVerticalScrollBar() .removeAdjustmentListener(adjustmentHandler);
componentHandler); this.graphComponent.getHorizontalScrollBar() .removeAdjustmentListener(adjustmentHandler); this.graphComponent.getVerticalScrollBar() .removeAdjustmentListener(adjustmentHandler);