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:grafix.graficos.indices.IndiceADX.java

@Override
public void plotar(final XYPlot plot, final JanelaGraficos janela, final int contador) {
    XYLineAndShapeRenderer r = new XYLineAndShapeRenderer();
    r.setSeriesLinesVisible(0, true);/*w w  w  .  j av a 2s  .  c  o  m*/
    r.setSeriesShapesVisible(0, false);
    r.setSeriesPaint(0, Color.BLUE);
    r.setSeriesStroke(0, new BasicStroke(.75f));

    r.setSeriesPaint(1, Color.RED);
    r.setSeriesStroke(1, new BasicStroke(.6f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 3.0f, 4.0f }, 0.0f));
    r.setSeriesLinesVisible(1, true);
    r.setSeriesShapesVisible(1, false);

    r.setSeriesPaint(2, new Color(0f, .6f, 0f));
    r.setSeriesStroke(2, new BasicStroke(.6f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 2.0f,
            new float[] { 3.0f, 4.0f }, 0.0f));
    r.setSeriesLinesVisible(2, true);
    r.setSeriesShapesVisible(2, false);

    r.setToolTipGenerator(new IndiceToolTipGenerator(this));
    plot.setRenderer(contador, r);
    plot.setDataset(contador, getDataSet(janela));
}

From source file:gui.MainForm.java

private static JFreeChart create_AMS_DATA_Chart(CategoryDataset categorydataset) {
    JFreeChart jfreechart = ChartFactory.createBarChart("AMS??", "", "??", 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:org.jfree.chart.demo.CompareToPreviousYearDemo.java

private static JFreeChart createChart() {
    XYDataset xydataset = createDataset2006();
    XYDataset xydataset1 = createDataset2007();
    DateAxis dateaxis = new DateAxis("Date");
    Month month = new Month(1, 2007);
    Month month1 = new Month(12, 2007);
    dateaxis.setRange(month.getFirstMillisecond(), month1.getLastMillisecond());
    dateaxis.setDateFormatOverride(new SimpleDateFormat("MMM"));
    dateaxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
    XYLineAndShapeRenderer xylineandshaperenderer = new XYLineAndShapeRenderer();
    xylineandshaperenderer.setUseFillPaint(true);
    xylineandshaperenderer.setBaseFillPaint(Color.white);
    xylineandshaperenderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator("{1}: {2}",
            new SimpleDateFormat("MMM-yyyy"), new DecimalFormat("0.00")));
    XYPlot xyplot = new XYPlot(xydataset1, dateaxis, new NumberAxis("Sales"), xylineandshaperenderer);
    xyplot.setDomainPannable(true);//from   w ww.  jav  a2 s . c o m
    xyplot.setRangePannable(true);
    DateAxis dateaxis1 = new DateAxis();
    dateaxis1.setVisible(false);
    xyplot.setDomainAxis(1, dateaxis1);
    xyplot.setDataset(1, xydataset);
    xyplot.mapDatasetToDomainAxis(1, 1);
    XYLineAndShapeRenderer xylineandshaperenderer1 = new XYLineAndShapeRenderer();
    xylineandshaperenderer1.setSeriesPaint(0, Color.blue);
    xylineandshaperenderer1.setUseFillPaint(true);
    xylineandshaperenderer1.setBaseFillPaint(Color.white);
    xylineandshaperenderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator("{1}: {2}",
            new SimpleDateFormat("MMM-yyyy"), new DecimalFormat("0.00")));
    xyplot.setRenderer(1, xylineandshaperenderer1);
    JFreeChart jfreechart = new JFreeChart("Sales Comparison Chart", xyplot);
    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);
    DateAxis dateaxis2 = (DateAxis) xyplot.getDomainAxis();
    dateaxis2.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));
    ChartUtilities.applyCurrentTheme(jfreechart);
    return jfreechart;
}

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

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

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

    Map<String, Object> params = new HashMap<String, Object>(1);
    params.put(GraphSource.ITEM_COLOR, Color.red);
    ps1.add(new DataPoint(3, "Red", params));

    params = new HashMap<String, Object>(1);
    params.put(GraphSource.ITEM_COLOR, Color.green);
    ps1.add(new DataPoint(5, "Green", params));

    params = new HashMap<String, Object>(1);
    params.put(GraphSource.ITEM_COLOR, Color.blue);
    ps1.add(new DataPoint(7, "Blue", params));

    DataSeries s1 = new DataSeries(ps1, emptyMap);

    Map<String, Object> graphParams = new HashMap<String, Object>();
    graphParams.put(GraphSource.GRAPH_TYPE, GraphSource.GRAPH_TYPE_PIE);
    graphParams.put(GraphSource.GRAPH_LEGEND, true);

    JFreeChartGraphSource source = new JFreeChartGraphSource();
    source.setData(Arrays.asList(s1));
    source.setParams(graphParams);/*from  w  ww  . java  2 s.c  o  m*/
    source.initialize();

    return source;
}

