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:edu.emory.library.tast.database.graphs.GraphPie.java
public JFreeChart createChart(Object[] data) { DefaultPieDataset pieDataset = new DefaultPieDataset(); JFreeChart chart = ChartFactory.createPieChart(null, pieDataset, false, true, false); chart.setBackgroundPaint(Color.white); List dataSeries = getDataSeries(); if (dataSeries.size() == 0) return null; Format formatter = getSelectedIndependentVariable().getFormat(); for (int i = 0; i < data.length; i++) { Object[] row = (Object[]) data[i]; String cat = formatter == null ? row[0].toString() : formatter.format(row[0]); pieDataset.setValue(cat, (Number) row[1]); }/*from www .ja v a 2s . c o m*/ return chart; }
From source file:org.encog.workbench.tabs.visualize.scatter.LegendPanel.java
public LegendPanel(LegendItemSource source) { this.legend = new LegendTitle(source); legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0)); legend.setFrame(new LineBorder()); legend.setBackgroundPaint(Color.white); legend.setPosition(RectangleEdge.BOTTOM); setPreferredSize(new Dimension(1024, 35)); }
From source file:peakml.util.swt.widget.DerivativeGraph.java
public DerivativeGraph(Composite parent, int style) { super(parent, SWT.EMBEDDED | style); // layout//from www.java2 s.c o m setLayout(new FillLayout()); // create the components spectrumplot = new FastSpectrumPlot("mass", "intensity"); spectrumplot.setBackgroundPaint(Color.WHITE); linechart = new JFreeChart("", spectrumplot); linechart.setBackgroundPaint(Color.WHITE); // org.jfree.experimental.chart.swt.ChartComposite c = // new org.jfree.experimental.chart.swt.ChartComposite(this, SWT.NONE, linechart); // // c.setRangeZoomable(true); // c.setDomainZoomable(true); // add the components // -------------------------------------------------------------------------------- // This uses the SWT-trick for embedding AWT-controls in an SWT-Composite. // 2009-10-17: Tested the SWT setup in jfreechart.experimental - this is still better. try { System.setProperty("sun.awt.noerasebackground", "true"); } catch (NoSuchMethodError error) { ; } java.awt.Frame frame = org.eclipse.swt.awt.SWT_AWT.new_Frame(this); ChartPanel panel = new ChartPanel(linechart, false, false, false, false, false); panel.setFillZoomRectangle(true); panel.setMouseZoomable(true, true); // create a new ChartPanel, without the popup-menu (5x false) frame.add(panel); // -------------------------------------------------------------------------------- }
From source file:com.mirth.connect.client.ui.AttachmentExportDialog.java
public AttachmentExportDialog() { super(PlatformUI.MIRTH_FRAME); userPreferences = Preferences.userNodeForPackage(Mirth.class); setTitle("Export Attachment"); setPreferredSize(new Dimension(500, 155)); getContentPane().setBackground(Color.white); setLocationRelativeTo(null);/*from w w w . j a v a 2 s .co m*/ setResizable(false); setModal(true); initComponents(); initLayout(); pack(); }
From source file:JToolbarSeparator.java
protected void paintComponent(Graphics g) { super.paintComponent(g); Dimension size = getSize();/*w ww . j av a2 s .com*/ int pos = size.width / 2; g.setColor(Color.gray); g.drawLine(pos, 3, pos, size.height - 5); g.drawLine(pos, 2, pos + 1, 2); g.setColor(Color.white); g.drawLine(pos + 1, 3, pos + 1, size.height - 5); g.drawLine(pos, size.height - 4, pos + 1, size.height - 4); }
From source file:org.jfree.chart.demo.BoxAndWhiskerChartDemo2.java
private static JFreeChart createChart(BoxAndWhiskerXYDataset boxandwhiskerxydataset) { DateAxis dateaxis = new DateAxis("Day"); NumberAxis numberaxis = new NumberAxis("Value"); XYBoxAndWhiskerRenderer xyboxandwhiskerrenderer = new XYBoxAndWhiskerRenderer(); XYPlot xyplot = new XYPlot(boxandwhiskerxydataset, dateaxis, numberaxis, xyboxandwhiskerrenderer); xyplot.setOrientation(PlotOrientation.HORIZONTAL); JFreeChart jfreechart = new JFreeChart("Box-and-Whisker Chart Demo 2", xyplot); jfreechart.setBackgroundPaint(Color.white); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setDomainGridlinesVisible(true); xyplot.setRangeGridlinePaint(Color.white); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); return jfreechart; }
From source file:peakml.util.swt.widget.IntensityTrendGraph.java
public IntensityTrendGraph(Composite parent, int style) { super(parent, SWT.EMBEDDED | style); // layout/* w w w .j ava2s. co m*/ setLayout(new FillLayout()); // create the components errorbarplot = new FastErrorBarPlot("", "Intensity"); errorbarplot.setBackgroundPaint(Color.WHITE); linechart = new JFreeChart("", errorbarplot); linechart.setBackgroundPaint(Color.WHITE); // add the components // -------------------------------------------------------------------------------- // This uses the SWT-trick for embedding awt-controls in an SWT-Composite. try { System.setProperty("sun.awt.noerasebackground", "true"); } catch (NoSuchMethodError error) { ; } java.awt.Frame frame = org.eclipse.swt.awt.SWT_AWT.new_Frame(this); // create a new ChartPanel, without the popup-menu (5x false) frame.add(new ChartPanel(linechart, false, false, false, false, false)); // -------------------------------------------------------------------------------- }
From source file:org.jfree.chart.demo.BarChartDemo9.java
private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createBarChart("Bar Chart Demo 9", null, "Value", categorydataset, PlotOrientation.VERTICAL, false, true, false); TextTitle texttitle = jfreechart.getTitle(); texttitle.setBorder(0.0D, 0.0D, 1.0D, 0.0D); texttitle.setBackgroundPaint(new GradientPaint(0.0F, 0.0F, Color.red, 350F, 0.0F, Color.white, true)); texttitle.setExpandToFitSpace(true); jfreechart.setBackgroundPaint(new GradientPaint(0.0F, 0.0F, Color.yellow, 350F, 0.0F, Color.white, true)); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setNoDataMessage("NO DATA!"); categoryplot.setBackgroundPaint(null); categoryplot.setInsets(new RectangleInsets(10D, 5D, 5D, 5D)); categoryplot.setOutlinePaint(Color.black); categoryplot.setRangeGridlinePaint(Color.gray); categoryplot.setRangeGridlineStroke(new BasicStroke(1.0F)); Paint apaint[] = createPaint(); CustomBarRenderer custombarrenderer = new CustomBarRenderer(apaint); custombarrenderer.setGradientPaintTransformer( new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL)); categoryplot.setRenderer(custombarrenderer); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); numberaxis.setRange(0.0D, 800D);/* w ww . ja va2 s . c o m*/ numberaxis.setTickMarkPaint(Color.black); return jfreechart; }
From source file:lu.lippmann.cdb.lab.mds.MDSViewBuilder.java
/** * /*w ww .java2 s . co m*/ */ public static JXPanel buildMDSViewFromDataSet(final Instances instances, final MDSResult mdsResult, final int maxInstances, final Listener<Instances> listener, final String... attrNameToUseAsPointTitle) throws Exception { final XYSeriesCollection dataset = new XYSeriesCollection(); final JFreeChart chart = ChartFactory.createScatterPlot("", // title "X", "Y", // axis labels dataset, // dataset PlotOrientation.VERTICAL, attrNameToUseAsPointTitle.length == 0, // legend? true, // tooltips? yes false // URLs? no ); final XYPlot xyPlot = (XYPlot) chart.getPlot(); xyPlot.setBackgroundPaint(Color.WHITE); xyPlot.getDomainAxis().setTickLabelsVisible(false); xyPlot.getRangeAxis().setTickLabelsVisible(false); //FIXME : should be different for Shih if (!mdsResult.isNormalized()) { String stress = FormatterUtil.DECIMAL_FORMAT .format(ClassicMDS.getKruskalStressFromMDSResult(mdsResult)); chart.setTitle(mdsResult.getCInstances().isCollapsed() ? "Collapsed MDS(Instances=" + maxInstances + ",Stress=" + stress + ")" : "MDS(Stress=" + stress + ")"); } else { chart.setTitle(mdsResult.getCInstances().isCollapsed() ? "Collapsed MDS(Instances=" + maxInstances + ")" : "MDS"); } final SimpleMatrix coordinates = mdsResult.getCoordinates(); buildFilteredSeries(mdsResult, xyPlot, attrNameToUseAsPointTitle); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setMouseWheelEnabled(true); chartPanel.setPreferredSize(new Dimension(1200, 900)); chartPanel.setBorder(new TitledBorder("MDS Projection")); chartPanel.setBackground(Color.WHITE); final JButton selectionButton = new JButton("Select data"); selectionButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final org.jfree.data.Range XDomainRange = xyPlot.getDomainAxis().getRange(); final org.jfree.data.Range YDomainRange = xyPlot.getRangeAxis().getRange(); final Instances cInstances = mdsResult.getCollapsedInstances(); final Instances selectedInstances = new Instances(cInstances, 0); List<Instances> clusters = null; if (mdsResult.getCInstances().isCollapsed()) { clusters = mdsResult.getCInstances().getCentroidMap().getClusters(); } for (int i = 0; i < cInstances.numInstances(); i++) { final Instance centroid = instances.instance(i); if (XDomainRange.contains(coordinates.get(i, 0)) && YDomainRange.contains(coordinates.get(i, 1))) { if (mdsResult.getCInstances().isCollapsed()) { if (clusters != null) { final Instances elementsOfCluster = clusters.get(i); final int nbElements = elementsOfCluster.numInstances(); for (int k = 0; k < nbElements; k++) { selectedInstances.add(elementsOfCluster.get(k)); } } } else { selectedInstances.add(centroid); } } } if (listener != null) { listener.onAction(selectedInstances); } } }); final JXPanel allPanel = new JXPanel(); allPanel.setLayout(new BorderLayout()); allPanel.add(chartPanel, BorderLayout.CENTER); final JXPanel southPanel = new JXPanel(); southPanel.add(selectionButton); allPanel.add(southPanel, BorderLayout.SOUTH); return allPanel; }
From source file:peakml.util.swt.widget.IPeakGraph.java
public IPeakGraph(Composite parent, int style) { super(parent, SWT.EMBEDDED | style); // layout//from www.j av a 2s . c om setLayout(new FillLayout()); // create the components timeplot = new FastTimePlot("retention time", "intensity"); timeplot.setBackgroundPaint(Color.WHITE); linechart = new JFreeChart("", timeplot); linechart.setBackgroundPaint(Color.WHITE); // org.jfree.experimental.chart.swt.ChartComposite c = // new org.jfree.experimental.chart.swt.ChartComposite(this, SWT.NONE, linechart); // // c.setRangeZoomable(true); // c.setDomainZoomable(true); // add the components // -------------------------------------------------------------------------------- // This uses the SWT-trick for embedding AWT-controls in an SWT-Composite. // 2009-10-17: Tested the SWT setup in jfreechart.experimental - this is still better. try { System.setProperty("sun.awt.noerasebackground", "true"); } catch (NoSuchMethodError error) { ; } java.awt.Frame frame = org.eclipse.swt.awt.SWT_AWT.new_Frame(this); ChartPanel panel = new ChartPanel(linechart, false, false, false, false, false); panel.setFillZoomRectangle(true); panel.setMouseZoomable(true, true); // create a new ChartPanel, without the popup-menu (5x false) frame.add(panel); // -------------------------------------------------------------------------------- }