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


Java Color.DARK_GRAY属性代码示例

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


在下文中一共展示了Color.DARK_GRAY属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ColorComboBox

/**
 * C'tor
 * The combo box is initialized with some basic colors and user can also
 * pick a custom color
 */
public ColorComboBox() {
    this( new Color[] {
        Color.BLACK,
        Color.BLUE,
        Color.CYAN,
        Color.DARK_GRAY,
        Color.GRAY,
        Color.GREEN,
        Color.LIGHT_GRAY,
        Color.MAGENTA,
        Color.ORANGE,
        Color.PINK,
        Color.RED,
        Color.WHITE,
        Color.YELLOW,
        }, new String[0], true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ColorComboBox.java

示例2: paintComponent

@Override
protected void paintComponent(Graphics g) {

	// TODO: Give "priorities" and always pick color of a notice with
	// highest priority (e.g. parsing errors will usually be red).

	Color borderColor = getColor();
	if (borderColor==null) {
		borderColor = Color.DARK_GRAY;
	}
	Color fillColor = getBrighterColor(borderColor);

	int w = getWidth();
	int h = getHeight();

	g.setColor(fillColor);
	g.fillRect(0,0, w,h);

	g.setColor(borderColor);
	g.drawRect(0,0, w-1,h-1);

}
 
开发者ID:Thecarisma,项目名称:powertext,代码行数:22,代码来源:ErrorStrip.java

示例3: loadResources

private synchronized void loadResources() {
    if (cAlarm != null) return;

    cAlarm = (ResourceManager.hasColorResource(cAlarmKey))
        ? ResourceManager.getColor(cAlarmKey)
        : Color.RED;
    cWarn = (ResourceManager.hasColorResource(cWarnKey))
        ? ResourceManager.getColor(cWarnKey)
        : Color.MAGENTA;
    cPlain = (ResourceManager.hasColorResource(cPlainKey))
        ? ResourceManager.getColor(cPlainKey)
        : Color.DARK_GRAY;
    cExport = (ResourceManager.hasColorResource(cExportKey))
        ? ResourceManager.getColor(cExportKey)
        : Color.GREEN;
    cGood = (ResourceManager.hasColorResource(cGoodKey))
        ? ResourceManager.getColor(cGoodKey)
        : Color.BLUE;
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:19,代码来源:ReportCompactColonyPanel.java

示例4: paintAfterTabs

protected void paintAfterTabs(Graphics g) {
    Rectangle bounds = displayer.getBounds();

    int lineY = bounds.y + bounds.height - 1;
    int sel = displayer.getSelectionModel().getSelectedIndex();

    Color shadowC = UIManager.getColor("controlShadow");
    shadowC = shadowC != null ? shadowC : Color.DARK_GRAY;

    if (sel != -1) {
        Color controlC = UIManager.getColor("control");
        controlC = controlC != null ? controlC : Color.GRAY;

        Rectangle tabRect = new Rectangle();
        displayer.getTabRect(sel, tabRect);
        g.setColor(shadowC);
        g.drawLine(bounds.x, lineY, bounds.x + tabRect.x - 1, lineY);
        g.drawLine(bounds.x + tabRect.x + tabRect.width, lineY,
                bounds.x + bounds.width - 1, lineY);
        g.setColor(controlC);
        g.drawLine(bounds.x + tabRect.x, lineY,
                bounds.x + tabRect.x + tabRect.width - 1, lineY);
    } else {
        g.setColor(shadowC);
        g.drawLine(bounds.x, lineY, bounds.x + bounds.width - 1, lineY);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:GtkEditorTabDisplayerUI.java

示例5: decodeColor

/**
* Decodes a color value.  The parameter <code>str</code> is either the
* name of a Java color or a string in the form <code>"#rrggbb"</code>
* or <code>"#aarrggbb"</code>.  As a special case, the string
* <code>"none"</code> returns <code>null</code>.
*
* @param str The string representation of the color
* @return The color value
*/

  public static Color decodeColor(String str) {
     if (str.equalsIgnoreCase("none")) return null;
     if (str.equalsIgnoreCase("bg")) return BACKGROUND_FILL;
     if (str.equalsIgnoreCase("black")) return Color.BLACK;
     if (str.equalsIgnoreCase("blue")) return Color.BLUE;
     if (str.equalsIgnoreCase("cyan")) return Color.CYAN;
     if (str.equalsIgnoreCase("darkGray")) return Color.DARK_GRAY;
     if (str.equalsIgnoreCase("DARK_GRAY")) return Color.DARK_GRAY;
     if (str.equalsIgnoreCase("gray")) return Color.GRAY;
     if (str.equalsIgnoreCase("green")) return Color.GREEN;
     if (str.equalsIgnoreCase("lightGray")) return Color.LIGHT_GRAY;
     if (str.equalsIgnoreCase("LIGHT_GRAY")) return Color.LIGHT_GRAY;
     if (str.equalsIgnoreCase("magenta")) return Color.MAGENTA;
     if (str.equalsIgnoreCase("orange")) return Color.ORANGE;
     if (str.equalsIgnoreCase("pink")) return Color.PINK;
     if (str.equalsIgnoreCase("red")) return Color.RED;
     if (str.equalsIgnoreCase("white")) return Color.WHITE;
     if (str.equalsIgnoreCase("yellow")) return Color.YELLOW;
     try {
        if (str.startsWith("0x")) {
           str = str.substring(2);
        } else if (str.startsWith("#")) {
           str = str.substring(1);
        }
        int nDigits = str.length();
        int aa = 0xFF;
        if (nDigits == 8) {
           aa = Integer.parseInt(str.substring(0, 2), 16);
           str = str.substring(2);
        } else if (nDigits != 6) {
           throw new RuntimeException("decodeColor: Colors must have " +
                                      "6 or 8 hexadecimal digits");
        }
        return new Color(Integer.parseInt(str, 16) | (aa << 24), true);
     } catch (NumberFormatException ex) {
        throw new RuntimeException("decodeColor: Illegal color " + str);
     }
  }
 
开发者ID:eric-roberts,项目名称:JavaPPTX,代码行数:48,代码来源:PPUtil.java

示例6: createLookAndFeelCustomizationKeysAndValues

@Override
public Object[] createLookAndFeelCustomizationKeysAndValues() {
    if (ThemeValue.functioning()) {
        return new Object[] {
            //XXX once the JDK team has integrated support for standard
            //UIManager keys into 1.5 (not there as of b47), these can 
            //probably be deleted, resulting in a performance improvement:
            "control", control,
            "controlHighlight", new ThemeValue (Region.PANEL, ThemeValue.LIGHT, Color.LIGHT_GRAY), //NOI18N
            "controlShadow", new ThemeValue (Region.PANEL, ThemeValue.DARK, Color.DARK_GRAY), //NOI18N
            "controlDkShadow", new ThemeValue (Region.PANEL, ThemeValue.BLACK, Color.BLACK), //NOI18N
            "controlLtHighlight", new ThemeValue (Region.PANEL, ThemeValue.WHITE, Color.WHITE), //NOI18N
            "textText", new ThemeValue (Region.PANEL, ColorType.TEXT_FOREGROUND, Color.BLACK), //NOI18N
            "text", new ThemeValue (Region.PANEL, ColorType.TEXT_BACKGROUND, Color.GRAY), //NOI18N
            
            "tab_unsel_fill", control, //NOI18N
             
            "SplitPane.dividerSize", new Integer (2),  //NOI18N
            
            SYSTEMFONT, controlFont, //NOI18N
            USERFONT, controlFont, //NOI18N
            MENUFONT, controlFont, //NOI18N
            LISTFONT, controlFont, //NOI18N
            "Label.font", controlFont, //NOI18N
            "Panel.font", controlFont, //NOI18N

            // workaround: GTKLookAndFeel FileChooser is unusable, cannot
            // choose a dir and doesn't look native anyway.  We force MetalFileChooserUI
                    
            "FileChooserUI", "javax.swing.plaf.metal.MetalFileChooserUI", // NOI18N
            "FileView.computerIcon",       javax.swing.plaf.metal.MetalIconFactory.getTreeComputerIcon(), // NOI18N
            "FileView.hardDriveIcon",      javax.swing.plaf.metal.MetalIconFactory.getTreeHardDriveIcon(), // NOI18N
            "FileView.floppyDriveIcon",    javax.swing.plaf.metal.MetalIconFactory.getTreeFloppyDriveIcon(), // NOI18N
            "FileChooser.newFolderIcon",   javax.swing.plaf.metal.MetalIconFactory.getFileChooserNewFolderIcon(), // NOI18N
            "FileChooser.upFolderIcon",    javax.swing.plaf.metal.MetalIconFactory.getFileChooserUpFolderIcon(), // NOI18N
            "FileChooser.homeFolderIcon",  javax.swing.plaf.metal.MetalIconFactory.getFileChooserHomeFolderIcon(), // NOI18N
            "FileChooser.detailsViewIcon", javax.swing.plaf.metal.MetalIconFactory.getFileChooserDetailViewIcon(), // NOI18N
            "FileChooser.listViewIcon",    javax.swing.plaf.metal.MetalIconFactory.getFileChooserListViewIcon(), // NOI18N
            "FileChooser.usesSingleFilePane", Boolean.TRUE, // NOI18N
            "FileChooser.ancestorInputMap", // NOI18N
                        new UIDefaults.LazyInputMap(new Object[] {
                            "ESCAPE", "cancelSelection", // NOI18N
                            "F2", "editFileName", // NOI18N
                            "F5", "refresh", // NOI18N
                            "BACK_SPACE", "Go Up", // NOI18N
                            "ENTER", "approveSelection", // NOI18N
                            "ctrl ENTER", "approveSelection" // NOI18N
                        }),
            // special tree icons - only for property sheet
            "Tree.gtk_expandedIcon", new GTKExpandedIcon(),
            "Tree.gtk_collapsedIcon", new GTKCollapsedIcon(),
        };
    } else {
        Object[] result = new Object[] {
            TOOLBAR_UI, new UIDefaults.ProxyLazyValue("org.netbeans.swing.plaf.gtk.GtkToolbarUI"), //NOI18N
            // special tree icons - only for property sheet
            "Tree.gtk_expandedIcon", new GTKExpandedIcon(),
            "Tree.gtk_collapsedIcon", new GTKCollapsedIcon(),
        };
        return result;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:62,代码来源:GtkLFCustoms.java

示例7: getCategoryTextColor

static Color getCategoryTextColor () {
    Color shadow = UIManager.getColor("textInactiveText");
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) )
        shadow = UIManager.getColor("Table.foreground");
    return shadow != null ? shadow : Color.DARK_GRAY;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:AbstractQuickSearchComboBar.java

示例8: getItemOutlinePaint

@Override
public Paint getItemOutlinePaint(int series, int item) {
	return Color.DARK_GRAY;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:ColorizedBubbleRenderer.java

示例9: InventButton

public InventButton(Vector pos, boolean tag) {
	super(pos, new Vector(40, 40), Color.DARK_GRAY, "");
	this.tag = tag;
}
 
开发者ID:ritcat14,项目名称:The-Mysterious-Mind-Of-Jack,代码行数:4,代码来源:InventButton.java


注:本文中的java.awt.Color.DARK_GRAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。