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:UI.MainViewPanel.java

public ChartPanel getPanel2(Metric2 m2) {

    int totalRiskCount = m2.totalCriticalCount + m2.totalHighCount + m2.totalLowCount + m2.totalMediumCount;
    String[][] risks = new String[totalRiskCount][3];
    BarChart barChart = new BarChart(m2.totalCriticalCount, m2.totalHighCount, m2.totalMediumCount,
            m2.totalLowCount, 0, "", risks);

    ChartPanel thisChart = barChart.drawBarChart();
    thisChart.setBackground(Color.white);

    JFreeChart chart = thisChart.getChart();
    chart.setBackgroundPaint(new Color(0, 0, 0, 0));

    Plot plot = chart.getPlot();/*w  w  w  .  j a v a2s . c o  m*/
    plot.setBackgroundPaint(chartBackgroundColor);

    return thisChart;
}

From source file:RotationAboutCenter.java

protected void paintComponent(Graphics g) {
    Graphics2D g2d;/*from   w ww.  j  av a2 s  .  c  om*/
    g2d = (Graphics2D) g.create();

    // Erase background to white
    g2d.setColor(Color.WHITE);
    g2d.fillRect(0, 0, getWidth(), getHeight());

    // base rectangle
    g2d.setColor(Color.GRAY.brighter());
    g2d.fillRect(50, 50, 50, 50);

    // rotated 45 degrees around origin
    g2d.rotate(Math.toRadians(45));
    g2d.setColor(Color.GRAY.darker());
    g2d.fillRect(50, 50, 50, 50);

    // rotated 45 degrees about center of rect
    g2d = (Graphics2D) g.create();
    g2d.rotate(Math.toRadians(45), 75, 75);
    g2d.setColor(Color.BLACK);
    g2d.fillRect(50, 50, 50, 50);

    // done with g2d, dispose it
    g2d.dispose();
}

From source file:jmbench.plots.OverallRelativeAreaPlot.java

public OverallRelativeAreaPlot(String title, int sizes[]) {
    // createAreaChart

    chart = ChartFactory.createStackedAreaChart(title, // chart title
            "Size", // domain axis label
            "Relative Average Speed", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, false);//from w  ww .  jav a  2 s  .c  o m

    chart.addSubtitle(new TextTitle("Weighted by Operation Speed. Larger is Better.",
            new Font("SansSerif", Font.ITALIC, 12)));

    plot = chart.getCategoryPlot();

    sizeNames = new String[sizes.length];
    for (int i = 0; i < sizes.length; i++) {
        sizeNames[i] = Integer.toString(sizes[i]);
    }

    plot.setRangeGridlinePaint(Color.WHITE);
    plot.setBackgroundPaint(Color.WHITE);

    plot.setDomainGridlinesVisible(true);
}

From source file:UserInterface.StoreManager.StoreReportsPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*w  ww .j av  a  2s .  c  o m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    storeReportsPanel = new javax.swing.JLabel();
    productReportButton = new javax.swing.JButton();
    shelfReportsButton = new javax.swing.JButton();
    storeKeeperButton = new javax.swing.JButton();

    setBackground(java.awt.Color.white);

    storeReportsPanel.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    storeReportsPanel.setText("Store Reports");

    productReportButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    productReportButton.setText("Product Report");
    productReportButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            productReportButtonActionPerformed(evt);
        }
    });

    shelfReportsButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    shelfReportsButton.setText("Shelf Report");
    shelfReportsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            shelfReportsButtonActionPerformed(evt);
        }
    });

    storeKeeperButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    storeKeeperButton.setText("Store Keeper Report");
    storeKeeperButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            storeKeeperButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap(215, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(shelfReportsButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            119, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(121, 121, 121).addComponent(productReportButton)
                                    .addGap(150, 150, 150))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    layout.createSequentialGroup().addComponent(storeReportsPanel).addGap(323,
                                            323, 323))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(storeKeeperButton).addGap(292, 292, 292)))));

    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { productReportButton, shelfReportsButton, storeKeeperButton });

    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(24, 24, 24)
                    .addComponent(storeReportsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 38,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(131, 131, 131)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(shelfReportsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(productReportButton))
                    .addGap(78, 78, 78).addComponent(storeKeeperButton).addContainerGap(162, Short.MAX_VALUE)));

    layout.linkSize(javax.swing.SwingConstants.VERTICAL,
            new java.awt.Component[] { productReportButton, shelfReportsButton, storeKeeperButton });

}

From source file:DebugFrame.java

/**
 * Clears the back buffer// ww w  .  j a v  a 2  s  .co m
 */
public void clear() {
    Graphics g = panel.buff.getGraphics();

    g.setColor(Color.white);
    g.fillRect(0, 0, panel.getWidth(), panel.getHeight());
}

From source file:components.MenuLayoutDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread.//from   w  ww.  j  ava 2 s . com
 */
