List of usage examples for java.awt Color orange
Color orange
To view the source code for java.awt Color orange.
Click Source Link
From source file:fitmon.WorkoutChart.java
/** * Creates a sample chart.//from ww w .j a v a2s . co m * * @param dataset the dataset. * * @return The chart. */ public JFreeChart createChart(CategoryDataset dataset) { // create the chart... JFreeChart chart = ChartFactory.createBarChart("weekly workout", // chart title "Date", // domain axis label "Performance", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? ); // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... // set the background color for the chart... chart.setBackgroundPaint(Color.white); // get a reference to the plot for further customisation... CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); // set the range axis to display integers only... NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setRange(25, 200); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // disable bar outlines... BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); // set up gradient paints for series... GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.ORANGE, 0.0f, 0.0f, Color.lightGray); GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.PINK, 0.0f, 0.0f, Color.lightGray); GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.lightGray); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); // OPTIONAL CUSTOMISATION COMPLETED. return chart; }
From source file:umontreal.iro.lecuyer.charts.SSJCategorySeriesCollection.java
protected static String detectXColorClassic(Color color) { String retour = null;/*from w w w .jav a2 s. co m*/ int red = color.getRed(); int green = color.getGreen(); int blue = color.getBlue(); // On utilise pas la method Color.equals(Color ) car on ne veut pas tester le parametre de transparence : Alpha if (red == Color.GREEN.getRed() && blue == Color.GREEN.getBlue() && green == Color.GREEN.getGreen()) return "green"; else if (red == Color.RED.getRed() && blue == Color.RED.getBlue() && green == Color.RED.getGreen()) return "red"; else if (red == Color.WHITE.getRed() && blue == Color.WHITE.getBlue() && green == Color.WHITE.getGreen()) return "white"; else if (red == Color.GRAY.getRed() && blue == Color.GRAY.getBlue() && green == Color.GRAY.getGreen()) return "gray"; else if (red == Color.BLACK.getRed() && blue == Color.BLACK.getBlue() && green == Color.BLACK.getGreen()) return "black"; else if (red == Color.YELLOW.getRed() && blue == Color.YELLOW.getBlue() && green == Color.YELLOW.getGreen()) return "yellow"; else if (red == Color.MAGENTA.getRed() && blue == Color.MAGENTA.getBlue() && green == Color.MAGENTA.getGreen()) return "magenta"; else if (red == Color.CYAN.getRed() && blue == Color.CYAN.getBlue() && green == Color.CYAN.getGreen()) return "cyan"; else if (red == Color.BLUE.getRed() && blue == Color.BLUE.getBlue() && green == Color.BLUE.getGreen()) return "blue"; else if (red == Color.DARK_GRAY.getRed() && blue == Color.DARK_GRAY.getBlue() && green == Color.DARK_GRAY.getGreen()) return "darkgray"; else if (red == Color.LIGHT_GRAY.getRed() && blue == Color.LIGHT_GRAY.getBlue() && green == Color.LIGHT_GRAY.getGreen()) return "lightgray"; else if (red == Color.ORANGE.getRed() && blue == Color.ORANGE.getBlue() && green == Color.ORANGE.getGreen()) return "orange"; else if (red == Color.PINK.getRed() && blue == Color.PINK.getBlue() && green == Color.PINK.getGreen()) return "pink"; if (red == 192 && blue == 128 && green == 64) return "brown"; else if (red == 128 && blue == 128 && green == 0) return "olive"; else if (red == 128 && blue == 0 && green == 128) return "violet"; else if (red == 192 && blue == 0 && green == 64) return "purple"; else return null; }
From source file:no.met.jtimeseries.marinogram.MarinogramTemperaturePlot.java
private XYPlot createPlot(TimeZone timezone, boolean plotAirTemp, boolean plotWaterTemp, boolean plotDewpointTemp) throws ParseException { Date startTime = null;/*from w w w . ja v a 2s. c o m*/ NumberPhenomenon aTemperature = null; NumberPhenomenon wTemperature = null; NumberPhenomenon dTemperature = null; // default setting ChartPlotter plotter = new ChartPlotter(); plotter.setHeight(this.getHeight()); plotter.setWidth(this.getWidth()); plotter.setPlotDefaultProperties("", ""); double minValue = 100; double maxValue = -100; int plotIndex = 0; if (plotAirTemp) { aTemperature = getLocationForecastDataModel().getPhenomenen(PhenomenonName.AirTemperature.toString(), NumberPhenomenon.class); minValue = aTemperature.getMinValue() < minValue ? aTemperature.getMinValue() : minValue; maxValue = aTemperature.getMaxValue() > maxValue ? aTemperature.getMaxValue() : maxValue; startTime = aTemperature.getTime().get(0); plotTemperature(plotter, aTemperature, new BasicStroke(2.0f), Color.RED, messages.getString("label.air"), true); plotter.getPlot().getRenderer(plotIndex).setSeriesVisibleInLegend(0, true); plotter.getPlot().getRenderer(plotIndex).setSeriesVisibleInLegend(1, true); plotIndex++; } if (plotWaterTemp) { wTemperature = getOceanForecastDataModel().getPhenomenen(PhenomenonName.seaTemperature.toString(), NumberPhenomenon.class); // only plot water temperature if it is availbe for this location if (wTemperature != null) { minValue = wTemperature.getMinValue() < minValue ? wTemperature.getMinValue() : minValue; maxValue = wTemperature.getMaxValue() > maxValue ? wTemperature.getMaxValue() : maxValue; startTime = wTemperature.getTime().get(0); BasicStroke dottedStroke = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[] { 2.0f, 6.0f }, 0.0f); plotTemperature(plotter, wTemperature, dottedStroke, Color.RED, messages.getString("label.water"), true); plotter.getPlot().getRenderer(plotIndex++).setSeriesVisibleInLegend(0, true); } } if (plotDewpointTemp) { dTemperature = getLocationForecastDataModel() .getPhenomenen(PhenomenonName.dewPointTemperature.toString(), NumberPhenomenon.class); minValue = dTemperature.getMinValue() < minValue ? dTemperature.getMinValue() : minValue; maxValue = dTemperature.getMaxValue() > maxValue ? dTemperature.getMaxValue() : maxValue; startTime = dTemperature.getTime().get(0); plotTemperature(plotter, dTemperature, new BasicStroke(2.0f), Color.ORANGE, messages.getString("label.dewpoint"), false); plotter.getPlot().getRenderer(plotIndex).setSeriesVisibleInLegend(0, true); } double tick = (maxValue - minValue) / 3.5; tick = Math.ceil(tick); double lowBound = Math.floor(minValue / (tick)) * (tick); lowBound = lowBound - tick / 2; double upperBound = lowBound + tick * 7; // set range axis NumberAxis numberAxis = new NumberAxis(); numberAxis.setLabelPaint(Color.RED); numberAxis.setTickLabelPaint(Color.RED); numberAxis.setLabel(messages.getString("parameter.temperature") + " (\u00B0 C)"); numberAxis.setTickUnit(new NumberTickUnit(tick)); numberAxis.setLowerBound(lowBound); numberAxis.setUpperBound(upperBound); //Set left axis and right axis plotter.getPlot().setRangeAxis(0, numberAxis); plotter.getPlot().setRangeAxis(1, numberAxis); //Set the third axis and hide the third axis if (plotAirTemp && plotWaterTemp && plotDewpointTemp) { NumberAxis numberAxis2 = new NumberAxis(); numberAxis2.setTickUnit(new NumberTickUnit(tick)); numberAxis2.setLowerBound(lowBound); numberAxis2.setUpperBound(upperBound); plotter.getPlot().setRangeAxis(2, numberAxis2); plotter.getPlot().getRangeAxis(2).setVisible(false); } //Show legend at the top right position of the plot LegendTitle lt = new LegendTitle(plotter.getPlot()); lt.setItemFont(new Font("Dialog", Font.PLAIN, 9)); lt.setBackgroundPaint(new Color(255, 255, 255, 100)); lt.setFrame(new BlockBorder(Color.white)); lt.setPosition(RectangleEdge.TOP); XYTitleAnnotation ta = new XYTitleAnnotation(0.99, 0.95, lt, RectangleAnchor.TOP_RIGHT); plotter.getPlot().addAnnotation(ta); // set domain range after (must) plot all the data plotter.addHourBasedDomainGridLines(); // add markers plotter.addDomainMarkers(getShortTermTime(startTime), timezone, locale); Date minDate = getShortTermTime(startTime).get(0); Date maxDate = getShortTermTime(startTime).get(getShortTermTime(startTime).size() - 1); plotter.setDomainRange(minDate, maxDate); plotter.setDomainDateFormat(timezone, "HH"); plotter.getPlot().setOutlineVisible(true); // invisible the domain i.e, x axis plotter.getPlot().getDomainAxis().setTickLabelsVisible(false); return plotter.getPlot(); }
From source file:edu.esprit.sweet4u.GUI.Statistique.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed ClientDAO cdao = new ClientDAO(); ResponsablePatisserieDAO rpdao = new ResponsablePatisserieDAO(); DefaultCategoryDataset barChartData = new DefaultCategoryDataset(); barChartData.setValue(cdao.calculNombreClient(), "Nombre des utilisateurs", "Clients"); barChartData.setValue(rpdao.calculNombreResponsable(), "Nombre des utilisateurs", "Responsables Ptisserie"); JFreeChart barChart = ChartFactory.createBarChart3D("Statistiques des membres", "Type", "Nombre des utilisateurs", barChartData, PlotOrientation.VERTICAL, rootPaneCheckingEnabled, rootPaneCheckingEnabled, rootPaneCheckingEnabled); CategoryPlot barchrt = barChart.getCategoryPlot(); barchrt.setRangeGridlinePaint(Color.ORANGE); ChartPanel barPanel = new ChartPanel(barChart); jPanel2.removeAll();/*from w w w. j a v a 2 s. c o m*/ jPanel2.add(barPanel, BorderLayout.CENTER); jPanel2.validate(); // DefaultPieDataset pieDataset = new DefaultPieDataset(); // pieDataset.setValue("Clients",cdao.calculNombreClient()); // // pieDataset.setValue("Responsables Ptisserie",rpdao.calculNombreResponsable()); // JFreeChart chart= ChartFactory.createPieChart("Pie chart", pieDataset, true, true, true); // PiePlot P=(PiePlot)chart.getPlot(); //// P.setForegroundAlpha(TOP_ALIGNMENT); // ChartFrame frame = new ChartFrame("Pie chart", chart); // frame.setVisible(true); // frame.setSize(600,700); }
From source file:aplicarFiltros.PanelResultado.java
public void graficar() { //Grafico de cantidad de Pixeles JFreeChart chartPixel = ChartFactory.createPieChart("Clasificacin", datasetPixel, true, true, false); chartPixel.setBackgroundPaint(Color.ORANGE); PiePlot plotPixel = (PiePlot) chartPixel.getPlot(); //Color de las etiquetas plotPixel.setLabelBackgroundPaint(Color.ORANGE); //Color de el fondo del grfico plotPixel.setBackgroundPaint(Color.WHITE); plotPixel.setNoDataMessage("No hay data"); ChartPanel panelPixel = new ChartPanel(chartPixel); final JPanel contentPixel = new JPanel(new BorderLayout()); contentPixel.add(panelPixel);/*from w w w.j a v a 2 s.co m*/ //panelPixel.setPreferredSize(new java.awt.Dimension(500, 250)); panelGraficoPixel.setPreferredSize(new java.awt.Dimension(500, 180)); this.panelGraficoPixel.setLayout(new BorderLayout()); this.panelGraficoPixel.add(contentPixel); contentPixel.setVisible(true); this.panelGraficoPixel.setVisible(true); }
From source file:com.mentor.questa.ucdb.jenkins.QuestaCoverageAction.java
private JFreeChart createBarChart(final StaplerRequest req, final CategoryDataset dataset, final String title) { JFreeChart chart = ChartFactory.createBarChart(title, //title null, //categoryaxislabel, null, //valueaxislabel dataset, //dataset PlotOrientation.HORIZONTAL, //orientation false, //legend true, //tooltips false //urls );//from ww w . j a v a 2s. com // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... chart.setBackgroundPaint(Color.white); final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(null); plot.setForegroundAlpha(0.8f); final BarRenderer cir = new BarRenderer() { private final Paint[] colors = { Color.red, Color.blue, Color.green, Color.yellow, Color.orange, Color.cyan, Color.magenta, Color.blue }; /** * Returns the paint for an item. Overrides the default behavior * inherited from AbstractSeriesRenderer. * * @param row the series. * @param column the category. * * @return The item color. */ @Override public Paint getItemPaint(final int row, final int column) { return colors[column % colors.length]; } }; cir.setMaximumBarWidth(0.35); plot.setRenderer(cir); // crop extra space around the graph plot.setInsets(new RectangleInsets(0, 0, 0, 5.0)); return chart; }
From source file:org.zaproxy.zap.extension.customFire.ScanProgressDialog.java
/** * /* www .ja v a2 s.co m*/ */ private void initialize() { this.setSize(new Dimension(580, 504)); if (site != null) { this.setTitle("Scann Progress"); } JTabbedPane tabbedPane = new JTabbedPane(); JPanel tab1 = new JPanel(); tab1.setLayout(new GridBagLayout()); JPanel hostPanel = new JPanel(); hostPanel.setLayout(new GridBagLayout()); hostPanel.add(new JLabel("Host:"), LayoutHelper.getGBC(0, 0, 1, 0.4D)); hostPanel.add(getHostSelect(), LayoutHelper.getGBC(1, 0, 1, 0.6D)); tab1.add(hostPanel, LayoutHelper.getGBC(0, 0, 3, 1.0D, 0.0D)); tab1.add(getJScrollPane(), LayoutHelper.getGBC(0, 1, 3, 1.0D, 1.0D));//* tab1.add(new JLabel(), LayoutHelper.getGBC(0, 1, 1, 1.0D, 0.0D)); // spacer tab1.add(getCloseButton(), LayoutHelper.getGBC(1, 2, 1, 0.0D, 0.0D)); tab1.add(new JLabel(), LayoutHelper.getGBC(2, 1, 1, 1.0D, 0.0D)); // spacer tabbedPane.insertTab("Progress", null, tab1, null, 0); this.add(tabbedPane); int mins = extension.getScannerParam().getMaxChartTimeInMins(); if (mins > 0) { // Treat zero mins as disabled JPanel tab2 = new JPanel(); tab2.setLayout(new GridBagLayout()); this.seriesTotal = new TimeSeries("TotalResponses"); // Name not shown, so no need to i18n final TimeSeriesCollection dataset = new TimeSeriesCollection(this.seriesTotal); this.series100 = new TimeSeries("1xx"); this.series200 = new TimeSeries("2xx"); this.series300 = new TimeSeries("3xx"); this.series400 = new TimeSeries("4xx"); this.series500 = new TimeSeries("5xx"); this.seriesTotal.setMaximumItemAge(mins * 60); this.series100.setMaximumItemAge(mins * 60); this.series200.setMaximumItemAge(mins * 60); this.series300.setMaximumItemAge(mins * 60); this.series400.setMaximumItemAge(mins * 60); this.series500.setMaximumItemAge(mins * 60); dataset.addSeries(series100); dataset.addSeries(series200); dataset.addSeries(series300); dataset.addSeries(series400); dataset.addSeries(series500); chart = createChart(dataset);//* // Set up some vaguesly sensible colours chart.getXYPlot().getRenderer(0).setSeriesPaint(0, Color.BLACK); // Totals chart.getXYPlot().getRenderer(0).setSeriesPaint(1, Color.ORANGE); // 100: Info chart.getXYPlot().getRenderer(0).setSeriesPaint(2, Color.GREEN); // 200: OK chart.getXYPlot().getRenderer(0).setSeriesPaint(3, Color.BLUE); // 300: Info chart.getXYPlot().getRenderer(0).setSeriesPaint(4, Color.YELLOW); // 400: Bad req chart.getXYPlot().getRenderer(0).setSeriesPaint(5, Color.RED); // 500: Internal error chart.getXYPlot().getRenderer(0).setSeriesStroke(0, new BasicStroke(5.0f)); // Totals chart.getXYPlot().getRenderer(0).setSeriesStroke(0, new BasicStroke(3.0f)); // 100: Info chart.getXYPlot().getRenderer(0).setSeriesStroke(0, new BasicStroke(3.0f)); // 200: OK chart.getXYPlot().getRenderer(0).setSeriesStroke(0, new BasicStroke(3.0f)); // 300: Info chart.getXYPlot().getRenderer(0).setSeriesStroke(0, new BasicStroke(3.0f)); // 400: Bad req chart.getXYPlot().getRenderer(0).setSeriesStroke(0, new BasicStroke(3.0f)); // 500: Internal error final ChartPanel chartPanel = new ChartPanel(chart); tab2.add(chartPanel, LayoutHelper.getGBC(0, 0, 1, 1.0D, 1.0D)); tabbedPane.insertTab("ResponseCharts", null, tab2, null, 1); } // Stop the updating thread when the window is closed this.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { stopThread = true; } }); }
From source file:tauargus.gui.PanelTable.java
private Color getBackgroundColor(Cell cell, Code code) { if (tableSet.hasBeenAudited) { //adapt background color if audit is not OK if (cell.status.isPrimaryUnsafe()) { if ((cell.response == cell.realizedLower) && (cell.response == cell.realizedUpper)) { return Color.orange; } //exact if ((cell.response + cell.upper) > cell.realizedUpper) { return Color.getHSBColor(255, 100, 100); }//from ww w. ja v a2 s .com if ((cell.response + cell.lower) < cell.realizedLower) { return Color.getHSBColor(255, 100, 100); } return getBackgroundColor(code); } else { return getBackgroundColor(code); } // if (cell.status.isUnsafe() && cell.auditOk) { // if (cell.status.isPrimaryUnsafe()) { // return Color.red; // } else { // return Color.orange; // } } else { return getBackgroundColor(code); } }
From source file:com.view.TimeSeriesChartView.java
public JFreeChart getTimeSeriesChart(Excel theExcel, ReceivingControl theRC) { System.out.println(theRC.getNumberOfItem()); System.out.println(theRC.getNumberOfSite()); System.out.println(theRC.getNumberOfVendor()); System.out.println(theRC.getVendorInfo()); System.out.println(theRC.getSiteInfo()); System.out.println(theRC.getItemInfo()); // TimeSeries item1_xy_data = new TimeSeries("Item1"); // TimeSeries item2_xy_data = new TimeSeries("Item2"); // TimeSeries item3_xy_data = new TimeSeries("Item3"); ArrayList<Receiving> theReceiving = theExcel.getSheetReceiving(); // HashMap<Month, Integer> item1Map = new HashMap<>(); // HashMap<Month, Integer> item2Map = new HashMap<>(); // HashMap<Month, Integer> item3Map = new HashMap<>(); TimeSeries data[] = new TimeSeries[theRC.getNumberOfItem()]; HashMap<Month, Integer> itemMap[] = new HashMap[theRC.getNumberOfItem()]; for (int i = 0; i < theRC.getNumberOfItem(); i++) { String itemName = "item" + i; data[i] = new TimeSeries(itemName); itemMap[i] = new HashMap<>(); }//from ww w .j a v a2 s . c om Calendar cal = Calendar.getInstance(); for (int i = 0; i < theReceiving.size(); i++) { cal.setTime(theReceiving.get(i).getDate()); int month = cal.get(Calendar.MONTH) + 1; int year = cal.get(Calendar.YEAR); int quantity = theReceiving.get(i).getQuantity(); Month theMonth = new Month(month, year); int itemNum = theReceiving.get(i).getItem() - 1; itemMap[itemNum].put(theMonth, updateItemMap(itemMap[itemNum], theMonth, quantity)); // if (theReceiving[i].getItem() == 1) // { // item1Map.put(theMonth, updateItemMap(item1Map, theMonth, quantity)); // } // else if (theReceiving[i].getItem() == 2) // { // item2Map.put(theMonth, updateItemMap(item2Map, theMonth, quantity)); // } // else if (theReceiving[i].getItem() == 3) // { // item3Map.put(theMonth, updateItemMap(item3Map, theMonth, quantity)); // } } TimeSeriesCollection my_data_series = new TimeSeriesCollection(); for (int i = 0; i < theRC.getNumberOfItem(); i++) { for (Map.Entry<Month, Integer> entry : itemMap[i].entrySet()) { data[i].add(entry.getKey(), entry.getValue()); } my_data_series.addSeries(data[i]); } // add series using addSeries method // my_data_series.addSeries(item1_xy_data); // my_data_series.addSeries(item2_xy_data); // my_data_series.addSeries(item3_xy_data); JFreeChart chart = ChartFactory.createTimeSeriesChart("Receiving", "Month", "Quantity", my_data_series, true, true, false); chart.setBackgroundPaint(Color.YELLOW); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.GREEN); plot.setRangeGridlinePaint(Color.orange); plot.setAxisOffset(new RectangleInsets(50, 0, 20, 5)); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); renderer.setBaseShapesVisible(true); renderer.setBaseShapesFilled(true); DateAxis axis = (DateAxis) plot.getDomainAxis(); axis.setDateFormatOverride(new SimpleDateFormat("MM.yyyy")); return chart; }
From source file:Bouncer.java
protected void setPaint(Graphics2D g2) { if (mGradient) { GradientPaint gp = new GradientPaint(0, 0, Color.yellow, 50, 25, Color.red, true); g2.setPaint(gp);//from w w w . ja v a 2s .c o m } else g2.setPaint(Color.orange); }