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


Java SystemColor.scrollbar方法代码示例

本文整理汇总了Java中java.awt.SystemColor.scrollbar方法的典型用法代码示例。如果您正苦于以下问题:Java SystemColor.scrollbar方法的具体用法?Java SystemColor.scrollbar怎么用?Java SystemColor.scrollbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.SystemColor的用法示例。


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

示例1: draw

import java.awt.SystemColor; //导入方法依赖的package包/类
public static void draw(Graphics g, ScrollbarState s) {
    Dimension size = s.getSize();
    Color bkColor = s.isBackgroundSet() ? s.getBackground()
                                       : SystemColor.scrollbar;
    g.setColor(bkColor);
    g.fillRect(0, 0, size.width, size.height);

    boolean vertical = s.isVertical();

    Rectangle btn1Rect = s.getDecreaseRect();
    if (btn1Rect == null) {
        return;
    }
    Rectangle btn2Rect = s.getIncreaseRect();
    if (btn2Rect == null) {
        return;
    }
    int dir1 = (vertical ? NORTH : WEST);
    int dir2 = (vertical ? SOUTH : EAST);
    boolean btn1Pressed = s.isDecreasePressed();
    boolean btn2Pressed = s.isIncreasePressed();

    g.translate(btn1Rect.x, btn1Rect.y);
    paintArrowButton(g, dir1, btn1Rect.width, btn1Rect.height, btn1Pressed,
                     s.isEnabled());
    g.translate(-btn1Rect.x, -btn1Rect.y);
    g.translate(btn2Rect.x, btn2Rect.y);
    paintArrowButton(g, dir2, btn2Rect.width, btn2Rect.height, btn2Pressed,
                     s.isEnabled());
    g.translate(-btn2Rect.x, -btn2Rect.y);
    drawSlider(g, s);
    paintHighlight(g, s);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:34,代码来源:DefaultScrollbar.java

示例2: getBasicSystemColors

import java.awt.SystemColor; //导入方法依赖的package包/类
private Object[] getBasicSystemColors() {
    Object[] basicSystemColors = {"desktop", SystemColor.desktop,
                                  "activeCaption", SystemColor.activeCaption,
                                  "activeCaptionText", SystemColor.activeCaptionText,
                                  "activeCaptionBorder", SystemColor.activeCaptionBorder,
                                  "inactiveCaption", SystemColor.inactiveCaption,
                                  "inactiveCaptionText", SystemColor.inactiveCaptionText,
                                  "inactiveCaptionBorder", SystemColor.inactiveCaptionBorder,
                                  "window", SystemColor.window,
                                  "windowBorder", SystemColor.windowBorder,
                                  "windowText", SystemColor.windowText,
                                  "menu", SystemColor.menu,
                                  "menuText", SystemColor.menuText,
                                  "text", SystemColor.text,
                                  "textText", SystemColor.textText,
                                  "textHighlight", SystemColor.textHighlight,
                                  "textHighlightText", SystemColor.textHighlightText,
                                  "textInactiveText", SystemColor.textInactiveText,
                                  "control", SystemColor.control,
                                  "controlText", SystemColor.controlText,
                                  "controlHighlight", SystemColor.controlHighlight,
                                  "controlLtHighlight", SystemColor.controlLtHighlight,
                                  "controlShadow", SystemColor.controlShadow,
                                  "controlDkShadow", SystemColor.controlDkShadow,
                                  "scrollbar", SystemColor.scrollbar,
                                  "info", SystemColor.info,
                                  "infoText", SystemColor.infoText };
    return basicSystemColors;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:BasicLookAndFeel.java


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