Example usage for java.awt Color YELLOW

List of usage examples for java.awt Color YELLOW

Introduction

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

Prototype

Color YELLOW

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

Click Source Link

Document

The color yellow.

Usage

From source file:com.pusksesmas.form_statistik.statistik_diagnosa.java

private void tabelDataMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelDataMouseClicked

    if (vpil.getSelectedIndex() == 1) {
        int row = tabelData.getSelectedRow();
        String namaPenyakit = (tabelData.getModel().getValueAt(row, 0)).toString();
        String jan = (tabelData.getModel().getValueAt(row, 1)).toString();
        String feb = (tabelData.getModel().getValueAt(row, 2)).toString();
        String mar = (tabelData.getModel().getValueAt(row, 3)).toString();
        String apr = (tabelData.getModel().getValueAt(row, 4)).toString();
        String mei = (tabelData.getModel().getValueAt(row, 5)).toString();
        String jun = (tabelData.getModel().getValueAt(row, 6)).toString();
        String jul = (tabelData.getModel().getValueAt(row, 7)).toString();
        String agus = (tabelData.getModel().getValueAt(row, 8)).toString();
        String sept = (tabelData.getModel().getValueAt(row, 9)).toString();
        String okt = (tabelData.getModel().getValueAt(row, 10)).toString();
        String nov = (tabelData.getModel().getValueAt(row, 11)).toString();
        String des = (tabelData.getModel().getValueAt(row, 12)).toString();

        DefaultCategoryDataset pieDataset = new DefaultCategoryDataset();
        //        pieDataset.setValue("Diagnosa", new Integer(jan));
        pieDataset.setValue(new Integer(jan), "", "Januari");
        pieDataset.setValue(new Integer(feb), "", "Februari");
        pieDataset.setValue(new Integer(mar), "", "Maret");
        pieDataset.setValue(new Integer(apr), "", "April");
        pieDataset.setValue(new Integer(mei), "", "Mei");
        pieDataset.setValue(new Integer(jun), "", "Juni");
        pieDataset.setValue(new Integer(jul), "", "Juli");
        pieDataset.setValue(new Integer(agus), "", "Agustus");
        pieDataset.setValue(new Integer(sept), "", "September");
        pieDataset.setValue(new Integer(okt), "", "Oktober");
        pieDataset.setValue(new Integer(nov), "", "November");
        pieDataset.setValue(new Integer(des), "", "Desember");
        JFreeChart chart = ChartFactory.createBarChart3D(
                "STATISTIK HASIL DIGNOSA\nNAMA PENYAKIT: " + namaPenyakit, "BULAN", "JUMLAH",
                (CategoryDataset) pieDataset, PlotOrientation.VERTICAL, false, true, false);
        chart.setBackgroundPaint(Color.yellow);
        chart.getTitle().setPaint(Color.red);

        final CategoryPlot p = chart.getCategoryPlot();

        BarRenderer renderer = (BarRenderer) p.getRenderer();
        DecimalFormat sdf = new DecimalFormat("#,##0");
        renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator("{2}", sdf));
        p.setRenderer(renderer);/*from  w  w w. java 2  s  . com*/
        renderer.setBasePositiveItemLabelPosition(
                new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.TOP_CENTER));
        renderer.setItemLabelsVisible(true);
        chart.getCategoryPlot().setRenderer(renderer);

        p.setRangeGridlinePaint(Color.blue);
        ChartFrame frame = new ChartFrame("barchart", chart);
        frame.setVisible(true);
        frame.setLocation(250, 100);
        frame.setSize(800, 600);
    } else if (vpil.getSelectedIndex() == 2) {
        int row = tabelData.getSelectedRow();
        String jan = (tabelData.getModel().getValueAt(row, 1)).toString();
        String feb = (tabelData.getModel().getValueAt(row, 2)).toString();
        String mar = (tabelData.getModel().getValueAt(row, 3)).toString();
        String apr = (tabelData.getModel().getValueAt(row, 4)).toString();
        String mei = (tabelData.getModel().getValueAt(row, 5)).toString();
        String jun = (tabelData.getModel().getValueAt(row, 6)).toString();
        String jul = (tabelData.getModel().getValueAt(row, 7)).toString();
        String agus = (tabelData.getModel().getValueAt(row, 8)).toString();
        String sept = (tabelData.getModel().getValueAt(row, 9)).toString();
        String okt = (tabelData.getModel().getValueAt(row, 10)).toString();
        String nov = (tabelData.getModel().getValueAt(row, 11)).toString();
        String des = (tabelData.getModel().getValueAt(row, 12)).toString();
        DefaultPieDataset pieDataset = new DefaultPieDataset();
        pieDataset.setValue("Januari", new Integer(jan));
        pieDataset.setValue("Februari", new Integer(feb));
        pieDataset.setValue("Maret", new Integer(mar));
        pieDataset.setValue("April", new Integer(apr));
        pieDataset.setValue("Mei", new Integer(mei));
        pieDataset.setValue("Juni", new Integer(jun));
        pieDataset.setValue("Juli", new Integer(jul));
        pieDataset.setValue("Agustus", new Integer(agus));
        pieDataset.setValue("September", new Integer(sept));
        pieDataset.setValue("Oktober", new Integer(okt));
        pieDataset.setValue("November", new Integer(nov));
        pieDataset.setValue("Desember", new Integer(des));
        JFreeChart chart = ChartFactory.createPieChart("STATISTIK HASIL DIGNOSA", pieDataset, true, true, true);
        //        PiePlot3D P = (PiePlot3D)chart.getPlot();
        PiePlot P = (PiePlot) chart.getPlot();
        //P.setForegroundAlpha(TOP_ALIGNMENT);
        ChartFrame frame = new ChartFrame("STATISTIK HASIL DIGNOSA", chart);
        frame.setVisible(true);
        frame.setLocation(250, 100);
        frame.setSize(800, 600);
    } else {

    }

}

