Example usage for java.awt Color blue

List of usage examples for java.awt Color blue

Introduction

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

Prototype

Color blue

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

Click Source Link

Document

The color blue.

Usage

From source file:rod_design_compute.ShowPanel.java

public ShowPanel(MainFrame parent) {
    initComponents();// www.j av a 2s  . c o  m
    setBackground(Color.white);
    setBorder(BorderFactory.createLineBorder(Color.blue, (int) 2.0));
    this.parent = parent;
    originX = 100;
    originY = 560 - 100;
    ratio = 1.0;
    radiusBase = 5;
    lengthSlider = 200;
    lengthBlock = 50;
    radiusBaseDefault = 5;
    lengthSliderDefault = 200;
    lengthBlockDefault = 50;
    minDistance = 15;
    jLabelThu.setOpaque(true);
}

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

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

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", Integer.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(/*ww w. ja v a  2 s . com*/
                    cht.xyLineChart().setXValue(column1).series(cht.xySerie(column2)).setShowShapes(false)
                            .setShowLines(false),
                    cht.xyLineChart().setXValue(column1).series(cht.xySerie(column2))
                            .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)),
                    cht.xyLineChart().setXValue(column1).series(cht.xySerie(column2))
                            .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).setRangeMinValueExpression(1)
                                    .setRangeMaxValueExpression(15)));
}

From source file:Branch.java

public void init() {
    Container cp = getContentPane();
    root = new DefaultMutableTreeNode("root");
    tree = new JTree(root);
    // Add it and make it take care of scrolling:
    cp.add(new JScrollPane(tree), BorderLayout.CENTER);
    // Capture the tree's model:
    model = (DefaultTreeModel) tree.getModel();
    JButton test = new JButton("Press me");
    test.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (i < data.length) {
                child = new Branch(data[i++]).node();
                // What's the last one you clicked?
                chosen = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
                if (chosen == null)
                    chosen = root;/*from w  ww .  ja v a2  s  .  c o  m*/
                // The model will create the appropriate event.
                // In response, the tree will update itself:
                model.insertNodeInto(child, chosen, 0);
                // Puts the new node on the chosen node.
            }
        }
    });
    // Change the button's colors:
    test.setBackground(Color.BLUE);
    test.setForeground(Color.WHITE);
    JPanel p = new JPanel();
    p.add(test);
    cp.add(p, BorderLayout.SOUTH);
}

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

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

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", Integer.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(/*from  w  w w  .j a va 2  s .  com*/
                    cht.scatterChart().setXValue(column1)
                            .series(cht.xySerie(column2), cht.xySerie(column1).setXValue(column2))
                            .setShowShapes(false).setShowLines(false),
                    cht.scatterChart().setXValue(column1).series(cht.xySerie(column2))
                            .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)),
                    cht.scatterChart().setXValue(column1).series(cht.xySerie(column2))
                            .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:wsattacker.plugin.intelligentdos.ui.helper.ChartHelper.java

public static JFreeChart createOverlaidChart(SuccessfulAttack sa) {

    // create subplot 1...
    final XYSeries data1 = createDatasetResponseTime(RequestType.UNTAMPERED, sa.getUntamperedMetrics());
    final XYSeries data2 = createDatasetResponseTime(RequestType.TAMPERED, sa.getTamperedMetrics());
    final XYSeries data3 = createDatasetResponseTime(RequestType.TESTPROBES, sa.getTestProbes());

    final XYSeriesCollection collection = new XYSeriesCollection();
    collection.addSeries(data1);// w w  w. j ava2  s .  c om
    collection.addSeries(data2);
    collection.addSeries(data3);

    final XYItemRenderer renderer = new StandardXYItemRenderer();
    final NumberAxis rangeAxis1 = new NumberAxis("duration in ms");
    final XYPlot plot = new XYPlot(collection, new NumberAxis(""), rangeAxis1, renderer);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    renderer.setSeriesPaint(0, Color.GREEN);
    renderer.setSeriesPaint(1, Color.RED);
    renderer.setSeriesPaint(2, Color.BLUE);

    // return a new chart containing the overlaid plot...
    return new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
}

From source file:org.jfree.chart.demo.XYAreaChartDemo1.java

private static JFreeChart createChart(XYDataset xydataset) {
    JFreeChart jfreechart = ChartFactory.createXYAreaChart("XY Area Chart Demo", "Domain (X)", "Range (Y)",
            xydataset, PlotOrientation.VERTICAL, true, true, false);
    jfreechart.setBackgroundPaint(Color.white);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setForegroundAlpha(0.65F);/*from  w  ww.ja  va  2s .c o m*/
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    ValueAxis valueaxis = xyplot.getDomainAxis();
    valueaxis.setTickMarkPaint(Color.black);
    valueaxis.setLowerMargin(0.0D);
    valueaxis.setUpperMargin(0.0D);
    ValueAxis valueaxis1 = xyplot.getRangeAxis();
    valueaxis1.setTickMarkPaint(Color.black);
    XYPointerAnnotation xypointerannotation = new XYPointerAnnotation("Test", 5D, -500D, 2.3561944901923448D);
    xypointerannotation.setTipRadius(0.0D);
    xypointerannotation.setBaseRadius(35D);
    xypointerannotation.setFont(new Font("SansSerif", 0, 9));
    xypointerannotation.setPaint(Color.blue);
    xypointerannotation.setTextAnchor(TextAnchor.HALF_ASCENT_RIGHT);
    xyplot.addAnnotation(xypointerannotation);
    return jfreechart;
}

From source file:org.jfree.chart.demo.XYBarChartDemo4.java

