本文整理汇总了Java中java.awt.Color.yellow方法的典型用法代码示例。如果您正苦于以下问题:Java Color.yellow方法的具体用法?Java Color.yellow怎么用?Java Color.yellow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Color
的用法示例。
在下文中一共展示了Color.yellow方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComponentImage
import java.awt.Color; //导入方法依赖的package包/类
protected static BufferedImage createComponentImage(int w, int h,
ComponentColorModel cm)
{
WritableRaster wr = cm.createCompatibleWritableRaster(w, h);
BufferedImage img = new BufferedImage(cm, wr, false, null);
Graphics2D g = img.createGraphics();
int width = w / 8;
Color[] colors = new Color[8];
colors[0] = Color.red;
colors[1] = Color.green;
colors[2] = Color.blue;
colors[3] = Color.white;
colors[4] = Color.black;
colors[5] = new Color(0x80, 0x80, 0x80, 0x00);
colors[6] = Color.yellow;
colors[7] = Color.cyan;
for (int i = 0; i < 8; i++) {
g.setColor(colors[i]);
g.fillRect(i * width, 0, width, h);
}
return img;
}
示例2: getNodeColor
import java.awt.Color; //导入方法依赖的package包/类
public Color getNodeColor(int nodeID) {
boolean c = collapsedNodes.contains(nodeID);
boolean a = collapsedAttributes.contains(nodeID);
if (c) {
if (a)
return Color.green;
return Color.yellow;
}
if (a)
return Color.cyan;
return Color.white;
}
示例3: 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);
}
示例4: 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)];
}
示例5: 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);
}
示例6: 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;
}
示例7: makeGradientColors
import java.awt.Color; //导入方法依赖的package包/类
private Color[] makeGradientColors(int numColors, boolean alpha) {
Color[] colors = new Color[] {Color.red, Color.blue,
Color.green, Color.yellow};
Color[] ret = new Color[numColors];
for (int i = 0; i < numColors; i++) {
ret[i] = alpha ? makeAlphaColor(colors[i], 32) : colors[i];
}
return ret;
}
示例8: 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;
}
}
示例9: RGBAnimationTest
import java.awt.Color; //导入方法依赖的package包/类
/** Creates a new instance of RGBAnimationTest */
public RGBAnimationTest() {
frames = new Frame[4];
frames[0] = new Frame(new Color[] {Color.red, Color.green});
frames[1] = new Frame(new Color[] {Color.green, Color.cyan});
frames[2] = new Frame(new Color[] {Color.cyan, Color.yellow});
frames[3] = new Frame(new Color[] {Color.yellow, Color.red});
writer = ImageIO.getImageWritersByFormatName(format).next();
reader = ImageIO.getImageReadersByFormatName(format).next();
}
示例10: 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
};
}
示例11: drawAgent
import java.awt.Color; //导入方法依赖的package包/类
@Override
public void drawAgent(Graphics g, int x, int y, Color c, int id) {
if(!(x == 0 && y == 0)) {
super.drawAgent(g, x, y, Color.yellow, -1);
}
}
示例12: ScrollerDown
import java.awt.Color; //导入方法依赖的package包/类
public ScrollerDown(int x, int y, boolean visible, int width, int height) {
super(x, y, visible, Color.yellow, width, height);
}
示例13: MeterInterval
import java.awt.Color; //导入方法依赖的package包/类
/**
* Creates a new interval.
*
* @param label the label (<code>null</code> not permitted).
* @param range the range (<code>null</code> not permitted).
*/
public MeterInterval(String label, Range range) {
this(label, range, Color.yellow, new BasicStroke(2.0f), null);
}
示例14: setWarning
import java.awt.Color; //导入方法依赖的package包/类
public void setWarning() { color = Color.yellow; repaint(); }