Java Code Examples for java.awt.Color#CYAN

The following examples show how to use java.awt.Color#CYAN . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Test method for {@link
 * com.sldeditor.common.property.PropertyManager#updateValue(java.lang.String, java.awt.Color)}.
 */
@Test
public void testUpdateValueStringColor() {
    PropertyManager propertyManager = new PropertyManager();
    propertyManager.setPropertyFile(null);
    String key = "test colour key";
    Color value = Color.CYAN;
    propertyManager.updateValue(key, value);

    Color defaultValue = Color.MAGENTA;
    Color actualResult = propertyManager.getColourValue(key, defaultValue);
    assertEquals(value, actualResult);

    String newKey = "test colour key 2";

    actualResult = propertyManager.getColourValue(newKey, defaultValue);
    assertEquals(defaultValue, actualResult);
}
 
Example 2
public void paintComponent(Graphics g){
	Graphics2D g2 = (Graphics2D) g;
	
	g2.setColor(Color.BLACK);
	curve.draw(g2);
	
	Color[] colors = new Color[]{
			Color.RED, Color.GREEN, Color.CYAN, Color.MAGENTA, Color.ORANGE};
	int i= 0;

	g2.setColor(Color.BLUE);
	for(CirculinearContinuousCurve2D cont :
		CirculinearCurves2D.splitContinuousCurve(curve)){
		g2.setColor(colors[i++]);
		cont.draw(g2);
	}
}
 
Example 3
Source Project: frog   File: BrainPicture.java    License: Apache License 2.0 6 votes vote down vote up
public static Color color(float i) {
	if (i == 0)
		return Color.black;
	if (i == 1)
		return Color.RED;
	if (i <= 3)
		return Color.ORANGE;
	if (i <= 10)
		return Color.YELLOW;
	if (i <= 20)
		return Color.GREEN;
	if (i <= 50)
		return Color.CYAN;
	if (i <= 100)
		return Color.BLUE;
	return Color.MAGENTA;
}
 
Example 4
Source Project: frog   File: BrainPicture.java    License: Apache License 2.0 6 votes vote down vote up
public static Color color(float i) {
	if (i == 0)
		return Color.black;
	if (i == 1)
		return Color.RED;
	if (i <= 3)
		return Color.ORANGE;
	if (i <= 10)
		return Color.YELLOW;
	if (i <= 20)
		return Color.GREEN;
	if (i <= 50)
		return Color.CYAN;
	if (i <= 100)
		return Color.BLUE;
	return Color.MAGENTA;
}
 
Example 5
public Paint color() {
	if (en1 != null) {
		return Color.BLACK;
	} else if (en2 != null) {
		return Color.GRAY;
	}
	if (att1 != null) {
		return Color.BLUE;
	} else if (att2 != null) {
		return Color.CYAN;
	}
	if (fk1 != null) {
		return Color.red;
	} else if (fk2 != null) {
		return Color.magenta;
	} else if (ty != null) {
		return Color.white;
	}
	return Util.anomaly();
}
 
Example 6
Source Project: SNT   File: Path.java    License: GNU General Public License v3.0 6 votes vote down vote up
public Color getSWCcolor() {
	switch (swcType) {
	case Path.SWC_SOMA:
		return Color.BLUE;
	case Path.SWC_DENDRITE:
		return Color.GREEN;
	case Path.SWC_APICAL_DENDRITE:
		return Color.CYAN;
	case Path.SWC_AXON:
		return Color.RED;
	case Path.SWC_FORK_POINT:
		return Color.ORANGE;
	case Path.SWC_END_POINT:
		return Color.PINK;
	case Path.SWC_CUSTOM:
		return Color.YELLOW;
	case Path.SWC_UNDEFINED:
	default:
		return SimpleNeuriteTracer.DEFAULT_DESELECTED_COLOR;
	}
}
 
Example 7
Source Project: frog   File: BrainPicture.java    License: Apache License 2.0 6 votes vote down vote up
public static Color color(float i) {
	if (i == 0)
		return Color.black;
	if (i == 1)
		return Color.RED;
	if (i <= 3)
		return Color.ORANGE;
	if (i <= 10)
		return Color.YELLOW;
	if (i <= 20)
		return Color.GREEN;
	if (i <= 50)
		return Color.CYAN;
	if (i <= 100)
		return Color.BLUE;
	return Color.MAGENTA;
}
 
