Example usage for java.awt Color WHITE

List of usage examples for java.awt Color WHITE

Introduction

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

Prototype

Color WHITE

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

Click Source Link

Document

The color white.

Usage

From source file:compecon.dashboard.panel.AbstractChartsPanel.java

protected void configureChart(JFreeChart chart) {
    chart.setBackgroundPaint(Color.white);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

    DateAxis dateAxis = (DateAxis) plot.getDomainAxis();
    NumberAxis valueAxis = (NumberAxis) plot.getRangeAxis();

    dateAxis.setDateFormatOverride(new SimpleDateFormat("dd-MMM"));
    valueAxis.setAutoRangeIncludesZero(true);
    valueAxis.setUpperMargin(0.15);/*from ww  w  .  j a v  a  2s . c om*/
    valueAxis.setLowerMargin(0.15);
}

From source file:com.kurvlrgui.gui.ChartPanel.java

/**
 * Creates new form ChartPanel//w ww  . j a  v a2  s.  c  o m
 */
public ChartPanel(String title, NumericData s1, NumericData s2) {
    initComponents();

    calculated = new XYSeries("Calculated");
    for (NumericPair np : s1.values) {
        calculated.add(np.x, np.y);
    }

    observed = null;
    if (s2 != null) {
        observed = new XYSeries("Observed");
        for (NumericPair np : s2.values) {
            observed.add(np.x, np.y);
        }
    }

    XYSeriesCollection dataset = new XYSeriesCollection();
    dataset.addSeries(calculated);
    if (s2 != null)
        dataset.addSeries(observed);

    JFreeChart chart = ChartFactory.createXYLineChart(title, "X", "Y", dataset, PlotOrientation.VERTICAL, true,
            true, false);
    chart.setBackgroundPaint(Color.white);

    XYPlot plot = chart.getXYPlot();

    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesLinesVisible(0, false);
    renderer.setSeriesLinesVisible(1, false);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    panel = new org.jfree.chart.ChartPanel(chart);

    panel.setHorizontalAxisTrace(true);
    panel.setVerticalAxisTrace(true);

    this.add(panel);
}

From source file:service.chart.FitnessChart.java

/**
 * Utworz wykres funkcji fitness dla najlepszego osobnika w danej iteracji algorytmu genetycznego 
 * na podstawie zestawu danych/*from   www . j  a v  a  2s .  com*/
 * 
 * @param categoryDataset Zestaw danych
 * @return Wykres funkcji fitness
 */
private static JFreeChart createChart(CategoryDataset categoryDataset) {

    JFreeChart chart = ChartFactory.createLineChart("Best fitness function value", // title
            "Iteration", // x-axis label
            "Fitness", // y-axis label
            categoryDataset, // data
            PlotOrientation.VERTICAL, true, // create legend?
            true, // generate tooltips?
            false // generate URLs?
    );

    chart.setBackgroundPaint(Color.white);

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    CategoryItemRenderer r = plot.getRenderer();
    if (r instanceof LineAndShapeRenderer) {
        LineAndShapeRenderer renderer = (LineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(false);
        renderer.setBaseShapesFilled(true);
    }

    return chart;
}

From source file:finalproject.GraphData.java

/**
 * Creates a chart with the data that is graphed vs time
 * @param data//  ww w  . j  ava2  s .  c  om
 * @param names
 * @return 
 */
public JFreeChart graphVsTime(String[][] data, String[] names) {
    TimeSeries mySeries = new TimeSeries("Data");

    for (int i = 0; i < data.length; i++) {
        if (data[i][0] != null && data[i][1] != null)
            mySeries.add(new Hour(convertTime(data[i][0]), day), Integer.parseInt(data[i][1]));
    }

    TimeSeriesCollection collection = new TimeSeriesCollection(mySeries);

    XYDataset dataset = collection;

    JFreeChart chart = ChartFactory.createTimeSeriesChart("Blood Glucose vs Time", names[0], names[1], dataset,
            true, true, false);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.BLACK);
    plot.setRangeGridlinePaint(Color.BLACK);

    return chart;
}

From source file:it.alus.GPSreceiver.instruments.SatelliteRadar.java

