当前位置: 首页>>代码示例>>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;未经允许,请勿转载。