Example usage for java.awt Color LIGHT_GRAY

List of usage examples for java.awt Color LIGHT_GRAY

Introduction

In this page you can find the example usage for java.awt Color LIGHT_GRAY.

Prototype

Color LIGHT_GRAY

To view the source code for java.awt Color LIGHT_GRAY.

Click Source Link

Document

The color light gray.

Usage

From source file:net.sf.dynamicreports.test.jasper.chart.StackedBar3DChartTest.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  .j  ava 2  s.c o  m
                    cht.stackedBar3DChart().setCategory(column1).series(cht.serie(column2)).setShowLabels(true)
                            .setXOffset(2d).setYOffset(3d),
                    cht.stackedBar3DChart().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.stackedBar3DChart().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:org.jfree.chart.demo.selection.SelectionDemo7ScatterRenderer.java

/**
 * Creates a chart./*  w  w w  .j  ava 2  s . co  m*/
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private static JFreeChart createChart(final MultiValueCategoryDataset dataset,
        final DatasetSelectionExtension<CategoryCursor<String, String>> ext) {

    ScatterRenderer r = new ScatterRenderer();
    CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), r);
    plot.setBackgroundColor(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(4, 4, 4, 4));
    JFreeChart chart = new JFreeChart("ScatterRendererDemo1", plot);
    ChartUtilities.applyCurrentTheme(chart);

    //register the plot
    ext.addChangeListener(plot);

    //illustrates the usage of a shape item rendering strategy
    final CategoryCursor<String, String> cursor = new CategoryCursor<String, String>();
    r.setShapeIRS(new DefaultShapeIRS(r) {
        private static final long serialVersionUID = 1L;

        @Override
        public Shape getItemShape(int row, int column) {
            cursor.setPosition((String) dataset.getRowKey(row), (String) dataset.getColumnKey(column));
            if (ext.isSelected(cursor)) {
                return new Rectangle2D.Double(-10.0, -10.0, 20.0, 20.0);
            } else {
                return super.getItemShape(row, column);
            }
        }
    });

    return chart;
}

From source file:com.googlecode.logVisualizer.chart.ConsumptionBarChart.java

@Override
protected ChartPanel createChartPanel() {
    final ChartPanel panel = super.createChartPanel();
    final CategoryPlot plot = (CategoryPlot) panel.getChart().getPlot();
    final StackedBarRenderer renderer = (StackedBarRenderer) plot.getRenderer();
    final CategoryDataset dataset = plot.getDataset();

    for (int i = 0; i < dataset.getRowCount(); i++)
        if (dataset.getRowKey(i).equals("Food"))
            renderer.setSeriesPaint(i, new Color(255, 80, 80));
        else if (dataset.getRowKey(i).equals("Booze"))
            renderer.setSeriesPaint(i, new Color(100, 100, 255));
        else if (dataset.getRowKey(i).equals("Spleen"))
            renderer.setSeriesPaint(i, new Color(80, 255, 80));
        else if (dataset.getRowKey(i).equals("Other"))
            renderer.setSeriesPaint(i, Color.LIGHT_GRAY);

    return panel;
}

From source file:net.sf.dynamicreports.test.jasper.chart.TimeSeriesChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<Date> column1;
    TextColumnBuilder<Timestamp> column2;
    TextColumnBuilder<Integer> column3;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", Date.class),
            column2 = col.column("Column2", "field2", Timestamp.class),
            column3 = col.column("Column3", "field3", Integer.class))
            .summary(//from  w ww.  ja va 2s  .  c o  m
                    cht.timeSeriesChart().setTimePeriod(column1).series(cht.serie(column3))
                            .setTimePeriodType(TimePeriod.DAY).setShowShapes(false).setShowLines(false),
                    cht.timeSeriesChart().setTimePeriod(column1).series(cht.serie(column3))
                            .setTimeAxisFormat(cht.axisFormat().setLabel("time").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)
                                    .setVerticalTickLabels(true)),
                    cht.timeSeriesChart().setTimePeriod(column2).series(cht.serie(column3))
                            .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).setVerticalTickLabels(true)));
}

From source file:net.sf.profiler4j.console.MemoryPlotPanel.java

public MemoryPlotPanel(int maxAge, String title) {
    super(new BorderLayout());

    totalSeries = new TimeSeries("Committed Memory", Millisecond.class);
    totalSeries.setMaximumItemAge(maxAge);
    usedSeries = new TimeSeries("Used Memory", Millisecond.class);
    usedSeries.setMaximumItemAge(maxAge);
    TimeSeriesCollection seriesCollection = new TimeSeriesCollection();
    seriesCollection.addSeries(totalSeries);
    seriesCollection.addSeries(usedSeries);

    NumberAxis numberAxis = new NumberAxis("Memory (KB)");
    numberAxis.setLabelFont(new Font("SansSerif", 0, 14));
    numberAxis.setTickLabelFont(new Font("SansSerif", 0, 12));
    numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    DateAxis dateAxis = new DateAxis("Time");
    dateAxis.setTickLabelFont(new Font("SansSerif", 0, 12));
    dateAxis.setLabelFont(new Font("SansSerif", 0, 14));
    dateAxis.setAutoRange(true);/*from  ww w. jav a2  s  . c  o  m*/
    dateAxis.setLowerMargin(0);
    dateAxis.setUpperMargin(0);
    dateAxis.setTickLabelsVisible(true);
    dateAxis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));

    XYLineAndShapeRenderer lineRenderer = new XYLineAndShapeRenderer(true, false);
    lineRenderer.setSeriesPaint(0, Color.RED);
    lineRenderer.setSeriesPaint(1, Color.GREEN.darker());
    lineRenderer.setStroke(new BasicStroke(2F, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));

    XYPlot xyplot = new XYPlot(seriesCollection, dateAxis, numberAxis, lineRenderer);
    xyplot.setBackgroundPaint(Color.WHITE);
    xyplot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    xyplot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D));

    JFreeChart chart = new JFreeChart(title, new Font("SansSerif", Font.PLAIN, 14), xyplot, true);
    chart.setBackgroundPaint(Color.white);

    ChartPanel panel = new ChartPanel(chart);
    panel.setBorder(createCompoundBorder(createEmptyBorder(8, 8, 8, 8), createLineBorder(Color.LIGHT_GRAY)));
    add(panel);
    setBorder(createEmptyBorder(8, 8, 8, 8));
}

