List of usage examples for java.awt Color blue
Color blue
To view the source code for java.awt Color blue.
Click Source Link
From source file:ta4jexamples.analysis.CashFlowToChart.java
/** * Adds the cash flow axis to the plot.//w w w.ja v a 2 s. c om * @param plot the plot * @param dataset the cash flow dataset */ private static void addCashFlowAxis(XYPlot plot, TimeSeriesCollection dataset) { final NumberAxis cashAxis = new NumberAxis("Cash Flow Ratio"); cashAxis.setAutoRangeIncludesZero(false); plot.setRangeAxis(1, cashAxis); plot.setDataset(1, dataset); plot.mapDatasetToRangeAxis(1, 1); final StandardXYItemRenderer cashFlowRenderer = new StandardXYItemRenderer(); cashFlowRenderer.setSeriesPaint(0, Color.blue); plot.setRenderer(1, cashFlowRenderer); }
From source file:ar.com.fdvs.dj.test.StylesReport2Test.java
public DynamicReport buildReport() throws Exception { // Style detailStyle = new Style(); Style detailStyle = new StyleBuilder(false).setTransparency(Transparency.OPAQUE) .setBackgroundColor(new Color(200, 200, 230)).build(); Style headerStyle = new Style(); headerStyle.setFont(Font.ARIAL_MEDIUM_BOLD); headerStyle.getFont().setItalic(true); headerStyle.setBorderTop(Border.PEN_2_POINT); headerStyle.setBorderBottom(Border.THIN); headerStyle.setBackgroundColor(Color.blue); headerStyle.setTransparency(Transparency.OPAQUE); headerStyle.setTextColor(Color.white); headerStyle.setHorizontalAlign(HorizontalAlign.CENTER); headerStyle.setVerticalAlign(VerticalAlign.MIDDLE); headerStyle.setRotation(Rotation.LEFT); Style titleStyle = new Style(); titleStyle.setFont(new Font(10, Font._FONT_VERDANA, true)); Style numberStyle = new Style(); numberStyle.setHorizontalAlign(HorizontalAlign.RIGHT); Style amountStyle = new Style(); amountStyle.setHorizontalAlign(HorizontalAlign.RIGHT); amountStyle.setBackgroundColor(Color.cyan); amountStyle.setTransparency(Transparency.OPAQUE); amountStyle.setFont(Font.ARIAL_MEDIUM_BOLD); amountStyle.getFont().setUnderline(true); amountStyle.setPaddingBottom(new Integer(5)); Style oddRowStyle = new Style(); oddRowStyle.setBorder(Border.NO_BORDER); Color veryLightGrey = new Color(230, 230, 230); oddRowStyle.setBackgroundColor(veryLightGrey); oddRowStyle.setTransparency(Transparency.OPAQUE); Style variableStyle = new Style(); BeanUtils.copyProperties(variableStyle, amountStyle); variableStyle.setFont(Font.ARIAL_MEDIUM_BOLD); variableStyle.setBackgroundColor(Color.PINK); Style variableStyle2 = new Style(); BeanUtils.copyProperties(variableStyle2, amountStyle); variableStyle2.setFont(Font.ARIAL_MEDIUM_BOLD); variableStyle2.setBackgroundColor(Color.ORANGE); DynamicReportBuilder drb = new DynamicReportBuilder(); Integer margin = new Integer(20); drb.setTitle("November 2006 sales report") //defines the title of the report .setSubtitle("The items in this report correspond " + "to the main products: DVDs, Books, Foods and Magazines") .setTitleStyle(titleStyle).setTitleHeight(new Integer(30)) .setDefaultStyles(null, null, null, detailStyle).setSubtitleHeight(new Integer(20)) .setDetailHeight(new Integer(15)) // .setLeftMargin(margin) // .setRightMargin(margin) // .setTopMargin(margin) // .setBottomMargin(margin) .setPrintBackgroundOnOddRows(true).setOddRowBackgroundStyle(oddRowStyle) .setColumnsPerPage(new Integer(1)).setColumnSpace(new Integer(5)); AbstractColumn columnState = ColumnBuilder.getNew().setColumnProperty("state", String.class.getName()) .setTitle("State").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle) .build();//from w w w .ja v a2 s. co m AbstractColumn columnBranch = ColumnBuilder.getNew().setColumnProperty("branch", String.class.getName()) .setTitle("Branch").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle) .build(); AbstractColumn columnaProductLine = ColumnBuilder.getNew() .setColumnProperty("productLine", String.class.getName()).setTitle("Product Line") .setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle).build(); AbstractColumn columnaItem = ColumnBuilder.getNew().setColumnProperty("item", String.class.getName()) .setTitle("item").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle) .build(); AbstractColumn columnCode = ColumnBuilder.getNew().setColumnProperty("id", Long.class.getName()) .setTitle("ID").setWidth(new Integer(40)).setStyle(numberStyle).setHeaderStyle(headerStyle).build(); AbstractColumn columnaCantidad = ColumnBuilder.getNew().setColumnProperty("quantity", Long.class.getName()) .setTitle("Quantity").setWidth(new Integer(80)).setStyle(numberStyle).setHeaderStyle(headerStyle) .build(); AbstractColumn columnAmount = ColumnBuilder.getNew().setColumnProperty("amount", Float.class.getName()) .setTitle("Amount").setWidth(new Integer(90)).setPattern("$ 0.00").setStyle(amountStyle) .setHeaderStyle(headerStyle).build(); drb.addColumn(columnState); drb.addColumn(columnaItem); drb.addColumn(columnBranch); drb.addColumn(columnaProductLine); drb.addColumn(columnCode); drb.addColumn(columnaCantidad); drb.addColumn(columnAmount); DJGroup group = new GroupBuilder().setCriteriaColumn((PropertyColumn) columnState) .addFooterVariable(columnAmount, DJCalculation.SUM, variableStyle).build(); drb.addGroup(group); DJGroup group2 = new GroupBuilder().setCriteriaColumn((PropertyColumn) columnaItem) .addFooterVariable(columnAmount, DJCalculation.SUM).build(); drb.addGroup(group2); group2.setDefaulFooterVariableStyle(variableStyle2); drb.setUseFullPageWidth(true); DynamicReport dr = drb.build(); // saveXML(dr,"dynamicReport"); return dr; }
From source file:org.rioproject.examples.hospital.ui.PatientStatsPanel.java
public PatientStatsPanel() { super(new BorderLayout(8, 8)); setBorder(BorderFactory.createEmptyBorder(2, 8, 8, 8)); patientLabel = new JLabel(getLabelText(null)); add(patientLabel, BorderLayout.NORTH); pulseTimeSeries.setMaximumItemAge(5 * MINUTE); temperatureTimeSeries.setMaximumItemAge(5 * MINUTE); TimeSeriesCollection pulseDataSet = new TimeSeriesCollection(pulseTimeSeries); TimeSeriesCollection temperatureDataSet = new TimeSeriesCollection(temperatureTimeSeries); JFreeChart pulseChart = createTimeSeriesChart(pulseDataSet, Color.RED); JFreeChart temperatureChart = createTimeSeriesChart(temperatureDataSet, Color.BLUE); JPanel chartPanel = new JPanel(new GridLayout(1, 2)); chartPanel.add(makeChartPanel(pulseChart)); chartPanel.add(makeChartPanel(temperatureChart)); add(chartPanel, BorderLayout.CENTER); scheduler = Executors.newSingleThreadScheduledExecutor(); scheduler.scheduleAtFixedRate(new FeederTask(), 0, 2, TimeUnit.SECONDS); }
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 {//from w w w . j a v a2s .c o m 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:net.sf.dynamicreports.test.jasper.chart.Bar3DChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(//w w w . java2 s . c o m cht.bar3DChart().setCategory(column1).series(cht.serie(column2)).setShowLabels(true) .setXOffset(2d).setYOffset(3d), cht.bar3DChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category") .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.bar3DChart().setCategory(column1).series(cht.serie(column2)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15))); }
From source file:net.sf.dynamicreports.test.jasper.chart.BarChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(//from w ww.j a v a 2 s. c om cht.barChart().setCategory(column1).series(cht.serie(column2)).setShowLabels(true) .setShowTickLabels(false).setShowTickMarks(false), cht.barChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category") .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.barChart().setCategory(column1).series(cht.serie(column2)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15))); }
From source file:net.sf.dynamicreports.test.jasper.chart.LineChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(//from w w w. j a va2 s.c o m cht.lineChart().setCategory(column1).series(cht.serie(column2)).setShowShapes(false) .setShowLines(false), cht.lineChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category") .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.lineChart().setCategory(column1).series(cht.serie(column2)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15))); }
From source file:ChartUsingJava.CombinedXYPlotDemo1.java
/** * Creates an overlaid chart./* w ww. jav a2 s . c o m*/ * * @return The chart. */ private static JFreeChart createCombinedChart() { // create plot ... IntervalXYDataset data1 = createDataset1(); XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false); renderer1.setBaseToolTipGenerator( new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00"))); renderer1.setSeriesStroke(0, new BasicStroke(4.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL)); renderer1.setSeriesPaint(0, Color.blue); DateAxis domainAxis = new DateAxis("Year"); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.02); ValueAxis rangeAxis = new NumberAxis("$billion"); XYPlot plot1 = new XYPlot(data1, null, rangeAxis, renderer1); plot1.setBackgroundPaint(Color.lightGray); plot1.setDomainGridlinePaint(Color.white); plot1.setRangeGridlinePaint(Color.white); // add a second dataset and renderer... IntervalXYDataset data2 = createDataset2(); XYBarRenderer renderer2 = new XYBarRenderer() { public Paint getItemPaint(int series, int item) { XYDataset dataset = getPlot().getDataset(); if (dataset.getYValue(series, item) >= 0.0) { return Color.red; } else { return Color.green; } } }; renderer2.setSeriesPaint(0, Color.red); renderer2.setDrawBarOutline(false); renderer2.setBaseToolTipGenerator( new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00"))); XYPlot plot2 = new XYPlot(data2, null, new NumberAxis("$billion"), renderer2); plot2.setBackgroundPaint(Color.lightGray); plot2.setDomainGridlinePaint(Color.white); plot2.setRangeGridlinePaint(Color.white); CombinedXYPlot cplot = new CombinedXYPlot(domainAxis, rangeAxis); cplot.add(plot1, 3); cplot.add(plot2, 2); cplot.setGap(8.0); cplot.setDomainGridlinePaint(Color.white); cplot.setDomainGridlinesVisible(true); // return a new chart containing the overlaid plot... JFreeChart chart = new JFreeChart("CombinedXYPlotDemo1", JFreeChart.DEFAULT_TITLE_FONT, cplot, false); chart.setBackgroundPaint(Color.white); LegendTitle legend = new LegendTitle(cplot); chart.addSubtitle(legend); return chart; }
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 2 s. co 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:net.sf.dynamicreports.test.jasper.chart.StackedBarChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(/*from w w w . ja v a 2s. c o m*/ cht.stackedBarChart().setCategory(column1).series(cht.serie(column2)).setShowLabels(true) .setShowTickLabels(false).setShowTickMarks(false), cht.stackedBarChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category") .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.stackedBarChart().setCategory(column1).series(cht.serie(column2)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15))); }