本文整理汇总了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;
}
}
示例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();
}
}));
}
示例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);
}
});
}
示例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();
}
}
示例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());
}
示例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);
}
}
}
示例7: getUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public ScrollPaneUI getUI() {
AndroidClassUtil.callEmptyMethod();
return null;
}
示例8: setUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void setUI(ScrollPaneUI ui) {
AndroidClassUtil.callEmptyMethod();
super.setUI(ui);
}
示例9: updateUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void updateUI()
{
setUI((ScrollPaneUI) UIManager.getUI(this));
}
示例10: setUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
@Override
public void setUI(ScrollPaneUI ui) {
super.setUI(ui);
updateViewportBorder();
}
示例11: getUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public ScrollPaneUI getUI() {
return (ScrollPaneUI)ui;
}
示例12: setUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void setUI(final ScrollPaneUI ui) {
super.setUI(ui);
}
示例13: updateUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void updateUI() {
setUI((ScrollPaneUI)UIManager.getUI(this));
}
示例14: setUI
import javax.swing.plaf.ScrollPaneUI; //导入依赖的package包/类
public void setUI(ScrollPaneUI ui) {
super.setUI(ui);
updateViewportBorder();
}
示例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);
}