Java 类javax.swing.plaf.ScrollPaneUI 实例源码

项目:incubator-netbeans    文件:DocumentViewOp.java   
private void updateListeners() {
    ScrollPaneUI ui = scrollPane.getUI();
    if (ui != lastUI) {
        // Update "ui" property listener
        if (ui != null) {
            // Check mouse wheel listeners on scroll pane.
            // Pair first non-MWDelegator listener with 
            // Remove any other delegators than this one.
            MouseWheelListener[] mwls = scrollPane.getListeners(MouseWheelListener.class);
            if (LOG.isLoggable(Level.FINE)) {
                LOG.log(Level.FINE, "MouseWheelDelegator.updateListeners(): scrollPane change scrollPane={0}, MouseWheelListeners:{1}\n",
                        new Object[]{obj2String(scrollPane), Arrays.asList(mwls)});
            }
            delegateListener = null;
            for (MouseWheelListener listener : mwls) {
                if (listener instanceof MouseWheelDelegator) {
                    scrollPane.removeMouseWheelListener(listener);
                    if (delegateListener == null) {
                        delegateListener = ((MouseWheelDelegator) listener).delegateListener;
                        scrollPane.addMouseWheelListener(this);
                    }
                } else { // Regular listener 
                    // Current patch only assumes one MW listener attached by the UI impl.
                    if (delegateListener == null) {
                        delegateListener = listener;
                        scrollPane.removeMouseWheelListener(listener);
                        scrollPane.addMouseWheelListener(this);
                    }
                }
            }
        }
        lastUI = ui;
    }
}
项目:openjdk-jdk10    文件:JScrollPaneOperator.java   
/**
 * Maps {@code JScrollPane.getUI()} through queue
 */
public ScrollPaneUI getUI() {
    return (runMapping(new MapAction<ScrollPaneUI>("getUI") {
        @Override
        public ScrollPaneUI map() {
            return ((JScrollPane) getSource()).getUI();
        }
    }));
}
项目:openjdk-jdk10    文件:JScrollPaneOperator.java   
/**
 * Maps {@code JScrollPane.setUI(ScrollPaneUI)} through queue
 */
public void setUI(final ScrollPaneUI scrollPaneUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JScrollPane) getSource()).setUI(scrollPaneUI);
        }
    });
}
项目:openjdk9    文件:JScrollPaneOperator.java   
/**
 * Maps {@code JScrollPane.getUI()} through queue
 */
public ScrollPaneUI getUI() {
    return (runMapping(new MapAction<ScrollPaneUI>("getUI") {
        @Override
        public ScrollPaneUI map() {
            return ((JScrollPane) getSource()).getUI();
        }
    }));
}
项目:openjdk9    文件:JScrollPaneOperator.java   
/**
 * Maps {@code JScrollPane.setUI(ScrollPaneUI)} through queue
 */
public void setUI(final ScrollPaneUI scrollPaneUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JScrollPane) getSource()).setUI(scrollPaneUI);
        }
    });
}
项目:PhET    文件:PScrollPane.java   
/**
 * Sets the UI.
 * 
 * @param ui the scroll pane UI to associate with this PScollPane
 */
public void setUI(final ScrollPaneUI ui) {
    super.setUI(ui);

    if (!disableKeyActions) {
        installCustomKeyActions();
    }
    else {
        disableKeyActions();
    }
}
项目:piccolo2d.java    文件:PScrollPane.java   
/**
 * Sets the UI.
 * 
 * @param ui the scroll pane UI to associate with this PScollPane
 */
