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


Java Color.LIGHT_GRAY属性代码示例

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


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

示例1: paint

public void paint(Graphics g) {
    if (isGtk) {
        //Presumably we can get this fixed for JDK 1.5.1
        Color c = getBackground();

        if (c == null) {
            c = UIManager.getColor("control"); //NOI18N
        }

        if (c == null) {
            c = Color.LIGHT_GRAY;
        }

        Color oldC = g.getColor();
        g.setColor(c);
        g.fillRect(0, 0, getWidth(), getHeight());
        g.setColor(oldC);
    }

    super.paint(g);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:PropertyPanel.java

示例2: PackageEditing

public PackageEditing(Component centerIn) {
super();

center = centerIn;

panel = new LPanel();
add(panel);

editing = new LLabel("EDITING", AV.AVFont, AV.green);
editing.addShadow();
editing.setLocation(0, 0);
panel.add(editing);

packageName = new LLabel("Test", AV.AVFontSmall, Color.LIGHT_GRAY);
panel.add(packageName);

variantName = new LLabel("Test", AV.AVFontSmall, Color.LIGHT_GRAY);
variantName.putUnder(packageName, 0, 0);
panel.add(variantName);

setSize(10, variantName.getY() + variantName.getHeight());
   }
 
开发者ID:tstavrianos,项目名称:automatic-variants,代码行数:22,代码来源:PackageEditing.java

示例3: print

@Override public int print(Graphics default_graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
	if(pageIndex!=0)
		return NO_SUCH_PAGE;
	pageFormat.setOrientation(PageFormat.LANDSCAPE);

	Color foreground = this.foreground, background = this.background, grid = this.grid;
	this.foreground = Color.BLACK; this.background = Color.WHITE; this.grid = Color.LIGHT_GRAY;

	Graphics2D graphics = (Graphics2D) default_graphics;
	graphics.translate(pageFormat.getImageableX(),
			pageFormat.getImageableY());
	this.paint(graphics);
	Thread.yield(); //yield shortly that the graphics are printed properly

	this.foreground = foreground; this.background = background; this.grid = grid;
	return PAGE_EXISTS;
}
 
开发者ID:kristian,项目名称:JDigitalSimulator,代码行数:17,代码来源:SimulationOscilloscope.java

示例4: getColor

private static Color getColor(Level level) {
  if (level == Level.SEVERE) {
    return Color.RED;
  } else if (level == Level.WARNING) {
    return Color.ORANGE;
  } else
    return Color.LIGHT_GRAY;
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:8,代码来源:ConsoleLogHandler.java

示例5: configureEditedComponent

private void configureEditedComponent(JComponent c) {
    if(c == null) return;
    if(USE_NEW_ITEM_COLOR_SWITCHING) {
        if(c.getForeground() == Color.LIGHT_GRAY) {
            c.setForeground(getNormalForeground(c));
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:MenuEditLayer.java

示例6: main

/**
 * 
 * @param args
 */
public static void main(String[] args) {
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  } catch (Exception e1) {
    e1.printStackTrace();
  }

  mxSwingConstants.SHADOW_COLOR = Color.LIGHT_GRAY;
  mxConstants.W3C_SHADOWCOLOR = "#D3D3D3";

  GraphEditor editor = new GraphEditor();
  editor.createFrame(new EditorMenuBar(editor)).setVisible(true);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:GraphEditor.java

示例7: drawOverflowIndicator

/**
 * Draws indicator in case the annotation text overflows on the y axis.
 *
 * @param anno
 *            the annotation
 * @param g
 *            the graphics context to draw upon
 * @param loc
 *            the location of the annotation
 * @param printing
 *            if we are currently printing
 */
private void drawOverflowIndicator(final WorkflowAnnotation anno, final Graphics2D g, final Rectangle2D loc,
		final boolean printing) {
	if (printing) {
		// never draw them for printing
		return;
	}
	Graphics2D g2 = (Graphics2D) g.create();

	int size = 20;
	int xOffset = 10;
	int yOffset = 10;
	int stepSize = size / 4;
	int dotSize = 3;
	int x = (int) loc.getMaxX() - size - xOffset;
	int y = (int) loc.getMaxY() - size - yOffset;
	GradientPaint gp = new GradientPaint(x, y, Color.WHITE, x, y + size * 1.5f, Color.LIGHT_GRAY);
	g2.setPaint(gp);
	g2.fillRect(x, y, size, size);

	g2.setColor(Color.BLACK);
	g2.drawRect(x, y, size, size);

	g2.fillOval(x + stepSize, y + stepSize * 2, dotSize, dotSize);
	g2.fillOval(x + stepSize * 2, y + stepSize * 2, dotSize, dotSize);
	g2.fillOval(x + stepSize * 3, y + stepSize * 2, dotSize, dotSize);

	g2.dispose();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:40,代码来源:AnnotationDrawer.java

示例8: getColorForValue

public static Color getColorForValue(double value, int alpha, boolean logarithmic, double minValue, double maxValue,
		Color minColor, Color maxColor) {
	if (Double.isNaN(value)) {
		return Color.LIGHT_GRAY;
	}

	// map value to [0,1]
	if (minValue == maxValue) {
		value = 0.5;
	} else if (logarithmic) {
		value = (Math.log(value) - Math.log(minValue)) / (Math.log(maxValue) - Math.log(minValue));
	} else {
		value = (value - minValue) / (maxValue - minValue);
	}

	Color MIN_LEGEND_COLOR = minColor;
	Color MAX_LEGEND_COLOR = maxColor;
	float[] minCol = Color.RGBtoHSB(MIN_LEGEND_COLOR.getRed(), MIN_LEGEND_COLOR.getGreen(), MIN_LEGEND_COLOR.getBlue(),
			null);
	float[] maxCol = Color.RGBtoHSB(MAX_LEGEND_COLOR.getRed(), MAX_LEGEND_COLOR.getGreen(), MAX_LEGEND_COLOR.getBlue(),
			null);
	double hColorDiff = maxCol[0] - minCol[0];
	double sColorDiff = maxCol[1] - minCol[1];
	double bColorDiff = maxCol[2] - minCol[2];

	Color color = new Color(Color.HSBtoRGB((float) (minCol[0] + hColorDiff * value), (float) (minCol[1] + value
			* sColorDiff), (float) (minCol[2] + value * bColorDiff)));

	if (alpha < 255) {
		color = DataStructureUtils.setColorAlpha(color, alpha);
	}
	return color;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:33,代码来源:ContinuousColorProvider.java

示例9: drawViewButton

private RoundRectangle2D drawViewButton(double x, double y, Graphics2D g2d, boolean draw, boolean clicked) {
	Rectangle2D dvR;
	RoundRectangle2D dvRR;
	Color tmp;
	Color fg = Color.BLACK;
	Color bg = Color.LIGHT_GRAY;

	if (clicked) {
		tmp = fg;
		fg = bg;
		bg = tmp;
	}

	if (nCpu > 2) {
		fg = Color.DARK_GRAY.brighter().brighter();
		bg = Color.LIGHT_GRAY;
	}

	dvR = drawCenteredText("change view", fg, bg, x, y, g2d, false, false);
	dvRR = new RoundRectangle2D.Double(x, y, dvR.getWidth(), dvR.getHeight(), 5.0, 5.0);
	if (draw) {
		tmp = g2d.getColor();
		g2d.setColor(bg);
		g2d.fill(dvRR);
		g2d.setColor(fg);
		g2d.draw(dvRR);
		drawCenteredText("change view", fg, bg, x + dvR.getWidth() / 2.0, y + dvR.getHeight() / 2.0, g2d, false, true);
		g2d.setColor(tmp);
	}
	return dvRR;
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:31,代码来源:QueueDrawer.java

示例10: setColor

public void setColor() {
//			Color c = !layerVisible ? Color.LIGHT_GRAY : Color.GRAY;
			Color c = Color.LIGHT_GRAY;
			this.setBackground(c);
			for (Component comp : this.getComponents())
				if (!(comp instanceof JButton))
					comp.setBackground(c);
		}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:8,代码来源:LayerManager.java

示例11: getDrawPaint

/**
 * @see edu.uci.ics.jung.graph.decorators.EdgePaintFunction#getDrawPaint(edu.uci.ics.jung.graph.Edge)
 */
public Paint getDrawPaint(Edge e) {
	if ( mPred == null || mPred.size() == 0) return Color.BLACK;
	if( isBlessed( e )) {
		return new Color(0.0f, 0.0f, 1.0f, 0.5f);//Color.BLUE;
	} else {
		return Color.LIGHT_GRAY;
	}
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:11,代码来源:ShortestPathDemo.java

示例12: setColor

public void setColor() {
	Color c = Color.LIGHT_GRAY;
	this.setBackground(c);
	for (Component comp : this.getComponents())
		if (!(comp instanceof JButton))
			comp.setBackground(c);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:7,代码来源:LayerManager.java

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

示例14: drawViewButton

private RoundRectangle2D drawViewButton(double x, double y, Graphics2D g2d, boolean draw, boolean clicked) {
	Rectangle2D dvR;
	RoundRectangle2D dvRR;
	Color tmp;
	Color fg = Color.BLACK;
	Color bg = Color.LIGHT_GRAY;

	if (clicked) {
		tmp = fg;
		fg = bg;
		bg = tmp;
	}

	if (nCpu > 2) {
		fg = Color.darkGray.brighter().brighter();
		bg = Color.LIGHT_GRAY;
	}

	dvR = drawCenteredText("change view", fg, bg, x, y, g2d, false, false);
	dvRR = new RoundRectangle2D.Double(x, y, dvR.getWidth(), dvR.getHeight(), 5.0, 5.0);
	if (draw) {
		tmp = g2d.getColor();
		g2d.setColor(bg);
		g2d.fill(dvRR);
		g2d.setColor(fg);
		g2d.draw(dvRR);
		drawCenteredText("change view", fg, bg, x + dvR.getWidth() / 2.0, y + dvR.getHeight() / 2.0, g2d, false, true);
		g2d.setColor(tmp);
	}
	return dvRR;
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:31,代码来源:QueueDrawer.java

示例15: installUI

public void installUI(JComponent c) {
    super.installUI(c);

    //Fetch the "no properties" string - it's not going to change
    //for the life of the session
    //        noPropsString = NbBundle.getMessage(MarginViewportUI.class,
    //            "CTL_NoProperties"); //NOI18N
    //Set an appropriate font and color.  Only really relevant on OS-X to
    //keep the font consistent with other NB fonts
    Color fg = UIManager.getColor("controlShadow"); //NOI18N

    if (fg == null) {
        fg = Color.LIGHT_GRAY;
    }

    c.setForeground(fg);

    Color bg = UIManager.getColor("Tree.background"); //NOI18N

    if (bg == null) {
        bg = Color.WHITE;
    }

    c.setBackground(bg);

    Font f = UIManager.getFont("Tree.font"); //NOI18N

    if (f == null) {
        f = UIManager.getFont("controlFont"); //NOI18N
    }

    if (f != null) {
        c.setFont(f);
    }

    c.addContainerListener(this);

    Component[] kids = c.getComponents();

    for (int i = 0; i < kids.length; i++) {
        //Should almost always be empty anyway, if not only one component,
        //but for completeness...
        kids[i].addComponentListener(this);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:45,代码来源:MarginViewportUI.java


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