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:TimedPApplet.java
/*************************************************************************** * Initialise the applet by attempting to create and start a Player object * capable of playing the media specified in the applet tag. **************************************************************************/ public void init() { setLayout(new BorderLayout()); setBackground(Color.lightGray); try {/*from w ww .j a v a 2 s . c o m*/ nameOfMedia2Play = (new URL(getDocumentBase(), getParameter(MEDIA_NAME_PROPERTY))).toExternalForm(); locator = new MediaLocator(nameOfMedia2Play); player = Manager.createPlayer(locator); player.addControllerListener(this); timer = new SystemTimeBase(); player.start(); } catch (Exception e) { throw new Error("Couldn't initialise BBPApplet: " + e.getMessage()); } }
From source file:kardex.graficakardex.java
public graficakardex() { datosxy.removeAllSeries();// www .jav a 2 s.c om //sxy.add(x[0], y[0]); y = new double[kardex.valor.length]; y = kardex.valor; int n = y.length; for (int i = 0; i < n; i++) { sxy.add(i, y[i]); // System.out.print(x[i]+"-"+i+" "); } datosxy.addSeries(sxy); graficaxy = ChartFactory.createXYLineChart("Grafica de Stock de Producto", "transacciones", "cantidades", datosxy, PlotOrientation.VERTICAL, true, true, true); graficaxy.setBackgroundPaint(Color.white); XYPlot plot = (XYPlot) graficaxy.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); final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); configurarDomainAxis(domainAxis); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; renderer.setBaseShapesVisible(true); renderer.setBaseShapesFilled(true); renderer.setDrawSeriesLineAsPath(true); } }
From source file:CargarEntrenamiento.grafica2.java
public grafica2() { datosxy.removeAllSeries();/*from w w w. j av a 2 s .c o m*/ XYSeries sxy = new XYSeries("pesos"); //sxy.add(x[0], y[0]); y = new double[cargarEntreno.valorentreno.length]; y = cargarEntreno.valorentreno; int n = y.length; for (int i = 0; i < n; i++) { sxy.add(i, y[i]); // System.out.print(x[i]+"-"+i+" "); } datosxy.addSeries(sxy); graficaxy = ChartFactory.createXYLineChart("Grafica de Progreso", "tiempo", "RM-pesos", datosxy, PlotOrientation.VERTICAL, true, true, true); graficaxy.setBackgroundPaint(Color.white); XYPlot plot = (XYPlot) graficaxy.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); final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); configurarDomainAxis(domainAxis); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; renderer.setBaseShapesVisible(true); renderer.setBaseShapesFilled(true); renderer.setDrawSeriesLineAsPath(true); } }
From source file:br.usp.icmc.gazetteer.SemanticSearchTest.Grafico.java
public ChartPanel criaGrafico() { // create the chart... JFreeChart graf = ChartFactory.createXYLineChart("MAP ENTRE AS QUERYS", // chart title "QUERY", // x axis label "MAP", // y axis label createDataset1(), // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls );/* w w w. java 2s. c o m*/ // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... graf.setBackgroundPaint(Color.white); // get a reference to the plot for further customisation... XYPlot plot = (XYPlot) graf.getPlot(); plot.setDataset(1, createDataset2()); plot.setBackgroundPaint(Color.lightGray); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); renderer.setShapesVisible(false); XYLineAndShapeRenderer renderer2 = new XYLineAndShapeRenderer(true, false); plot.setRenderer(1, renderer2); // change the auto tick unit selection to integer units only... NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // OPTIONAL CUSTOMISATION COMPLETED. ChartPanel myChartPanel = new ChartPanel(graf, true); return myChartPanel; }
From source file:ControlQueryPApplet.java
/*************************************************************************** * Initialise the applet by attempting to create and start a Player object * capable of playing the media specified in the applet tag. **************************************************************************/ public void init() { setLayout(new BorderLayout()); setBackground(Color.lightGray); try {/*from ww w . j a v a 2 s. c o m*/ nameOfMedia2Play = (new URL(getDocumentBase(), getParameter(MEDIA_NAME_PROPERTY))).toExternalForm(); locator = new MediaLocator(nameOfMedia2Play); Manager.setHint(Manager.PLUGIN_PLAYER, new Boolean(true)); player = Manager.createPlayer(locator); player.addControllerListener(this); timer = new SystemTimeBase(); player.start(); } catch (Exception e) { throw new Error("Couldn't initialise BBPApplet: " + e.getMessage()); } }
From source file:ws.moor.bt.gui.charts.RawDownloadRate.java
private JFreeChart createChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createTimeSeriesChart("Download Rate", "Time", "KB/s", dataset, false, false, false);//from w w w .j a v a2s . c om chart.setBackgroundPaint(Color.white); XYPlot plot = chart.getXYPlot(); 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); DateAxis axis = (DateAxis) plot.getDomainAxis(); axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss")); return chart; }
From source file:WeatherFrame.java
public WeatherFrame() { initComponents();//ww w . j a v a 2 s. c o m 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:it.eng.spagobi.engines.kpi.bo.charttypes.dialcharts.Thermometer.java
/** * Creates a chart of type thermometer.//w w w .j a v a 2s.c o m * * @return A chart thermometer. */ public JFreeChart createChart() { logger.debug("IN"); if (dataset == null) { logger.debug("The dataset to be represented is null"); return null; } ThermometerPlot plot = new ThermometerPlot((ValueDataset) dataset); logger.debug("Created the new Thermometer Plot"); JFreeChart chart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, plot, true); logger.debug("Created the new Chart"); chart.setBackgroundPaint(color); logger.debug("Setted the 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"); } plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setPadding(new RectangleInsets(10.0, 10.0, 10.0, 10.0)); plot.setThermometerStroke(new BasicStroke(2.0f)); plot.setThermometerPaint(Color.lightGray); plot.setGap(3); plot.setValueLocation(3); plot.setRange(lower, upper); plot.setUnits(ThermometerPlot.UNITS_NONE); logger.debug("Setted all the properties of the plot"); // set subranges for (Iterator iterator = intervals.iterator(); iterator.hasNext();) { KpiInterval subrange = (KpiInterval) iterator.next(); int range = 0; //For the thermometer the number of intervals is forced to 3 and they have to have as labels the following ones if (subrange.getLabel().equalsIgnoreCase("NORMAL")) range = (ThermometerPlot.NORMAL); else if (subrange.getLabel().equalsIgnoreCase("WARNING")) range = (ThermometerPlot.WARNING); else if (subrange.getLabel().equalsIgnoreCase("CRITICAL")) range = (ThermometerPlot.CRITICAL); plot.setSubrange(range, subrange.getMin(), subrange.getMax()); if (subrange.getColor() != null) { plot.setSubrangePaint(range, subrange.getColor()); } logger.debug("Setted new range of the plot"); } logger.debug("OUT"); return chart; }
From source file:org.jfree.chart.demo.StackedBarChart3DDemo5.java
private static JFreeChart createChart(int i, CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createStackedBarChart3D("Chart " + (i + 1), "Category", "Value", categorydataset, PlotOrientation.VERTICAL, false, false, false); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.getDomainAxis().setMaximumCategoryLabelLines(2); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); categoryplot.setDomainGridlinePaint(Color.white); categoryplot.setRangeGridlinePaint(Color.white); ValueAxis valueaxis = categoryplot.getRangeAxis(); valueaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); return jfreechart; }
From source file:edu.cuny.cat.ui.ProfitPlotPanel.java
public ProfitPlotPanel() { shoutSet = Collections.synchronizedSet(new HashSet<Shout>()); registry = GameController.getInstance().getRegistry(); setTitledBorder("Income and Expenses"); dataset = new DefaultCategoryDataset(); final JFreeChart chart = ChartFactory.createStackedBarChart("", "", "", dataset, PlotOrientation.HORIZONTAL, true, true, false);//ww w .ja v a2 s . c om // chart.setAntiAlias(false); chart.setBackgroundPaint(getBackground()); final CategoryPlot categoryplot = (CategoryPlot) chart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); final StackedBarRenderer stackedbarrenderer = (StackedBarRenderer) categoryplot.getRenderer(); UIUtils.setDefaultBarRendererStyle(stackedbarrenderer); stackedbarrenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); stackedbarrenderer.setBaseItemLabelsVisible(true); final ChartPanel chartPanel = new ChartPanel(chart); add(chartPanel, BorderLayout.CENTER); }