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:umontreal.iro.lecuyer.charts.DiscreteDistIntChart.java

private void init() {
    int m = b - a + 1;
    double[][] cdf = new double[2][m];
    double[][] probability = new double[2][m];

    for (int i = 0; i < m; i++) {
        cdf[0][i] = i + a;/*from   w  w w  .j  a  v a 2  s .  c  om*/
        cdf[1][i] = dist.cdf(i + a);
        probability[0][i] = i + a;
        probability[1][i] = dist.prob(i + a);
    }

    double[][] cdfFinal = new double[2][2 * (m - 1)];
    for (int i = 0; i < m - 1; i++) {
        cdfFinal[0][2 * i] = cdf[0][i];
        cdfFinal[0][2 * i + 1] = cdf[0][i + 1];
        cdfFinal[1][2 * i] = cdf[1][i];
        cdfFinal[1][2 * i + 1] = cdf[1][i];
    }

    cdfChart = new XYLineChart("cdf: " + dist.toString(), "", "", cdfFinal);
    probChart = new XYLineChart("probability: " + dist.toString(), "", "", probability);
    cdfChart.setprobFlag(true);
    probChart.setprobFlag(true);

    // Only for tikZ
    XYListSeriesCollection collec = cdfChart.getSeriesCollection();
    collec.setColor(0, Color.BLUE);
    collec.setPlotStyle(0, "thick");
    collec.setMarksType(0, "only marks");

    collec = probChart.getSeriesCollection();
    collec.setColor(0, Color.ORANGE);
    collec.setPlotStyle(0, "ycomb");
    collec.setMarksType(0, "*");
    collec.setDashPattern(0, "solid");
}

From source file:wsattacker.plugin.intelligentdos.ui.helper.ChartHelper.java

public static JFreeChart createWhiskerChart(SuccessfulAttack sa) {
    BoxAndWhiskerCategoryDataset boxandwhiskercategorydataset = createDataset(sa);
    final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setMaximumBarWidth(0.05);//from  www  .j a v  a2  s .c o m
    renderer.setMeanVisible(false);
    renderer.setSeriesPaint(0, Color.GREEN);
    renderer.setSeriesPaint(1, Color.RED);
    renderer.setSeriesPaint(2, Color.BLUE);

    NumberAxis numberAxis = new NumberAxis("duration in ms");
    CategoryPlot categoryplot = new CategoryPlot(boxandwhiskercategorydataset, new CategoryAxis(""), numberAxis,
            renderer);
    categoryplot.setDomainGridlinesVisible(true);
    categoryplot.setRangePannable(true);
    NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    JFreeChart jFreeChart = new JFreeChart("", new Font("SansSerif", Font.BOLD, 14), categoryplot, true);
    jFreeChart.removeLegend();
    return jFreeChart;
}

From source file:org.mili.jmibs.jfree.JFreeChartBarIterationObjectLoadIntervalBenchmarkSuiteResultRenderer.java

private JFreeChart createChart(String title, CategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart(title, "Benchmark (Iteration/Object Loading/Interval)",
            "Time in ns", dataset, PlotOrientation.HORIZONTAL, true, true, false);
    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);//w  w  w . j  a  va  2  s . co  m
    GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, new Color(0, 0, 64));
    GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
    GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, new Color(64, 0, 0));
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    return chart;
}

From source file:com.att.aro.ui.view.diagnostictab.plot.SpeedThrottlePlot.java

/**
 * @param plot/*from ww w  .ja  va  2  s. c  om*/
 * @param seriesDL
 * @param seriesUP
 */
private void setDataPlot(XYPlot plot, XYSeries seriesDL, XYSeries seriesUP) {
    serCollection.addSeries(seriesDL);
    serCollection.addSeries(seriesUP);

    XYStepRenderer renderer = new XYStepRenderer();

    LogAxis rangeAxis = new LogAxis(); // new API 
    rangeAxis.setAutoRange(true);
    rangeAxis.setVisible(false);
    plot.setRangeAxis(rangeAxis);
    plot.setRangePannable(true);
    plot.setRangeCrosshairVisible(true);

    renderer = (XYStepRenderer) plot.getRenderer();
    renderer.setBaseShapesVisible(true);
    renderer.setSeriesStroke(0, new BasicStroke(1.0f));
    renderer.setSeriesStroke(1, new BasicStroke(2.5f));
    renderer.setSeriesPaint(0, Color.blue);
    renderer.setSeriesPaint(1, Color.red);
    renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
    renderer.setDefaultEntityRadius(6);

    renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
        @Override
        public String generateToolTip(XYDataset dataset, int series, int item) {
            StringBuffer displayInfo = new StringBuffer();
            java.lang.Number tempx = dataset.getX(series, item);
            java.lang.Number tempy = dataset.getY(series, item);
            // series 0 -> downstream , stries 1 -> upstream
            String streamInfo = "";
            if (series == 0) {
                streamInfo = ResourceBundleHelper.getMessageString("dlog.collector.option.attenuator.downlink");
            } else {
                streamInfo = ResourceBundleHelper.getMessageString("dlog.collector.option.attenuator.uplink");
            }
            return displayInfo.append("Time: " + tempx + " , " + streamInfo + " : " + tempy + " kbps")
                    .toString();
        }
    });
    plot.setRenderer(renderer);
    plot.setDataset(serCollection);

}

