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:sanger.team16.gui.genevar.eqtl.snp.RegionalLinePlot.java
public ChartPanel getChartPanel(String chromosome, int position, int distance, double threshold) throws ArrayIndexOutOfBoundsException { JFreeChart chart = createChart(chromosome, position, distance, threshold, dataset); chart.setBackgroundPaint(Color.white); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new Dimension(680, 210)); return chartPanel; }
From source file:com.edgenius.wiki.security.service.SimpleListImageCaptchaEngine.java
@Override protected void buildInitialFactories() { TextPaster textPaster = new RandomTextPaster(Integer.valueOf(6), Integer.valueOf(7), Color.black); BackgroundGenerator backgroundGenerator = new UniColorBackgroundGenerator(Integer.valueOf(140), Integer.valueOf(50), Color.white); FontGenerator fontGenerator = new TwistedAndShearedRandomFontGenerator(Integer.valueOf(20), Integer.valueOf(25)); WordToImage wordToImage = new ComposedWordToImage(fontGenerator, backgroundGenerator, textPaster); this.addFactory(new GimpyFactory(new RandomWordGenerator(), wordToImage)); }
From source file:de.hs.mannheim.modUro.diagram.JCellCountDiagram.java
protected JFreeChart createChart(XYDataset dataset, String name) { String title = name;/*from www .j av a2 s.co m*/ JFreeChart xyLineChart = ChartFactory.createXYLineChart(title, // title "t", // x-axis label "n", // y-axis label dataset); String fontName = "Palatino"; xyLineChart.getTitle().setFont(new Font(fontName, Font.BOLD, 18)); XYPlot plot = (XYPlot) xyLineChart.getPlot(); plot.setDomainPannable(true); plot.setRangePannable(true); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); plot.getDomainAxis().setLowerMargin(0.0); plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14)); plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12)); plot.getRangeAxis().setLowerMargin(0.0); // plot.getRangeAxis().setRange(0.0, 1.01); plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14)); plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12)); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.gray); xyLineChart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14)); xyLineChart.getLegend().setFrame(BlockBorder.NONE); xyLineChart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER); XYItemRenderer r = plot.getRenderer(); // set the default stroke for all series int i = 0; for (String celltype : getTimeSeries().getDataSeriesNames()) { r.setSeriesPaint(i, CellTypeColor.getColor(celltype)); i++; } r.setSeriesPaint(i, Color.BLACK); return xyLineChart; }
From source file:com.liusoft.dlog4j.servlet.DLOG_RandomImageServlet.java
/** * ???,,?16,/*from ww w . j a v a 2 s . c o m*/ * @param num ?? * @param out ? * @throws IOException */ protected static void render(String num, boolean gif, OutputStream out) throws IOException { if (num.getBytes().length > 4) throw new IllegalArgumentException("The length of param num cannot exceed 4."); int width = 40; int height = 15; BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D g = (Graphics2D) bi.getGraphics(); g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); Font mFont = new Font("Tahoma", Font.PLAIN, 14); g.setFont(mFont); g.setColor(Color.BLACK); g.drawString(num, 2, 13); if (gif) { AnimatedGifEncoder e = new AnimatedGifEncoder(); e.setTransparent(Color.WHITE); e.start(out); e.setDelay(0); e.addFrame(bi); e.finish(); } else { ImageIO.write(bi, "png", out); } }
From source file:com.igormaznitsa.sciareto.notifications.NotificationManager.java
public void showNotification(@Nullable final Image icon, @Nullable final String title, @Nonnull final Type type, @Nonnull final JComponent component) { Utils.safeSwingCall(new Runnable() { @Override/*from w w w . j a va 2 s . co m*/ public void run() { final JPanel stack = Main.getApplicationFrame().getStackPanel(); Color color = Color.WHITE; switch (type) { case ERROR: color = new Color(0xFFCCCC, false); break; case WARN: color = new Color(0xFFFF99, false); break; case INFO: color = new Color(0xCCFFCC, false); break; } stack.add(new MessagePanel(icon, title, color, component), 0); stack.revalidate(); Main.getApplicationFrame().getGlassPane().setVisible(true); } }); }
From source file:scheduler.benchmarker.manager.CreateSimpleSplineChart.java
public ChartPanel createChartPanel() { XYDataset dataset = createDataset(); NumberAxis numberaxis = new NumberAxis("EMAILS"); numberaxis.setAutoRangeIncludesZero(true); numberaxis.setRange(0, dataset.getItemCount(1)); numberaxis.setVisible(false);//from w ww . j a va 2s.co m NumberAxis numberaxis1 = new NumberAxis("TIME CONSUMED"); numberaxis1.setAutoRangeIncludesZero(false); XYSplineRenderer xysplinerenderer = new XYSplineRenderer(); XYPlot xyplot = new XYPlot(dataset, numberaxis, numberaxis1, xysplinerenderer); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); //xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); JFreeChart jfreechart = new JFreeChart("PLAN VALUES FOR '" + sName + "' SCHEDULER", new Font(Font.SANS_SERIF, Font.PLAIN, 11), xyplot, true); chartPanel = new ChartPanel(jfreechart, true); //Creating listener chartPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent e) { ChartEntity entity = e.getEntity(); if (entity != null && (entity instanceof XYItemEntity)) { XYItemEntity item = (XYItemEntity) entity; String chartTitle = "RULE ARRANGEMENT INFORMATION FOR EMAIL \"" + dataSource.get(item.getItem()).getEmailName() + "\""; createSubChart( new CreateStackedBarChart3D(dataSource.get(item.getItem()), pluginColor, chartTitle) .createChartPanel()); } } @Override public void chartMouseMoved(ChartMouseEvent e) { //DO NOTHING } }); return chartPanel; }
From source file:edu.cuny.cat.ui.ChargePlotPanel.java
public ChargePlotPanel() { registry = GameController.getInstance().getRegistry(); setTitledBorder("Charges"); dataset = new DefaultCategoryDataset(); final JFreeChart chart = ChartFactory.createBarChart("", "", "", dataset, PlotOrientation.HORIZONTAL, true, true, false);//from w w w . j a va 2 s . c om // chart.setAntiAlias(false); chart.setBackgroundPaint(getBackground()); categoryplot = (CategoryPlot) chart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); final BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer(); UIUtils.setDefaultBarRendererStyle(barrenderer); barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}")); categoryplot.setRowRenderingOrder(SortOrder.DESCENDING); final ChartPanel chartPanel = new ChartPanel(chart); add(chartPanel, BorderLayout.CENTER); }
From source file:XYPlotter.java
/** * Init the mainwindow */ private void initFrame() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBackground(Color.WHITE); setSize(640, 480); }
From source file:com.pasi.pdfbox.Main.java
private static JFreeChart createBarChart() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(7445, "JFreeSVG", "Warm-up"); dataset.addValue(24448, "Batik", "Warm-up"); dataset.addValue(4297, "JFreeSVG", "Test"); dataset.addValue(21022, "Batik", "Test"); JFreeChart chart = ChartFactory.createBarChart("Performance: JFreeSVG vs Batik", null /* x-axis label*/, "Milliseconds" /* y-axis label */, dataset); chart.addSubtitle(/*from w w w . ja v a 2 s . com*/ new TextTitle("Time to generate 1000 charts in SVG " + "format (lower bars = better performance)")); chart.setBackgroundPaint(Color.white); CategoryPlot plot = (CategoryPlot) chart.getPlot(); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); chart.getLegend().setFrame(BlockBorder.NONE); return chart; }
From source file:be.ac.ua.comp.scarletnebula.gui.BareGraph.java
/** * @see Graph/*w w w.ja v a 2 s . c o m*/ */ @Override public ChartPanel getChartPanel() { final XYPlot plot = new XYPlot(dataset, domain, range, renderer); plot.setBackgroundPaint(Color.darkGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.setInsets(new RectangleInsets(0, 0, 0, 0)); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinesVisible(true); final JFreeChart chart = new JFreeChart(null, new Font("SansSerif", Font.BOLD, 24), plot, true); chart.setBackgroundPaint(Color.white); chart.removeLegend(); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); return chartPanel; }