From source file:simz1.StackedBarChart.java

public void DrinksGraph() {
    DefaultCategoryDataset drdata = new DefaultCategoryDataset();
    drdata.setValue(dr1, "sales", d1);
    drdata.setValue(dr2, "sales", d2);
    drdata.setValue(dr3, "sales", d3);
    drdata.setValue(dr4, "sales", d4);
    drdata.setValue(dr5, "sales", d5);
    drdata.setValue(dr6, "sales", d6);
    drdata.setValue(dr7, "sales", d7);

    JFreeChart chart4 = ChartFactory.createLineChart("Sales of Drinks last week", "Date", "sales", drdata,
            PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot c4 = chart4.getCategoryPlot();
    c4.setBackgroundPaint(Color.white);
    c4.getRenderer().setSeriesPaint(0, Color.YELLOW);
    //c4.setRangeGridlinePaint(Color.yellow);

    ChartPanel c4Panel = new ChartPanel(chart4);
    mhp.chartPanel.removeAll();//w ww  . j  a v  a2 s .co m
    mhp.chartPanel.add(c4Panel);
}

From source file:org.openscience.cdk.applications.taverna.basicutilities.ChartTool.java

/**
 * Creates a line chart.//from ww  w  .  ja va  2s  .co  m
 * 
 * @param title
 * @param categoryAxisLabel
 *            (X-Axis label)
 * @param valueAxisLabel
 *            (Y-Axis label)
 * @param dataset
 * @param includeZero
 *            True when zero shall be included to the axis range.
 * @return JfreeChart instance.
 */
public JFreeChart createLineChart(String title, String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, boolean includeZero, boolean drawShapes) {
    JFreeChart chart = ChartFactory.createLineChart(title, categoryAxisLabel, valueAxisLabel, dataset,
            this.orientation, this.drawLegend, false, false);
    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);
    chart.setAntiAlias(true);
    CategoryPlot plot = chart.getCategoryPlot();
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setLowerMargin(0.025);
    domainAxis.setUpperMargin(0.025);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setAutoRangeIncludesZero(includeZero);
    LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, Color.blue);
    renderer.setSeriesPaint(1, Color.red);
    renderer.setSeriesPaint(2, Color.green);
    renderer.setSeriesPaint(3, Color.darkGray);
    renderer.setSeriesPaint(4, Color.yellow);
    renderer.setDrawOutlines(true);
    renderer.setUseFillPaint(true);
    renderer.setBaseShapesVisible(drawShapes);
    renderer.setBaseShapesFilled(true);
    return chart;
}

