Example usage for java.awt Color RED

List of usage examples for java.awt Color RED

Introduction

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

Prototype

Color RED

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

Click Source Link

Document

The color red.

Usage

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

private static Paint[] createPaint() {
    Paint apaint[] = new Paint[5];
    apaint[0] = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, Color.white);
    apaint[1] = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, Color.white);
    apaint[2] = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, Color.white);
    apaint[3] = new GradientPaint(0.0F, 0.0F, Color.orange, 0.0F, 0.0F, Color.white);
    apaint[4] = new GradientPaint(0.0F, 0.0F, Color.magenta, 0.0F, 0.0F, Color.white);
    return apaint;
}

From source file:edu.jhuapl.graphs.jfreechart.BarEffectsTest.java

public static JFreeChartGraphSource getSource() throws GraphException {
    Map<String, Object> emptyMap = Collections.emptyMap();

    List<PointInterface> ps1 = new LinkedList<PointInterface>();
    ps1.add(new DataPoint(3, "Red", emptyMap));
    ps1.add(new DataPoint(5, "Green", emptyMap));
    ps1.add(new DataPoint(7, "Blue", emptyMap));

    Map<String, Object> s1Meta = new HashMap<String, Object>();
    s1Meta.put(GraphSource.SERIES_COLOR, Color.green);
    DataSeries s1 = new DataSeries(ps1, s1Meta);

    List<PointInterface> ps2 = new LinkedList<PointInterface>();

    Map<String, Object> redMap = new HashMap<String, Object>(1);
    redMap.put(GraphSource.ITEM_COLOR, Color.red);
    ps2.add(new DataPoint(5, "Red", redMap));

    Map<String, Object> greenMap = new HashMap<String, Object>(1);
    greenMap.put(GraphSource.ITEM_COLOR, Color.green);
    ps2.add(new DataPoint(2, "Green", greenMap));

    Map<String, Object> blueMap = new HashMap<String, Object>(1);
    blueMap.put(GraphSource.ITEM_COLOR, Color.blue);
    ps2.add(new DataPoint(14, "Blue", redMap));

    Map<String, Object> s2Meta = new HashMap<String, Object>();
    s2Meta.put(GraphSource.SERIES_COLOR, Color.orange);
    DataSeries s2 = new DataSeries(ps2, s2Meta);

    Map<String, Object> graphParams = new HashMap<String, Object>();
    graphParams.put(GraphSource.GRAPH_TYPE, GraphSource.GRAPH_TYPE_BAR);
    graphParams.put(JFreeChartBarGraphSource.PLOT_ORIENTATION, PlotOrientation.HORIZONTAL);
    graphParams.put(GraphSource.GRAPH_LEGEND, true);

    JFreeChartGraphSource source = new JFreeChartGraphSource();
    source.setData(Arrays.asList(s1, s2));
    source.setParams(graphParams);/*ww w .j  a v  a2 s.c  o m*/
    source.initialize();

    return source;
}

From source file:Main.java

public void repaint(BufferedImage orig, BufferedImage copy) {
    Graphics2D g = copy.createGraphics();
    g.drawImage(orig, 0, 0, null);// w w w .  j  a va 2s .c  o m
    g.setColor(Color.RED);
    if (captureRect == null) {
        return;
    }
    g.draw(captureRect);
    g.setColor(new Color(25, 25, 23, 10));
    g.fill(captureRect);
    g.dispose();
}

From source file:com.rapidminer.gui.plotter.charts.ColorizedBarRenderer.java

@Override
public Paint getItemPaint(int series, int item) {
    if (colorValues == null || colorValues.length <= item || minColor == maxColor) {
        return Color.RED;
    } else {/*from  w  w  w  .  j av  a 2 s.  co m*/
        double normalized = (colorValues[item] - minColor) / (maxColor - minColor);
        return colorProvider.getPointColor(normalized);
    }
}

From source file:GUI.GraficaView.java

private void init() {
    ArrayList<OperacionesDiarias> aux = operario.getArrayOperacionesDiarias();
    Collections.sort(aux);//from   w  w  w  . jav a  2  s  .c  o  m

    panel = new JPanel();
    getContentPane().add(panel);
    // Fuente de Datos
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    for (OperacionesDiarias op : aux) {
        if (op.getListaOperaciones().size() > 0) {
            dataset.setValue(op.getPorcentaje(), operario.getNombre(), op.getFecha());
        }

    }

    // Creando el Grafico
    JFreeChart chart = ChartFactory.createBarChart3D("Rendimiento", "Dia", "Porcentaje %", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.LIGHT_GRAY);
    chart.getTitle().setPaint(Color.black);
    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.red);

    // Mostrar Grafico
    ChartPanel chartPanel = new ChartPanel(chart);
    panel.add(chartPanel);
    repaint();
}

From source file:userInterface.StateAdminRole.DecisionChart4JPanel.java

