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


Java SystemColor.textHighlight方法代碼示例

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


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

示例1: determineSelectionBackground

import java.awt.SystemColor; //導入方法依賴的package包/類
private Color determineSelectionBackground() {
	Color c = UIManager.getColor("List.selectionBackground");
	if (c==null) {
		c = UIManager.getColor("nimbusSelectionBackground");
		if (c==null) { // Not Nimbus, but still need a value - fallback
			c = UIManager.getColor("textHighlight");
			if (c==null) {
				c = SystemColor.textHighlight;
			}
		}
	}

	// Nimbus unfortunately requires a Color, not a ColorUIResource, for
	// the background override to work. This causes this color to "stick"
	// even if the LAF is changed to something else later.  "c" here may
	// actually be a ColorUIResource
	return new Color(c.getRGB());//new ColorUIResource(c);

}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:20,代碼來源:FastListUI.java

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

示例3: writeObject

import java.awt.SystemColor; //導入方法依賴的package包/類
/**
 * Serializes this painter.
 *
 * @param s The stream to write to.
 * @throws IOException If an IO error occurs.
 */
private void writeObject(ObjectOutputStream s) throws IOException {
	s.defaultWriteObject();
	int rgb = -1; // No Paint -> Use JTextComponent's selection color
	if (paint!=null) {
		// NOTE: We cheat and always serialize the Paint as a Color.
		// This is (practically) always the case anyway.
		Color c = (paint instanceof Color) ? ((Color)paint) :
										SystemColor.textHighlight;
		rgb = c.getRGB();
	}
	s.writeInt(rgb);
}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:19,代碼來源:ChangeableHighlightPainter.java

示例4: getDefaultSelectionBG

import java.awt.SystemColor; //導入方法依賴的package包/類
/**
 * Returns the default selection background color to use if "default" is
 * specified in a theme.
 *
 * @return The default selection background to use.
 * @see #getDefaultSelectionFG()
 */
private static final Color getDefaultSelectionBG() {
	Color c = UIManager.getColor("TextArea.selectionBackground");
	if (c==null) {
		c = UIManager.getColor("textHighlight");
		if (c==null) {
			c = UIManager.getColor("nimbusSelectionBackground");
			if (c==null) {
				c = new ColorUIResource(SystemColor.textHighlight);
			}
		}
	}
	return c;
}
 
開發者ID:curiosag,項目名稱:ftc,代碼行數:21,代碼來源:Theme.java

示例5: writeObject

import java.awt.SystemColor; //導入方法依賴的package包/類
/**
 * Serializes this painter.
 * 
 * @param s
 *            The stream to write to.
 * @throws IOException
 *             If an IO error occurs.
 */
private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    int rgb = -1; // No Paint -> Use JTextComponent's selection color
    if (paint != null) {
        // NOTE: We cheat and always serialize the Paint as a Color.
        // This is (practically) always the case anyway.
        Color c = (paint instanceof Color) ? ((Color) paint) :
                SystemColor.textHighlight;
        rgb = c.getRGB();
    }
    s.writeInt(rgb);
}
 
開發者ID:intuit,項目名稱:Tank,代碼行數:21,代碼來源:ChangeableHighlightPainter.java

示例6: main

import java.awt.SystemColor; //導入方法依賴的package包/類
/**************************************************************************
	 * 	Create Standard Colors
	 * 	@param args args
	 */
	public static void main(String[] args)
	{
		org.compiere.Adempiere.startupEnvironment(true);
		Color[] colors = new Color[]
			{Color.black, Color.red, Color.green, Color.blue,
			Color.darkGray, Color.gray, Color.lightGray, Color.white,
			Color.cyan, Color.magenta, Color.orange, Color.pink, Color.yellow,
			SystemColor.textHighlight};
		String[] names = new String[]
			{"Black", "Red", "Green", "Blue",
			"Gray dark", "Gray", "Gray light", "White",
			"Cyan", "Magenta", "Orange", "Pink", "Yellow",
			"Blue dark"};
		for (int i = 0; i < colors.length; i++)
			System.out.println(names[i] + " = " + colors[i] + " RGB=" + colors[i].getRGB()
				+ " -> " + new Color(colors[i].getRGB(), false)
				+ " -> " + new Color(colors[i].getRGB(), true));
/**
		//	Create Colors
		for (int i = 0; i < colors.length; i++)
			create(colors[i], names[i]);
		create(whiteGray, "Gray white");
		create(darkGreen, "Green dark");
		create(blackGreen, "Green black");
		create(blackBlue, "Blue black");
		create(brown, "Brown");
		create(darkBrown, "Brown dark");
**/

		//	Read All Colors
		int[] IDs = PO.getAllIDs ("AD_PrintColor", null, null);
		for (int i = 0; i < IDs.length; i++)
		{
			MPrintColor pc = new MPrintColor(Env.getCtx(), IDs[i], null);
			System.out.println(IDs[i] + ": " + pc + " = " + pc.getColor() + ", RGB=" + pc.getColor().getRGB());
		}
	}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:42,代碼來源:MPrintColor.java

示例7: getSelectedColor

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

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

示例9: pickAppropriateTextHiliteColor

import java.awt.SystemColor; //導入方法依賴的package包/類
public static Color pickAppropriateTextHiliteColor()
{
	final Color DEFAULT_COLOR = Color.lightGray;
	
	Color color = SystemColor.textHighlight;
	
	if (color==null)
		return DEFAULT_COLOR;
	
	double brightness = PlatformFriend.determineBrightness(color);
	
	if (brightness==0.0)
		return DEFAULT_COLOR;
	
	return color;
}
 
開發者ID:dhorlick,項目名稱:balloonist,代碼行數:17,代碼來源:PlatformFriend.java

示例10: getSelectionColor

import java.awt.SystemColor; //導入方法依賴的package包/類
Color getSelectionColor() {
    return SystemColor.textHighlight;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:4,代碼來源:AWTCaret.java


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