List of usage examples for java.awt Color BLACK
Color BLACK
To view the source code for java.awt Color BLACK.
Click Source Link
From source file:de.hs.mannheim.modUro.diagram.JCellCountDiagram.java
protected JFreeChart createChart(XYDataset dataset, String name) { String title = name;//from w w w. j ava 2s. 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:uk.org.rbc1b.roms.controller.volunteer.VolunteerBadgePdfView.java
/** * Adds the Volunteer's name to the Badge. * * @param content to be added//from ww w . j a v a 2 s.co m * @param name concatenated String of forename and surname */ private static void addVolunteerName(PdfContentByte content, String name) throws DocumentException, IOException { content.beginText(); content.moveText(183, 470); BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1257, false); content.setFontAndSize(bf, 16); content.setColorFill(Color.BLACK); content.showText(name); content.endText(); }
From source file:com.googlecode.logVisualizer.chart.LineChartBuilder.java
private JFreeChart createChart(final XYDataset dataset) { final JFreeChart chart = ChartFactory.createXYLineChart(getTitle(), xLable, yLable, dataset, PlotOrientation.VERTICAL, isIncludeLegend(), true, false); final XYPlot plot = (XYPlot) chart.getPlot(); double lastXValue = 0; if (dataset.getSeriesCount() > 0) lastXValue = dataset.getXValue(0, dataset.getItemCount(0) - 1); plot.setDomainAxis(new FixedZoomNumberAxis(lastXValue)); plot.getDomainAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits()); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinePaint(Color.black); plot.setRangeGridlinePaint(Color.black); plot.setNoDataMessage("No data available"); if (dataset.getSeriesCount() > 0) ((NumberAxis) plot.getDomainAxis()).setUpperBound(lastXValue); ((NumberAxis) plot.getRangeAxis()).setStandardTickUnits(NumberAxis.createIntegerTickUnits()); final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); for (int i = 0; i < dataset.getSeriesCount(); i++) { renderer.setSeriesShapesVisible(i, false); renderer.setSeriesStroke(i, new BasicStroke(2)); }/*from w w w . j a v a 2s. com*/ renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); plot.setRenderer(renderer); return chart; }
From source file:edu.ucla.stat.SOCR.chart.gui.CircleDrawer.java
/** * Draws the circle.// w ww. j av a2s . c om * * @param g2 the graphics device. * @param area the area in which to draw. */ public void draw(Graphics2D g2, Rectangle2D area) { Ellipse2D ellipse = new Ellipse2D.Double(area.getX(), area.getY(), area.getWidth(), area.getHeight()); if (this.fillPaint != null) { g2.setPaint(this.fillPaint); g2.fill(ellipse); } if (this.outlinePaint != null && this.outlineStroke != null) { g2.setPaint(this.outlinePaint); g2.setStroke(this.outlineStroke); g2.draw(ellipse); } g2.setPaint(Color.black); g2.setStroke(new BasicStroke(1.0f)); Line2D line1 = new Line2D.Double(area.getCenterX(), area.getMinY(), area.getCenterX(), area.getMaxY()); Line2D line2 = new Line2D.Double(area.getMinX(), area.getCenterY(), area.getMaxX(), area.getCenterY()); g2.draw(line1); g2.draw(line2); }
From source file:test.buddhabrot.BuddhabrotApp.java
public BuddhabrotApp(final GridNode node) throws HeadlessException { super();//from ww w . jav a2 s . c om setSize(WIDTH, HEIGHT); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { try { if (future != null) { if (!future.isJobFinished()) { log.info("Cancelling Job... wait"); setTitle("Cancelling Job - WAIT"); if (!future.cancel()) { log.warn("Cancel Failed"); } } } node.shutdown(); // Give time to send termination message try { Thread.sleep(2000); } catch (InterruptedException e1) { e1.printStackTrace(); } } catch (Exception ex) { ex.printStackTrace(); } System.exit(0); } }); setVisible(true); // create off-screen buffer Graphics g = image.getGraphics(); g.setColor(Color.black); g.fillRect(0, 0, WIDTH, HEIGHT); repaint(); }
From source file:net.sf.mzmine.chartbasics.chartthemes.ChartThemeFactory.java
public static EStandardChartTheme createBlackNWhiteTheme() { EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW"); // Fonts/*ww w . jav a 2 s. c o m*/ theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16)); theme.setLargeFont(new Font("Arial", Font.BOLD, 11)); theme.setRegularFont(new Font("Arial", Font.PLAIN, 11)); theme.setSmallFont(new Font("Arial", Font.PLAIN, 11)); // Paints theme.setTitlePaint(Color.black); theme.setSubtitlePaint(Color.black); theme.setLegendItemPaint(Color.black); theme.setPlotOutlinePaint(Color.black); theme.setBaselinePaint(Color.black); theme.setCrosshairPaint(Color.black); theme.setLabelLinkPaint(Color.black); theme.setTickLabelPaint(Color.black); theme.setAxisLabelPaint(Color.black); theme.setShadowPaint(Color.black); theme.setItemLabelPaint(Color.black); theme.setLegendBackgroundPaint(Color.white); theme.setChartBackgroundPaint(Color.white); theme.setPlotBackgroundPaint(Color.white); // paint sequence: add black Paint[] colors = new Paint[] { Color.BLACK, new Color(0xFF, 0x55, 0x55), new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55), new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray, ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW, ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED, ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW, ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED, ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW, ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED, ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW, ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN }; theme.setDrawingSupplier( new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE)); theme.setErrorIndicatorPaint(Color.black); theme.setGridBandPaint(new Color(255, 255, 255, 20)); theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40)); // axis Color transp = new Color(0, 0, 0, 200); theme.setRangeGridlinePaint(transp); theme.setDomainGridlinePaint(transp); theme.setAxisLinePaint(Color.black); // axis offset theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0)); return theme; }
From source file:mase.app.soccer.Soccer.java
@Override public void start() { super.start(); this.field = new Continuous2D(par.discretization, par.fieldLength, par.fieldWidth); double fl = par.fieldLength, fw = par.fieldWidth, hg = par.goalWidth / 2, d = par.cornerDiag; Segment t1 = new Segment(new Double2D(0, fw / 2 - hg), new Double2D(0, d)); Segment t2 = new Segment(t1.end, new Double2D(d, 0)); Segment t3 = new Segment(t2.end, new Double2D(fl - d, 0)); Segment t4 = new Segment(t3.end, new Double2D(fl, d)); Segment t5 = new Segment(t4.end, new Double2D(fl, fw / 2 - hg)); Segment t6 = new Segment(new Double2D(fl, fw / 2 + hg), new Double2D(fl, fw - d)); Segment t7 = new Segment(t6.end, new Double2D(fl - d, fw)); Segment t8 = new Segment(t7.end, new Double2D(d, fw)); Segment t9 = new Segment(t8.end, new Double2D(0, fw - d)); Segment t10 = new Segment(t9.end, new Double2D(0, fw / 2 + hg)); leftGoalCenter = new PointObject(field, new Double2D(0, fw / 2)); rightGoalCenter = new PointObject(field, new Double2D(fl, fw / 2)); fieldBoundaries = new MultilineObject(field, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); fieldBoundaries.setStroke(new BasicStroke(1)); fieldBoundaries.paint = Color.BLACK; fieldBoundaries.filled = false;/* ww w . j a va 2 s .co m*/ fieldBoundaries.setLocation(new Double2D(0, 0)); ball = new Ball(this); ball.setLabel(""); ball.setColor(Color.WHITE); schedule.scheduleRepeating(ball); createAgents(); resetTeams(startFlag); startFlag = !startFlag; referee = new Referee(); schedule.scheduleRepeating(referee); }
From source file:diplomawork.model.JPEGSaver.java
public void saveChartToFile(JFreeChart chart, boolean trainFlag) { chart.setBackgroundPaint(Color.white); XYPlot plot = (XYPlot) chart.getPlot(); plot.getDomainAxis().setVisible(false); plot.getRangeAxis().setVisible(false); plot.setBackgroundAlpha(0);// ww w . jav a2s . c o m plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setOutlinePaint(null); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; renderer.setBaseShapesVisible(false); renderer.setSeriesPaint(0, Color.BLACK); } plot.getRenderer().setSeriesStroke(0, new java.awt.BasicStroke(4f)); File f = null; if (trainFlag) { nameOfJPGFile = "src/resorce/TranePlot" + trainCount++ + ".jpg"; f = new File(nameOfJPGFile); } else { // f = new File("src/resorce/Plot" + n++ + ".jpg"); f = new File("src/resorce/Plot" + ".jpg"); } try { ChartUtilities.saveChartAsJPEG(f, chart, 80, 80); } catch (IOException ex) { Logger.getLogger(JPEGSaver.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.googlecode.logVisualizer.chart.HorizontalBarChartBuilder.java
private JFreeChart createChart(final CategoryDataset dataset) { final JFreeChart chart = ChartFactory.createBarChart(getTitle(), xLable, yLable, dataset, PlotOrientation.HORIZONTAL, isIncludeLegend(), true, false); final CategoryPlot plot = (CategoryPlot) chart.getPlot(); final BarRenderer renderer = (BarRenderer) plot.getRenderer(); final CategoryAxis categoryAxis = plot.getDomainAxis(); final NumberAxis numberAxis = (NumberAxis) plot.getRangeAxis(); plot.setNoDataMessage("No data available"); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.black); plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT); setBarShadowVisible(chart, false);// ww w. j a va 2 s. c o m renderer.setBaseItemLabelsVisible(true); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator("{1}, {2}", NumberFormat.getInstance())); categoryAxis.setCategoryMargin(0.02); categoryAxis.setUpperMargin(0.02); categoryAxis.setLowerMargin(0.02); numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); numberAxis.setUpperMargin(0.1); return chart; }
From source file:it.eng.spagobi.engines.kpi.bo.charttypes.dialcharts.Meter.java
/** * Creates the MeterChart ./*w ww. ja v a 2 s .c o m*/ * * @return A MeterChart . */ public JFreeChart createChart() { logger.debug("IN"); if (dataset == null) { logger.debug("The dataset to be represented is null"); return null; } MeterPlot plot = new MeterPlot((ValueDataset) dataset); logger.debug("Created new plot"); plot.setRange(new Range(lower, upper)); logger.debug("Setted plot range"); for (Iterator iterator = intervals.iterator(); iterator.hasNext();) { KpiInterval interval = (KpiInterval) iterator.next(); plot.addInterval(new MeterInterval(interval.getLabel(), new Range(interval.getMin(), interval.getMax()), Color.lightGray, new BasicStroke(2.0f), interval.getColor())); logger.debug("Added new interval to the plot"); } plot.setNeedlePaint(Color.darkGray); plot.setDialBackgroundPaint(Color.white); plot.setDialOutlinePaint(Color.gray); plot.setDialShape(DialShape.CHORD); plot.setMeterAngle(260); plot.setTickLabelsVisible(true); Font f = new Font("Arial", Font.PLAIN, 11); plot.setTickLabelFont(f); plot.setTickLabelPaint(Color.darkGray); plot.setTickSize(5.0); plot.setTickPaint(Color.lightGray); plot.setValuePaint(Color.black); plot.setValueFont(new Font("Arial", Font.PLAIN, 14)); logger.debug("Setted all properties of the plot"); JFreeChart chart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); logger.debug("Created the chart"); chart.setBackgroundPaint(color); logger.debug("Setted background color of the chart"); TextTitle title = setStyleTitle(name, styleTitle); chart.setTitle(title); logger.debug("Setted the title of the chart"); if (subName != null && !subName.equals("")) { TextTitle subTitle = setStyleTitle(subName, styleSubTitle); chart.addSubtitle(subTitle); logger.debug("Setted the subtitle of the chart"); } logger.debug("OUT"); return chart; }