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:com.tag.Hyperlink.java

private void init() {
    setHorizontalAlignment(SwingConstants.LEFT);
    setBackground(Color.WHITE);
    setBorder(null);//  w  w w  .jav a  2s. co  m
    setBorderPainted(false);
    setOpaque(false);

    String toolTip = getUri().toString();
    setToolTipText(toolTip);

    addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Desktop desktop = Desktop.getDesktop();
            boolean mail = desktop.isSupported(Action.BROWSE);
            if (mail) {
                try {
                    desktop.browse(uri);
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            }
        }

    });
}

From source file:Interfaz.XYLineChart.java

/** Constructor de clase 
* @param d Dimension/*from  www  .jav a2  s  .c o  m*/
*/
public XYLineChart(Dimension d, ArrayList<Restriccion> rest, ArrayList<Coordenada> cor) {

    //se declara el grafico XY Lineal
    XYDataset xydataset = xyDataset(rest, cor);
    JFreeChart jfreechart = ChartFactory.createXYLineChart("Graficas lineales", "X", "Y", xydataset,
            PlotOrientation.VERTICAL, true, true, false);

    //personalizacin del grafico
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    xyplot.setBackgroundPaint(Color.white);
    xyplot.setDomainGridlinePaint(Color.BLACK);
    xyplot.setRangeGridlinePaint(Color.BLACK);

    // -> Pinta Shapes en los puntos dados por el XYDataset
    //        XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
    //        xylineandshaperenderer.setBaseShapesVisible(true);
    //        //--> muestra los valores de cada punto XY
    //        XYItemLabelGenerator xy = new StandardXYItemLabelGenerator();
    //        xylineandshaperenderer.setBaseItemLabelGenerator( xy );
    //        xylineandshaperenderer.setBaseItemLabelsVisible(true);
    //        xylineandshaperenderer.setBaseLinesVisible(true);
    //        xylineandshaperenderer.setBaseItemLabelsVisible(true);                
    //fin de personalizacin

    //se crea la imagen y se asigna a la clase ImageIcon
    BufferedImage bufferedImage = jfreechart.createBufferedImage(d.width, d.height);
    this.setImage(bufferedImage);
}

From source file:de.fub.maps.project.plugins.tasks.eval.RoadClassifcationDiagram.java

/**
 * Creates new form RoadClassifcationDiagram
 *///from   w  w w.  j  a  v  a  2s  .c o m
public RoadClassifcationDiagram() {
    initComponents();
    barChart = ChartFactory.createXYBarChart(null, "Degree", false, null, dataset, PlotOrientation.VERTICAL,
            true, true, true);
    barChart.setBackgroundPaint(Color.WHITE);
    barChart.getPlot().setBackgroundPaint(Color.WHITE);
    chartpanel = new ChartPanel(barChart, false);
    add(chartpanel, BorderLayout.CENTER);
}

From source file:utils.Graficos_old.java

