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


Java Color.pink方法代碼示例

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


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

示例1: setTextColor

import java.awt.Color; //導入方法依賴的package包/類
/**
    * Sets the text Color for the activator text.
    * The following is a list of supported Color names
    * <ul>
    * <li>black
    * <li>blue
    * <li>cyan
    * <li>darkGray
    * <li>gray
    * <li>green
    * <li>lightGray
    * <li>magenta
    * <li>orange
    * <li>pink
    * <li>red
    * <li>white
    * <li>yellow
    * </ul>
    */
   public void setTextColor(String name) {
Color color=null;
if ("black".equals(name)) {
    color = Color.black;
} else if ("blue".equals(name)) {
    color = Color.blue;
} else if ("cyan".equals(name)) {
    color = Color.cyan;
} else if ("darkGray".equals(name)) {
    color = Color.darkGray;
} else if ("gray".equals(name)) {
    color = Color.gray;
} else if ("green".equals(name)) {
    color = Color.green;
} else if ("lightGray".equals(name)) {
    color = Color.lightGray;
} else if ("magenta".equals(name)) {
    color = Color.magenta;
} else if ("orange".equals(name)) {
    color = Color.orange;
} else if ("pink".equals(name)) {
    color = Color.pink;
} else if ("red".equals(name)) {
    color = Color.red;
} else if ("white".equals(name)) {
    color = Color.white;
} else if ("yellow".equals(name)) {
    color = Color.yellow;
}

if (color == null) {
    return;
}
textAttribs.removeAttribute(StyleConstants.Foreground);
textAttribs.addAttribute(StyleConstants.Foreground, color);
setForeground(color);
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:57,代碼來源:BrowserDisplayer.java

示例2: getTreeCellFgColor

import java.awt.Color; //導入方法依賴的package包/類
@Override
public Color getTreeCellFgColor() {
  // FIXME: should get colors from LAF
  if (isActive()) {
    return metadata == null ? Color.red : Color.black;
  }
  else {
    return metadata == null ? Color.pink : Color.gray;
  }
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:11,代碼來源:ModuleManagerWindow.java

示例3: randomColor

import java.awt.Color; //導入方法依賴的package包/類
private Color randomColor() {
	Color colors[] = {Color.black, Color.blue, Color.cyan,
		Color.gray, Color.darkGray, Color.green,
		Color.lightGray, Color.magenta, Color.orange,
		Color.pink,Color.red, Color.white, Color.yellow};
	return colors[(int)(Math.random() * colors.length)];
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:8,代碼來源:DiskExplorer.java

示例4: HistGCanvas

import java.awt.Color; //導入方法依賴的package包/類
public HistGCanvas(Histogram histg) {
    this.histg = histg;

    barColors[0] = Color.blue;
    barColors[1] = Color.red;
    barColors[2] = Color.green;
    barColors[3] = Color.yellow;
    barColors[4] = Color.gray;
    barColors[5] = Color.cyan;
    barColors[6] = Color.orange;
    barColors[7] = Color.lightGray;
    barColors[8] = Color.pink;
    barColors[9] = Color.darkGray;
}
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:15,代碼來源:HistGCanvas.java

示例5: getColor

import java.awt.Color; //導入方法依賴的package包/類
public Color getColor(String color) {
    Matcher match = Pattern.compile("(\\d+), (\\d+), (\\d+)").matcher(color);
    Matcher matchTwo = Pattern.compile("(\\d+)\\s(\\d+)\\s(\\d+)").matcher(color);

    try {
        if (match.find() == true) {
            return new Color(Integer.parseInt(match.group(1)), Integer.parseInt(match.group(2)), Integer.parseInt(match.group(3)));
        } else if (matchTwo.find() == true) {
            return new Color(Integer.parseInt(matchTwo.group(1)), Integer.parseInt(matchTwo.group(2)), Integer.parseInt(matchTwo.group(3)));
        } else {
            switch (color) {
                case "black": return Color.black;
                case "blue": return Color.blue;
                case "cyan": return Color.cyan;
                case "gray": return Color.gray;
                case "green": return Color.green;
                case "magenta": return Color.magenta;
                case "orange": return Color.orange;
                case "pink": return Color.pink;
                case "red": return Color.red;
                case "white": return Color.white;
                case "yellow": return Color.yellow;
                case "dark_green": return Color.green.darker().darker().darker();
                case "light_red": return Color.red.brighter();
                default: return Color.gray;
            }
        }
    } catch (Exception ex) {
        com.gmt2001.Console.err.println("Bad RegEx Sent for getColor: " + ex.getMessage());
        return Color.gray;
    }
}
 
開發者ID:GloriousEggroll,項目名稱:quorrabot,代碼行數:33,代碼來源:DiscordAPI.java

示例6: createDefaultPaintArray

import java.awt.Color; //導入方法依賴的package包/類
/**
 * Convenience method to return an array of <code>Paint</code> objects that
 * represent the pre-defined colors in the <code>Color<code> and 
 * <code>ChartColor</code> objects.
 *
 * @return An array of objects with the <code>Paint</code> interface.
 */
public static Paint[] createDefaultPaintArray() {

    return new Paint[] {
        new Color(0xFF, 0x55, 0x55),
        new Color(0x55, 0x55, 0xFF),
        new Color(0x55, 0xFF, 0x55),
        new Color(0xFF, 0xFF, 0x55),
        new Color(0xFF, 0x55, 0xFF),
        new Color(0x55, 0xFF, 0xFF),
        Color.pink,
        Color.gray,
        ChartColor.DARK_RED,
        ChartColor.DARK_BLUE,
        ChartColor.DARK_GREEN,
        ChartColor.DARK_YELLOW,
        ChartColor.DARK_MAGENTA,
        ChartColor.DARK_CYAN,
        Color.darkGray,
        ChartColor.LIGHT_RED,
        ChartColor.LIGHT_BLUE,
        ChartColor.LIGHT_GREEN,
        ChartColor.LIGHT_YELLOW,
        ChartColor.LIGHT_MAGENTA,
        ChartColor.LIGHT_CYAN,
        Color.lightGray,
        ChartColor.VERY_DARK_RED,
        ChartColor.VERY_DARK_BLUE,
        ChartColor.VERY_DARK_GREEN,
        ChartColor.VERY_DARK_YELLOW,
        ChartColor.VERY_DARK_MAGENTA,
        ChartColor.VERY_DARK_CYAN,
        ChartColor.VERY_LIGHT_RED,
        ChartColor.VERY_LIGHT_BLUE,
        ChartColor.VERY_LIGHT_GREEN,
        ChartColor.VERY_LIGHT_YELLOW,
        ChartColor.VERY_LIGHT_MAGENTA,
        ChartColor.VERY_LIGHT_CYAN
    };
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:47,代碼來源:ChartColor.java

示例7: createDefaultPaintArray

import java.awt.Color; //導入方法依賴的package包/類
/**
 * Convenience method to return an array of <code>Paint</code> objects that represent
 * the pre-defined colors in the <code>Color<code> and <code>ChartColor</code> objects.
 *
 * @return an array of objects with the <code>Paint</code> interface.
 */
public static Paint[] createDefaultPaintArray() {

    return new Paint[] {
        Color.red,
        Color.blue,
        Color.green,
        Color.yellow,
        Color.orange,
        Color.magenta,
        Color.cyan,
        Color.pink,
        Color.gray,
        ChartColor.DARK_RED,
        ChartColor.DARK_BLUE,
        ChartColor.DARK_GREEN,
        ChartColor.DARK_YELLOW,
        ChartColor.DARK_MAGENTA,
        ChartColor.DARK_CYAN,
        Color.darkGray,
        ChartColor.LIGHT_RED,
        ChartColor.LIGHT_BLUE,
        ChartColor.LIGHT_GREEN,
        ChartColor.LIGHT_YELLOW,
        ChartColor.LIGHT_MAGENTA,
        ChartColor.LIGHT_CYAN,
        Color.lightGray,
        ChartColor.VERY_DARK_RED,
        ChartColor.VERY_DARK_BLUE,
        ChartColor.VERY_DARK_GREEN,
        ChartColor.VERY_DARK_YELLOW,
        ChartColor.VERY_DARK_MAGENTA,
        ChartColor.VERY_DARK_CYAN,
        ChartColor.VERY_LIGHT_RED,
        ChartColor.VERY_LIGHT_BLUE,
        ChartColor.VERY_LIGHT_GREEN,
        ChartColor.VERY_LIGHT_YELLOW,
        ChartColor.VERY_LIGHT_MAGENTA,
        ChartColor.VERY_LIGHT_CYAN
    };
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:47,代碼來源:ChartColor.java


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