Example 8
@ConfigItem(
	keyName = "untaggedFishColor",
	name = "Untagged fish color",
	description = "Color of untagged fish",
	position = 5
)
default Color untaggedFishColor()
{
	return Color.CYAN;
}
 
Example 9
private Color getColor(Object value) {
    String val = Objects.toString(value, "").trim();
    switch (val) {
        case "Execute":
            return Color.BLUE;//.darker();
        case "App":
            return Color.CYAN;//.darker();
        case "Browser":
            return Color.RED;//.darker();
        default:
            return new Color(204, 0, 255);
    }
}
 
Example 10
@Alpha
@ConfigItem(
	position = 10,
	keyName = "markerColor9",
	name = "Group 9 tile color",
	description = "Configures the color of the 9th group of marked tiles",
	hidden = true,
	unhide = "amount",
	unhideValue = "9 || 10 || 11 || 12"
)
default Color markerColor9()
{
	return Color.CYAN;
}
 
Example 11
@ConfigItem(
	position = 2,
	keyName = "colorGameObject",
	name = "Trail Object Color",
	description = "Color for mushrooms, mud, seaweed, etc",
	titleSection = "colorsTitle"
)
default Color getObjectColor()
{
	return Color.CYAN;
}
 
Example 12
@ConfigItem(
	position = 2,
	keyName = "npcColor",
	name = "Highlight Color",
	description = "Color of the NPC highlight"
)
default Color getHighlightColor()
{
	return Color.CYAN;
}
 
Example 13
@ConfigItem(
	position = 1,
	keyName = "damageNotificationColor",
	name = "Damage Notification Color",
	description = "Color of damage notification text in chat"
)
default Color damageNotificationColor()
{
	return Color.CYAN;
}
 
Example 14
public Color getColor(RequestType type) {
    Color result;
    switch (type) {
        case ASSOCIATION:
            result = Color.YELLOW;
            break;
        case XRDS:
            result = Color.LIGHT_GRAY;
            break;
        case HTML:
            result = Color.BLUE;
            break;
        case TOKEN_VALID:
            result = Color.green;
            break;
        case TOKEN_ATTACK:
            result = Color.red;
            break;
        case CHECK_AUTHENTICATION:
            result = Color.CYAN;
            break;
        case ERROR:
            result = Color.MAGENTA;
            break;
        case XXE:
            result = Color.PINK;
            break;
        default:
            throw new AssertionError();
    }
    return result;
}
 
Example 15
protected JComponent createColorPicker() {

        Color[] colors = {Color.BLACK,
                Color.DARK_GRAY,
                Color.GRAY,
                Color.LIGHT_GRAY,
                Color.WHITE,
                Color.CYAN,
                Color.BLUE,
                Color.MAGENTA,
                Color.YELLOW,
                Color.ORANGE,
                Color.RED,
                Color.PINK,
                Color.GREEN};


        JPanel colorsPanel = new JPanel(new GridLayout(-1, 6, 4, 4));
        colorsPanel.setOpaque(false);
        for (Color color : colors) {
            ColorLabel colorLabel = new ColorLabel(color);
            colorLabel.setDisplayName(ColorCodes.getName(color));
            colorLabel.setHoverEnabled(true);
            colorLabel.setMaximumSize(colorLabel.getPreferredSize());
            colorLabel.setMinimumSize(colorLabel.getPreferredSize());
            colorLabel.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseReleased(MouseEvent e) {
                    setSelectedColor(colorLabel.getColor());
                }
            });
            colorsPanel.add(colorLabel);
        }
        return colorsPanel;
    }
 
Example 16
Source Project: javagame   File: MainPanel.java    License: MIT License 5 votes vote down vote up
public MainPanel() {
    setPreferredSize(new Dimension(WIDTH, HEIGHT));

    soul = new Soul(WIDTH / 2, HEIGHT / 2, 100, 180, Color.CYAN);

    addMouseMotionListener(this);

    // �Q�[�����[�v�J�n
    Thread gameLoop = new Thread(this);
    gameLoop.start();
}
 