From source file:cl.almejo.vsim.gui.ColorScheme.java

public ColorScheme(String name) {
    _name = name;// w w  w. jav  a2  s .  c om
    _colors.put("background", Color.GRAY);
    _colors.put("bus-on", Color.RED);
    _colors.put("gates", Color.BLUE);
    _colors.put("ground", Color.GREEN);
    _colors.put("off", Color.BLACK);
    _colors.put("wires-on", Color.RED);
    _colors.put("signal", Color.RED);
    _colors.put("grid", Color.GRAY);
    _colors.put("label", Color.YELLOW);
}

From source file:chart.XYChart.java

public XYChart(String applicationTitle, String chartTitle, double[] xData, double[] YDataAnalitic,
        double[] YDataNumerical1, double[] YDataNumerical2) {

    super(applicationTitle);

    JFreeChart xylineChart = ChartFactory.createXYLineChart(chartTitle, "", "",
            createDatasetForThree(xData, YDataAnalitic, YDataNumerical1, YDataNumerical2),
            PlotOrientation.VERTICAL, true, true, false);
    ChartPanel chartPanel = new ChartPanel(xylineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    final XYPlot plot = xylineChart.getXYPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesPaint(0, Color.RED);
    renderer.setSeriesPaint(1, Color.GREEN);
    renderer.setSeriesPaint(2, Color.YELLOW);
    renderer.setSeriesPaint(3, Color.BLUE);
    renderer.setSeriesStroke(0, new BasicStroke(1.0f));
    renderer.setSeriesStroke(1, new BasicStroke(1.0f));
    renderer.setSeriesStroke(2, new BasicStroke(1.0f));
    renderer.setSeriesStroke(3, new BasicStroke(1.0f));
    plot.setRenderer(renderer);//from   w ww .  jav  a 2  s . c  om
    setContentPane(chartPanel);

    // panel.removeAll();
    //  panel.add(chartPanel);
    //  panel.validate();

}

From source file:sim.app.sugarscape.Charts.java

JFreeChart createTradeChart() {
    JFreeChart chart = ChartFactory.createXYLineChart("Trading and Population over Time", "Time", "Level",
            model.agents_series_coll, PlotOrientation.VERTICAL, true, true, false);
    model.trade_chart = chart;//from w w w  .  j a va2 s  . c om
    NumberAxis rangeAxis1 = new NumberAxis("Time");
    rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    org.jfree.chart.axis.NumberAxis domainAxis = new NumberAxis("Bins");
    XYPlot plot = chart.getXYPlot();
    ValueAxis xAxis = plot.getDomainAxis();
    XYItemRenderer renderer = plot.getRenderer();
    renderer.setSeriesPaint(0, Color.BLUE);
    plot.setDataset(1, model.trade_coll);
    XYItemRenderer rend2 = new StandardXYItemRenderer();
    //if (rend2 != null)
    rend2.setSeriesPaint(1, Color.BLACK);
    plot.setRenderer(1, rend2);
    return chart;
}

From source file:Business.Chart.ChartHeartRate.java

public ChartHeartRate(final String applicationTitle, String chartTitle, HospitalWorkRequest workRequest) {
    super(applicationTitle);
    series = new TimeSeries("Heart Rate");
    this.workRequest = workRequest;
    this.chartTitle = chartTitle;

    final XYDataset dataset = createDatasetHeartRate(workRequest);
    final JFreeChart chart = createChart(dataset);
    //final XYDataset dataset1 =  createDatasetBloodPressure(workRequest );
    //final JFreeChart chart1 = createChart1( dataset1 );
    final XYPlot plot = chart.getXYPlot();
    HospitalWorkRequest hos1 = (HospitalWorkRequest) workRequest;
    int age = hos1.getPerson().getAge();
    int a = hos1.getPerson().getAboveHeartRateMarker(age);
    int b = hos1.getPerson().getBelowHeartRateMarker(age);
    ValueMarker valueMarker = new ValueMarker(a);
    valueMarker.setLabel("ALERT");
    valueMarker.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    valueMarker.setPaint(Color.blue);
    ValueMarker valueMarker1 = new ValueMarker(b);
    valueMarker1.setLabel("ALERT");
    valueMarker1.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    valueMarker1.setPaint(Color.BLUE);
    plot.addRangeMarker(valueMarker);/* www. j a  va  2s  .c  o  m*/
    plot.addRangeMarker(valueMarker1);
    //ChartFrame frame = new ChartFrame("series chart", chart);
    //      frame.setVisible(true);
    //     frame.setSize(450, 350);
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 370));
    chartPanel.setMouseZoomable(true, false);
    setContentPane(chartPanel);
    getContentPane().repaint();
}