From source file:net.sf.dynamicreports.test.jasper.chart.BubbleChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<Integer> column1;
    TextColumnBuilder<Integer> column2;
    TextColumnBuilder<Double> column3;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", Integer.class),
            column2 = col.column("Column2", "field2", Integer.class),
            column3 = col.column("Column3", "field3", Double.class))
            .summary(//w w w  .  j  a v  a  2 s  .c  om
                    cht.bubbleChart().setXValue(column1)
                            .series(cht.xyzSerie().setYValue(column2).setZValue(column3)
                                    .setSeries(exp.text("a")),
                                    cht.xyzSerie().setXValue(column2).setYValue(column1).setZValue(column3))
                            .setScaleType(ScaleType.ON_BOTH_AXES),
                    cht.bubbleChart().setXValue(column1)
                            .series(cht.xyzSerie().setYValue(column2).setZValue(column3))
                            .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)),
                    cht.bubbleChart().setXValue(column1)
                            .series(cht.xyzSerie().setYValue(column2).setZValue(column3))
                            .setYAxisFormat(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)));
}

From source file:net.sf.dynamicreports.test.jasper.chart.GroupedStackedBarChartTest.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 .  ja va2 s.  c  om
                    cht.groupedStackedBarChart().setCategory(column1)
                            .series(cht.groupedSerie(column2).setSeries(column1).setGroup(column1))
                            .setShowLabels(true).setShowTickLabels(false).setShowTickMarks(false),
                    cht.stackedBarChart().setCategory(column1)
                            .series(cht.groupedSerie(column2).setSeries(column1).setGroup(column1))
                            .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.groupedSerie(column2).setSeries(column1).setGroup(column1))
                            .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.LayeredBarChartTest.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.  ja  va  2s .c o m*/
                    cht.layeredBarChart().customizers(new ChartCustomizer()).setCategory(column1)
                            .series(cht.serie(column2)).setShowLabels(true).setShowTickLabels(false)
                            .setShowTickMarks(false),
                    cht.layeredBarChart().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.layeredBarChart().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:com.itemanalysis.jmetrik.graph.histogram.HistogramPanel.java

public void setGraph() {
    HistogramChartDataset dataset = null;
    dataset = new HistogramChartDataset();

    chart = HistogramChart.createHistogram(chartTitle, xlabel, //x-axis label
            ylabel, //y-axis label
            dataset, chartOrientation, hasGroupingVariable, //legend
            true, //tooltips
            false //urls
    );/*from ww  w  .  j a  v a  2  s .co  m*/

    if (chartSubtitle != null && !"".equals(chartSubtitle)) {
        TextTitle subtitle1 = new TextTitle();
        chart.addSubtitle(subtitle1);
    }

    XYPlot plot = (XYPlot) chart.getPlot();
    if (hasGroupingVariable)
        plot.setForegroundAlpha(0.80f);
    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    //next two lines are temp setting for book
    //these two lines will create a histogram with white bars so it appears as just the bar outline
    //        renderer.setBarPainter(new StandardXYBarPainter());
    //        renderer.setSeriesPaint(0, Color.white);

    ChartPanel panel = new ChartPanel(chart);
    panel.getPopupMenu().addSeparator();
    this.addJpgMenuItem(this, panel.getPopupMenu());
    panel.setPreferredSize(new Dimension(width, height));

    //        //temp setting for book
    //        this.addLocalEPSMenuItem(this, panel.getPopupMenu(), chart);//remove this line for public release versions

    chart.setPadding(new RectangleInsets(20.0, 5.0, 20.0, 5.0));
    this.setBackground(Color.WHITE);
    this.add(panel);

}

From source file:com.liud.dailynote.ThumbnailatorTest.java

public void testYS7() throws IOException {
    String result = "src/main/resources/images/";
    BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = bi.createGraphics();
    g.setColor(Color.LIGHT_GRAY);
    g.drawRect(0, 0, 10, 10);/*w w w .j av  a  2s .c  o m*/
    char[] data = "liudTest".toCharArray();
    g.drawChars(data, 0, data.length, 5, 32);

    // watermark ? 1.? 2.? 3.?
    Thumbnails.of(result + "sijili.jpg").scale(1.0f).watermark(Positions.CENTER, bi, 1.0f)
            .toFile(result + "image_warter_liud.jpg");
}