Example usage for java.awt Color blue

List of usage examples for java.awt Color blue

Introduction

In this page you can find the example usage for java.awt Color blue.

Prototype

Color blue

To view the source code for java.awt Color blue.

Click Source Link

Document

The color blue.

Usage

From source file:edu.osu.netmotifs.warswap.ui.GenerateMotifImages.java

public static void main(String[] args) {
    HashMap<Integer, Color> cHash = new HashMap<Integer, Color>();
    cHash.put(0, Color.BLUE);
    cHash.put(2, Color.BLACK);/*ww w . j av a2s  .  c o  m*/
    cHash.put(1, Color.RED);
    try {
        new GenerateMotifImages(cHash,
                "/home/mitra/workspace/uni-workspace/warswap_tool/warswap.subgraphsdddd.OUT", 3,
                "data/htmout.htm").createHtm(1, 0, 10);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:Main.java

public static void setLabelCenter(JLabel label, String str, int width, int height) {
    Graphics g = label.getGraphics();
    Color c = g.getColor();/*from  www.ja va  2s .  co  m*/
    g.setColor(Color.BLUE);
    label.setText(str);
    int strWidth = SwingUtilities.computeStringWidth(g.getFontMetrics(), str);
    int lX = width / 2 - strWidth;
    int lY = g.getFont().getSize() / 2;
    //System.out.printf("\"label\"+%s X:%d,Y:%d\n",str,lX,lY);
    label.setBounds(lX, lY, strWidth, g.getFont().getSize());
    g.setColor(c);
}

From source file:org.jfree.graphics2d.demo.ImageTest.java

private static void drawClipTest(Graphics2D g2) {
    g2.translate(10, 20);/*from   w  ww  . j  av  a 2 s  .  co m*/
    g2.setColor(Color.RED);
    g2.fillRect(10, 10, 100, 100);
    g2.clip(new Rectangle(0, 0, 60, 60));
    g2.setPaint(Color.BLUE);
    g2.fillRect(10, 10, 100, 100);
    g2.setClip(null);
    g2.setPaint(Color.GREEN);
    g2.fillRect(60, 60, 50, 50);
}

From source file:ImageProc.java

public static void imwrite(File file, int[][] classificationMat, int imgDim1, int imgDim2) {
    BufferedImage image = new BufferedImage(imgDim2, imgDim1, BufferedImage.TYPE_INT_RGB);

    for (int i = 0; i < imgDim1; i++) {
        for (int j = 0; j < imgDim2; j++) {

            switch (classificationMat[i][j]) {
            case 1:
                image.setRGB(j, i, Color.BLUE.getRGB());
                break;
            case 2:
                image.setRGB(j, i, Color.CYAN.getRGB());
                break;
            case 3:
                image.setRGB(j, i, Color.GREEN.getRGB());
                break;
            case 4:
                image.setRGB(j, i, Color.ORANGE.getRGB());
                break;
            case 5:
                image.setRGB(j, i, Color.RED.getRGB());
                break;
            }/*  w w w . j av a 2s.co  m*/
        }
    }
    try {
        ImageIO.write(image, "png", file);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static Border getBorderBlue(int thickness) {
    return BorderFactory.createLineBorder(Color.blue, thickness);
}

From source file:LisajousApp.Draw.java

private static JFreeChart createChart(XYDataset dataset) {
    JFreeChart chart = ChartFactory.createScatterPlot("Lissajous", "X", "Y", dataset, PlotOrientation.VERTICAL,
            false, false, false);/*from   w ww  .j ava 2s  .  co  m*/
    chart.setBackgroundPaint(Color.lightGray);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.getRenderer().setSeriesPaint(0, Color.blue);
    // ta linia niej odpowiada za grubo punktw
    Shape shape = new Ellipse2D.Double(0, 0, 0.5, 0.5);
    plot.getRenderer().setSeriesShape(0, shape);

    return chart;
}

From source file:Main.java

public void paint(Graphics g) {
    g.setColor(Color.BLUE);
    g.drawString(name, 0, 0);
}

From source file:org.jfree.chart.demo.BubbleChartDemo1.java

private static JFreeChart createChart(XYZDataset xyzdataset) {
    JFreeChart jfreechart = ChartFactory.createBubbleChart("Bubble Chart Demo 1", "X", "Y", xyzdataset,
            PlotOrientation.HORIZONTAL, true, true, false);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    xyplot.setForegroundAlpha(0.65F);/* ww  w.j  a  va2  s .co  m*/
    XYItemRenderer xyitemrenderer = xyplot.getRenderer();
    xyitemrenderer.setSeriesPaint(0, Color.blue);
    NumberAxis numberaxis = (NumberAxis) xyplot.getDomainAxis();
    numberaxis.setLowerMargin(0.14999999999999999D);
    numberaxis.setUpperMargin(0.14999999999999999D);
    NumberAxis numberaxis1 = (NumberAxis) xyplot.getRangeAxis();
    numberaxis1.setLowerMargin(0.14999999999999999D);
    numberaxis1.setUpperMargin(0.14999999999999999D);
    return jfreechart;
}

From source file:DrawRectPanel.java

public void paintComponent(Graphics g) {
    super.paintComponent(g);
    g.setColor(Color.blue);
    g.drawRect(10, 10, 80, 30);/*  w  w  w. j  a v  a  2 s.  c  o  m*/
    g.drawRoundRect(100, 10, 80, 30, 15, 15);

    int thickness = 4;

    for (int i = 0; i <= thickness; i++)
        g.draw3DRect(200 - i, 10 - i, 80 + 2 * i, 30 + 2 * i, true);
    for (int i = 0; i < thickness; i++)
        g.draw3DRect(200 - i, 50 - i, 80 + 2 * i, 30 + 2 * i, false);

    g.drawOval(10, 100, 80, 30);
}

From source file:GradientsVertical.java

public void paint(Graphics g) {
    super.paint(g);
    Graphics2D g2d = (Graphics2D) g;

    GradientPaint gp1 = new GradientPaint(25, 25, Color.blue, 15, 25, Color.black, true);

    g2d.setPaint(gp1);/*from   w ww  .ja v  a 2 s.co m*/
    g2d.fillRect(20, 200, 300, 40);

}