/**
 * Constructs the demo application.// www  .  ja va2  s .c  om
 *
 * @param title  the frame title.
 */
public XYBarChartDemo4(final String title) {

    super(title);

    final IntervalXYDataset dataset = createDataset();

    final JFreeChart chart = ChartFactory.createXYBarChart(title, "X", false, "Y", dataset,
            PlotOrientation.VERTICAL, true, false, false);

    // then customise it a little...
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.blue));
    final XYPlot plot = (XYPlot) chart.getPlot();
    final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    // add the chart to a panel...
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 300));
    setContentPane(chartPanel);

}

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

@Override
protected void configureReport(JasperReportBuilder rb) {
    FieldBuilder<String> column1 = field("field1", String.class);
    TextColumnBuilder<Integer> column2 = col.column("Column2", "field2", Integer.class);

    rb.summary(cmp.horizontalList(/*  w  w w  . j ava 2s  .co m*/
            cht.spiderChart().setCategory(column1).series(cht.serie(column2)).setMaxValue(10d)
                    .setRotation(SpiderRotation.ANTICLOCKWISE).setTableOrder(TableOrder.BY_COLUMN)
                    .setWebFilled(false).setStartAngle(20d).setHeadPercent(30d).setInteriorGap(0.15d)
                    .setAxisLineColor(Color.RED).setAxisLineWidth(2f).setLabelColor(Color.BLUE).setLabelGap(2d)
                    .setLabelFont(stl.font().bold()),
            cht.spiderChart().setCategory(column1).series(cht.serie(column2)).setTitle("title")
                    .setSubtitle("subtitle")));
}

From source file:de.berlios.statcvs.xml.chart.AbstractTimeSeriesChart.java

/**
 * @param filename//from ww  w.  ja  va 2 s  . co m
 * @param title
 */
public AbstractTimeSeriesChart(ReportSettings settings, String filename, String title, String rangeLabel) {
    super(settings, filename, title);

    tsc = new TimeSeriesCollection();

    setChart(ChartFactory.createTimeSeriesChart(settings.getProjectName(), I18n.tr("Date"), rangeLabel, tsc,
            true, true, false));

    //Paint[] colors = new Paint[1];
    //colors[0] = Color.blue;
    //getChart().getPlot().setSeriesPaint(colors);

    // setup axis
    XYPlot plot = getChart().getXYPlot();
    ValueAxis axis = plot.getDomainAxis();
    axis.setVerticalTickLabels(true);
    plot.setRenderer(new XYStepRenderer());

    // the 4th color is yellow which has almost no contrast to the white 
    // background color, therefore we use a different color
    plot.getRenderer().setSeriesPaint(0, Color.red);
    plot.getRenderer().setSeriesPaint(1, Color.blue);
    plot.getRenderer().setSeriesPaint(2, Color.green);
    plot.getRenderer().setSeriesPaint(3, Color.magenta);
    plot.getRenderer().setSeriesPaint(4, Color.orange);
    plot.getRenderer().setSeriesPaint(5, Color.cyan);
    plot.getRenderer().setSeriesPaint(6, Color.pink);
}

From source file:com.ouc.cpss.view.SupTradeChartBuilder.java

private static JFreeChart createJFreeChart(PieDataset dataset) {
    /**//  w w w .j av a2s  . com
     * JFreeChart
     */
    //?     
    StandardChartTheme standardChartTheme = new StandardChartTheme("CN");
    //     
    standardChartTheme.setExtraLargeFont(new Font("", Font.BOLD, 20));
    //    
    standardChartTheme.setRegularFont(new Font("", Font.PLAIN, 15));
    //?     
    standardChartTheme.setLargeFont(new Font("", Font.PLAIN, 15));
    //?   
    ChartFactory.setChartTheme(standardChartTheme);
    //??  
    //createPieChart 2D; createPieChart3D  3D
    JFreeChart chart = ChartFactory.createPieChart("", dataset, true, true, false);

    //,?
    chart.setTitle(new TextTitle("", new Font("", Font.ITALIC, 22)));

    //?
    LegendTitle legend = chart.getLegend(0);
    //,ture,?
    legend.setItemFont(new Font("", Font.BOLD, 20));

    //?(??)
    PiePlot plot = (PiePlot) chart.getPlot();
    //?==?
    plot.setLabelFont(new Font("", Font.BOLD, 22));
    //
    plot.setBaseSectionOutlinePaint(Color.BLUE);
    //
    plot.setBaseSectionOutlineStroke(new BasicStroke(0.5f));
    //?,??,??
    plot.setDirection(Rotation.CLOCKWISE);//,Rotation.CLOCKWISE
    //()
    plot.setStartAngle(70);
    //???
    //plot.setExplodePercent(1, 0.5D);
    //plot.setExplodePercent("One", 0.5D);
    //,3D?
    plot.setExplodePercent(dataset.getKey(0), 0.1d);
    //
    plot.setLabelLinkPaint(Color.BLUE);
    //
    plot.setLabelOutlinePaint(Color.black);
    //
    plot.setLabelShadowPaint(Color.RED);
    //
    plot.setSectionPaint(1, Color.BLACK);
    // :,{0},{1},{2}?,???
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}:{1}\r\n{2}",
            NumberFormat.getNumberInstance(), new DecimalFormat("0.00%")));

    //
    plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0}={2}"));
    //:(true),(false)
    plot.setCircular(true);
    //?
    plot.setNoDataMessage("??...");

    //???
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());
    //
    //plot.setURLGenerator(new StandardPieURLGenerator("detail.jsp"));

    return chart;
}