From source file:dataminning2.KmeanGraphplot.java

protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    int w = getWidth();
    int h = getHeight();
    // Draw ordinate.
    g2.draw(new Line2D.Double(PAD, PAD, PAD, h - PAD));
    // Draw abcissa.
    g2.draw(new Line2D.Double(PAD, h - PAD, w - PAD, h - PAD));
    double xInc = (double) (w - 2 * PAD) / (data.length - 1);
    double scale = (double) (h - 2 * PAD) / 88;
    // Mark data points.

    g2.setPaint(Color.red);//from  ww  w  .j a  va2 s. c om

    for (int i = 0; i < cluster0.length; i++) {
        double x = PAD + i * dataX[i];
        double y = h - PAD - scale * dataY[i];
        g2.fill(new Ellipse2D.Double(x - 2, y - 2, 4, 4));
    }

    g2.setPaint(Color.BLUE);

    for (int i = 0; i < cluster1.length; i++) {
        double x = PAD + i * dataX[i];
        double y = h - PAD - scale * dataY[i];
        g2.fill(new Ellipse2D.Double(x - 2, y - 2, 4, 4));
    }
    g2.setPaint(Color.YELLOW);

    for (int i = 0; i < cluster2.length; i++) {
        double x = PAD + i * dataX[i];
        double y = h - PAD - scale * dataY[i];
        g2.fill(new Ellipse2D.Double(x - 2, y - 2, 4, 4));
    }
}

From source file:Business.Chart.ChartBloodPressure.java

public ChartBloodPressure(final String applicationTitle, String chartTitle, HospitalWorkRequest workRequest) {
    super(applicationTitle);
    series6 = new TimeSeries("Blood Pressure");
    this.workRequest = workRequest;
    this.chartTitle = chartTitle;

    final XYDataset dataset6 = createDatasetBloodPressure(workRequest);
    final JFreeChart chart6 = createChart(dataset6);
    //final XYDataset dataset1 =  createDatasetBloodPressure(workRequest );
    //final JFreeChart chart1 = createChart1( dataset1 );
    final XYPlot plot = chart6.getXYPlot();
    HospitalWorkRequest hos1 = (HospitalWorkRequest) workRequest;
    int age = hos1.getPerson().getAge();
    int a = hos1.getPerson().getAboveBPMarker(age);
    int b = hos1.getPerson().getBelowBPMarker(age);
    ValueMarker valueMarker = new ValueMarker(a);
    valueMarker.setLabel("ALERT");
    valueMarker.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    valueMarker.setPaint(Color.blue);
    ValueMarker valueMarker1 = new ValueMarker(b);
    valueMarker1.setLabel("ALERT");
    valueMarker1.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    valueMarker1.setPaint(Color.BLUE);
    plot.addRangeMarker(valueMarker);//from  w w w  .  ja  v  a  2 s.c  o  m
    plot.addRangeMarker(valueMarker1);
    //ChartFrame frame = new ChartFrame("series chart", chart);
    //      frame.setVisible(true);
    //     frame.setSize(450, 350);
    final ChartPanel chartPanel6 = new ChartPanel(chart6);
    chartPanel6.setPreferredSize(new java.awt.Dimension(560, 370));
    chartPanel6.setMouseZoomable(true, false);
    setContentPane(chartPanel6);
    getContentPane().repaint();
}