List of usage examples for java.awt Color WHITE
Color WHITE
To view the source code for java.awt Color WHITE.
Click Source Link
From source file:evaluation.simulator.gui.results.LineJFreeChartCreator.java
/** * Creates a chart./*from w w w .j a v a 2 s. c om*/ * * @param dataset * the data for the chart. * * @return a chart. */ private static JFreeChart createChart(final XYDataset dataset) { final JFreeChart chart = ChartFactory.createXYLineChart("Latency Mix Message", // chart title "BATCH_SIZE", // x axis label "ms", // y axis label dataset, // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); // Spezial berschreiben des Aussehen der Striche im Graphen final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer() { private static final long serialVersionUID = 1L; Stroke soild = new BasicStroke(2.0f); @Override public Stroke getItemStroke(int row, int column) { return this.soild; } }; final XYPlot plot = chart.getXYPlot(); plot.setRenderer(renderer); return chart; }
From source file:org.jfree.chart.demo.SubCategoryAxisDemo1.java
private static JFreeChart createChart(CategoryDataset dataset) { JFreeChart chart = ChartFactory.createBarChart("SubCategoryAxis Demo 1", "Category", "Value", dataset, PlotOrientation.VERTICAL, false, true, false); chart.setBackgroundPaint(Color.white); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.lightGray); SubCategoryAxis subCategoryAxis = new SubCategoryAxis(null); subCategoryAxis.addSubCategory("S1"); subCategoryAxis.addSubCategory("S2"); subCategoryAxis.addSubCategory("S3"); plot.setDomainAxis(subCategoryAxis); plot.setDomainGridlinePaint(Color.white); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinePaint(Color.white); NumberAxis valueAxis = (NumberAxis) plot.getRangeAxis(); valueAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false);/*from w ww .jav a2s . c o m*/ GradientPaint gradientpaint0 = 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)); renderer.setSeriesPaint(0, gradientpaint0); renderer.setSeriesPaint(1, gradientpaint1); renderer.setSeriesPaint(2, gradientpaint2); return chart; }
From source file:edu.wustl.cab2b.client.ui.visualization.charts.ScatterPlot.java
protected JFreeChart createChart(Dataset dataset) { XYDataset xyDataset = (XYDataset) dataset; JFreeChart jfreechart = ChartFactory.createScatterPlot("Scatter Plot", "X", "Y", xyDataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setBackgroundPaint(Color.white); XYDotRenderer xydotrenderer = new XYDotRenderer(); xydotrenderer.setDotWidth(4);/*from w w w . j a v a 2 s. c o m*/ xydotrenderer.setDotHeight(4); xyplot.setRenderer(xydotrenderer); xyplot.setDomainCrosshairVisible(true); xyplot.setRangeCrosshairVisible(true); NumberAxis numberaxis = (NumberAxis) xyplot.getDomainAxis(); numberaxis.setAutoRangeIncludesZero(false); return jfreechart; }
From source file:networkanalyzer.DynamicPing.java
public DynamicPing() { this.series = new TimeSeries("Ping", Second.class); final TimeSeriesCollection dataset = new TimeSeriesCollection(this.series); chart = createChart(dataset);//from w w w . ja v a2 s. co m //background color chart chart.setBackgroundPaint(Color.WHITE); chartPanel = new ChartPanel(chart); chartPanel.setSize(504, 346); }
From source file:ec.display.StatisticsChartPane.java
private void createCharts(Statistics statistics) { if (statistics instanceof ChartableStatistics) { ChartableStatistics chartStats = (ChartableStatistics) statistics; JFreeChart chart = chartStats.makeChart(); chart.setBackgroundPaint(Color.white); ChartPanel chartPanel = new ChartPanel(chart); StatisticsChartPaneTab chartPaneTab = new StatisticsChartPaneTab(chartPanel); this.addTab("Chart " + (numCharts++), chartPaneTab); }/*from w w w. j a v a 2s . co m*/ if (statistics.children != null) { for (int i = 0; i < statistics.children.length; ++i) createCharts(statistics.children[i]); } }
From source file:org.jfree.chart.demo.LineChartDemo8.java
private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createLineChart("Line Chart Demo 8", "Category", "Count", categorydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); SymbolAxis symbolaxis = new SymbolAxis("Group", new String[] { "A", "B", "C", "D", "E", "F" }); categoryplot.setRangeAxis(symbolaxis); LineAndShapeRenderer lineandshaperenderer = (LineAndShapeRenderer) categoryplot.getRenderer(); lineandshaperenderer.setSeriesShapesVisible(0, true); lineandshaperenderer.setSeriesShapesVisible(1, false); lineandshaperenderer.setSeriesShapesVisible(2, true); lineandshaperenderer.setSeriesLinesVisible(2, false); lineandshaperenderer.setSeriesShape(2, ShapeUtilities.createDiamond(4F)); lineandshaperenderer.setDrawOutlines(true); lineandshaperenderer.setUseFillPaint(true); lineandshaperenderer.setBaseFillPaint(Color.white); return jfreechart; }
From source file:edu.wustl.cab2b.client.ui.visualization.charts.LineChart.java
protected JFreeChart createChart(Dataset dataset) { XYDataset xyDataset = (XYDataset) dataset; JFreeChart jfreechart = ChartFactory.createXYLineChart("Line Chart", "X", "Y", xyDataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setBackgroundPaint(Color.white); xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer(); xylineandshaperenderer.setShapesVisible(true); xylineandshaperenderer.setShapesFilled(true); NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); return jfreechart; }
From source file:org.jfree.chart.demo.LineChartDemo7.java
private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createLineChart("Line Chart Demo 7", "Category", "Count", categorydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); LineAndShapeRenderer lineandshaperenderer = (LineAndShapeRenderer) categoryplot.getRenderer(); lineandshaperenderer.setSeriesShapesVisible(0, true); lineandshaperenderer.setSeriesShapesVisible(1, false); lineandshaperenderer.setSeriesShapesVisible(2, true); lineandshaperenderer.setSeriesLinesVisible(2, false); lineandshaperenderer.setSeriesShape(2, ShapeUtilities.createDiamond(4F)); lineandshaperenderer.setDrawOutlines(true); lineandshaperenderer.setUseFillPaint(true); lineandshaperenderer.setBaseFillPaint(Color.white); return jfreechart; }
From source file:TexturedPanel.java
/** * Creates a new TexturedPanel with a simple striped pattern consisting of the * given foreground and background colors. *///ww w . j a va2 s .com public TexturedPanel(Color foreground, Color background) { super(); ourDefaultForeground = (foreground != null ? foreground : Color.white); ourDefaultBackground = (background != null ? background : getBackground()); setupDefaultPainter(ourDefaultForeground, ourDefaultBackground); }
From source file:UI.MainViewPanel.java
public ChartPanel getPanel1(Metric1 m1) { int totalRiskCount = m1.totalCriticalCount + m1.totalHighCount + m1.totalLowCount + m1.totalMediumCount; String[][] risks = new String[totalRiskCount][3]; PieChart pieChart = new PieChart(m1.totalCriticalCount, m1.totalHighCount, m1.totalMediumCount, m1.totalLowCount, "", risks, true); ChartPanel thisChart = pieChart.drawPieChart(); thisChart.setBackground(Color.white); JFreeChart chart = thisChart.getChart(); chart.setBackgroundPaint(new Color(0, 0, 0, 0)); Plot plot = chart.getPlot();/* w ww. j a va 2 s . c o m*/ plot.setBackgroundPaint(chartBackgroundColor); return thisChart; }