Example usage for java.awt Color WHITE

List of usage examples for java.awt Color WHITE

Introduction

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

Prototype

Color WHITE

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

Click Source Link

Document

The color white.

Usage

From source file:WeeklyReport.Sections.Bookings.java

private JFreeChart bookingsByPODChart() {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    Map<Double, Map<String, String>> map = new CargoQuoteType().bookingsByPOD();
    map.entrySet().stream().forEach((mapEntry) -> {
        Map<String, String> m1 = mapEntry.getValue();
        m1.entrySet().stream().forEach((pair) -> {
            dataset.setValue(mapEntry.getKey(), pair.getKey(), pair.getValue());
        });//  w  w  w  . j  a  va  2  s  .  co  m
    });
    JFreeChart barChart = ChartFactory.createBarChart3D("Bookings by POD", "Company", "Cubic Meters", dataset,
            PlotOrientation.HORIZONTAL, true, true, false);
    barChart.setBackgroundPaint(Color.WHITE);
    CategoryPlot categoryPlot = barChart.getCategoryPlot();
    CategoryAxis domainAxis = categoryPlot.getDomainAxis();
    BarRenderer br = (BarRenderer) categoryPlot.getRenderer();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45);
    categoryPlot.setBackgroundPaint(Color.WHITE);
    categoryPlot.setRangeGridlinePaint(Color.BLACK);
    return barChart;
}

From source file:analisisnumerico.Main.java

public Main() {
    setTitle("Analisis Numerico");
    setBounds(145, 80, 780, 480);//  ww w  .  ja  v  a2s.  co  m
    this.setUndecorated(true);
    initComponents();
    jPanel2.setBackground(new Color(219, 68, 55));
    JLabel text = new JLabel("Analisis Numerico");
    text.setBounds(14, 0, 160, 40);
    text.setForeground(Color.WHITE);
    jPanel2.add(text);
    jButton1.setSize(20, 20);
    jButton2.setSize(20, 20);
    Fondo f = new Fondo();
    jPanel1.add(f);
    m.setBounds(0, 0, 780, 480);
    f.add(m);
    jButton2.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            setExtendedState(ICONIFIED);
        }
    });
    jButton2.setVisible(true);
    jButton1.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            System.exit(0);
        }
    });
    jButton1.setVisible(true);

    jButton6.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Biseccion s = new Biseccion(F);
            f.removeAll();
            s.setBounds(0, 0, 780, 480);
            f.add(s);
            f.setVisible(true);
            f.updateUI();
        }
    });

    jButton7.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Secante s = new Secante(F);
            f.removeAll();
            s.setBounds(0, 0, 780, 480);
            f.add(s);
            f.setVisible(true);
            f.updateUI();
        }
    });

    jButton3.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Menu m = new Menu(F);
            f.removeAll();
            m.setBounds(0, 0, 780, 480);
            f.add(m);
            f.setVisible(true);
            f.updateUI();
        }
    });

    jButton8.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Newton n = new Newton(F);
            f.removeAll();
            n.setBounds(0, 0, 780, 480);
            f.add(n);
            f.setVisible(true);
            f.updateUI();
        }
    });
    jButton5.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Grafica g = new Grafica(F);
            f.removeAll();
            g.setBounds(0, 0, 780, 480);
            f.add(g);
            f.setVisible(true);
            f.updateUI();

        }
    });
    jButton4.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            SistemasEcuaciones m = new SistemasEcuaciones();
            f.removeAll();
            m.setBounds(0, 0, 780, 480);
            f.add(m);
            f.setVisible(true);
            f.updateUI();
        }
    });
}

From source file:org.jenkinsci.plugins.todos.TodosChartBuilder.java

/**
 * Build a trend chart from the provided data.
 * // w  w w .  j av a 2 s  .  co  m
 * @param action
 *            the build action
 * @return the trend chart
 */