From source file:cs.gui.stats.PerformanceStats.java

private ChartPanel createChart(String axisLabel, int type) {
    int width = (screenSize.width - (screenSize.width / 35));
    int height = (int) (screenSize.height - (screenSize.height / (double) 4));

    //int width = (screenSize.width - (screenSize.width / 35)) / 2;
    //int height = (int) (screenSize.height - (screenSize.height / (double) 4)) / 2;

    lastValue = new double[SUBPLOT_COUNT];
    //================= visualise standard chart ==========================
    CombinedDomainXYPlot combineddomainxyplot = new CombinedDomainXYPlot(new DateAxis("Time"));

    lastValue[0] = 100D;/*from   w  ww .  j av a 2  s  .c  o m*/
    TimeSeries timeseries = null;
    XYPlot xyplot = null;

    //add new timeseries to modularity row
    datasets[type] = new TimeSeriesCollection();

    NumberAxis numberaxis = new NumberAxis(axisLabel);
    numberaxis.setAutoRangeIncludesZero(true);

    //fast
    StandardXYItemRenderer xyItemRender = new StandardXYItemRenderer();
    //original
    //xyItemRender = new StandardXYItemRenderer();

    xyItemRender.setSeriesStroke(0,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(1,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(2,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(3,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));

    //TODO colours need to be defined statically before the renderer is created!
    xyplot = new XYPlot(datasets[type], null, numberaxis, xyItemRender);

    switch (type) {
    case 0: {
        xyItemRender.setSeriesPaint(0, Color.BLACK);
        timeseries = new TimeSeries("Number of existing threads", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
        timeseries = new TimeSeries("Number of answered threads", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 1: {
        xyItemRender.setSeriesPaint(0, Color.YELLOW);
        timeseries = new TimeSeries("Mean thread answer time (per day)", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 2: {
        xyItemRender.setSeriesPaint(0, Color.GRAY);
        timeseries = new TimeSeries("Number of thread replies", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 3: {
        xyItemRender.setSeriesPaint(0, Color.GREEN);
        timeseries = new TimeSeries("New thread arrival activity change (%)", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
        xyItemRender.setSeriesPaint(1, Color.BLUE);
        timeseries = new TimeSeries("Thread reply activity change (%)", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 4: {
        xyItemRender.setSeriesPaint(0, Color.GREEN);
        timeseries = new TimeSeries("Mean thread aswer time (per month)", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    }

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

    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    combineddomainxyplot.add(xyplot);

    ChartPanel chart = null;

    switch (type) {
    case 0: {
        jfreechart1 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart1.getSubtitle(0);

        //set legend fonts
        jfreechart1.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart1.setBorderPaint(Color.black);
        jfreechart1.setBorderVisible(true);
        jfreechart1.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis1 = combineddomainxyplot.getDomainAxis();
        dateAxis1 = (DateAxis) valueAxis1;

        if (scope1 == 0) {
            valueAxis1.setAutoRange(true);
        } else {
            valueAxis1.setFixedAutoRange(scope1);
        }

        chart = new ChartPanel(jfreechart1);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis1, dateAxis1, ddlScope1));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart1.setAntiAlias(false);
    }
        break;
    case 1: {

        jfreechart2 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart2.getSubtitle(0);

        //set legend fonts
        jfreechart2.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart2.setBorderPaint(Color.black);
        jfreechart2.setBorderVisible(true);
        jfreechart2.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis2 = combineddomainxyplot.getDomainAxis();
        dateAxis2 = (DateAxis) valueAxis2;

        if (scope2 == 0) {
            valueAxis2.setAutoRange(true);
        } else {
            valueAxis2.setFixedAutoRange(scope2);
        }

        chart = new ChartPanel(jfreechart2);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis2, dateAxis2, ddlScope2));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart2.setAntiAlias(false);
    }
        break;
    case 2: {

        jfreechart3 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart3.getSubtitle(0);

        //set legend fonts
        jfreechart3.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart3.setBorderPaint(Color.black);
        jfreechart3.setBorderVisible(true);
        jfreechart3.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis3 = combineddomainxyplot.getDomainAxis();
        dateAxis3 = (DateAxis) valueAxis3;

        if (scope3 == 0) {
            valueAxis3.setAutoRange(true);
        } else {
            valueAxis3.setFixedAutoRange(scope3);
        }

        chart = new ChartPanel(jfreechart3);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis3, dateAxis3, ddlScope3));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart3.setAntiAlias(false);
    }
        break;
    case 3: {
        jfreechart4 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart4.getSubtitle(0);

        //set legend fonts
        jfreechart4.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart4.setBorderPaint(Color.black);
        jfreechart4.setBorderVisible(true);
        jfreechart4.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis4 = combineddomainxyplot.getDomainAxis();
        dateAxis4 = (DateAxis) valueAxis4;

        if (scope4 == 0) {
            valueAxis4.setAutoRange(true);
        } else {
            valueAxis4.setFixedAutoRange(scope4);
        }

        chart = new ChartPanel(jfreechart4);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis4, dateAxis4, ddlScope4));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart4.setAntiAlias(false);
    }
        break;
    case 4: {
        jfreechart5 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart5.getSubtitle(0);

        //set legend fonts
        jfreechart5.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart5.setBorderPaint(Color.black);
        jfreechart5.setBorderVisible(true);
        jfreechart5.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis5 = combineddomainxyplot.getDomainAxis();
        dateAxis5 = (DateAxis) valueAxis5;

        if (scope5 == 0) {
            valueAxis5.setAutoRange(true);
        } else {
            valueAxis5.setFixedAutoRange(scope5);
        }

        chart = new ChartPanel(jfreechart5);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis5, dateAxis5, ddlScope5));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart5.setAntiAlias(false);
    }
        break;
    }

    return chart;

}

From source file:piilSource.BarChart.java

private JFreeChart createChart(String title, final CategoryDataset dataset, String metaLabel) {

    // create the chart...
    final JFreeChart chart = ChartFactory.createBarChart(
            "Barplot of the " + metaLabel + " values for all samples - " + title, // chart title
            "Samples", // domain axis label
            metaLabel + " values", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, // tooltips?
            false // URLs?
    );/*from   ww  w .  j av a2  s.  c o m*/

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);

    // get a reference to the plot for further customisation...
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.red);
    plot.setRangeGridlinePaint(Color.white);

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    if (metaLabel.equals("beta")) {
        rangeAxis.setRange(0, 1);
        rangeAxis.setTickUnit(new NumberTickUnit(0.2));
    }

    // disable bar outlines...
    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    // set up gradient paints for series...
    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.blue);
    final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.green);
    final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.red);
    final GradientPaint gp3 = new GradientPaint(0.0f, 0.0f, Color.yellow, 0.0f, 0.0f, Color.yellow);
    final GradientPaint gp4 = new GradientPaint(0.0f, 0.0f, Color.cyan, 0.0f, 0.0f, Color.cyan);
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);
    renderer.setSeriesPaint(3, gp3);
    renderer.setSeriesPaint(4, gp4);

    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    if (dataset.getColumnCount() > 40) {
        domainAxis.setTickLabelFont(new Font("Serif", Font.PLAIN, 10));
        domainAxis
                .setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2));
    }
    return chart;
}

