List of usage examples for java.awt Color lightGray
Color lightGray
To view the source code for java.awt Color lightGray.
Click Source Link
From source file:compecon.dashboard.panel.AbstractChartsPanel.java
protected void configureChart(JFreeChart chart) { chart.setBackgroundPaint(Color.white); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); DateAxis dateAxis = (DateAxis) plot.getDomainAxis(); NumberAxis valueAxis = (NumberAxis) plot.getRangeAxis(); dateAxis.setDateFormatOverride(new SimpleDateFormat("dd-MMM")); valueAxis.setAutoRangeIncludesZero(true); valueAxis.setUpperMargin(0.15);//from ww w. j ava2s.co m valueAxis.setLowerMargin(0.15); }
From source file:it.alus.GPSreceiver.instruments.Accelerometer.java
public Accelerometer() { super(null);// w w w .j a v a 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("Acceleration"); titleLabel.setFont(new Font("Arial", 1, 18)); titleLabel.setRadius(0.45D); titleLabel.setAngle(90); titleLabel.setPaint(Color.lightGray); plot.addLayer(titleLabel); DialValueIndicator valueindicator = new DialValueIndicator(0); plot.addLayer(valueindicator); DialTextAnnotation annotation = new DialTextAnnotation("g"); annotation.setFont(new Font("Arial", 1, 20)); annotation.setRadius(0.4D); annotation.setPaint(Color.lightGray); plot.addLayer(annotation); plot.setDialFrame(dialFrame); StandardDialScale scale = new StandardDialScale(-1, 3, -95, -340, 1, 20); 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:br.unicamp.cst.motivational.MotivationalMonitor.java
@Override public synchronized void run() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); final JFreeChart chart = ChartFactory.createBarChart(getTitle(), getEntity(), "Value", dataset, PlotOrientation.VERTICAL, true, true, false); final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); chart.setBackgroundPaint(Color.lightGray); ChartFrame frame = new ChartFrame(getTitle(), chart); frame.pack();/*ww w. j a v a 2 s . c o m*/ frame.setVisible(true); while (true) { ArrayList<Codelet> tempCodeletsList = new ArrayList<Codelet>(); tempCodeletsList.addAll(this.getListOfMotivationalEntities()); synchronized (tempCodeletsList) { for (Codelet co : tempCodeletsList) { dataset.addValue(co.getActivation(), co.getName(), "activation"); } try { Thread.currentThread().sleep(getRefreshPeriod()); } catch (InterruptedException e) { e.printStackTrace(); } } } }
From source file:it.alus.GPSreceiver.instruments.Variometer.java
public Variometer() { super(null);//from www . ja v a 2s . co m 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 unitLabel = new DialTextAnnotation("100 Ft/min"); unitLabel.setFont(new Font("Arial", 1, 18)); unitLabel.setRadius(0.3D); unitLabel.setAngle(90); unitLabel.setPaint(Color.white); plot.addLayer(unitLabel); DialValueIndicator valueindicator = new DialValueIndicator(0); plot.addLayer(valueindicator); DialTextAnnotation annotation = new DialTextAnnotation("Ft/min"); annotation.setFont(new Font("Arial", 1, 14)); annotation.setRadius(0.4D); annotation.setPaint(Color.lightGray); plot.addLayer(annotation); plot.setDialFrame(dialFrame); StandardDialScale realScale = new StandardDialScale(-3000, 3000, -10, -340, 100, 10); realScale.setVisible(false); plot.addScale(0, realScale); StandardDialScale dispScale = new StandardDialScale(-30, 30, -10, -340, 5, 10); dispScale.setMajorTickPaint(Color.white); dispScale.setMinorTickPaint(Color.lightGray); dispScale.setFirstTickLabelVisible(true); dispScale.setTickRadius(0.88); dispScale.setTickLabelOffset(0.15); NumberFormat formatter = new DecimalFormat("#"); dispScale.setTickLabelFormatter(formatter); dispScale.setTickLabelFont(new Font("Arial", Font.BOLD, 24)); dispScale.setTickLabelPaint(Color.white); plot.addScale(1, dispScale); 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:it.alus.GPSreceiver.instruments.Turnometer.java
public Turnometer() { super(null);//from ww w . j a v a 2s. 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:it.alus.GPSreceiver.instruments.SatelliteRadar.java
public SatelliteRadar() { super(null);/*ww w .jav a 2s . c o m*/ azimuth = new int[MAX_SAT]; elevation = new int[MAX_SAT]; snr = new int[MAX_SAT]; resetArray(); satSeries = new XYSeries("Satellites"); XYSeriesCollection seriescollection = new XYSeriesCollection(); seriescollection.addSeries(satSeries); jChart = ChartFactory.createPolarChart("Satellites", seriescollection, true, false, false); jChart.setBackgroundPaint(Color.white); PolarPlot polarplot = (PolarPlot) jChart.getPlot(); polarplot.setBackgroundPaint(Color.lightGray); polarplot.setAngleGridlinePaint(Color.white); polarplot.setRadiusGridlinePaint(Color.white); NumberAxis numberaxis = (NumberAxis) polarplot.getAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); super.setChart(jChart); super.setMouseZoomable(false); super.setPreferredSize(new Dimension(500, 270)); }
From source file:richclient.EvolutionChart.java
/** * Creates a chart./* ww w . j av a2 s . c om*/ * * @param dataset the data for the chart. * * @return a chart. */ public JFreeChart createChart(XYDataset dataset) { // create the chart final JFreeChart chart = ChartFactory.createXYLineChart("Market evolution", // chart title "Time", // x axis label "Value", // y axis label dataset, // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls ); // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... chart.setBackgroundPaint(Color.white); // final StandardLegend legend = (StandardLegend) chart.getLegend(); // legend.setDisplaySeriesShapes(true); // get a reference to the plot for further customisation... final XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.lightGray); // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0)); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesLinesVisible(0, true); renderer.setSeriesShapesVisible(1, true); plot.setRenderer(renderer); // change the auto tick unit selection to integer units only... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // OPTIONAL CUSTOMISATION COMPLETED. return chart; }
From source file:service.chart.FitnessChart.java
/** * Utworz wykres funkcji fitness dla najlepszego osobnika w danej iteracji algorytmu genetycznego * na podstawie zestawu danych// ww w . j a va 2 s.co m * * @param categoryDataset Zestaw danych * @return Wykres funkcji fitness */ private static JFreeChart createChart(CategoryDataset categoryDataset) { JFreeChart chart = ChartFactory.createLineChart("Best fitness function value", // title "Iteration", // x-axis label "Fitness", // y-axis label categoryDataset, // data PlotOrientation.VERTICAL, true, // create legend? true, // generate tooltips? false // generate URLs? ); chart.setBackgroundPaint(Color.white); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); CategoryItemRenderer r = plot.getRenderer(); if (r instanceof LineAndShapeRenderer) { LineAndShapeRenderer renderer = (LineAndShapeRenderer) r; renderer.setBaseShapesVisible(false); renderer.setBaseShapesFilled(true); } return chart; }
From source file:diplomawork.model.ViewForDiagram.java
/** * Creates a chart.// w w w .j a va2 s . c o m * * @param dataset a dataset. * * @return A chart. */ private JFreeChart createChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createTimeSeriesChart("EUR/USD", // title "Date", // x-axis label "Price Per Unit", // y-axis label dataset, // data true, // create legend? true, // generate tooltips? false // generate URLs? ); chart.setBackgroundPaint(Color.white); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); plot.setOutlinePaint(null); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; renderer.setBaseShapesVisible(true); renderer.setBaseShapesFilled(true); renderer.setDrawSeriesLineAsPath(true); renderer.setSeriesPaint(0, Color.BLUE); } DateAxis axis = (DateAxis) plot.getDomainAxis(); axis.setDateFormatOverride(new SimpleDateFormat("dd HH:mm:ss")); return chart; }
From source file:org.jfree.chart.demo.XYAreaChartDemo1.java
private static JFreeChart createChart(XYDataset xydataset) { JFreeChart jfreechart = ChartFactory.createXYAreaChart("XY Area Chart Demo", "Domain (X)", "Range (Y)", xydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setForegroundAlpha(0.65F);/*from www. j a v a 2 s. c o m*/ xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); ValueAxis valueaxis = xyplot.getDomainAxis(); valueaxis.setTickMarkPaint(Color.black); valueaxis.setLowerMargin(0.0D); valueaxis.setUpperMargin(0.0D); ValueAxis valueaxis1 = xyplot.getRangeAxis(); valueaxis1.setTickMarkPaint(Color.black); XYPointerAnnotation xypointerannotation = new XYPointerAnnotation("Test", 5D, -500D, 2.3561944901923448D); xypointerannotation.setTipRadius(0.0D); xypointerannotation.setBaseRadius(35D); xypointerannotation.setFont(new Font("SansSerif", 0, 9)); xypointerannotation.setPaint(Color.blue); xypointerannotation.setTextAnchor(TextAnchor.HALF_ASCENT_RIGHT); xyplot.addAnnotation(xypointerannotation); return jfreechart; }