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:SwingGlassExample.java

public SwingGlassExample() {
    super("GlassPane Demo");
    setSize(500, 300);/*from ww w  .j  a v a  2 s.co  m*/
    setDefaultCloseOperation(EXIT_ON_CLOSE);

    // Now set up a few buttons & images for the main application
    JPanel mainPane = new JPanel();
    mainPane.setBackground(Color.white);
    JButton redB = new JButton("Red");
    JButton blueB = new JButton("Blue");
    JButton greenB = new JButton("Green");
    mainPane.add(redB);
    mainPane.add(greenB);
    mainPane.add(blueB);
    mainPane.add(new JLabel(new ImageIcon("oreilly.gif")));

    // Attach the popup debugger to the main app buttons so you
    // see the effect of making a glass pane visible
    PopupDebugger pd = new PopupDebugger(this);
    redB.addActionListener(pd);
    greenB.addActionListener(pd);
    blueB.addActionListener(pd);

    // And last but not least, our button to launch the glass pane
    JButton startB = new JButton("Start the big operation!");
    startB.addActionListener(new ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent A) {
            // manually control the 1.2/1.3 bug work-around
            glass.setNeedToRedispatch(false);
            glass.setVisible(true);
            startTimer();
        }
    });

    Container contentPane = getContentPane();
    contentPane.add(mainPane, BorderLayout.CENTER);
    contentPane.add(startB, BorderLayout.SOUTH);

    // Set up the glass pane with a little message and a progress bar...
    JPanel controlPane = new JPanel(new GridLayout(2, 1));
    controlPane.setOpaque(false);
    controlPane.add(new JLabel("Please wait..."));
    controlPane.add(waiter);
    glass = new FixedGlassPane(getJMenuBar(), getContentPane());
    glass.setLayout(new GridLayout(0, 1));
    glass.setOpaque(false);
    glass.add(new JLabel()); // padding...
    glass.add(new JLabel());
    glass.add(controlPane);
    glass.add(new JLabel());
    glass.add(new JLabel());
    setGlassPane(glass);
}

From source file:de.ipk_gatersleben.ag_nw.graffiti.services.GUIhelper.java

public static Component getHelpTextComponent(String plainText, String title, String helpTopic) {
    JPanel result = new JPanel();
    plainText = plainText.replaceAll("<br>", "\n");
    plainText = plainText.replaceAll("<html>", "");
    plainText = plainText.replaceAll("<small>", "");
    FolderPanel fp = new FolderPanel(title, false, false, false,
            JLabelJavaHelpLink.getHelpActionListener(helpTopic));
    JTextArea helpText = new JTextArea();
    helpText.setLineWrap(true);//from  w ww .java  2 s  .  com
    helpText.setWrapStyleWord(true);
    helpText.setText(plainText);
    helpText.setEditable(false);
    fp.addGuiComponentRow(new JLabel(""), helpText, false);
    fp.layoutRows();
    fp.setFrameColor(Color.LIGHT_GRAY, Color.WHITE, 1, 5);

    double border = 2;
    double topBorder = 12;
    double[][] size = { { border, TableLayoutConstants.FILL, border }, // Columns
            { topBorder, TableLayoutConstants.PREFERRED, border } }; // Rows
    result.setLayout(new TableLayout(size));
    result.add(fp, "1,1");
    return result;
}

From source file:br.ufrgs.enq.jcosmo.ui.SigmaProfileAreaPanel.java

