本文整理匯總了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);
}
示例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;
}