From source file:net.sf.firemox.clickable.target.card.CardFactory.java

/**
 * Update the card border's color and other UI colors requiring only a global
 * repaint to update the UI./*www  .j a  v a 2s  . co  m*/
 * 
 * @param colorStr
 *          is the new card border's color
 */
public static void updateColor(String colorStr) {
    if (colorStr != null) {
        if ("white".equals(colorStr)) {
            borderColor = Color.WHITE;
        } else if ("gold".equals(colorStr)) {
            borderColor = Color.YELLOW.darker().darker();
        } else if ("black".equals(colorStr)) {
            borderColor = Color.BLACK;
        } else {
            // Auto
            borderColor = null;
        }
    }
    powerToughnessColor = new Color(Configuration.getInt("powerToughnessColor", Color.BLUE.getRGB()));
}

From source file:org.rdv.viz.dial.DialPanel.java

/**
 * Updates the threshold ranges./* w w w  . j a v a 2s . c  o  m*/
 * 
 * @param range  the dial range
 */
private void updateThresholdRanges() {
    Range range = model.getRange();
    double warningThresh = model.getWarningThreshold() * (range.getLength());
    double criticalThresh = model.getCriticalThreshold() * (range.getLength());

    criticalMinimumThreshold = range.getLowerBound() + criticalThresh;
    warningMinimumThreshold = range.getLowerBound() + warningThresh;
    warningMaximumThreshold = range.getUpperBound() - warningThresh;
    criticalMaxThreshold = range.getUpperBound() - criticalThresh;

    // remove previous dial ranges
    for (StandardDialRange dialRange : thresholdDialRanges) {
        if (dialRange != null) {
            plot.removeLayer(dialRange);
        }
    }

    thresholdDialRanges[0] = new StandardDialRange(range.getLowerBound(), criticalMinimumThreshold, Color.red);
    thresholdDialRanges[0].setInnerRadius(0);
    thresholdDialRanges[0].setOuterRadius(0.9);
    plot.addLayer(thresholdDialRanges[0]);

    thresholdDialRanges[1] = new StandardDialRange(criticalMinimumThreshold, warningMinimumThreshold,
            Color.yellow);
    thresholdDialRanges[1].setInnerRadius(0);
    thresholdDialRanges[1].setOuterRadius(0.9);
    plot.addLayer(thresholdDialRanges[1]);

    thresholdDialRanges[2] = new StandardDialRange(warningMaximumThreshold, criticalMaxThreshold, Color.yellow);
    thresholdDialRanges[2].setInnerRadius(0);
    thresholdDialRanges[2].setOuterRadius(0.9);
    plot.addLayer(thresholdDialRanges[2]);

    thresholdDialRanges[3] = new StandardDialRange(criticalMaxThreshold, range.getUpperBound(), Color.red);
    thresholdDialRanges[3].setInnerRadius(0);
    thresholdDialRanges[3].setOuterRadius(0.9);
    plot.addLayer(thresholdDialRanges[3]);

    // make sure to do this after changing the dial ranges because it gets reset for some reason
    dialValueIndicator.setTemplateValue(-222.222e222);

    checkThresholds();
}

