当前位置: 首页>>代码示例>>Java>>正文


Java ScrollPaneUI类代码示例

本文整理汇总了Java中javax.swing.plaf.ScrollPaneUI的典型用法代码示例。如果您正苦于以下问题:Java ScrollPaneUI类的具体用法?Java ScrollPaneUI怎么用?Java ScrollPaneUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScrollPaneUI类属于javax.swing.plaf包,在下文中一共展示了ScrollPaneUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateListeners

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
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;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:DocumentViewOp.java

示例2: getUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
/**
 * Maps {@code JScrollPane.getUI()} through queue
 */
public ScrollPaneUI getUI() {
    return (runMapping(new MapAction<ScrollPaneUI>("getUI") {
        @Override
        public ScrollPaneUI map() {
            return ((JScrollPane) getSource()).getUI();
        }
    }));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JScrollPaneOperator.java

示例3: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
/**
 * 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);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JScrollPaneOperator.java

示例4: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:PScrollPane.java

示例5: testGetSetUpdateUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:JScrollPaneTest.java

示例6: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
@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);
    }
  }
}
 
开发者ID:JetBrains,项目名称:jediterm,代码行数:35,代码来源:JBScrollPane.java

示例7: getUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public ScrollPaneUI getUI() {
	AndroidClassUtil.callEmptyMethod();
	return null;
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:5,代码来源:JScrollPane.java

示例8: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void setUI(ScrollPaneUI ui) {
	AndroidClassUtil.callEmptyMethod();
	super.setUI(ui);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:5,代码来源:JScrollPane.java

示例9: updateUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void updateUI()
{
  setUI((ScrollPaneUI) UIManager.getUI(this));
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:JScrollPane.java

示例10: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
@Override
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  updateViewportBorder();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:JBScrollPane.java

示例11: getUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public ScrollPaneUI getUI() {
    return (ScrollPaneUI)ui;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:JScrollPane.java

示例12: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void setUI(final ScrollPaneUI ui) {
    super.setUI(ui);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:JScrollPane.java

示例13: updateUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void updateUI() {
    setUI((ScrollPaneUI)UIManager.getUI(this));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:JScrollPane.java

示例14: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  updateViewportBorder();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:JBScrollPane.java

示例15: setUI

import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
@Override
public void setUI(ScrollPaneUI ui) {
  super.setUI(ui);
  // disable standard Swing keybindings
  setInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:EditorImpl.java


注:本文中的javax.swing.plaf.ScrollPaneUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。