當前位置: 首頁>>代碼示例>>Java>>正文


Java SystemColor.control方法代碼示例

本文整理匯總了Java中java.awt.SystemColor.control方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemColor.control方法的具體用法?Java SystemColor.control怎麽用?Java SystemColor.control使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.SystemColor的用法示例。


在下文中一共展示了SystemColor.control方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawBackground

import java.awt.SystemColor; //導入方法依賴的package包/類
public static void drawBackground(Graphics g, TextComponentState s,
                                  WinTheme t) {
    
    Color c = (s.isEnabled() ? s.getBackground() : SystemColor.control);

    WinThemeGraphics wgr = new WinThemeGraphics(g);

    if (t.isXpThemeActive()) {

        wgr.setTheme(t.getXpTheme("Edit")); //$NON-NLS-1$
        int flags = (s.isEnabled() ? WindowsConsts.ETS_NORMAL :
                     WindowsConsts.ETS_DISABLED);
        wgr.drawXpBackground(s.getSize(),
                WindowsConsts.EP_EDITTEXT, flags);
        if (s.isEnabled() && s.isBackgroundSet()) {
            fill(s, c, wgr);
        }

    } else {
        g.setColor(c);
        fill(s, c, wgr);
        wgr.drawEdge(s.getSize(), WindowsDefs.EDGE_SUNKEN);
    }
    wgr.dispose();
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:26,代碼來源:WinTextComponent.java

示例2: drawBackground

import java.awt.SystemColor; //導入方法依賴的package包/類
public static void drawBackground(Graphics g, ButtonState s) {
    Rectangle rect = s.getBounds();
    Color bkColor = s.isBackgroundSet() ? s.getBackground() :
                                          SystemColor.control;
    g.setColor(bkColor);
    g.fillRect(0, 0, rect.width, rect.height);

    drawButtonFrame(g, s.getBounds(), s.isPressed());

    if (s.isFocused()) {
        Color foreColor = s.isTextColorSet() ?
                s.getTextColor() :
                SystemColor.controlText;
        g.setColor(foreColor);

        drawFocusRect(g, 3, 3, rect.width - 7, rect.height - 7);
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:19,代碼來源:DefaultButton.java

示例3: getTreeCellRendererComponent

import java.awt.SystemColor; //導入方法依賴的package包/類
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded,
        boolean leaf, int row, boolean hasFocus) {
    super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);

    Color colorForeground;
    Color colorBackground;
    if (sel) {
        if (tree.hasFocus()) {
            colorBackground = SystemColor.textHighlight;
            colorForeground = SystemColor.textHighlightText;
        }
        else {
            colorForeground = SystemColor.controlText;
            colorBackground = SystemColor.control;
        }
        setBackgroundSelectionColor(colorBackground);
    }
    else {
        colorForeground = tree.getForeground();
        colorBackground = tree.getBackground();
        setBackgroundNonSelectionColor(colorBackground);
    }
    setForeground(colorForeground);

    return this;
}
 
開發者ID:shevek,項目名稱:spring-rich-client,代碼行數:27,代碼來源:FocusableTreeCellRenderer.java

示例4: getColorAsString

import java.awt.SystemColor; //導入方法依賴的package包/類
/**
 *  Parses Color into String representation.
 *  Required as SystemColors and Alpha Colors have different formats
 *  @param c Color
 *  @return [r=102,g=102,b=153,a=255]
 */
private static final String getColorAsString (Color c)
{
	if (c == null)
		c = SystemColor.control;
	StringBuilder sb = new StringBuilder("[r=").append(c.getRed())
		.append(",g=").append(c.getGreen())
		.append(",b=").append(c.getBlue())
		.append(",a=").append(c.getAlpha())
		.append("]");
//	System.out.println(sb.toString());
	return sb.toString();
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:19,代碼來源:CompiereColor.java

示例5: getColorAsString

import java.awt.SystemColor; //導入方法依賴的package包/類
/**
 * Parses Color into String representation.
 * Required as SystemColors and Alpha Colors have different formats
 * 
 * @param c Color
 * @return [r=102,g=102,b=153,a=255]
 * @see #parseColor
 */
public static String getColorAsString(Color c)
{
	if (c == null)
	{
		c = SystemColor.control;
	}
	final StringBuffer sb = new StringBuffer("[r=").append(c.getRed())
			.append(",g=").append(c.getGreen())
			.append(",b=").append(c.getBlue())
			.append(",a=").append(c.getAlpha())
			.append("]");
	// System.out.println(sb.toString());
	return sb.toString();
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:23,代碼來源:AdempiereTheme.java

示例6: getDefaultBackgroundColor

import java.awt.SystemColor; //導入方法依賴的package包/類
public static Color getDefaultBackgroundColor() {
    if (Configuration.useRibbonInterface.get()) {
        return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
    } else {
        return SystemColor.control;
    }
}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:8,代碼來源:View.java

示例7: getControlColor

import java.awt.SystemColor; //導入方法依賴的package包/類
private static Color getControlColor() {
    if (Configuration.useRibbonInterface.get()) {
        return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
    } else {
        return SystemColor.control;
    }
}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:8,代碼來源:TimelineBodyPanel.java

示例8: getBackgroundColor

import java.awt.SystemColor; //導入方法依賴的package包/類
public static Color getBackgroundColor() {
    if (Configuration.useRibbonInterface.get()) {
        return SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
    } else {
        return SystemColor.control;
    }
}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:8,代碼來源:TimelinePanel.java

示例9: 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

示例10: makeColors

import java.awt.SystemColor; //導入方法依賴的package包/類
static public void makeColors ()
{
	if (haveParameter("color.background"))
		Background = getParameter("color.background", Color.gray.brighter());
	else Background = SystemColor.window;
	if (haveParameter("color.control"))
		ControlBackground = getParameter("color.control", Color.gray
			.brighter());
	else ControlBackground = SystemColor.control;
}
 
開發者ID:Zenigata,項目名稱:jago,代碼行數:11,代碼來源:Global.java


注:本文中的java.awt.SystemColor.control方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。