public void componentResized(ComponentEvent e) { JScrollPane sp= (JScrollPane) e.getComponent(); fixNameColumnWidth(sp.getViewport().getSize().width); sp.removeComponentListener(this); } });
@Override public void componentResized(ComponentEvent e) { JScrollPane sp = (JScrollPane) e.getComponent(); fixNameColumnWidth(sp.getViewport().getSize().width); sp.removeComponentListener(this); } });
/** * The method is invoked by {@link #addNotify} and {@link #removeNotify} to * ensure that any enclosing {@link JScrollPane} works correctly with this * panel. This method can be safely invoked with a <tt>null</tt> scrollPane. * * @param scrollPane the enclosing {@link JScrollPane} or <tt>null</tt> if * the panel is no longer enclosed in a {@link JScrollPane}. */ protected void setEnclosingScrollPane(JScrollPane scrollPane) { // if a scrollpane is already installed we remove it. if (enclosingScrollPane != null) { enclosingScrollPane.removeComponentListener(this); } enclosingScrollPane = scrollPane; if (enclosingScrollPane != null) { Uu.p("added root panel as a component listener to the scroll pane"); enclosingScrollPane.addComponentListener(this); default_scroll_mode = enclosingScrollPane.getViewport().getScrollMode(); } }
/** * The method is invoked by {@link #addNotify} and {@link #removeNotify} to * ensure that any enclosing {@link JScrollPane} works correctly with this * panel. This method can be safely invoked with a <tt>null</tt> scrollPane. * * @param scrollPane the enclosing {@link JScrollPane} or <tt>null</tt> if * the panel is no longer enclosed in a {@link JScrollPane}. */ protected void setEnclosingScrollPane(JScrollPane scrollPane) { // if a scrollpane is already installed we remove it. if (enclosingScrollPane != null) { enclosingScrollPane.removeComponentListener(this); } enclosingScrollPane = scrollPane; if (enclosingScrollPane != null) { Uu.p("added root panel as a component listener to the scroll pane"); enclosingScrollPane.addComponentListener(this); default_scroll_mode = enclosingScrollPane.getViewport().getScrollMode(); } }
/** * The method is invoked by {@link #addNotify} and {@link #removeNotify} to * ensure that any enclosing {@link JScrollPane} works correctly with this * panel. This method can be safely invoked with a <tt>null</tt> scrollPane. * * @param scrollPane the enclosing {@link JScrollPane} or <tt>null</tt> if * the panel is no longer enclosed in a {@link JScrollPane}. */ protected void setEnclosingScrollPane(JScrollPane scrollPane) { // if a scrollpane is already installed we remove it. if (enclosingScrollPane != null) { enclosingScrollPane.removeComponentListener(this); } enclosingScrollPane = scrollPane; if (enclosingScrollPane != null) { Uu.p("added root panel as a component listener to the scroll pane"); enclosingScrollPane.addComponentListener(this); default_scroll_mode = enclosingScrollPane.getViewport().getScrollMode(); } }
/** * Reverses the effect of <code>configureEnclosingScrollPane</code> by * replacing the <code>columnHeaderView</code> of the enclosing scroll pane * with <code>null</code>. * * @see #removeNotify * @see #configureEnclosingScrollPane */ private void unconfigureEnclosingScrollPane() { JScrollPane scrollPane = getAncestorOfClass( JScrollPane.class, this ); if ( scrollPane != null ) { scrollPane.removeComponentListener( this.componentHandler ); scrollPane.setColumnHeaderView( null ); scrollPane.setRowHeaderView( null ); scrollPane.setCorner( ScrollPaneConstants.UPPER_LEADING_CORNER, null ); } } }
public void closeDocument() { // remove re-size listener. documentViewScrollPane.removeComponentListener(this); // dispose the view if (documentView != null) { documentViewScrollPane.remove((JComponent) documentView); documentView.dispose(); documentView = null; } // close current document if (documentViewModel != null) { documentViewModel.dispose(); documentViewModel = null; } // setFitMode(PAGE_FIT_NONE); setCurrentPageIndex(0); setZoom(1); setRotation(0); // setToolMode(DocumentViewModelImpl.DISPLAY_TOOL_NONE); setViewCursor(DocumentViewControllerImpl.CURSOR_DEFAULT); }
JScrollPane scrollPane = getParentScrollPane(oldValue); if (scrollPane != null) { scrollPane.removeComponentListener(componentListener); scrollPane.getVerticalScrollBar() .removeAdjustmentListener(this);