private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("MenuLayoutDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    MenuLayoutDemo demo = new MenuLayoutDemo();
    Container contentPane = frame.getContentPane();
    contentPane.setBackground(Color.WHITE); //contrasting bg
    contentPane.add(demo.createMenuBar(), BorderLayout.LINE_START);

    //Display the window.
    frame.setSize(300, 150);
    frame.setVisible(true);
}

From source file:ClipArea.java

MyCanvas() {
    setSize(300, 300);
    setBackground(Color.white);
}

From source file:net.sf.mzmine.modules.peaklistmethods.peakpicking.adap3decompositionV1_5.EICPlot.java

public EICPlot(List<List<NavigableMap<Double, Double>>> clusters, List<Double> colors, List<List<String>> info,
        List<NavigableMap<Double, Double>> modelPeaks) {
    super(null, true);

    setBackground(Color.white);
    setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));

    NumberAxis xAxis = new NumberAxis("Retention Time");
    xAxis.setAutoRangeIncludesZero(false);
    xAxis.setUpperMargin(0);/* w w  w.j  a v  a2  s  . c  om*/
    xAxis.setLowerMargin(0);

    NumberAxis yAxis = new NumberAxis("Intensity");
    yAxis.setAutoRangeIncludesZero(false);
    yAxis.setUpperMargin(0);
    yAxis.setLowerMargin(0);

    xyDataset = new XYSeriesCollection();
    colorDataset = new ArrayList<>();
    toolTips = new ArrayList<>();

    int seriesID = 0;

    for (int i = 0; i < clusters.size(); ++i) {
        List<NavigableMap<Double, Double>> cluster = clusters.get(i);
        double color = colors.get(i);

        for (int j = 0; j < cluster.size(); ++j) {
            XYSeries series = new XYSeries(seriesID++);

            for (Entry<Double, Double> e : cluster.get(j).entrySet())
                series.add(e.getKey(), e.getValue());

            xyDataset.addSeries(series);
            colorDataset.add(color);
            toolTips.add(info.get(i).get(j));
        }
    }

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer() {
        @Override
        public Paint getItemPaint(int row, int col) {
            double c = colorDataset.get(row);
            return Color.getHSBColor((float) c, 1.0f, 1.0f);
        }
    };

    renderer.setDefaultShapesVisible(false);
    renderer.setDefaultToolTipGenerator(new XYToolTipGenerator() {
        @Override
        public String generateToolTip(XYDataset dataset, int series, int item) {
            try {
                return toolTips.get(series);
            } catch (NullPointerException | IndexOutOfBoundsException e) {
                return "";
            }
        }
    });

    XYPlot plot = new XYPlot(xyDataset, xAxis, yAxis, renderer);
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinesVisible(true);

    JFreeChart chart = new JFreeChart("", new Font("SansSerif", Font.BOLD, 12), plot, false);
    chart.setBackgroundPaint(Color.white);

    super.setChart(chart);
}

From source file:com.js.quickestquail.ui.stats.ExtensionStat.java

private JFreeChart generateChart() {
    JFreeChart chart = ChartFactory.createPieChart(
            java.util.ResourceBundle.getBundle("i18n/i18n").getString("stat.extension.title"), // chart title 
            generateDataset(), // data    
            true, // include legend   
            true, false);//from w w  w  .ja v  a  2s.co m
    chart.setBackgroundPaint(new Color(0xFF, 0xFF, 0xFF, 0));
    chart.getPlot().setBackgroundPaint(Color.WHITE);
    return chart;
}

From source file:atencionurgencia.evolucion.grafic_sVitales.java

private void graficar() {
    final TimeSeriesCollection dataset1 = axisTaFC.createDatasetTA();
    final JFreeChart chart2 = ChartFactory.createTimeSeriesChart("", // chart title
            "HORA", // domain axis label
            "Tensin Arterial - TA (ppm)", // range axis label
            dataset1, // data

            true, // include legend
            true, // tooltips?
            false // URL generator?  Not required...
    );//  w  ww.  j  a v  a2 s .  co  m
    chart2.setBackgroundPaint(Color.white);
    final XYPlot plot = chart2.getXYPlot();
    plot.setBackgroundPaint(new Color(0xEE, 0xEE, 0xFF));
    plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
    }
    //        plot.set

    //        
    ////        final CategoryDataset dataset2 = axisTaFC.createDatasetFC();
    ////        plot.setDataset(1, dataset2);
    plot.mapDatasetToRangeAxis(1, 0);
    //        
    //        final DateAxis domainAxis = (DateAxis) plot.getDomainAxis();
    //        domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45);
    ////        final ValueAxis axis2 = new NumberAxis("Frecuencia Cardiaca - FC (ppm)");
    ////        plot.setRangeAxis(1, axis2);

    plot.setDatasetRenderingOrder(DatasetRenderingOrder.REVERSE);
    //        
    //        
    //        
    final ChartPanel chartPanel = new ChartPanel(chart2);
    chartPanel.setPreferredSize(new java.awt.Dimension(444, 358));//[598, 358][444, 358]
    jPanel4.removeAll();
    jPanel4.setLayout(new BorderLayout());
    jPanel4.add(chartPanel, BorderLayout.NORTH);
    jPanel4.repaint();
}