Example 17
@ConfigItem(
	position = 2,
	keyName = "colorStart",
	name = "Start Color",
	description = "Color for rocks that start the trails"
)
default Color getStartColor()
{
	return Color.CYAN;
}
 
Example 18
Source Project: Komondor   File: Node.java    License: GNU General Public License v3.0 5 votes vote down vote up
public Node(String node_code, String wlan_code, int node_type,
        Point position) {

    // Items read by CSV
    this.node_code = node_code;
    this.wlan_code = wlan_code;
    this.node_type = node_type;
    if (this.node_type == 1) {
        color = Color.CYAN;
    }
    this.position = new Point();
    this.shape = new Ellipse2D.Double(0, 0, 0, 0);
}
 
Example 19
Source Project: diozero   File: SSD1331Test.java    License: MIT License 4 votes vote down vote up
public static void animateText(SsdOled oled, String text) {
	int width = oled.getWidth();
	int height = oled.getHeight();
	BufferedImage image = new BufferedImage(width, height, oled.getNativeImageType());
	Graphics2D g2d = image.createGraphics();
	Random random = new Random();
	
	Color[] colours = { Color.WHITE, Color.BLUE, Color.CYAN, Color.DARK_GRAY, Color.GRAY, Color.LIGHT_GRAY,
			Color.MAGENTA, Color.ORANGE, Color.PINK, Color.RED, Color.YELLOW };
	g2d.setBackground(Color.BLACK);
	
	Font f = g2d.getFont();
	Logger.info("Font name={}, family={}, size={}, style={}", f.getFontName(), f.getFamily(),
			Integer.valueOf(f.getSize()), Integer.valueOf(f.getStyle()));
	FontMetrics fm = g2d.getFontMetrics();
	int maxwidth = fm.stringWidth(text);
	
	int amplitude = height/4;
	int offset = height/2 - 4;
	int velocity = -2;
	int startpos = width;
	int pos = startpos;
	int x;
	for (int i=0; i<200; i++) {
		g2d.clearRect(0, 0, width, height);
		x = pos;

		for (char c : text.toCharArray()) {
			if (x > width) {
				break;
			}
			
			if (x < -10) {
				x += fm.charWidth(c);
				continue;
			}
			// Calculate offset from sine wave.
	        int y = (int) (offset + Math.floor(amplitude * Math.sin(x / ((float)width) * 2.0 * Math.PI)));
	        // Draw text.
			g2d.setColor(colours[random.nextInt(colours.length)]);
	        g2d.drawString(String.valueOf(c), x, y);
	        // Increment x position based on chacacter width.
	        x += fm.charWidth(c);
		}
	    // Draw the image buffer.
	    oled.display(image);
	    // Move position for next frame.
	    pos += velocity;
	    // Start over if text has scrolled completely off left side of screen.
	    if (pos < -maxwidth) {
	        pos = startpos;
	    }
	    
	    // Pause briefly before drawing next frame.
		try {
			Thread.sleep(50);
		} catch (InterruptedException e) {
		}
	}
}
 
Example 20
@Test
public void testGroupColorChangesGroupedVertexColors_AfterPeristence() {
	graphFunction("01002cf5");

	//
	// Group a node
	//
	FGVertex v1 = vertex("01002d06");
	FGVertex v2 = vertex("01002d0f");
	GroupedFunctionGraphVertex group = group("A", v1, v2);

	//
	// Change the group color
	//
	Color newGroupColor = Color.CYAN;
	color(group, newGroupColor);

	// 
	// Trigger persistence
	//
	Address groupAddress = group.getVertexAddress();
	FGData graphData = triggerPersistenceAndReload("01002cf5");

	//
	// Retrieve the group and make sure its color is restored
	//
	group = getGroupVertex(graphData.getFunctionGraph(), groupAddress);
	verifyColor(group, newGroupColor);

	//
	// Ungroup
	//
	ungroup(group);

	// 
	// Test the grouped vertices colors
	//
	v1 = vertex("01002d06");
	v2 = vertex("01002d0f");
	verifyColor(v1, newGroupColor);
	verifyColor(v2, newGroupColor);
}