private static JFreeChart createChart1(CategoryDataset categorydataset) {
    JFreeChart jfreechart = ChartFactory.createBarChart("Total Vaccinations", "Hospital", "Value",
            categorydataset, PlotOrientation.VERTICAL, true, true, false);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    categoryplot.setDomainGridlinesVisible(true);
    categoryplot.setRangeCrosshairVisible(true);
    categoryplot.setRangeCrosshairPaint(Color.blue);
    NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer();
    barrenderer.setDrawBarOutline(false);
    GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64));
    GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0));
    GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0));
    barrenderer.setSeriesPaint(0, gradientpaint);
    barrenderer.setSeriesPaint(1, gradientpaint1);
    barrenderer.setSeriesPaint(2, gradientpaint2);
    barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}"));
    CategoryAxis categoryaxis = categoryplot.getDomainAxis();
    categoryaxis.setCategoryLabelPositions(
            CategoryLabelPositions.createUpRotationLabelPositions(0.52359877559829882D));
    return jfreechart;
}

From source file:PopUpColorMenu.java

public void actionPerformed(ActionEvent e) {
    String color = e.getActionCommand();
    if (color.equals("Red"))
        selectedComponent.setBackground(Color.red);
    else if (color.equals("Green"))
        selectedComponent.setBackground(Color.green);
    else if (color.equals("Blue"))
        selectedComponent.setBackground(Color.blue);
}

From source file:graphml.vertexPainter.java

public Paint transform(node v) //So for each node that we draw...
{
    //We check the member variable, mColor, of the node.
    if (v.getColor().equalsIgnoreCase("yellow")) //If the node's mColor value is "yellow" we...
        return (Color.yellow); // Return our color, Color.yellow.
    else if (v.getColor().equalsIgnoreCase("red"))
        return (Color.red);
    else if (v.getColor().equalsIgnoreCase("blue"))
        return (Color.blue);
    else if (v.getColor().equalsIgnoreCase("green"))
        return (Color.green);
    else/*from   ww w  .j ava 2 s .com*/
        return (Color.MAGENTA);
}

From source file:eu.ggnet.dwoss.util.HtmlDialog.java

private void search() {
    try {//from www . j  a  v  a2 s  . c o m
        Highlighter.HighlightPainter painter = new DefaultHighlighter.DefaultHighlightPainter(Color.RED);

        documentTextPane.getHighlighter().removeAllHighlights();
        StyledDocument styledDocument = documentTextPane.getStyledDocument();
        String text = styledDocument.getText(0, styledDocument.getLength());

        if (StringUtils.isBlank(text) || StringUtils.isBlank(searchField.getText()))
            return;
        int indexOf = text.indexOf(searchField.getText());

        if (indexOf == -1)
            JOptionPane.showMessageDialog(this, "Nichts gefunden.");
        while (indexOf != -1) {
            try {
                documentTextPane.getHighlighter().addHighlight(indexOf,
                        indexOf + searchField.getText().length(), painter);
                indexOf = text.indexOf(searchField.getText(), indexOf + 1);
            } catch (BadLocationException ex) {
                Logger.getLogger(HtmlDialog.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    } catch (BadLocationException ex) {
        Logger.getLogger(HtmlDialog.class.getName()).log(Level.SEVERE, null, ex);
    }
}

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

private static JFreeChart createChart(XYZDataset xyzdataset) {
    NumberAxis numberaxis = new NumberAxis("X");
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    numberaxis.setLowerMargin(0.0D);//from  w  ww  .j  a v a  2s . c  o m
    numberaxis.setUpperMargin(0.0D);
    numberaxis.setAxisLinePaint(Color.white);
    numberaxis.setTickMarkPaint(Color.white);
    NumberAxis numberaxis1 = new NumberAxis("Y");
    numberaxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    numberaxis1.setLowerMargin(0.0D);
    numberaxis1.setUpperMargin(0.0D);
    numberaxis1.setAxisLinePaint(Color.white);
    numberaxis1.setTickMarkPaint(Color.white);
    XYBlockRenderer xyblockrenderer = new XYBlockRenderer();
    GrayPaintScale graypaintscale = new GrayPaintScale(-2D, 1.0D);
    xyblockrenderer.setPaintScale(graypaintscale);
    XYPlot xyplot = new XYPlot(xyzdataset, numberaxis, numberaxis1, xyblockrenderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinesVisible(false);
    xyplot.setRangeGridlinePaint(Color.white);
    xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D));
    xyplot.setOutlinePaint(Color.blue);
    JFreeChart jfreechart = new JFreeChart("XYBlockChartDemo1", xyplot);
    jfreechart.removeLegend();
    NumberAxis numberaxis2 = new NumberAxis("Scale");
    numberaxis2.setAxisLinePaint(Color.white);
    numberaxis2.setTickMarkPaint(Color.white);
    numberaxis2.setTickLabelFont(new Font("Dialog", 0, 7));
    PaintScaleLegend paintscalelegend = new PaintScaleLegend(new GrayPaintScale(), numberaxis2);
    paintscalelegend.setAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    paintscalelegend.setAxisOffset(5D);
    paintscalelegend.setMargin(new RectangleInsets(5D, 5D, 5D, 5D));
    paintscalelegend.setFrame(new BlockBorder(Color.red));
    paintscalelegend.setPadding(new RectangleInsets(10D, 10D, 10D, 10D));
    paintscalelegend.setStripWidth(10D);
    paintscalelegend.setPosition(RectangleEdge.RIGHT);
    paintscalelegend.setBackgroundPaint(new Color(120, 120, 180));
    jfreechart.addSubtitle(paintscalelegend);
    jfreechart.setBackgroundPaint(new Color(180, 180, 250));
    return jfreechart;
}