From source file:grafix.graficos.eixos.Eixo.java

protected void incluirMarcaIntraday(final XYPlot plot, final JanelaGraficos janela) {
    if (Controle.getConfiguracoesVolateis().isIntraday()) {
        MarcaGrafica m = new MarcaGrafica("", "INTRADAY",
                janela.getAcao().getRegistro(janela.getAcao().getNumeroRegistros() - 1).getData(), Color.BLUE);
        if (m.isRangeMarker()) {
            if (getNomeEixo().equals(m.getNomeEixo())) {
                plot.addRangeMarker(gerarRangeMarker(m));
            }//from   w  ww.j a va 2  s.  com
        } else {
            plot.addDomainMarker(gerarIntervalMarker(m, janela));
        }
    }
}

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

/**
 * Creates a sample chart./*ww w  .  j a v  a  2  s  .  co  m*/
 *
 * @param dataset  a dataset.
 *
 * @return The chart.
 */
private static JFreeChart createChart(CategoryDataset dataset) {

    // create the chart...
    JFreeChart chart = ChartFactory.createLineChart("Statistical Bar Chart Demo 1", // chart title
            "Type", // domain axis label
            "Value", // range axis label
            dataset);

    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    // customise the range axis...
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setAutoRangeIncludesZero(false);

    // customise the renderer...
    StatisticalBarRenderer renderer = new StatisticalBarRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setErrorIndicatorPaint(Color.black);
    renderer.setIncludeBaseInRange(false);
    plot.setRenderer(renderer);

    // ensure the current theme is applied to the renderer just added
    ChartUtilities.applyCurrentTheme(chart);

    renderer.setDefaultItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    renderer.setDefaultItemLabelsVisible(true);
    renderer.setDefaultItemLabelPaint(Color.yellow);
    renderer.setDefaultPositiveItemLabelPosition(
            new ItemLabelPosition(ItemLabelAnchor.INSIDE6, TextAnchor.BOTTOM_CENTER));

    // set up gradient paints for series...
    GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, new Color(0, 0, 64));
    GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    return chart;
}

From source file:cn.InstFS.wkr.NetworkMining.UIs.TimeSeriesChart2.java