public static JFreeChart buildChart(TodosBuildAction action) {
    String strComments = Messages.Todos_ReportSummary_Comments();

    JFreeChart chart = ChartFactory.createStackedAreaChart(null, null, strComments, buildDataset(action),
            PlotOrientation.VERTICAL, true, false, true);

    chart.setBackgroundPaint(Color.white);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setOutlinePaint(null);
    plot.setForegroundAlpha(0.8f);
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.black);

    CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
    plot.setDomainAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
    domainAxis.setLowerMargin(0.0);
    domainAxis.setUpperMargin(0.0);
    domainAxis.setCategoryMargin(0.0);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // Crop extra space around the graph
    plot.setInsets(new RectangleInsets(0, 0, 0, 5.0));

    TodosAreaRenderer renderer = new TodosAreaRenderer(action.getUrlName());
    plot.setRenderer(renderer);

    return chart;
}

From source file:JSplash.java

private void init() {
    JPanel pnlImage = new JPanel();
    ImageIcon image = new ImageIcon(getClass().getResource("img/logo.jpg"));
    JLabel lblBack = new JLabel(image);
    Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    Border loweredbevel = BorderFactory.createLoweredBevelBorder();

    lblBack.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
    getLayeredPane().add(lblBack, new Integer(Integer.MIN_VALUE));

    pnlImage.setLayout(null);/*from  www .j a  v a2 s  . com*/
    pnlImage.setOpaque(false);
    pnlImage.setBorder(BorderFactory.createCompoundBorder(raisedbevel, loweredbevel));

    pnlImage.add(this.lblVersion);

    this.lblVersion.setForeground(Color.white);
    this.lblVersion.setFont(new Font("Dialog", Font.PLAIN, 12));
    this.lblVersion.setBounds(15, 69, 120, 20);

    setContentPane(pnlImage);
    setSize(image.getIconWidth(), image.getIconHeight());
}

From source file:org.matsim.contrib.util.timeprofile.TimeProfileCharts.java

public static JFreeChart chartProfile(DefaultTableXYDataset dataset, ChartType type) {
    JFreeChart chart;//from   w  w  w.j a  v a  2s.  c o m
    switch (type) {
    case Line:
        chart = ChartFactory.createXYLineChart("TimeProfile", "Time [h]", "Values", dataset,
                PlotOrientation.VERTICAL, true, false, false);
        break;

    case StackedArea:
        chart = ChartFactory.createStackedXYAreaChart("TimeProfile", "Time [h]", "Values", dataset,
                PlotOrientation.VERTICAL, true, false, false);
        break;

    default:
        throw new IllegalArgumentException();
    }

    XYPlot plot = chart.getXYPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setBackgroundPaint(Color.white);

    NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
    xAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
    yAxis.setAutoRange(true);

    XYItemRenderer renderer = plot.getRenderer();
    for (int s = 0; s < dataset.getSeriesCount(); s++) {
        renderer.setSeriesStroke(s, new BasicStroke(2));
    }

    return chart;
}

From source file:jamel.gui.charts.JamelChart.java

/**
 * Returns the standard chart theme./*from w w  w.  jav  a2 s.c  om*/
 * @return the standard chart theme.
 */
private static StandardChartTheme getNewChartTheme() {
    StandardChartTheme theme = new StandardChartTheme("Standard Chart Theme");
    float size = theme.getExtraLargeFont().getSize2D();
    Font titleFont = theme.getExtraLargeFont().deriveFont(size - 4);
    theme.setExtraLargeFont(titleFont);
    Font axisFont = theme.getRegularFont();
    theme.setLargeFont(axisFont);
    theme.setChartBackgroundPaint(new Color(0, 0, 0, 1));
    theme.setPlotBackgroundPaint(Color.WHITE);
    theme.setDomainGridlinePaint(Color.GRAY);
    theme.setRangeGridlinePaint(Color.GRAY);
    return theme;
}

From source file:com.github.lucapino.sheetmaker.PreviewJFrame.java

