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


Java Color.MAGENTA属性代码示例

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


在下文中一共展示了Color.MAGENTA属性的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: 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

示例3: transform

@Override
public Paint transform(SubstrateNode input) {
	if (nodes.contains(input))
		return Color.GREEN; // source or destination
	else if (nodesHH.contains(input))
		return Color.MAGENTA; // hidden hops
	else
		return backupSN.transform(input);
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:9,代码来源:MappingTreeSelectionListener.java

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

示例5: testLineSlide

private PPSlide testLineSlide() {
   PPSlide slide = new PPSlide();
   slide.addTitle("Test PPLine Class");
   double xc = slide.getWidth() / 2;
   double yc = slide.getHeight() / 2;
   double r = 100;
   double dx = 0;
   double dy = 0;
   Color color = null;
   for (int i = 0; i < 8; i++) {
      switch (i) {
       case 0: dx = 0; dy = -r; color = Color.RED; break;
       case 1: dx = r; dy = -r; color = Color.ORANGE; break;
       case 2: dx = r; dy = 0; color = Color.YELLOW; break;
       case 3: dx = r; dy = r; color = Color.GREEN; break;
       case 4: dx = 0; dy = r; color = Color.CYAN; break;
       case 5: dx = -r; dy = r; color = Color.BLUE; break;
       case 6: dx = -r; dy = 0; color = Color.MAGENTA; break;
       case 7: dx = -r; dy = -r; color = Color.PINK; break;
      }
      PPLine line = new PPLine(xc, yc, xc + dx, yc + dy);
      line.setColor(color);
      line.setLineWeight(2);
      slide.add(line);
   }
   return slide;
}
 
开发者ID:eric-roberts,项目名称:JavaPPTX,代码行数:27,代码来源:PPShapeTest.java

示例6: paintComponent

@Override
public void paintComponent(Graphics g)
{
   super.paintComponent(g); 
   this.setBackground(Color.WHITE);

   // set new drawing color using integers
   g.setColor(new Color(255, 0, 0));
   g.fillRect(15, 25, 100, 20);
   g.drawString("Current RGB: " + g.getColor(), 130, 40);

   // set new drawing color using floats
   g.setColor(new Color(0.50f, 0.75f, 0.0f));
   g.fillRect(15, 50, 100, 20);
   g.drawString("Current RGB: " + g.getColor(), 130, 65);

   // set new drawing color using static Color objects
   g.setColor(Color.BLUE);
   g.fillRect(15, 75, 100, 20);
   g.drawString("Current RGB: " + g.getColor(), 130, 90);

   // display individual RGB values
   Color color = Color.MAGENTA;
   g.setColor(color);
   g.fillRect(15, 100, 100, 20);
   g.drawString("RGB values: " + color.getRed() + ", " +
      color.getGreen() + ", " + color.getBlue(), 130, 115);
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:28,代码来源:ColorJPanel.java

示例7: ColorSchemeCoordination

public ColorSchemeCoordination(Simulation sim, PotentialMasterList potentialMaster, Box box) {
    super(box);

    leafList = box.getLeafList();
    nbrManager = potentialMaster.getNeighborManager(box);
    colors = new Color[]{Color.WHITE,Color.MAGENTA, Color.RED, Color.ORANGE,Color.GRAY,Color.GREEN,Color.BLUE,Color.WHITE};
}
 
开发者ID:etomica,项目名称:etomica,代码行数:7,代码来源:ColorSchemeCoordination.java

示例8: makeColor

private static void makeColor() {
	/* Primi 9 Colori */
	list[0] = Color.RED;
	name[0] = "ROSSO";
	list[1] = Color.BLUE;
	name[1] = "BLU";
	list[2] = Color.MAGENTA;
	name[2] = "MAGENTA";
	list[3] = Color.GREEN;
	name[3] = "VERDE";
	list[4] = Color.BLACK;
	name[4] = "NERO";
	list[5] = Color.YELLOW;
	name[5] = "GIALLO";
	list[6] = Color.PINK;
	name[6] = "ROSA";
	list[7] = Color.CYAN;
	name[7] = "AZZURRO";
	list[8] = Color.ORANGE;
	name[8] = "ARANCIONE";
	list[9] = Color.GRAY;
	name[9] = "GRIGIO";
	list[10] = new Color(155, 0, 0);
	name[10] = "ROSSO SCURO";
	list[11] = new Color(94, 0, 2);
	name[11] = "MARRONE";
	list[12] = new Color(242, 129, 252);
	name[12] = "VIOLA CHIARO";
	list[13] = new Color(129, 69, 135);
	name[13] = "VIOLA SCURO";
	list[14] = new Color(141, 141, 254);
	name[14] = "BLU CHIARO";
	list[15] = new Color(1, 1, 109);
	name[15] = "BLU SCURO";
	list[16] = new Color(3, 124, 146);
	name[16] = "AZZURRO SCURO";
	list[17] = new Color(83, 172, 105);
	name[17] = "VERDINO";
	list[18] = new Color(33, 116, 35);
	name[18] = "VERDE SCURO";
	list[19] = new Color(128, 206, 49);
	name[19] = "VERDACCIO";
	list[20] = new Color(170, 162, 55);
	name[20] = "ORO";
	list[21] = new Color(191, 156, 34);
	name[21] = "OCRA";
	list[22] = new Color(255, 0, 128);
	name[22] = "ROSACCIO";
	list[23] = new Color(198, 50, 50);
	name[23] = "ROSSO N°2";
	list[24] = new Color(99, 55, 137);
	name[24] = "VIOLA SCURO N°2";
	list[25] = new Color(99, 55, 137).brighter();
	name[25] = "ROSSO N°3";
	list[26] = new Color(129, 69, 135).brighter();
	name[26] = "VIOLA SCURO N°2";
	list[27] = new Color(141, 141, 254).darker();
	name[27] = "BLU CHIARO N°2";
	list[28] = new Color(1, 1, 109).brighter().brighter();
	name[28] = "BLU SCURO N°2";
	list[29] = new Color(3, 124, 146).brighter();
	name[29] = "AZZURRO SCURO N°2";
	list[30] = new Color(83, 172, 105).darker();
	name[30] = "VERDINO N°2";
	list[31] = new Color(33, 116, 35).brighter();
	name[31] = "VERDE SCURO N°2";
	list[32] = new Color(128, 206, 49).brighter();
	name[32] = "VERDACCIO N°2";
	list[33] = new Color(170, 162, 55).brighter();
	name[33] = "ORO N°2";
	list[34] = new Color(191, 156, 34).darker();
	name[34] = "OCRA N°2";
	list[35] = new Color(255, 0, 128).brighter();
	name[35] = "ROSACCIO N°2";
	list[36] = new Color(198, 50, 50).darker().darker();
	name[36] = "ROSSO N°4";
	list[37] = new Color(99, 55, 137).brighter().brighter();
	name[37] = "VIOLA SCURO N°3";
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:79,代码来源:JavaWatColor.java

示例9: makeColor

private static void makeColor() {
	/* Primi 9 Colori */
	list[0] = Color.RED;
	name[0] = "ROSSO";
	list[1] = Color.BLUE;
	name[1] = "BLU";
	list[2] = Color.MAGENTA;
	name[2] = "MAGENTA";
	list[3] = Color.GREEN;
	name[3] = "VERDE";
	list[4] = Color.BLACK;
	name[4] = "NERO";
	list[5] = Color.YELLOW;
	name[5] = "GIALLO";
	list[6] = Color.PINK;
	name[6] = "ROSA";
	list[7] = Color.CYAN;
	name[7] = "AZZURRO";
	list[8] = Color.ORANGE;
	name[8] = "ARANCIONE";
	list[9] = Color.GRAY;
	name[9] = "GRIGIO";
	list[10] = new Color(155, 0, 0);
	name[10] = "ROSSO SCURO";
	list[11] = new Color(94, 0, 2);
	name[11] = "MARRONE";
	list[12] = new Color(242, 129, 252);
	name[12] = "VIOLA CHIARO";
	list[13] = new Color(129, 69, 135);
	name[13] = "VIOLA SCURO";
	list[14] = new Color(141, 141, 254);
	name[14] = "BLU CHIARO";
	list[15] = new Color(1, 1, 109);
	name[15] = "BLU SCURO";
	list[16] = new Color(3, 124, 146);
	name[16] = "AZZURRO SCURO";
	list[17] = new Color(83, 172, 105);
	name[17] = "VERDINO";
	list[18] = new Color(33, 116, 35);
	name[18] = "VERDE SCURO";
	list[19] = new Color(128, 206, 49);
	name[19] = "VERDACCIO";
	list[20] = new Color(170, 162, 55);
	name[20] = "ORO";
	list[21] = new Color(191, 156, 34);
	name[21] = "OCRA";
	list[22] = new Color(255, 0, 128);
	name[22] = "ROSACCIO";
	list[23] = new Color(198, 50, 50);
	name[23] = "ROSSO N�2";
	list[24] = new Color(99, 55, 137);
	name[24] = "VIOLA SCURO N�2";
	list[25] = new Color(99, 55, 137).brighter();
	name[25] = "ROSSO N�3";
	list[26] = new Color(129, 69, 135).brighter();
	name[26] = "VIOLA SCURO N�2";
	list[27] = new Color(141, 141, 254).darker();
	name[27] = "BLU CHIARO N�2";
	list[28] = new Color(1, 1, 109).brighter().brighter();
	name[28] = "BLU SCURO N�2";
	list[29] = new Color(3, 124, 146).brighter();
	name[29] = "AZZURRO SCURO N�2";
	list[30] = new Color(83, 172, 105).darker();
	name[30] = "VERDINO N�2";
	list[31] = new Color(33, 116, 35).brighter();
	name[31] = "VERDE SCURO N�2";
	list[32] = new Color(128, 206, 49).brighter();
	name[32] = "VERDACCIO N�2";
	list[33] = new Color(170, 162, 55).brighter();
	name[33] = "ORO N�2";
	list[34] = new Color(191, 156, 34).darker();
	name[34] = "OCRA N�2";
	list[35] = new Color(255, 0, 128).brighter();
	name[35] = "ROSACCIO N�2";
	list[36] = new Color(198, 50, 50).darker().darker();
	name[36] = "ROSSO N�4";
	list[37] = new Color(99, 55, 137).brighter().brighter();
	name[37] = "VIOLA SCURO N�3";

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:80,代码来源:JavaWatColor.java


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