public SigmaProfileAreaPanel() {
    setLayout(new BorderLayout());

    sigmaProfileChart = ChartFactory.createStackedXYAreaChart(null, "sigma [e/]", "p(sigma)area []",
            dataset, PlotOrientation.VERTICAL, true, true, false);

    sigmaProfilePlot = sigmaProfileChart.getXYPlot();
    sigmaProfilePlot.getDomainAxis().setAutoRange(false);
    sigmaProfilePlot.getDomainAxis().setRange(new Range(-0.025, 0.025));
    sigmaProfilePlot.setBackgroundPaint(Color.WHITE);

    sigmaProfilePlot.setAxisOffset(new RectangleInsets(8, 0, 0, 16));
    sigmaProfilePlot.setDomainGridlinesVisible(false);
    sigmaProfilePlot.setRangeGridlinesVisible(false);

    Font font = new Font("DeJaVu Serif", Font.BOLD, 16);
    Font fontMini = new Font("DeJaVu Serif", 0, 12);

    sigmaProfileChart.getLegend().setItemFont(fontMini);
    sigmaProfilePlot.getDomainAxis().setLabelFont(font);
    sigmaProfilePlot.getRangeAxis().setLabelFont(font);
    sigmaProfilePlot.getDomainAxis().setTickLabelFont(fontMini);
    sigmaProfilePlot.getRangeAxis().setTickLabelFont(fontMini);

    sigmaProfilePlot.getDomainAxis().setAxisLinePaint(Color.BLACK);
    sigmaProfilePlot.getDomainAxis().setTickMarkPaint(Color.BLACK);
    sigmaProfilePlot.getDomainAxis().setTickMarkInsideLength(4);
    sigmaProfilePlot.getDomainAxis().setTickMarkOutsideLength(0);

    sigmaProfilePlot.getRangeAxis().setAxisLinePaint(Color.BLACK);
    sigmaProfilePlot.getRangeAxis().setTickMarkPaint(Color.BLACK);
    sigmaProfilePlot.getRangeAxis().setTickMarkInsideLength(4);
    sigmaProfilePlot.getRangeAxis().setTickMarkOutsideLength(0);

    add(new ChartPanel(sigmaProfileChart), BorderLayout.CENTER);
}

From source file:com.wsntools.iris.tools.Graph.java

private void setupChartType(JFreeChart chart) {

    chart.setBackgroundPaint(Color.white);

    // plot = chart.getCategoryPlot();
    plot = chart.getXYPlot();/*from  ww w  . j  av  a 2 s.  com*/
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 4, 4, 4, 4));

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();

    rangeAxis.setAutoRangeIncludesZero(false);
    rangeAxis.setAutoRange(true);
    domainAxis.setAutoRangeIncludesZero(false);
    rangeAxis.setAutoRange(true);
    domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    chartPanel.setChart(chart);
}

From source file:piilSource.Histogram.java

public Histogram(final String s, List<List<String>> list, Character meta) {
    super(s);/*  w  ww .java2  s  .  c om*/
    metaLabel = (meta.equals('M')) ? "beta" : "expression";
    histogramPanel = createDemoPanel(s, list, metaLabel);
    histogramPanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(histogramPanel);

    exportButton = new JButton("Export to image");
    exportButton.setPreferredSize(new Dimension(150, 30));
    closeButton = new JButton("Close");
    closeButton.setPreferredSize(new Dimension(150, 30));
    buttonsPanel = new JPanel();
    buttonsPanel.setLayout(new FlowLayout());
    buttonsPanel.setBackground(Color.WHITE);
    buttonsPanel.add(exportButton);
    buttonsPanel.add(closeButton);

    exportButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent bc) {
            ExportDialog export = new ExportDialog();
            export.showExportDialog(chartFrame, "Export view as ...", histogramPanel,
                    "Histogram of the " + metaLabel + " values for all samples - " + s);
        }
    });
    closeButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            chartFrame.dispose();
        }
    });

    chartFrame = new JFrame();
    chartFrame.setLayout(new BorderLayout());
    chartFrame.setSize(400, 100);
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension dim = tk.getScreenSize();
    int xPos = (dim.width / 2) - (chartFrame.getWidth() / 2);
    int yPos = (dim.height / 2) - (chartFrame.getHeight() / 2);
    chartFrame.setLocation(xPos, yPos);
    chartFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    chartFrame.add(histogramPanel, BorderLayout.CENTER);
    chartFrame.add(buttonsPanel, BorderLayout.SOUTH);
    chartFrame.setSize(800, 400);
    chartFrame.setVisible(true);

}

From source file:TexturedPanel.java