public void setUI(final ScrollPaneUI ui) {
    super.setUI(ui);

    if (!disableKeyActions) {
        installCustomKeyActions();
    }
    else {
        disableKeyActions();
    }
}
项目:cn1    文件:JScrollPaneTest.java   
public void testGetSetUpdateUI() throws Exception {
    assertNotNull(pane.getUI());
    ScrollPaneUI ui = new BasicScrollPaneUI();
    pane.setUI(ui);
    assertEquals(ui, pane.getUI());
    pane.updateUI();
    assertNotSame(ui, pane.getUI());
}
项目:freeVM    文件:JScrollPaneTest.java   
public void testGetSetUpdateUI() throws Exception {
    assertNotNull(pane.getUI());
    ScrollPaneUI ui = new BasicScrollPaneUI();
    pane.setUI(ui);
    assertEquals(ui, pane.getUI());
    pane.updateUI();
    assertNotSame(ui, pane.getUI());
}
项目:freeVM    文件:JScrollPaneTest.java   
public void testGetSetUpdateUI() throws Exception {
    assertNotNull(pane.getUI());
    ScrollPaneUI ui = new BasicScrollPaneUI();
    pane.setUI(ui);
    assertEquals(ui, pane.getUI());
    pane.updateUI();
    assertNotSame(ui, pane.getUI());
}
项目:jediterm    文件:JBScrollPane.java   
@Override
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  updateViewportBorder();
  if (ui instanceof BasicScrollPaneUI) {
    try {
      Field field = BasicScrollPaneUI.class.getDeclaredField("mouseScrollListener");
      field.setAccessible(true);
      Object value = field.get(ui);
      if (value instanceof MouseWheelListener) {
        MouseWheelListener oldListener = (MouseWheelListener)value;
        MouseWheelListener newListener = event -> {
          if (isScrollEvent(event)) {
            Object source = event.getSource();
            if (source instanceof JScrollPane) {
              JScrollPane pane = (JScrollPane)source;
              if (pane.isWheelScrollingEnabled()) {
                JScrollBar bar = event.isShiftDown() ? pane.getHorizontalScrollBar() : pane.getVerticalScrollBar();
                if (bar != null && bar.isVisible()) oldListener.mouseWheelMoved(event);
              }
            }
          }
        };
        field.set(ui, newListener);
        // replace listener if field updated successfully
        removeMouseWheelListener(oldListener);
        addMouseWheelListener(newListener);
      }
    }
    catch (Exception exception) {
      LOG.warn(exception);
    }
  }
}
项目:j2se_for_android    文件:JScrollPane.java   
public ScrollPaneUI getUI() {
    AndroidClassUtil.callEmptyMethod();
    return null;
}
项目:j2se_for_android    文件:JScrollPane.java   
public void setUI(ScrollPaneUI ui) {
    AndroidClassUtil.callEmptyMethod();
    super.setUI(ui);
}
项目:javify    文件:JScrollPane.java   
public void updateUI()
{
  setUI((ScrollPaneUI) UIManager.getUI(this));
}
项目:intellij-ce-playground    文件:JBScrollPane.java   
@Override
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  updateViewportBorder();
}
项目:jvm-stm    文件:JScrollPane.java   
public void updateUI()
{
  setUI((ScrollPaneUI) UIManager.getUI(this));
}
项目:cn1    文件:JScrollPane.java   
public ScrollPaneUI getUI() {
    return (ScrollPaneUI)ui;
}
项目:cn1    文件:JScrollPane.java   
public void setUI(final ScrollPaneUI ui) {
    super.setUI(ui);
}
项目:cn1    文件:JScrollPane.java   
public void updateUI() {
    setUI((ScrollPaneUI)UIManager.getUI(this));
}
项目:JamVM-PH    文件:JScrollPane.java   
public void updateUI()
{
  setUI((ScrollPaneUI) UIManager.getUI(this));
}
项目:tools-idea    文件:JBScrollPane.java   
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  updateViewportBorder();
}
项目:classpath    文件:JScrollPane.java   
public void updateUI()
{
  setUI((ScrollPaneUI) UIManager.getUI(this));
}
项目:freeVM    文件:JScrollPane.java   
public ScrollPaneUI getUI() {
    return (ScrollPaneUI)ui;
}
项目:freeVM    文件:JScrollPane.java   
public void setUI(final ScrollPaneUI ui) {
    super.setUI(ui);
}
项目:freeVM    文件:JScrollPane.java   
public void updateUI() {
    setUI((ScrollPaneUI)UIManager.getUI(this));
}
项目:freeVM    文件:JScrollPane.java   
public ScrollPaneUI getUI() {
    return (ScrollPaneUI)ui;
}
项目:freeVM    文件:JScrollPane.java   
public void setUI(final ScrollPaneUI ui) {
    super.setUI(ui);
}
项目:freeVM    文件:JScrollPane.java   
public void updateUI() {
    setUI((ScrollPaneUI)UIManager.getUI(this));
}
项目:consulo    文件:JBScrollPane.java   
@Override
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  updateViewportBorder();
}
项目:consulo    文件:EditorImpl.java   
@Override
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  // disable standard Swing keybindings
  setInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
}
项目:javify    文件:JScrollPane.java   
/**
 * This method returns the scrollpane's UI delegate.
 *
 * @return The scrollpane's UI delegate.
 */
public ScrollPaneUI getUI()
{
  return (ScrollPaneUI) ui;
}
项目:javify    文件:JScrollPane.java   
/**
 * This method sets the scrollpane's UI delegate.
 *
 * @param ui The scrollpane's UI delegate.
 */
public void setUI(ScrollPaneUI ui)
{
  super.setUI(ui);
}
项目:jvm-stm    文件:JScrollPane.java   
/**
 * This method returns the scrollpane's UI delegate.
 *
 * @return The scrollpane's UI delegate.
 */
public ScrollPaneUI getUI()
{
  return (ScrollPaneUI) ui;
}
项目:jvm-stm    文件:JScrollPane.java   
/**
 * This method sets the scrollpane's UI delegate.
 *
 * @param ui The scrollpane's UI delegate.
 */
public void setUI(ScrollPaneUI ui)
{
  super.setUI(ui);
}
项目:JamVM-PH    文件:JScrollPane.java   
/**
 * This method returns the scrollpane's UI delegate.
 *
 * @return The scrollpane's UI delegate.
 */
public ScrollPaneUI getUI()
{
  return (ScrollPaneUI) ui;
}
项目:JamVM-PH    文件:JScrollPane.java   
/**
 * This method sets the scrollpane's UI delegate.
 *
 * @param ui The scrollpane's UI delegate.
 */
public void setUI(ScrollPaneUI ui)
{
  super.setUI(ui);
}
项目:classpath    文件:JScrollPane.java   
/**
 * This method returns the scrollpane's UI delegate.
 *
 * @return The scrollpane's UI delegate.
 */
public ScrollPaneUI getUI()
{
  return (ScrollPaneUI) ui;
}
项目:classpath    文件:JScrollPane.java   
/**
 * This method sets the scrollpane's UI delegate.
 *
 * @param ui The scrollpane's UI delegate.
 */
public void setUI(ScrollPaneUI ui)
{
  super.setUI(ui);
}