本文整理汇总了Java中javax.swing.plaf.metal.MetalScrollBarUI类的典型用法代码示例。如果您正苦于以下问题:Java MetalScrollBarUI类的具体用法?Java MetalScrollBarUI怎么用?Java MetalScrollBarUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MetalScrollBarUI类属于javax.swing.plaf.metal包,在下文中一共展示了MetalScrollBarUI类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeTreeScrollSupport
import javax.swing.plaf.metal.MetalScrollBarUI; //导入依赖的package包/类
/** Initialize full support for horizontal scrolling.
*/
private void initializeTreeScrollSupport() {
scrollPane = new JScrollPane();
scrollPane.setName("TreeTableView.scrollpane"); //NOI18N
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
if (UIManager.getColor("Table.background") != null) { // NOI18N
scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N
}
hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE);
hScrollBar.setVisible(false);
listener = new ScrollListener();
treeTable.addPropertyChangeListener(listener);
scrollPane.getViewport().addComponentListener(listener);
tree.addPropertyChangeListener(listener);
hScrollBar.getModel().addChangeListener(listener);
}
示例2: createScrollBarSwapListener
import javax.swing.plaf.metal.MetalScrollBarUI; //导入依赖的package包/类
protected PropertyChangeListener createScrollBarSwapListener() {
return new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
String propertyName = e.getPropertyName();
if (propertyName.equals(VERTICAL_SCROLL_BAR_PROPERTY) ||
propertyName.equals(HORIZONTAL_SCROLL_BAR_PROPERTY)) {
((JScrollBar) e.getOldValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
null);
((JScrollBar) e.getNewValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
Boolean.FALSE);
}
else if (BORDER_PROPERTY.equals(propertyName)) {
updateScrollbarsFreeStanding();
}
}
};
}
示例3: initializeTreeScrollSupport
import javax.swing.plaf.metal.MetalScrollBarUI; //导入依赖的package包/类
/** Initialize full support for horizontal scrolling.
*/
private void initializeTreeScrollSupport() {
scrollPane = new JScrollPane() {
public void setBorder(Border b) {
super.setBorder(null);
}
};
scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N
hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE);
listener = new ScrollListener();
treeTable.addPropertyChangeListener(listener);
scrollPane.getViewport().addComponentListener(listener);
tree.addPropertyChangeListener(listener);
hScrollBar.getModel().addChangeListener(listener);
}
示例4: updateScrollbarsFreeStanding
import javax.swing.plaf.metal.MetalScrollBarUI; //导入依赖的package包/类
/**
* If the border of the scrollpane is an instance of
* <code>MetalBorders.ScrollPaneBorder</code>, the client property
* <code>FREE_STANDING_PROP</code> of the scrollbars
* is set to false, otherwise it is set to true.
*/
private void updateScrollbarsFreeStanding() {
if (scrollpane == null) {
return;
}
Object value = Boolean.FALSE;
scrollpane.getHorizontalScrollBar().putClientProperty
(MetalScrollBarUI.FREE_STANDING_PROP, value);
scrollpane.getVerticalScrollBar().putClientProperty
(MetalScrollBarUI.FREE_STANDING_PROP, value);
}
示例5: configureScroller
import javax.swing.plaf.metal.MetalScrollBarUI; //导入依赖的package包/类
/**
* Configures the JScrollPane created by #createScroller().
*/
@Override
protected void configureScroller() {
super.configureScroller();
scroller.getVerticalScrollBar().putClientProperty(
MetalScrollBarUI.FREE_STANDING_PROP,
Boolean.FALSE);
}