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:TelasBanzos.TelaRelatorioAproveitamento.java

/**
 * Creates new form TelaNovoOrcamento//  w  w w .  ja v  a 2s  .  c o m
 */
public TelaRelatorioAproveitamento() {
    initComponents();

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.setValue(80, "0", "Nota");
    dataset.setValue(70, "0", "Frequncia");

    JFreeChart chart = ChartFactory.createBarChart("Aproveitamento", "Aproveitamento", "", dataset,
            PlotOrientation.VERTICAL, false, true, false);

    //colocar cor nas barras
    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer render = (BarRenderer) plot.getRenderer();
    render.setSeriesPaint(0, Color.blue);

    ChartPanel myChartPanel = new ChartPanel(chart, true);
    pnGraf.add(myChartPanel);

    setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("BanzosIcon.png")));//para setar um icone na janela
}

From source file:Business.Chart.ChartBP.java

public ChartBP(final String applicationTitle, String chartTitle, HospitalWorkRequest workRequest) {
    super(applicationTitle);
    series6 = new TimeSeries("Blood Pressure");
    this.chartTitle = chartTitle;
    this.workRequest = workRequest;
    final XYDataset dataset1 = createDatasetBP(workRequest);
    final JFreeChart chart1 = createChart1(dataset1);
    final XYPlot plot = chart1.getXYPlot();
    HospitalWorkRequest hos1 = (HospitalWorkRequest) workRequest;
    int age = hos1.getPerson().getAge();
    int a = hos1.getPerson().getAboveBPMarker(age);
    int b = hos1.getPerson().getBelowBPMarker(age);
    ValueMarker valueMarker = new ValueMarker(a);
    valueMarker.setLabel("ALERT");
    valueMarker.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    valueMarker.setPaint(Color.blue);
    ValueMarker valueMarker1 = new ValueMarker(b);
    valueMarker1.setLabel("ALERT");
    valueMarker1.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    valueMarker1.setPaint(Color.BLUE);
    plot.addRangeMarker(valueMarker);//from   ww w .  j  ava  2s  . c om
    plot.addRangeMarker(valueMarker1);
}

From source file:Main.java

AnimatedImage() {
    super(60, 60, BufferedImage.TYPE_INT_RGB);
    frameGradient = new GradientPaint[6];
    for (int i = 0; i < frameGradient.length; i++) {
        frameGradient[i] = new GradientPaint(0f, (float) i, Color.BLUE, 0f, (float) i + 13, Color.RED, true);
    }/*from ww  w  .j a  v a  2s  .  c  o  m*/
}

From source file:dataminning2.Graphplot.java

protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    int w = getWidth();
    int h = getHeight();
    // Draw ordinate.
    g2.draw(new Line2D.Double(PAD, PAD, PAD, h - PAD));
    // Draw abcissa.
    g2.draw(new Line2D.Double(PAD, h - PAD, w - PAD, h - PAD));
    double xInc = (double) (w - 2 * PAD) / (data.length - 1);
    double scale = (double) (h - 2 * PAD) / 88;
    // Mark data points.
    g2.setPaint(Color.red);//from   www  .  j  a  v  a  2s  . com
    int length1 = 0;
    int length2 = data.length / 3;
    for (int i = 0; i < length2; i++) {
        double x = PAD + i * dataX[i];
        double y = h - PAD - scale * dataY[i];
        g2.fill(new Ellipse2D.Double(x - 2, y - 2, 4, 4));
    }
    g2.setPaint(Color.BLUE);
    int lengthnew = length1 + length2;
    length2 = length2 + lengthnew;
    for (int i = lengthnew; i < length2; i++) {
        double x = PAD + i * dataX[i];
        double y = h - PAD - scale * dataY[i];
        g2.fill(new Ellipse2D.Double(x - 2, y - 2, 4, 4));
    }
    g2.setPaint(Color.YELLOW);
    lengthnew = lengthnew + lengthnew;
    for (int i = length2; i < data.length; i++) {
        double x = PAD + i * dataX[i];
        double y = h - PAD - scale * dataY[i];
        g2.fill(new Ellipse2D.Double(x - 2, y - 2, 4, 4));
    }
}

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

public static JPanel createDemoPanel() {
    JPanel jpanel = new JPanel(new GridLayout(2, 2));
    jpanel.setPreferredSize(new Dimension(800, 600));
    CategoryDataset categorydataset = createDataset();
    JFreeChart jfreechart = createChart("Type: VERTICAL", categorydataset);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer();
    barrenderer.setDrawBarOutline(false);
    barrenderer.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, Color.yellow));
    barrenderer.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, Color.green));
    barrenderer.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    jpanel.add(chartpanel);/*from   w  w  w .  j  ava  2 s  . c  om*/
    JFreeChart jfreechart1 = createChart("Type: HORIZONTAL", categorydataset);
    CategoryPlot categoryplot1 = (CategoryPlot) jfreechart1.getPlot();
    BarRenderer barrenderer1 = (BarRenderer) categoryplot1.getRenderer();
    barrenderer1.setDrawBarOutline(false);
    barrenderer1.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, Color.yellow));
    barrenderer1.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, Color.green));
    barrenderer1.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL));
    ChartPanel chartpanel1 = new ChartPanel(jfreechart1);
    jpanel.add(chartpanel1);
    JFreeChart jfreechart2 = createChart("Type: CENTER_VERTICAL", categorydataset);
    CategoryPlot categoryplot2 = (CategoryPlot) jfreechart2.getPlot();
    BarRenderer barrenderer2 = (BarRenderer) categoryplot2.getRenderer();
    barrenderer2.setDrawBarOutline(false);
    barrenderer2.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, Color.yellow));
    barrenderer2.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, Color.green));
    barrenderer2.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_VERTICAL));
    ChartPanel chartpanel2 = new ChartPanel(jfreechart2);
    jpanel.add(chartpanel2);
    JFreeChart jfreechart3 = createChart("Type: CENTER_HORIZONTAL", categorydataset);
    CategoryPlot categoryplot3 = (CategoryPlot) jfreechart3.getPlot();
    BarRenderer barrenderer3 = (BarRenderer) categoryplot3.getRenderer();
    barrenderer3.setDrawBarOutline(false);
    barrenderer3.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, Color.yellow));
    barrenderer3.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, Color.green));
    barrenderer3.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    ChartPanel chartpanel3 = new ChartPanel(jfreechart3);
    jpanel.add(chartpanel3);
    return jpanel;
}

