List of usage examples for java.awt Color YELLOW
Color YELLOW
To view the source code for java.awt Color YELLOW.
Click Source Link
From source file:classes.SharedClass.java
public void getStatistics() { result = db.select("member", new String[] { " count(id) id" }, new String[] { "id" }, new String[] { "99999" }, "!=", "and"); try {// w w w .ja va 2 s . com if (result.next()) { memberId = result.getInt("id"); } } catch (SQLException ex) { Logger.getLogger(SharedClass.class.getName()).log(Level.SEVERE, null, ex); ex.printStackTrace(); } //book result = db.select("book", new String[] { "count(id)" }, new String[] { "id" }, new String[] { "99999" }, "!=", "and"); try { if (result.next()) { bookId = result.getInt(1); } } catch (SQLException ex) { Logger.getLogger(SharedClass.class.getName()).log(Level.SEVERE, null, ex); } //operations result = db.select("operations", new String[] { "count(id)" }, new String[] { "type" }, new String[] { "borrowed" }, "=", "and"); try { if (result.next()) { operationsId = result.getInt(1); } } catch (SQLException ex) { Logger.getLogger(SharedClass.class.getName()).log(Level.SEVERE, null, ex); } DefaultCategoryDataset dataSet = new DefaultCategoryDataset(); dataSet.setValue(memberId, "Percent", "Members"); dataSet.setValue(bookId, "Percent", "Books"); dataSet.setValue(operationsId, "Percent", "Borrowe books"); JFreeChart chart = ChartFactory.createBarChart3D("Statistics", "Fields", "Percent", dataSet, PlotOrientation.VERTICAL, false, true, false); chart.setBackgroundPaint(Color.yellow); chart.getTitle().setPaint(Color.red); CategoryPlot plot = chart.getCategoryPlot(); plot.setRangeGridlinePaint(Color.blue); ChartFrame frame = new ChartFrame("Statistics", chart); frame.setLocationRelativeTo(null); frame.setSize(500, 550); frame.setVisible(true); }
From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.chartdemo.BasicExtXmlChartDemo.java
/** * Creates a sample chart./* w ww . j a v a2s.c om*/ * * @param dataset the dataset. * @return A chart. */ private JFreeChart createChart(final PieDataset dataset) { final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", // chart title dataset, // data true, // include legend true, false); // set the background color for the chart... chart.setBackgroundPaint(Color.yellow); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(270); // plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); return chart; }
From source file:net.sf.dynamicreports.test.jasper.chart.ChartSeriesColorsByNameTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<String> column2; TextColumnBuilder<Integer> column3; TextColumnBuilder<String> column4; TextColumnBuilder<Integer> column5; colors = new HashMap<String, Color>(); colors.put("a", Color.BLUE); colors.put("b", Color.YELLOW); colors.put("c", Color.GREEN); colors.put("d", Color.MAGENTA); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", String.class), column3 = col.column("Column3", "field3", Integer.class), column4 = col.column("Column4", "field4", String.class), column5 = col.column("Column5", "field5", Integer.class)) .summary(//from w w w .j av a2 s . co m cmp.horizontalList( cht.barChart().seriesColorsByName(colors).setCategory(column1) .series(cht.serie(column3).setSeries(column2)), cht.groupedStackedBarChart().seriesColorsByName(colors).setCategory(column1) .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))), cmp.horizontalList( cht.pieChart().seriesColorsByName(colors).setKey(column2).series(cht .serie(column3)), cht.xyBarChart().seriesColorsByName(colors).setXValue(column5) .series(cht.xySerie(column3).setSeries(column2))), cmp.horizontalList( cht.barChart() .setDataSource( new DRDataSource("field1", "field2", "field3", "field4", "field5")) .seriesColorsByName(colors).setCategory(column1) .series(cht.serie(column3).setSeries(column2)), cht.pieChart() .setDataSource( new DRDataSource("field1", "field2", "field3", "field4", "field5")) .seriesColorsByName(colors).setKey(column2).series(cht.serie(column3)), cht.xyBarChart() .setDataSource( new DRDataSource("field1", "field2", "field3", "field4", "field5")) .seriesColorsByName(colors).setXValue(column5) .series(cht.xySerie(column3).setSeries(column2)))); }
From source file:net.sf.dynamicreports.test.jasper.chart.MeterChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { Locale.setDefault(Locale.ENGLISH); rb.setLocale(Locale.ENGLISH).summary(cht.meterChart().setValue(field("field1", Integer.class)) .setDataRangeLowExpression(3).setDataRangeHighExpression(30).setValueColor(Color.BLUE) .setValueMask("#,###.0").setValueFont(stl.fontArial()).setShape(MeterShape.CIRCLE) .setMeterAngle(270).setUnits("units").setTickInterval(3d).setMeterBackgroundColor(Color.LIGHT_GRAY) .setNeedleColor(Color.CYAN).setTickColor(Color.MAGENTA).setTickLabelFont(stl.fontCourierNew()) .intervals(//w ww .j a v a2 s . c o m cht.meterInterval().setLabel("red").setAlpha(0.8).setBackgroundColor(Color.RED) .setDataRangeLowExpression(25).setDataRangeHighExpression(30), cht.meterInterval().setLabel("yellow").setAlpha(0.5).setBackgroundColor(Color.YELLOW) .setDataRangeLowExpression(20).setDataRangeHighExpression(25)), cht.meterChart().setValue(5).setShape(MeterShape.DIAL)); }
From source file:com.github.nbyl.xfdcontrol.plugins.notification.blink1.Blink1NotificationPlugin.java
@VisibleForTesting Color mapStatusToColor(JobStatus.Status status) { switch (status) { case SUCCESS: return Color.green; case TESTS_FAILING: return Color.YELLOW; case FAILED:/*from www. j a va2 s . co m*/ return Color.RED; } return Color.ORANGE; }
From source file:net.sf.dynamicreports.test.jasper.chart.ChartSeriesOrderTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<String> column2; TextColumnBuilder<Integer> column3; TextColumnBuilder<String> column4; colors = new HashMap<String, Color>(); colors.put("a", Color.BLUE); colors.put("b", Color.YELLOW); colors.put("c", Color.GREEN); colors.put("d", Color.MAGENTA); rb.setPageFormat(PageType.A3, PageOrientation.PORTRAIT) .columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", String.class), column3 = col.column("Column3", "field3", Integer.class), column4 = col.column("Column4", "field4", String.class)) .summary(/*from w w w .j a va 2s . c o m*/ cmp.horizontalList( cht.barChart().seriesColorsByName(colors).setSeriesOrderType(OrderType.ASCENDING) .setCategory(column1).series(cht.serie(column3).setSeries(column2)), cht.groupedStackedBarChart().seriesColorsByName(colors) .setSeriesOrderType(OrderType.ASCENDING).setCategory(column1) .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))), cmp.horizontalList(cht.barChart().seriesColorsByName(colors) .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1).series(cht .serie(column3).setSeries(column2)), cht.groupedStackedBarChart().seriesColorsByName(colors) .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1) .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))), cmp.horizontalList(cht.barChart().seriesColorsByName(colors) .setSeriesOrderBy(Arrays.asList("c", "b", "a", "d")).setCategory(column1) .series(cht.serie(column3).setSeries(column2)), cht.groupedStackedBarChart().seriesColorsByName(colors) .setSeriesOrderBy(Arrays.asList("c", "b", "a", "d")).setCategory(column1) .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))), cmp.horizontalList( cht.barChart().seriesColorsByName(colors).seriesOrderBy("c", "b", "a", "d") .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1) .series(cht.serie(column3).setSeries(column2)), cht.groupedStackedBarChart().seriesColorsByName(colors) .seriesOrderBy("c", "b", "a", "d").setSeriesOrderType(OrderType.DESCENDING) .setCategory(column1) .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))), cmp.horizontalList( cht.barChart().seriesColorsByName(colors).seriesOrderBy("c", "e", "d") .setCategory(column1).series(cht.serie(column3).setSeries(column2)), cht.barChart().seriesColorsByName(colors).seriesOrderBy("g", "e", "d") .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1) .series(cht.serie(column3).setSeries(column2)))); }
From source file:ch.epfl.lis.gnwgui.jungtransformers.NodeFillColorTransformer.java
/** * Constructor/*from w w w .j a va 2 s.c om*/ * @param pi */ public NodeFillColorTransformer(PickedInfo<V> pi) { pi_ = pi; defaultNodeColor = new Color(113, 153, 255); // Blue light pickedColor_ = Color.YELLOW; possibleNodeColor_ = new Color(255, 186, 0); // Orange solutionNodeColor_ = new Color(255, 70, 0); // Red // solutionNodeColor_ = new Color(170, 255, 170); // Pistachio }
From source file:trendgraph.XYLineChart_AWT.java
public XYLineChart_AWT(int yearStart, int yearEnd, String[] creditUnionName, String columnName) throws SQLException { super("Graph"); super.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.yearStart = yearStart; this.yearEnd = yearEnd; this.creditUnionName = creditUnionName; this.columnName = columnName; saveGraphButton = new JButton("Save Graph"); saveGraphButton.setBorderPainted(false); saveGraphButton.setFocusPainted(false); JFreeChart xylineChart = ChartFactory.createXYLineChart("CU Report", "Year (YYYY)", //X-axis columnName, //Y-axis (replace with columnName createDataset(), PlotOrientation.VERTICAL, true, true, false); ChartPanel chartPanel = new ChartPanel(xylineChart); chartPanel.setPreferredSize(new java.awt.Dimension(1000, 800)); //(x, y) final XYPlot plot = xylineChart.getXYPlot(); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesPaint(0, Color.RED); //can be GREEN, YELLOW, ETC. renderer.setSeriesStroke(0, new BasicStroke(3.0f)); //Font size renderer.setSeriesPaint(1, Color.BLUE); //can be GREEN, YELLOW, ETC. renderer.setSeriesStroke(1, new BasicStroke(3.0f)); //Font size renderer.setSeriesPaint(2, Color.GREEN); //can be GREEN, YELLOW, ETC. renderer.setSeriesStroke(2, new BasicStroke(3.0f)); //Font size renderer.setSeriesPaint(3, Color.yellow); //can be GREEN, YELLOW, ETC. renderer.setSeriesStroke(3, new BasicStroke(3.0f)); //Font size plot.setRenderer(renderer);/* ww w . j ava2s . c o m*/ chartPanel.setLayout(new FlowLayout(FlowLayout.TRAILING)); chartPanel.add(saveGraphButton); setContentPane(chartPanel); pack(); RefineryUtilities.centerFrameOnScreen(this); setVisible(true); saveGraphButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Rectangle rect = chartPanel.getBounds(); FileChooser chooser = new FileChooser(); //get chosen path and save the variable String path = chooser.getPath(); path = path.replace("\\", "/"); String format = "png"; String fileName = path + "." + format; BufferedImage captureImage = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_ARGB); chartPanel.paint(captureImage.getGraphics()); File file = new File(fileName); try { ImageIO.write(captureImage, format, file); //write data to file } catch (IOException ex) { Logger.getLogger(XYLineChart_AWT.class.getName()).log(Level.SEVERE, null, ex); } } }); }
From source file:org.jfree.chart.demo.PieChart3DDemo2.java
/** * Creates a new demo.//from ww w .ja v a 2 s . c o m * * @param title the frame title. */ public PieChart3DDemo2(final String title) { super(title); // create a dataset... final DefaultPieDataset data = new DefaultPieDataset(); data.setValue("Java", new Double(43.2)); data.setValue("Visual Basic", new Double(10.0)); data.setValue("C/C++", new Double(17.5)); data.setValue("PHP", new Double(32.5)); data.setValue("Perl", new Double(12.5)); // create the chart... final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 2", // chart title data, // data true, // include legend true, false); chart.setBackgroundPaint(Color.yellow); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(270); plot.setDirection(Rotation.ANTICLOCKWISE); plot.setForegroundAlpha(0.60f); plot.setInteriorGap(0.33); // add the chart to a panel... final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(chartPanel); final Rotator rotator = new Rotator(plot); rotator.start(); }
From source file:meter_rpm.Stackoverflow.java
private ChartPanel buildDialPlot(int minimumValue, int maximumValue, int majorTickGap) { DialPlot plot = new DialPlot(); plot.setView(0.0D, 0.0D, 1.0D, 1.0D); plot.setDataset(0, dataset0);//w w w. jav a 2s.co m plot.setDataset(1, dataset1); plot.setDialFrame(new StandardDialFrame()); DialTextAnnotation dialtextannotation = new DialTextAnnotation("RPM"); dialtextannotation.setFont(new Font("Dialog", 1, 12)); dialtextannotation.setRadius(0.69999999999999996D); plot.addLayer(dialtextannotation); // value indicator uses the real data set //plot.addLayer(new DialValueIndicator(0)); DialValueIndicator dialvalueindicator = new DialValueIndicator(0); dialvalueindicator.setFont(new Font("Dialog", Font.BOLD, 12)); dialvalueindicator.setOutlinePaint(Color.YELLOW); dialvalueindicator.setRadius(0.6D); dialvalueindicator.setAngle(-90D); dialvalueindicator.setTemplateValue(1000); plot.addLayer(dialvalueindicator); org.jfree.chart.plot.dial.DialPointer.Pin pin1 = new org.jfree.chart.plot.dial.DialPointer.Pin(1); pin1.setRadius(0.55000000000000004D); plot.addPointer(pin1); // needle uses constrained data set plot.addLayer(new DialPointer.Pointer(0)); StandardDialScale scale = new StandardDialScale(0d, 6000, -110, -320, majorTickGap, 4); scale.setTickRadius(0.88); scale.setTickLabelOffset(0.20); scale.setTickLabelFormatter(new DecimalFormat("####")); plot.addScale(0, scale); StandardDialScale standarddialscale1 = new StandardDialScale(0D, 30D, -120D, -300D, 5D, 4); standarddialscale1.setTickRadius(0.5D); standarddialscale1.setTickLabelOffset(0.14999999999999999D); standarddialscale1.setTickLabelFont(new Font("Dialog", 0, 10)); standarddialscale1.setMajorTickPaint(Color.RED); standarddialscale1.setMinorTickPaint(Color.RED); plot.addScale(1, standarddialscale1); plot.mapDatasetToScale(1, 1); JFreeChart jfreechart = new JFreeChart(plot); jfreechart.setTitle("ENGINE RPM & MANIFOLD PRESSURE"); ChartPanel chartpanel = new ChartPanel(jfreechart); chartpanel.setPreferredSize(new Dimension(400, 400)); return chartpanel; }