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:com.js.quickestquail.ui.stats.GenreStat.java
private JFreeChart generateChart() { JFreeChart chart = ChartFactory.createPieChart( java.util.ResourceBundle.getBundle("i18n/i18n").getString("stat.genre.title"), // chart title generateDataset(), // data true, // include legend true, false);// w w w . j av a 2s .c o m chart.setBackgroundPaint(new Color(0xFF, 0xFF, 0xFF, 0)); chart.getPlot().setBackgroundPaint(Color.WHITE); return chart; }
From source file:jmbench.plots.OperationsVersusSizePlot.java
public OperationsVersusSizePlot(String title, String ylabel) { chart = ChartFactory.createXYLineChart(title, "Matrix Size", ylabel, null, PlotOrientation.VERTICAL, true, false, false);/* w w w. j av a 2 s. c o m*/ // chart.removeLegend(); plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); // final NumberAxis rangeAxis = new LogarithmicAxis(ylabel); // plot.setRangeAxis(rangeAxis); // one of the numbers is getting cropped. this will make it fully visible chart.setPadding(new RectangleInsets(5, 0, 0, 5)); }
From source file:UserInterface.DoctorAdmin.TakeRequestJPanel.java
/** * Creates new form NurseWorkAreaJPanel//from ww w .ja va2s . c o m */ public TakeRequestJPanel(JPanel userProcessContainer, UserAccount account, Organization organization, Enterprise enterprise, QuickAssist system) { initComponents(); this.setBackground(Color.white); this.userProcessContainer = userProcessContainer; this.account = account; // this.organization = organization; this.enterprise = enterprise; this.organization = organization; this.system = system; populateDoctorCombo(); populateTable(); }
From source file:WeatherFrame.java
public WeatherFrame() { initComponents();/*from w ww . j a va2 s .com*/ fc = new JFileChooser(); fc.setMultiSelectionEnabled(true); //only can select a single button a time ButtonGroup group = new ButtonGroup(); group.add(AllRadioButton); group.add(YearlyRadioButton); group.add(MonthlyRadioButton); group.add(WeeklyRadioButton); group.add(DailyRadioButton); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Temperature", "Humidity", "Barometric Pressure", "Windspeed", "UVindex", "Raindfall" })); TempSet = new TimeSeriesCollection(); JFreeChart chart = ChartFactory.createXYLineChart("Temperature", "", "Degree Fahrenheit", TempSet, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(Color.white); ChartPanel.setLayout(new java.awt.BorderLayout()); ChartPanel CP = new ChartPanel(chart); CP.setPreferredSize(new Dimension(ChartPanel.getWidth(), ChartPanel.getHeight())); ChartPanel.add(CP, BorderLayout.CENTER); DefaultValueDataset dataset = new DefaultValueDataset(20f); ThermometerPlot thermometerplot = new ThermometerPlot(dataset); JFreeChart jfreechart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, thermometerplot, true); jfreechart.setBackgroundPaint(new Color(240, 240, 240)); thermometerplot.setThermometerPaint(Color.lightGray); thermometerplot.setThermometerStroke(new BasicStroke(2.0F)); ChartPanel DP = new ChartPanel(jfreechart); DP.setPreferredSize(new Dimension(TempThermoPanel.getWidth(), TempThermoPanel.getHeight())); TempThermoPanel.setLayout(new java.awt.BorderLayout()); TempThermoPanel.add(DP); TempThermoPanel.validate(); }
From source file:Gui.Graficos.java
private void init(String titulo, String tituloX, String tituloY) { panel = new JPanel(); panel.setBackground(Color.WHITE); getContentPane().add(panel);//from w ww. ja va2s . co m // Creando el Grafico JFreeChart chart = ChartFactory.createBarChart3D(titulo, tituloX, tituloY, dataset, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(new Color(225, 255, 228)); chart.getTitle().setPaint(Color.black); CategoryPlot p = chart.getCategoryPlot(); p.setRangeGridlinePaint(Color.red); // Mostrar Grafico ChartPanel chartPanel = new ChartPanel(chart); panel.add(chartPanel); // panel.setLayout(new VerticalLayout()); panel.add(btAceptar); //panel. panel.setLayout(null); chartPanel.setBounds(100, 10, 1100, 600); btAceptar.setBounds(1065, 620, 130, 30); }
From source file:edworld.pdfreader4humans.PDFReaderTest.java
@Test public void createPageImageWithoutStructure() throws IOException { File outputFile = new File("target/outputWithoutStructure.png"); ImageIO.write(reader.createPageImage(1, 3, Color.BLACK, Color.WHITE, false), "png", outputFile); assertImagesAreSimilar(getClass().getResourceAsStream("/testcase1/outputWithoutStructure.png"), ImageIO.read(outputFile)); }
From source file:peakmlviewer.dialog.PCADialog.java
public PCADialog(MainWnd mainwnd, Shell parent, String title) { super(parent, SWT.NONE); // save the parent pointer this.title = title; this.parent = parent; this.mainwnd = mainwnd; // create the window and set its properties shell = new Shell(parent, SWT.EMBEDDED | SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); shell.setSize(500, 300);/*from www . j av a 2s .co m*/ shell.setText(title); // create the jfreechart plot = new XYPlot(collection, new NumberAxis("principal component 1"), new NumberAxis("principal component 2"), new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES)); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinesVisible(true); plot.getRenderer().setBaseItemLabelsVisible(true); plot.getRenderer().setBaseItemLabelGenerator(new XYItemLabelGenerator() { public String generateLabel(XYDataset dataset, int series, int item) { return labels[item]; } }); chart = new JFreeChart("Principle Component Analysis", plot); chart.removeLegend(); chart.setBackgroundPaint(Color.WHITE); chart.getRenderingHints().put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // add the components // -------------------------------------------------------------------------------- // This uses the SWT-trick for embedding awt-controls in an SWT-Composit. try { System.setProperty("sun.awt.noerasebackground", "true"); } catch (NoSuchMethodError error) { ; } java.awt.Frame frame = org.eclipse.swt.awt.SWT_AWT.new_Frame(shell); // create a new ChartPanel, without the popup-menu (5x false) frame.add(new ChartPanel(chart, false, false, false, false, false)); // -------------------------------------------------------------------------------- }
From source file:org.spf4j.perf.impl.chart.Charts.java
public static JFreeChart createHeatJFreeChart(final String[] dsNames, final double[][] values, final long startTimeMillis, final long stepMillis, final String uom, final String chartName) { final QuantizedXYZDatasetImpl dataSet = new QuantizedXYZDatasetImpl(dsNames, values, startTimeMillis, stepMillis);/* w w w . j a v a2 s . c o m*/ NumberAxis xAxis = new NumberAxis("Time"); xAxis.setStandardTickUnits(dataSet.createXTickUnits()); xAxis.setLowerMargin(0); xAxis.setUpperMargin(0); xAxis.setVerticalTickLabels(true); NumberAxis yAxis = new NumberAxis(uom); yAxis.setStandardTickUnits(dataSet.createYTickUnits()); yAxis.setLowerMargin(0); yAxis.setUpperMargin(0); XYBlockRenderer renderer = new XYBlockRenderer(); PaintScale scale; if (dataSet.getMinValue() >= dataSet.getMaxValue()) { if (dataSet.getMinValue() == Double.POSITIVE_INFINITY) { scale = new InverseGrayScale(0, 1); } else { scale = new InverseGrayScale(dataSet.getMinValue(), dataSet.getMaxValue() + 1); } } else { scale = new InverseGrayScale(dataSet.getMinValue(), dataSet.getMaxValue()); } renderer.setPaintScale(scale); renderer.setBlockWidth(1); renderer.setBlockHeight(1); XYPlot plot = new XYPlot(dataSet, xAxis, yAxis, renderer); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinesVisible(false); plot.setRangeGridlinesVisible(false); plot.setRangeMinorGridlinesVisible(false); JFreeChart chart = new JFreeChart(chartName, plot); PaintScaleLegend legend = new PaintScaleLegend(scale, new NumberAxis("Count")); legend.setMargin(0, 5, 0, 5); chart.addSubtitle(legend); chart.removeLegend(); chart.setBackgroundPaint(Color.white); return chart; }
From source file:com.wattzap.view.graphs.MMPGraph.java
public MMPGraph(XYSeries series) { super();/*from w w w .j a va2 s .c o m*/ NumberAxis yAxis = new NumberAxis(userPrefs.messages.getString("poWtt")); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); double maxY = series.getMaxY(); yAxis.setRange(0, maxY + 20); yAxis.setTickLabelPaint(Color.white); yAxis.setLabelPaint(Color.white); LogAxis xAxis = new LogAxis(userPrefs.messages.getString("time")); xAxis.setTickLabelPaint(Color.white); xAxis.setBase(4); xAxis.setAutoRange(false); xAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); xAxis.setRange(1, series.getMaxX() + 500); xAxis.setNumberFormatOverride(new NumberFormat() { @Override public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) { long millis = (long) number * 1000; if (millis >= 60000) { return new StringBuffer(String.format("%d m %d s", TimeUnit.MILLISECONDS.toMinutes((long) millis), TimeUnit.MILLISECONDS.toSeconds((long) millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes((long) millis)))); } else { return new StringBuffer(String.format("%d s", TimeUnit.MILLISECONDS.toSeconds((long) millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes((long) millis)))); } } @Override public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) { return new StringBuffer(String.format("%s", number)); } @Override public Number parse(String source, ParsePosition parsePosition) { return null; } }); XYPlot plot = new XYPlot(new XYSeriesCollection(series), xAxis, yAxis, new XYLineAndShapeRenderer(true, false)); JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, false); chart.setBackgroundPaint(Color.gray); plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.darkGray); /*plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray);*/ ValueAxis domainAxis = plot.getDomainAxis(); domainAxis.setTickLabelPaint(Color.white); domainAxis.setLabelPaint(Color.white); chartPanel = new ChartPanel(chart); chartPanel.setSize(100, 800); chartPanel.setFillZoomRectangle(true); chartPanel.setMouseWheelEnabled(true); chartPanel.setBackground(Color.gray); setLayout(new BorderLayout()); add(chartPanel, BorderLayout.CENTER); setBackground(Color.black); chartPanel.revalidate(); setVisible(true); }
From source file:io.narayana.perf.product.BarChart.java
public JFreeChart generateChart(String title, String xaxisLabel, String yaxisLabel) { JFreeChart chart = ChartFactory.createBarChart(title, xaxisLabel, yaxisLabel, dataset, PlotOrientation.VERTICAL, true, false, false); CategoryPlot plot = chart.getCategoryPlot(); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); chart.setBackgroundPaint(Color.white); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinesVisible(true); plot.setDomainGridlinePaint(Color.black); plot.setRangeGridlinePaint(Color.black); rangeAxis.setStandardTickUnits(NumberAxis.createStandardTickUnits()); BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer(); for (int i = 0; i < dataset.getRowCount(); i++) { Color color = i < COLORS.length ? COLORS[i] : COLORS[0]; renderer.setSeriesPaint(i, color); }/*from w w w. j a v a2 s.c o m*/ return chart; }