From source file:ColorMenu.java

public ColorMenu(String name) {
    super(name);// w  w w  . j  av  a 2s.c o  m

    _unselectedBorder = new CompoundBorder(new MatteBorder(1, 1, 1, 1, getBackground()),
            new BevelBorder(BevelBorder.LOWERED, Color.WHITE, Color.GRAY));

    _selectedBorder = new CompoundBorder(new MatteBorder(2, 2, 2, 2, Color.RED),
            new MatteBorder(1, 1, 1, 1, getBackground()));

    _activeBorder = new CompoundBorder(new MatteBorder(2, 2, 2, 2, Color.BLUE),
            new MatteBorder(1, 1, 1, 1, getBackground()));

    JPanel p = new JPanel();
    p.setBorder(new EmptyBorder(5, 5, 5, 5));
    p.setLayout(new GridLayout(8, 8));
    _colorPanes = new HashMap();

    int values[] = new int[] { 0, 128, 192, 255 };

    for (int r = 0; r < values.length; r++)
        for (int g = 0; g < values.length; g++)
            for (int b = 0; b < values.length; b++) {
                Color color = new Color(values[r], values[g], values[b]);
                ColorPane colorPane = new ColorPane(color);
                p.add(colorPane);
                _colorPanes.put(color, colorPane);
            }

    add(p);

}

From source file:controller.DrawCurve.java

private JPanel createChart() {
    String chartTitle = "Camera Response Curve";
    String xAxisLabel = "log Exposure G(Z)";
    String yAxisLabel = "Intensity pixel Z";

    XYDataset dataset = createDataset();

    JFreeChart chart = ChartFactory.createXYLineChart(chartTitle, xAxisLabel, yAxisLabel, dataset);

    //Set custom color and thickness for line curve
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);

    // sets paint color for each series
    renderer.setSeriesPaint(0, Color.RED);
    renderer.setSeriesPaint(1, Color.GREEN);
    renderer.setSeriesPaint(2, Color.BLUE);

    // sets thickness for series (using strokes)
    renderer.setSeriesStroke(0, new BasicStroke(1.5f));
    renderer.setSeriesStroke(1, new BasicStroke(1.5f));
    renderer.setSeriesStroke(2, new BasicStroke(1.5f));

    XYPlot plot = chart.getXYPlot();/*from w ww .  jav a  2  s.  c o  m*/
    plot.setRenderer(renderer);

    return new ChartPanel(chart);
}

From source file:MainClass.java

public void paint(Graphics g) {
    Point2D.Double startQ = new Point2D.Double(50, 75); // Start point
    Point2D.Double endQ = new Point2D.Double(150, 75); // End point
    Point2D.Double control = new Point2D.Double(80, 25); // Control point

    // Points for cubic curve
    Point2D.Double startC = new Point2D.Double(50, 150); // Start point
    Point2D.Double endC = new Point2D.Double(150, 150); // End point
    Point2D.Double controlStart = new Point2D.Double(80, 100); // 1st control
                                                               // point
    Point2D.Double controlEnd = new Point2D.Double(160, 100); // 2nd control
                                                              // point

    QuadCurve2D.Double quadCurve; // Quadratic curve
    CubicCurve2D.Double cubicCurve; // Cubic curve

    quadCurve = new QuadCurve2D.Double( // Create quadratic curve
            startQ.x, startQ.y, // Segment start point
            control.x, control.y, // Control point
            endQ.x, endQ.y); // Segment end point

    cubicCurve = new CubicCurve2D.Double( // Create cubic curve
            startC.x, startC.y, // Segment start point
            controlStart.x, controlStart.y, // Control point for start
            controlEnd.x, controlEnd.y, // Control point for end
            endC.x, endC.y); // Segment end point

    Graphics2D g2D = (Graphics2D) g; // Get a 2D device context

    // Draw the curves
    g2D.setPaint(Color.BLUE);
    g2D.draw(quadCurve);//  w ww.  ja  va  2  s  .com
    g2D.draw(cubicCurve);
}

From source file:net.sf.statcvs.output.xml.chart.TimeLineChart.java

/**
 * @param filename//from   w ww.  ja  v  a  2 s .c o m
 * @param title
 */
public TimeLineChart(String filename, String title) {
    super(filename, title);

    Paint[] colors = new Paint[1];
    colors[0] = Color.blue;

    tsc = new TimeSeriesCollection();
    //collection.addSeries(createTimeSeries(timeline));

    //String range = timeline.getRangeLabel();
    String domain = I18n.tr("Date");

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

    //getChart().getPlot().setSeriesPaint(colors);

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

From source file:MyCheckBoxUI.java

public void mouseEntered(MouseEvent e) {
    JComponent c = (JComponent) e.getComponent();
    c.setBackground(Color.blue);
    c.repaint();
}