public static JFreeChart GraficoLinhas(List<CarCapContas> pagar, List<CarCapContas> receber, String titulo) {

    XYSeries series1 = new XYSeries("Pagar");

    //        CarCapContas contasPagar = new CarCapContas();
    for (CarCapContas contasPagar : pagar) {

        series1.add(contasPagar.getContaValorTotal(), contasPagar.getContaDataEmissao().getMonth());

    }/*from   w w  w . j  av  a  2 s .  c om*/

    XYSeries series2 = new XYSeries("Receber");

    for (CarCapContas contasReceber : receber) {

        series2.add(contasReceber.getContaValorTotal(), contasReceber.getContaDataEmissao().getMonth());

    }

    XYSeriesCollection dataset = new XYSeriesCollection();

    dataset.addSeries(series1);
    dataset.addSeries(series2);

    JFreeChart chart = ChartFactory.createXYLineChart(titulo, // chart title
            "X", // x axis label
            "Y", // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );

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

    // 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, false);
    renderer.setSeriesShapesVisible(1, false);
    plot.setRenderer(renderer);

    // change the auto tick unit selection to integer units only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // OPTIONAL CUSTOMISATION COMPLETED.
    return chart;

}

From source file:SaveYourDrawingToFile.java

public void paint(Graphics g) {
    g.setColor(Color.white);
    g.fillRect(0, 0, getSize().width, getSize().height);

    g.setColor(Color.black);//from  w w w .ja  v  a  2  s  .  com
    int i = 0;
    while (i < displayList.size()) {
        Point p0 = (Point) (displayList.get(i++));
        Point p1 = (Point) (displayList.get(i++));
        int x = Math.min(p0.x, p1.x);
        int y = Math.min(p0.y, p1.y);
        int w = Math.abs(p0.x - p1.x);
        int h = Math.abs(p0.y - p1.y);
        g.drawRect(x, y, w, h);
    }
}

From source file:Main.java

public Component getListCellRendererComponent(JList jc, Object val, int idx, boolean isSelected,
        boolean cellHasFocus) {
    setText(val.toString());
    setForeground(table.get(idx));/*from  w w w .ja  v a  2s .c  o  m*/
    if (isSelected)
        setBackground(Color.LIGHT_GRAY);
    else
        setBackground(Color.WHITE);
    return this;
}

From source file:GeneralPathDemo.java

public void paintComponent(Graphics g) {
    // super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    if (firstTime) {
        Dimension dim = getSize();
        int w = dim.width;
        int h = dim.height;
        oddShape = createPath();/*  ww w .  j av  a  2s. c  om*/
        area = new Rectangle(w, h);
        bi = (BufferedImage) createImage(w, h);
        big = bi.createGraphics();
        big.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        firstTime = false;
    }

    // Clears the shape that was previously drawn.
    big.setColor(Color.white);
    big.fillRect(0, 0, area.width, area.height);

    big.setColor(Color.magenta);
    big.setStroke(new BasicStroke(3.0f));
    big.draw(oddShape);
    // Draws the buffered image to the screen.
    g2.drawImage(bi, 0, 0, this);

}

From source file:gavisualizer.PieChart.java

@Override
public void generate() {
    // Creates Pie Chart from variables
    JFreeChart chart = ChartFactory.createPieChart(_title, // chart title
            _dataset, // data
            false, // include legend
            false, false);/*  w  w  w.  j  a  v  a  2 s  .  c o m*/

    // Set Plot canvas color and direction
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setBackgroundPaint(Color.WHITE);

    /*
    *  Use these to edit the decimal percentage: 
    *       NumberFormat nf = NumberFormat.getPercentInstance();
    *       nf.setRoundingMode(RoundingMode.);
    *       nf.setMinimumFractionDigits(2);
    *       plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} {2}", NumberFormat.getNumberInstance(), nf));
    *  
    *  And remove line 63
    */

    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} {2}"));
    plot.setOutlinePaint(Color.white);

    _chart = chart;
}

From source file:au.org.ala.delta.ui.TextFileViewer.java

public TextFileViewer(Window owner, File file) throws IOException {
    super(owner);
    setModal(true);/*  www.  java2 s. c om*/
    getContentPane().setLayout(new BorderLayout());
    viewer = new JTextPane();

    viewer.setEditable(false);
    viewer.setBackground(Color.WHITE);
    viewer.setBorder(null);
    viewer.setOpaque(true);
    viewer.setFont(UIManager.getFont("Label.font"));

    JScrollPane scroller = new JScrollPane(viewer);
    getContentPane().add(scroller, BorderLayout.CENTER);

    setTitle(file.getAbsolutePath());
    displayFileContents(file);
    pack();
}

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

private static JFreeChart createChart(CategoryDataset categorydataset) {
    JFreeChart jfreechart = ChartFactory.createBarChart("Bar Chart Demo", "Category", "Value", categorydataset,
            PlotOrientation.VERTICAL, true, true, false);
    jfreechart.setBackgroundPaint(Color.white);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    categoryplot.setBackgroundPaint(Color.lightGray);
    categoryplot.setDomainGridlinePaint(Color.white);
    categoryplot.setDomainGridlinesVisible(true);
    categoryplot.setRangeGridlinePaint(Color.white);
    NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer();
    barrenderer.setDrawBarOutline(false);
    GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64));
    GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0));
    GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0));
    barrenderer.setSeriesPaint(0, gradientpaint);
    barrenderer.setSeriesPaint(1, gradientpaint1);
    barrenderer.setSeriesPaint(2, gradientpaint2);
    CategoryAxis categoryaxis = categoryplot.getDomainAxis();
    categoryaxis.setCategoryLabelPositions(
            CategoryLabelPositions.createUpRotationLabelPositions(0.52359877559829882D));
    return jfreechart;
}