public static BufferedImage makeRoundedCorner(BufferedImage image, int cornerRadius) {
    int w = image.getWidth();
    int h = image.getHeight();
    BufferedImage output = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

    Graphics2D g2 = output.createGraphics();

    // This is what we want, but it only does hard-clipping, i.e. aliasing
    // g2.setClip(new RoundRectangle2D ...)
    // so instead fake soft-clipping by first drawing the desired clip shape
    // in fully opaque white with antialiasing enabled...
    g2.setComposite(AlphaComposite.Src);
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setColor(Color.WHITE);
    g2.fill(new RoundRectangle2D.Float(0, 0, w, h, cornerRadius, cornerRadius));

    // ... then compositing the image on top,
    // using the white shape from above as alpha source
    g2.setComposite(AlphaComposite.SrcIn);
    g2.drawImage(image, 0, 0, null);/*from w  ww .j  a  v  a 2  s .c  o  m*/

    g2.dispose();

    return output;
}

From source file:Main.java

public TColor() {
    sliderR = getSlider(0, 255, 0, 50, 5);
    sliderG = getSlider(0, 255, 0, 50, 5);
    sliderB = getSlider(0, 255, 0, 50, 5);
    sliderH = getSlider(0, 10, 0, 5, 1);
    sliderS = getSlider(0, 10, 0, 5, 1);
    sliderBr = getSlider(0, 10, 0, 5, 1);
    sliderAlpha = getSlider(0, 255, 255, 50, 5);

    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(6, 2, 15, 0));

    panel.add(new JLabel("R-G-B Sliders (0 - 255)"));
    panel.add(new JLabel("H-S-B Sliders (ex-1)"));
    panel.add(sliderR);// ww  w  .j  a va2s . c  o m
    panel.add(sliderH);
    panel.add(sliderG);
    panel.add(sliderS);
    panel.add(sliderB);
    panel.add(sliderBr);

    panel.add(new JLabel("Alpha Adjustment (0 - 255): ", JLabel.RIGHT));
    panel.add(sliderAlpha);

    panel.add(new JLabel("RGB Value: ", JLabel.RIGHT));

    rgbValue.setBackground(Color.white);
    rgbValue.setForeground(Color.black);
    rgbValue.setOpaque(true);
    panel.add(rgbValue);

    add(panel, BorderLayout.SOUTH);
    add(canvas);
}

From source file:max.hubbard.Factoring.Graphing.java

private static JFreeChart createChart(final XYDataset dataset, String equation) {

    // create the chart...
    final JFreeChart chart = ChartFactory.createXYLineChart(equation, // chart title
            "X", // x axis label
            "Y", // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );//from   w w  w . j  a  va  2 s  .co m

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
    chart.setBackgroundPaint(Color.white);

    //        final StandardLegend legend = (StandardLegend) chart.getLegend();
    //              legend.setDisplaySeriesShapes(true);

    // get a reference to the plot for further customisation...
    final XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.lightGray);
    //    plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesLinesVisible(0, true);
    renderer.setSeriesShapesVisible(0, true);
    plot.setRenderer(renderer);

    // change the auto tick unit selection to integer units only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setRange(new Range(-50, 50));
    // OPTIONAL CUSTOMISATION COMPLETED.

    return chart;

}

From source file:grisu.frontend.view.swing.files.preview.fileViewers.JobStatusGridFileViewer.java

private static ChartPanel createChart(String title, String y_axis, XYDataset dataset, boolean createLegend) {

    final JFreeChart chart = ChartFactory.createTimeSeriesChart(title, // title
            "Date", // x-axis label
            y_axis, // y-axis label
            dataset, // data
            createLegend, // create legend?
            true, // generate tooltips?
            false // generate URLs?
    );/*from  www.j av a  2 s.co m*/

    chart.setBackgroundPaint(Color.white);

    final XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setAutoRangeIncludesZero(true);

    final XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        final XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
        renderer.setDrawSeriesLineAsPath(true);
    }

    final DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("dd.MM. HH:mm"));

    return new ChartPanel(chart);

}