public SatelliteRadar() {
    super(null);/*w  ww  .j a v a  2  s.  co  m*/
    azimuth = new int[MAX_SAT];
    elevation = new int[MAX_SAT];
    snr = new int[MAX_SAT];
    resetArray();
    satSeries = new XYSeries("Satellites");
    XYSeriesCollection seriescollection = new XYSeriesCollection();
    seriescollection.addSeries(satSeries);
    jChart = ChartFactory.createPolarChart("Satellites", seriescollection, true, false, false);
    jChart.setBackgroundPaint(Color.white);
    PolarPlot polarplot = (PolarPlot) jChart.getPlot();
    polarplot.setBackgroundPaint(Color.lightGray);
    polarplot.setAngleGridlinePaint(Color.white);
    polarplot.setRadiusGridlinePaint(Color.white);
    NumberAxis numberaxis = (NumberAxis) polarplot.getAxis();
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    super.setChart(jChart);
    super.setMouseZoomable(false);
    super.setPreferredSize(new Dimension(500, 270));
}

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

private static JFreeChart createChart(MultiValueCategoryDataset multivaluecategorydataset) {
    CategoryPlot categoryplot = new CategoryPlot(multivaluecategorydataset, new CategoryAxis("Category"),
            new NumberAxis("Value"), new ScatterRenderer());
    categoryplot.setBackgroundPaint(Color.lightGray);
    categoryplot.setDomainGridlinePaint(Color.white);
    categoryplot.setRangeGridlinePaint(Color.white);
    categoryplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));
    JFreeChart jfreechart = new JFreeChart("ScatterRendererDemo1", categoryplot);
    ChartUtilities.applyCurrentTheme(jfreechart);
    return jfreechart;
}

From source file:userinterface.patientRole.LineChart.java

public LineChart(String applicationTitle, String chartTitle, XYSeries bR, XYSeries pR, XYSeries bS, XYSeries bP,
        JFrame parent) {//  w  w  w.j  a v  a2 s  .c o  m
    // super(applicationTitle);
    this.bR = bR;
    this.pR = pR;
    this.bS = bS;
    this.bP = bP;
    this.parent = parent;
    dataset = createDataset();
    JFreeChart xylineChart = ChartFactory.createXYLineChart(chartTitle, "Category", "Vital Signs",
            createDataset(), PlotOrientation.VERTICAL, true, true, false);
    ChartPanel chartPanel = new ChartPanel(xylineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    final XYPlot plot = xylineChart.getXYPlot();
    plot.setBackgroundPaint(Color.white);
    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);
    setContentPane(chartPanel);
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
        }
    });
}

From source file:edworld.pdfreader4humans.PDFReaderTest.java

@Test
public void createPageImageWithStructure() throws IOException {
    File outputFile = new File("target/outputWithStructure.png");
    ImageIO.write(reader.createPageImage(1, 3, Color.WHITE, Color.BLACK, true), "png", outputFile);
    assertImagesAreSimilar(getClass().getResourceAsStream("/testcase1/outputWithStructure.png"),
            ImageIO.read(outputFile));
}

From source file:net.sf.mzmine.modules.peaklistmethods.peakpicking.adap3decompositionV1_5.SimpleScatterPlot.java

public SimpleScatterPlot(double[] xValues, double[] yValues, double[] colors, String xLabel, String yLabel) {
    super(null, true);

    setBackground(Color.white);
    setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));

    xAxis = new NumberAxis(xLabel);
    xAxis.setAutoRangeIncludesZero(false);
    xAxis.setUpperMargin(0);/*w  w w .  j av a2s . co m*/
    xAxis.setLowerMargin(0);

    yAxis = new NumberAxis(yLabel);
    yAxis.setAutoRangeIncludesZero(false);
    yAxis.setUpperMargin(0);
    yAxis.setLowerMargin(0);

    xyDataset = new DefaultXYZDataset();
    int length = Math.min(xValues.length, yValues.length);
    double[][] data = new double[3][length];
    System.arraycopy(xValues, 0, data[0], 0, length);
    System.arraycopy(yValues, 0, data[1], 0, length);
    System.arraycopy(colors, 0, data[2], 0, length);
    xyDataset.addSeries(SERIES_ID, data);

    XYDotRenderer renderer = new XYDotRenderer() {
        @Override
        public Paint getItemPaint(int row, int col) {
            double c = xyDataset.getZ(row, col).doubleValue();
            return Color.getHSBColor((float) c, 1.0f, 1.0f);
        }
    };

    renderer.setDotHeight(3);
    renderer.setDotWidth(3);

    plot = new XYPlot(xyDataset, xAxis, yAxis, renderer);
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinesVisible(true);

    chart = new JFreeChart("", new Font("SansSerif", Font.BOLD, 12), plot, false);
    chart.setBackgroundPaint(Color.white);

    super.setChart(chart);
}

From source file:netplot.XYPlotPanel.java

private JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createXYLineChart(plotTitle, xAxisName, yAxisName, dataset,
            PlotOrientation.VERTICAL, enableLegend, true, true);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.DARK_GRAY);
    plot.setRangeGridlinePaint(Color.DARK_GRAY);
    return chart;
}