From source file:com.icesoft.faces.component.outputchart.AbstractChart.java

public ColorMap() {
    this.put("black", Color.BLACK);
    this.put("blue", Color.BLUE);
    this.put("cyan", Color.CYAN);
    this.put("darkGray", Color.DARK_GRAY);
    this.put("gray", Color.GRAY);
    this.put("green", Color.GREEN);
    this.put("lightGray", Color.LIGHT_GRAY);
    this.put("magenta", Color.MAGENTA);
    this.put("orange", Color.ORANGE);
    this.put("pink", Color.PINK);
    this.put("red", Color.RED);
    this.put("white", Color.WHITE);
    this.put("yellow", Color.YELLOW);
}

From source file:co.com.soinsoftware.hotelero.view.JFRoom.java

private void setBackgroudForNotEnabledRooms() {
    this.releaseAllRooms();
    final RoomStatus statusCheckIn = roomStatusController.selectDisabled();
    if (this.notEnabledSet != null) {
        for (final Invoice invoice : this.notEnabledSet) {
            final String roomName = invoice.getRoom().getName();
            final RoomStatus roomStatus = invoice.getRoomStatus();
            final Color color = (roomStatus.equals(statusCheckIn)) ? Color.RED : Color.YELLOW;
            this.setBackgroudForNotEnabledRooms(roomName, color);
        }/*from  ww w . j  a va 2  s. com*/
    }
}

From source file:net.sf.maltcms.chromaui.charts.GradientPaintScale.java

/**
 *
 * @return/*ww  w . j  ava2 s  .  c  om*/
 */
public static Color[] getDefaultColorRamp() {
    Color[] c = new Color[] { Color.BLUE, Color.MAGENTA, Color.RED, Color.ORANGE, Color.YELLOW, Color.WHITE };
    return c;
}