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:org.evosuite.jenkins.plot.Plot.java
@Override protected JFreeChart createGraph() { final JFreeChart chart = ChartFactory.createLineChart(null, "Build Number #", this.yLabel, this.dataset, PlotOrientation.VERTICAL, true, true, true); chart.setBackgroundPaint(Color.WHITE); CategoryPlot plot = (CategoryPlot) chart.getPlot(); CategoryAxis domainAxis = new CategoryAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); domainAxis.setLowerMargin(0.0);// ww w. j a v a 2 s. c o m domainAxis.setUpperMargin(0.0); domainAxis.setCategoryMargin(0.0); plot.setDomainAxis(domainAxis); plot.setBackgroundPaint(Color.WHITE); ValueAxis yAxis = plot.getRangeAxis(); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); //yAxis.setRange(0.0, 100.0); URLAndTooltipRenderer urlRenderer = new URLAndTooltipRenderer(this.project.getProject()); ColorPalette.apply(urlRenderer); plot.setRenderer(urlRenderer); return chart; }
From source file:it.alus.GPSreceiver.instruments.Turnometer.java
public Turnometer() { super(null);//w w w.ja va 2 s. c om dataset = new DefaultValueDataset(0.0); DialPlot plot = new DialPlot(); plot.setView(0.0, 0.0, 1.0, 1.0); plot.setDataset(0, dataset); StandardDialFrame dialFrame = new StandardDialFrame(); dialFrame.setBackgroundPaint(Color.lightGray); dialFrame.setForegroundPaint(Color.gray); //DialTextAnnotation titleLabel = new DialTextAnnotation("Vertical speed"); //titleLabel.setFont(new Font("Arial",1,18)); //titleLabel.setRadius(0.45D); //titleLabel.setAngle(90); //titleLabel.setPaint(Color.lightGray); //plot.addLayer(titleLabel); DialTextAnnotation L = new DialTextAnnotation("L"); L.setFont(new Font("Arial", Font.BOLD, 30)); L.setRadius(0.4); L.setPaint(Color.white); L.setAngle(200); plot.addLayer(L); DialTextAnnotation R = new DialTextAnnotation("R"); R.setFont(new Font("Arial", Font.BOLD, 30)); R.setRadius(0.4); R.setPaint(Color.white); R.setAngle(-20); plot.addLayer(R); DialValueIndicator valueindicator = new DialValueIndicator(0); plot.addLayer(valueindicator); DialTextAnnotation annotation = new DialTextAnnotation("deg/min"); annotation.setFont(new Font("Arial", 1, 14)); annotation.setRadius(0.4D); annotation.setPaint(Color.lightGray); plot.addLayer(annotation); plot.setDialFrame(dialFrame); StandardDialScale scale = new StandardDialScale(-540, 540, -135, -270, 90, 9); scale.setMajorTickPaint(Color.white); scale.setMinorTickPaint(Color.lightGray); scale.setFirstTickLabelVisible(true); scale.setTickRadius(0.88); scale.setTickLabelOffset(0.15); NumberFormat formatter = new DecimalFormat("#"); scale.setTickLabelFormatter(formatter); scale.setTickLabelFont(new Font("Arial", Font.BOLD, 24)); scale.setTickLabelPaint(Color.white); plot.addScale(0, scale); plot.setBackground(new DialBackground(Color.black)); Pointer needle = new Pointer(0); needle.setFillPaint(Color.white); plot.addLayer(needle); plot.mapDatasetToScale(1, 1); DialCap cap = new DialCap(); cap.setRadius(0.10); cap.setFillPaint(Color.gray); plot.setCap(cap); jChart = new JFreeChart(plot); super.setChart(jChart); super.setPreferredSize(new Dimension(400, 400)); }
From source file:org.jfree.chart.demo.YIntervalChartDemo2.java
private static JFreeChart createChart(IntervalXYDataset intervalxydataset) { JFreeChart jfreechart = ChartFactory.createXYLineChart("YIntervalChartDemo2", "Date", "Value", intervalxydataset, PlotOrientation.VERTICAL, true, true, false); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setDomainPannable(true);//from w ww .j a va 2 s.co m xyplot.setRangePannable(true); xyplot.setDomainAxis(new DateAxis("Date")); NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); numberaxis.setAutoRangeIncludesZero(false); XYErrorRenderer xyerrorrenderer = new XYErrorRenderer(); xyerrorrenderer.setBaseLinesVisible(true); xyerrorrenderer.setUseFillPaint(true); xyerrorrenderer.setBaseFillPaint(Color.white); xyplot.setRenderer(xyerrorrenderer); ChartUtilities.applyCurrentTheme(jfreechart); return jfreechart; }
From source file:ImageTransferTest.java
public ImageTransferFrame() { setTitle("ImageTransferTest"); setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); label = new JLabel(); image = new BufferedImage(DEFAULT_WIDTH, DEFAULT_HEIGHT, BufferedImage.TYPE_INT_ARGB); Graphics g = image.getGraphics(); g.setColor(Color.WHITE); g.fillRect(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT); g.setColor(Color.RED);/* ww w . j a v a 2 s . com*/ g.fillOval(DEFAULT_WIDTH / 4, DEFAULT_WIDTH / 4, DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2); label.setIcon(new ImageIcon(image)); add(new JScrollPane(label), BorderLayout.CENTER); JPanel panel = new JPanel(); JButton copyButton = new JButton("Copy"); panel.add(copyButton); copyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { copy(); } }); JButton pasteButton = new JButton("Paste"); panel.add(pasteButton); pasteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { paste(); } }); add(panel, BorderLayout.SOUTH); }
From source file:com.rapidminer.gui.plotter.charts.BarChart2DPlotter.java
public JFreeChart createChart(CategoryDataset categoryDataSet, String groupByName, String valueName, boolean createLegend) { JFreeChart chart = ChartFactory.createBarChart(null, // chart title groupByName, // domain axis label valueName, // range axis label categoryDataSet, // data PlotOrientation.VERTICAL, // orientation ((createLegend) && (groupByName != null)), // include legend if group by column is set true, // tooltips false // URLs );//from w w w. ja v a 2 s. c om // get a reference to the plot for further customisation... CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(new Color(230, 230, 230)); plot.setDomainGridlinePaint(Color.white); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinePaint(Color.white); // set up paints for series if (groupByName == null) { BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, SwingTools.LIGHT_BLUE); renderer.setSeriesPaint(1, SwingTools.LIGHT_YELLOW); } // domain axis labels CategoryAxis domainAxis = plot.getDomainAxis(); if (groupByName == null) { domainAxis.setTickLabelsVisible(true); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); } else { domainAxis.setTickLabelsVisible(false); } return chart; }
From source file:com.rapidminer.gui.plotter.charts.BarChart3DPlotter.java
public JFreeChart createChart(CategoryDataset categoryDataSet, String groupByName, String valueName, boolean createLegend) { JFreeChart chart = ChartFactory.createBarChart3D(null, // chart title groupByName, // domain axis label valueName, // range axis label categoryDataSet, // data PlotOrientation.VERTICAL, // orientation ((createLegend) && (groupByName != null)), // include legend if group by column is set true, // tooltips false // URLs );//from w ww . j ava2 s .c o m // get a reference to the plot for further customisation... CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(new Color(230, 230, 230)); plot.setDomainGridlinePaint(Color.white); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinePaint(Color.white); // set up paints for series if (groupByName == null) { BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, SwingTools.LIGHT_BLUE); renderer.setSeriesPaint(1, SwingTools.LIGHT_YELLOW); } // domain axis labels CategoryAxis domainAxis = plot.getDomainAxis(); if (groupByName == null) { domainAxis.setTickLabelsVisible(true); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); } else { domainAxis.setTickLabelsVisible(false); } return chart; }
From source file:net.sf.mzmine.modules.peaklistmethods.dataanalysis.projectionplots.ProjectionPlotPanel.java
public ProjectionPlotPanel(ProjectionPlotWindow masterFrame, ProjectionPlotDataset dataset, ParameterSet parameters) {//from w w w .j a v a 2 s . co m super(null); boolean createLegend = false; if ((dataset.getNumberOfGroups() > 1) && (dataset.getNumberOfGroups() < 20)) createLegend = true; chart = ChartFactory.createXYAreaChart("", dataset.getXLabel(), dataset.getYLabel(), dataset, PlotOrientation.VERTICAL, createLegend, false, false); chart.setBackgroundPaint(Color.white); setChart(chart); // title TextTitle chartTitle = chart.getTitle(); chartTitle.setMargin(5, 0, 0, 0); chartTitle.setFont(titleFont); chart.removeSubtitle(chartTitle); // disable maximum size (we don't want scaling) setMaximumDrawWidth(Integer.MAX_VALUE); setMaximumDrawHeight(Integer.MAX_VALUE); // set the plot properties plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); // set grid properties plot.setDomainGridlinePaint(gridColor); plot.setRangeGridlinePaint(gridColor); // set crosshair (selection) properties plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(false); plot.setForegroundAlpha(dataPointAlpha); NumberFormat numberFormat = NumberFormat.getNumberInstance(); // set the X axis (component 1) properties NumberAxis xAxis = (NumberAxis) plot.getDomainAxis(); xAxis.setNumberFormatOverride(numberFormat); // set the Y axis (component 2) properties NumberAxis yAxis = (NumberAxis) plot.getRangeAxis(); yAxis.setNumberFormatOverride(numberFormat); plot.setDataset(dataset); spotRenderer = new ProjectionPlotRenderer(plot, dataset); itemLabelGenerator = new ProjectionPlotItemLabelGenerator(parameters); spotRenderer.setBaseItemLabelGenerator(itemLabelGenerator); spotRenderer.setBaseItemLabelsVisible(true); spotRenderer.setBaseToolTipGenerator(new ProjectionPlotToolTipGenerator(parameters)); plot.setRenderer(spotRenderer); // Setup legend if (createLegend) { LegendItemCollection legendItemsCollection = new LegendItemCollection(); for (int groupNumber = 0; groupNumber < dataset.getNumberOfGroups(); groupNumber++) { Object paramValue = dataset.getGroupParameterValue(groupNumber); if (paramValue == null) { // No parameter value available: search for raw data files // within this group, and use their names as group's name String fileNames = new String(); for (int itemNumber = 0; itemNumber < dataset.getItemCount(0); itemNumber++) { String rawDataFile = dataset.getRawDataFile(itemNumber); if (dataset.getGroupNumber(itemNumber) == groupNumber) fileNames = fileNames.concat(rawDataFile); } if (fileNames.length() == 0) fileNames = "Empty group"; paramValue = fileNames; } Color nextColor = (Color) spotRenderer.getGroupPaint(groupNumber); Color groupColor = new Color(nextColor.getRed(), nextColor.getGreen(), nextColor.getBlue(), (int) Math.round(255 * dataPointAlpha)); legendItemsCollection.add(new LegendItem(paramValue.toString(), "-", null, null, spotRenderer.getDataPointsShape(), groupColor)); } plot.setFixedLegendItems(legendItemsCollection); } }
From source file:com.foudroyantfactotum.mod.fousarchive.midi.generation.MidiImageGeneration.java
public ImmutablePair<String, BufferedImage> buildImage() throws InterruptedException, ExecutionException { final Future<String> name = pool.submit(new LineProcessor(imgX)); final BufferedImage mdbf = new BufferedImage(imgX, imgY, BufferedImage.TYPE_BYTE_GRAY); final Graphics g = mdbf.getGraphics(); g.setColor(Color.BLACK);//from ww w .j a va 2s . c o m g.fillRect(0, 0, imgX, imgY); g.setColor(Color.WHITE); for (Line l = lines.take(); l != TERMINATE; l = lines.take()) { g.drawLine(l.note, (int) Math.round(l.tickStart * imgY), l.note, (int) Math.round(l.tickEnd * imgY)); } pool.shutdown(); g.dispose(); return ImmutablePair.of(name.get(), mdbf); }
From source file:bzstats.chart.KillRatioHistoryChart.java
protected JFreeChart getChart() { DefaultTableXYDataset dataset = new DefaultTableXYDataset(); fillDataset(dataset);/*from w w w . j a va 2 s . co m*/ XYPlot plot = new XYPlot(); NumberAxis xaxis = new NumberAxis("Time"); xaxis.setTickLabelsVisible(false); NumberAxis yaxis = new NumberAxis("Killratio"); plot.setDomainAxis(xaxis); plot.setRangeAxis(yaxis); plot.setDataset(dataset); plot.setRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); JFreeChart chart = new JFreeChart("Killratio", JFreeChart.DEFAULT_TITLE_FONT, plot, true); chart.addSubtitle(new TextTitle("kills/deaths")); chart.setBackgroundPaint(Color.white); return chart; }
From source file:sernet.gs.ui.rcp.main.bsi.views.chart.UmsetzungBarChart.java
protected JFreeChart createBarChart(Object dataset) { final float plotForegroundAlpha = 0.6f; JFreeChart chart = ChartFactory.createStackedBarChart3D(null, Messages.UmsetzungBarChart_1, Messages.UmsetzungBarChart_2, (CategoryDataset) dataset, PlotOrientation.HORIZONTAL, false, true, false);/* w w w . j a v a2s. c o m*/ chart.setBackgroundPaint(Color.white); chart.getPlot().setForegroundAlpha(plotForegroundAlpha); chart.setBackgroundPaint(Color.white); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.STANDARD); return chart; }