public static JFreeChart createChart(DataItems nor, DataItems abnor, String title, String protocol1,
        String protocol2) {/* www . j a  v a 2 s . c om*/
    // ?
    XYDataset xydataset1 = TimeSeriesChart1.createNormalDataset(nor, protocol1);
    JFreeChart jfreechart = ChartFactory.createScatterPlot(title, "", "", xydataset1);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();

    XYLineAndShapeRenderer xylineandshaperenderer1 = (XYLineAndShapeRenderer) xyplot.getRenderer();
    // ??1?1

    NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);
    java.awt.geom.Ellipse2D.Double double1 = new java.awt.geom.Ellipse2D.Double(-4D, -4D, 6D, 6D);
    // ???

    // ??
    xylineandshaperenderer1.setSeriesLinesVisible(0, true);
    xylineandshaperenderer1.setBaseShapesVisible(false);
    xylineandshaperenderer1.setSeriesShape(0, double1);
    xylineandshaperenderer1.setSeriesPaint(0, Color.blue);
    xylineandshaperenderer1.setSeriesFillPaint(0, Color.blue);
    xylineandshaperenderer1.setSeriesOutlinePaint(0, Color.blue);
    xylineandshaperenderer1.setSeriesStroke(0, new BasicStroke(0.5F));

    // ?
    XYDataset xydataset2 = TimeSeriesChart1.createNormalDataset(abnor, protocol2);
    /*      XYTextAnnotation localXYTextAnnotation = new XYTextAnnotation("aa",10,
    Double.parseDouble(abnor.getElementAt(10).getData()));
          xyplot.addAnnotation(localXYTextAnnotation);*/
    XYLineAndShapeRenderer xylineandshaperenderer2 = new XYLineAndShapeRenderer();
    int datasetcount = xyplot.getDatasetCount();
    xyplot.setDataset(datasetcount, xydataset2);
    xyplot.setRenderer(datasetcount, xylineandshaperenderer2);
    /*      System.out.println("DatasetCount="+xyplot.getDatasetCount());
                  
          for(int c=0;c<xyplot.getDatasetCount();c++){
             System.out.println("DatasetSeriesCount="+xyplot.getDataset(c).getSeriesCount());
             System.out.println("Dataset["+c+"]="+xyplot.getDataset(c).getSeriesKey(0));
          }*/

    /*   // ??? 
       xylineandshaperenderer2.setBaseShapesVisible(false);
       // ??
       xylineandshaperenderer2.setSeriesLinesVisible(0, true);
       xylineandshaperenderer2.setSeriesShape(0, double1);
       // 
       xylineandshaperenderer2.setSeriesPaint(0, Color.green);
       xylineandshaperenderer2.setSeriesFillPaint(0, Color.green);
       xylineandshaperenderer2.setSeriesOutlinePaint(0, Color.green);
            
       xylineandshaperenderer2.setUseFillPaint(true);
       xylineandshaperenderer2
    .setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
       xylineandshaperenderer2.setSeriesStroke(0, new BasicStroke(0.5F));
               
    */
    xylineandshaperenderer2.setSeriesLinesVisible(0, true);
    xylineandshaperenderer2.setBaseShapesVisible(false);
    xylineandshaperenderer2.setSeriesShape(0, double1);
    xylineandshaperenderer2.setSeriesPaint(0, Color.GREEN);
    xylineandshaperenderer2.setSeriesFillPaint(0, Color.GREEN);
    xylineandshaperenderer2.setSeriesOutlinePaint(0, Color.green);
    xylineandshaperenderer2.setSeriesStroke(0, new BasicStroke(0.5F));
    jfreechart.getLegend().setVisible(true);
    return jfreechart;

}

From source file:es.unex.meigas.extFillData.FittingDataPanel.java

public FittingDataPanel(final LeastSquaresFit lsf, final Tree[] trees, final XYVariables xy) {

    super(Meigas.getMainFrame(), "Ajuste de datos", true);

    m_Lsf = lsf;//from   ww w. ja  va 2s.  c o  m
    m_Trees = trees;
    m_XY = xy;

    createChart();

    initialize();

    final Plot plot = this.jPanelChart.getChart().getPlot();
    plot.setOutlineStroke(new BasicStroke(1));
    plot.setOutlinePaint(Color.blue);

}

From source file:br.upe.ecomp.dosa.controller.chart.FileBoxplotChartManager.java

private JFreeChart createChart(String title, String xLabel, String yLabel, BoxAndWhiskerCategoryDataset dataset,
        boolean logarithmicYAxis) {

    final CategoryAxis xAxis = new CategoryAxis("Sample");
    final NumberAxis yAxis;
    if (logarithmicYAxis) {
        yAxis = new LogarithmicAxis("Fitness (Log10)");
        ((LogarithmicAxis) yAxis).setExpTickLabelsFlag(true);
    } else {//from  w ww.  ja v  a2 s.c  o  m
        yAxis = new NumberAxis("Fitness");
    }
    yAxis.setAutoRangeIncludesZero(false);
    yAxis.setAutoRange(true);
    final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setFillBox(true);
    renderer.setBaseCreateEntities(true);
    // renderer.setArtifactPaint(Color.green);
    renderer.setBaseOutlinePaint(Color.blue);
    renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
    final JFreeChart chart = ChartFactory.createBoxAndWhiskerChart(title, xAxis.getLabel(), yAxis.getLabel(),
            dataset, true);
    final CategoryPlot plot = chart.getCategoryPlot();// new CategoryPlot(dataset, xAxis, yAxis,
                                                      // renderer);
    plot.setBackgroundPaint(Color.white);
    // chart.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setRenderer(renderer);
    plot.setRangeAxis(yAxis);
    yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    return chart;
}

From source file:JToggleButtonMenuItem.java

public void menuSelectionChanged(boolean isIncluded) {
    ButtonModel model = getModel();
    // Only change armed state if different
    if (model.isArmed() != isIncluded) {
        model.setArmed(isIncluded);//ww  w . j a  v  a2s .c o  m
    }

    if (isIncluded) {
        savedForeground = getForeground();
        if (!savedForeground.equals(Color.BLUE)) {
            setForeground(Color.BLUE);
        } else {
            // In case foreground blue, use something different
            setForeground(Color.RED);
        }
    } else {
        setForeground(savedForeground);
        // If null, get foreground from installed look and feel
        if (savedForeground == null) {
            updateUI();
        }
    }
}