/**
 * Creates a new TexturedPanel with a simple pattern based on the provided
 * texture map and consisting of the given foreground and background colors.
 *///from   w  w  w .j ava 2s  .  c  om
public TexturedPanel(Color foreground, Color background, boolean[][] texture, int scale) {
    super();
    ourDefaultForeground = (foreground != null ? foreground : Color.white);
    ourDefaultBackground = (background != null ? background : getBackground());

    setupTexturePainter(ourDefaultForeground, ourDefaultBackground, texture, scale);
}

From source file:ch.zhaw.init.walj.projectmanagement.util.chart.PieChart.java

/**
 * creates the pie chart/*from   ww w. j a va  2 s . com*/
 * @throws NumberFormatException
 * @throws IOException
 */
public void createChart() throws NumberFormatException, IOException {

    // create dataset with used and remaining budget
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("spent", con.getUsedBudget(project));
    dataset.setValue("remaining", con.getRemainingBudget(project));

    // create chart
    JFreeChart chart = ChartFactory.createPieChart("", dataset, false, false, false);

    // set color and style
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionPaint("remaining", new Color(0, 101, 166));
    plot.setSectionPaint("spent", new Color(0, 62, 102));
    plot.setLabelGenerator(null);
    plot.setBackgroundPaint(Color.WHITE);
    plot.setShadowXOffset(0);
    plot.setShadowYOffset(0);
    plot.setOutlineVisible(false);
    plot.setInteriorGap(0);

    // set size and save it as JPEG
    int width = 350; /* Width of the image */
    int height = 350; /* Height of the image */
    File pieChart = new File(path + "/Charts/BudgetProject" + project.getID() + ".jpg");
    ChartUtilities.saveChartAsJPEG(pieChart, chart, width, height);
}

From source file:no.met.jtimeseries.marinogram.MarinogramWrapper.java

public static void main(String args[]) throws Exception {
    MarinogramTemperaturePlot mp = new MarinogramTemperaturePlot(800, 200, "UTC", "en");
    mp.setDescription("Temperature");

    MarinogramTemperaturePlot mp1 = new MarinogramTemperaturePlot(800, 200, "UTC", "en");
    mp1.setDescription("Temperature1");

    MarinogramPlot marinogram = new MarinogramWrapper(900, 200, "UTC", "en");
    marinogram.setDescription("marinogram");

    MarinogramWrapper marinogram1 = new MarinogramWrapper(940, 200, "UTC", "en");
    // //www.j ava 2 s  . com
    // 30.95, 71.5
    // 58.9653, 5.7180
    //41.8947&longitude=12.4839
    //41.0138
    //5.04092, 58.89468 
    //16.66, 68.56 
    //10.72938, 71.50000 
    ChartPlottingInfo cpi = new ChartPlottingInfo.Builder(5.32905, 74.39825).width(mp1.getWidth())
            .showAirTemperature(true).showWaterTemperature(true).showDewpointTemperature(true)
            .showPressure(true).showWaveDirection(true).showWaveHeight(true).showCurrentDirection(true)
            .showCurrentSpeed(true).showWindDirection(true).showWindSpeed(true).timezone("UTC").language("en")
            .build();
    JFreeChart jchart = marinogram1.createMarinogram(cpi);
    jchart.setBorderVisible(false);
    Paint paint = new GradientPaint(0, 0, Color.WHITE, marinogram1.getWidth(), 0, Color.WHITE);
    jchart.setBackgroundPaint(paint);
    jchart.removeLegend();
    ChartFrame frame = new ChartFrame(jchart, new java.awt.Dimension(900, 400));
    frame.pack();
    frame.setVisible(true);
}

From source file:edu.memphis.ccrg.lida.framework.gui.panels.ActivationChartPanel.java

/** Creates new form JChartGuiPanel */
public ActivationChartPanel() {
    chart = ChartFactory.createXYLineChart("", "Tick", "Activation", dataset, PlotOrientation.VERTICAL, true,
            true, false);//from   www .  j av  a2  s.c om
    chart.setBackgroundPaint(new Color(238, 233, 233));
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    initComponents();
}