本文整理了Java中javax.swing.JScrollPane.getClientProperty()
方法的一些代码示例,展示了JScrollPane.getClientProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getClientProperty()
方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getClientProperty
暂无
代码示例来源:origin: net.java.dev.laf-widget/laf-widget
/**
* Checks whether the specified scroll pane supports auto scroll.
*
* @param scrollPane
* Scroll pane component.
* @return <code>true</code> if the specified scroll pane supports auto
* scroll, <code>false</code> otherwise.
*/
public static boolean hasAutoScroll(JScrollPane scrollPane) {
Object compProperty = scrollPane
.getClientProperty(LafWidget.AUTO_SCROLL);
if (Boolean.TRUE.equals(compProperty))
return true;
if (Boolean.FALSE.equals(compProperty))
return false;
return (Boolean.TRUE.equals(UIManager.get(LafWidget.AUTO_SCROLL)));
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-application-swing
protected void initScrollPane(JScrollPane scrollPane) {
Boolean onlyVerticalScrollable = (Boolean) scrollPane.getClientProperty("onlyVerticalScrollable");
if (onlyVerticalScrollable != null && onlyVerticalScrollable) {
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
final JViewport viewport = scrollPane.getViewport();
viewport.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
Dimension newDimension = new Dimension(viewport.getExtentSize().width,
viewport.getViewSize().height);
viewport.setViewSize(newDimension);
}
});
}
}
代码示例来源:origin: com.github.insubstantial/substance
/**
* Returns the scroll bar buttons kind of the specified scroll bar.
*
* @param scrollBar
* Scroll bar.
* @return The scroll bar buttons kind of the specified scroll bar.
* @see SubstanceLookAndFeel#SCROLL_PANE_BUTTONS_POLICY
*/
public static ScrollPaneButtonPolicyKind getScrollPaneButtonsPolicyKind(
JScrollBar scrollBar) {
Component parent = scrollBar.getParent();
if (parent instanceof JScrollPane) {
Object jspKind = ((JScrollPane) parent)
.getClientProperty(SubstanceLookAndFeel.SCROLL_PANE_BUTTONS_POLICY);
if (jspKind instanceof ScrollPaneButtonPolicyKind)
return (ScrollPaneButtonPolicyKind) jspKind;
}
Object globalJspKind = UIManager
.get(SubstanceLookAndFeel.SCROLL_PANE_BUTTONS_POLICY);
if (globalJspKind instanceof ScrollPaneButtonPolicyKind)
return (ScrollPaneButtonPolicyKind) globalJspKind;
return ScrollPaneButtonPolicyKind.OPPOSITE;
}
代码示例来源:origin: org.java.net.substance/substance
/**
* Returns the scroll bar buttons kind of the specified scroll bar.
*
* @param scrollBar
* Scroll bar.
* @return The scroll bar buttons kind of the specified scroll bar.
* @see SubstanceLookAndFeel#SCROLL_PANE_BUTTONS_POLICY
*/
public static ScrollPaneButtonPolicyKind getScrollPaneButtonsPolicyKind(
JScrollBar scrollBar) {
Component parent = scrollBar.getParent();
if (parent instanceof JScrollPane) {
Object jspKind = ((JScrollPane) parent)
.getClientProperty(SubstanceLookAndFeel.SCROLL_PANE_BUTTONS_POLICY);
if (jspKind instanceof ScrollPaneButtonPolicyKind)
return (ScrollPaneButtonPolicyKind) jspKind;
}
Object globalJspKind = UIManager
.get(SubstanceLookAndFeel.SCROLL_PANE_BUTTONS_POLICY);
if (globalJspKind instanceof ScrollPaneButtonPolicyKind)
return (ScrollPaneButtonPolicyKind) globalJspKind;
return ScrollPaneButtonPolicyKind.OPPOSITE;
}
代码示例来源:origin: JetBrains/jediterm
static boolean isDark(Component c) {
Container parent = c.getParent();
if (parent instanceof JScrollPane) {
JScrollPane pane = (JScrollPane)parent;
Object property = pane.getClientProperty(BRIGHTNESS_FROM_VIEW);
if (property instanceof Boolean && (Boolean)property) {
Color color = JBScrollPane.getViewBackground(pane);
if (color != null) return ColorUtil.isDark(color);
}
}
return UIUtil.isUnderDarcula();
}
}
代码示例来源:origin: JetBrains/jediterm
JBInsets.removeFrom(bounds, pane.getInsets());
Object property = pane.getClientProperty(Flip.class);
Flip flip = property instanceof Flip ? (Flip)property : Flip.NONE;
boolean hsbOnTop = flip == Flip.BOTH || flip == Flip.VERTICAL;
内容来源于网络,如有侵权,请联系作者删除!