当前位置: 首页>>代码示例>>Java>>正文


Java Color.darkGray方法代码示例

本文整理汇总了Java中java.awt.Color.darkGray方法的典型用法代码示例。如果您正苦于以下问题:Java Color.darkGray方法的具体用法?Java Color.darkGray怎么用?Java Color.darkGray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Color的用法示例。


在下文中一共展示了Color.darkGray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: LoadColors

import java.awt.Color; //导入方法依赖的package包/类
public void LoadColors()
{
	colors[GameResources.colorWhite] = Color.white;
	colors[GameResources.colorBlack] = Color.black;
	colors[GameResources.colorGreen] = new Color(game.gameOptions.colorGreenChat);
	colors[GameResources.colorRed] = new Color(game.gameOptions.colorRedChat);
	colors[GameResources.colorBlue] =new Color(game.gameOptions.colorBlueChat);
	colors[GameResources.colorYellow] =new Color(game.gameOptions.colorYellowChat);
	colors[GameResources.colorGray] = Color.gray;
	colors[GameResources.colorMagenta] = Color.magenta;
	colors[GameResources.colorDarkGray] = Color.darkGray;
	colors[GameResources.colorOrange] = Color.orange;
	colors[GameResources.colorCyan] = Color.cyan;
	
	// Weapons
	colors[GameResources.colorGreenWeapons] = new Color(game.gameOptions.colorGreenWeapons);
	colors[GameResources.colorRedWeapons] = new Color(game.gameOptions.colorRedWeapons);
	colors[GameResources.colorBlueWeapons] =new Color(game.gameOptions.colorBlueWeapons);
	colors[GameResources.colorYellowWeapons] =new Color(game.gameOptions.colorYellowWeapons);

	colors[GameResources.colorHealth] = new Color(255, 0, 0, 150);
	colors[GameResources.colorEnergy] = new Color(0, 0, 255, 150);
	colors[GameResources.colorBackground] = new Color(0, 0, 0, 130);
	colors[GameResources.colorInterfaceShade] = new Color(0, 40, 0, 255);
	colors[GameResources.colorPrivateMessage] = new Color(255, 153, 51);
	colors[GameResources.colorName] = new Color(222, 170, 0);
	colors[GameResources.colorPoints] = new Color(222, 120, 0);
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:29,代码来源:Java2DResources.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: DraggingWindow

import java.awt.Color; //导入方法依赖的package包/类
public DraggingWindow(final Window ancestor) {
    super(ancestor);

    Color myFloatColor = UIManager
            .getColor("ToolBar.floatingForeground");
    Color myDockColor = UIManager.getColor("ToolBar.dockingForeground");
    if (myFloatColor == null)
        myFloatColor = Color.darkGray;
    if (myDockColor == null)
        myDockColor = Color.yellow;

    myFloatBorder = BorderFactory.createLineBorder(myFloatColor, 3);
    myDockBorder = BorderFactory.createLineBorder(myDockColor, 3);

    myContent = new JPanel();
    myContent.setOpaque(true);

    myFloatColor = UIManager.getColor("ToolBar.floatingBackground");
    myDockColor = UIManager.getColor("ToolBar.dockingBackground");
    if (myFloatColor == null)
        myFloatColor = myContent.getBackground();
    if (myDockColor == null)
        myDockColor = myContent.getBackground();

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(myContent, BorderLayout.CENTER);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:28,代码来源:Handler.java

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

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

import java.awt.Color; //导入方法依赖的package包/类
public CalibrationStatusDisplay(JFrame frame, Point2D.Double[] calibrationPoints, Point2D.Double[] calibrationData){
	super.setBackground(Color.darkGray);
	super.setOpaque(true);
	
	this.windowDimension = new Dimension(600,300);
	this.calibrationPoints = calibrationPoints;
	this.calibrationData = calibrationData;
	
	this.frame = frame;
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:11,代码来源:CalibrationStatusDisplay.java

示例8: createGuaranteedKeysAndValues

import java.awt.Color; //导入方法依赖的package包/类
@Override
public Object[] createGuaranteedKeysAndValues() {
    return new Object[] {
         "InternalFrame.activeTitleBackground",
            new GuaranteedValue("InternalFrame.activeTitleBackground",
            Color.BLUE),
            
        "InternalFrame.borderShadow",
            new GuaranteedValue("InternalFrame.borderShadow", Color.gray),

        "InternalFrame.borderHighlight",
            new GuaranteedValue("InternalFrame.borderHighlight",
            Color.white),

        "InternalFrame.borderDarkShadow",
            new GuaranteedValue("InternalFrame.borderDarkShadow",
            Color.darkGray),

        "InternalFrame.borderLight",
            new GuaranteedValue("InternalFrame.borderLight",
            Color.lightGray),

        "TabbedPane.background",
            new GuaranteedValue("TabbedPane.background", Color.LIGHT_GRAY),

        "TabbedPane.focus",
            new GuaranteedValue("TabbedPane.focus", Color.GRAY),

        "TabbedPane.highlight",
            new GuaranteedValue("TabbedPane.highlight", Color.WHITE) ,
         
        "Button.dashedRectGapX",
           new GuaranteedValue("Button.dashedRectGapX", Integer.valueOf(5)),
           
        "Button.dashedRectGapY",
           new GuaranteedValue("Button.dashedRectGapY", Integer.valueOf(4)),
           
        "Button.dashedRectGapWidth",
           new GuaranteedValue("Button.dashedRectGapWidth", Integer.valueOf(10)),
           
        "Button.dashedRectGapHeight",
           new GuaranteedValue("Button.dashedRectGapHeight", Integer.valueOf(8)),
                 
        "Tree.expandedIcon", new TreeIcon(false),
        "Tree.collapsedIcon", new TreeIcon(true)
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:WindowsLFCustoms.java

示例9: 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.darkGray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。