Example usage for java.awt Color orange

List of usage examples for java.awt Color orange

Introduction

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

Prototype

Color orange

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

Click Source Link

Document

The color orange.

Usage

From source file:net.sf.jsfcomp.chartcreator.utils.ChartUtils.java

public static Color getColor(String color) {
    // HTML colors (#FFFFFF format)
    if (color.startsWith("#")) {
        return new Color(Integer.parseInt(color.substring(1), 16));
    } else {/*from   w ww  . j a va2  s  .  c o m*/
        // Colors by name
        if (color.equalsIgnoreCase("black"))
            return Color.black;
        if (color.equalsIgnoreCase("gray"))
            return Color.gray;
        if (color.equalsIgnoreCase("yellow"))
            return Color.yellow;
        if (color.equalsIgnoreCase("green"))
            return Color.green;
        if (color.equalsIgnoreCase("blue"))
            return Color.blue;
        if (color.equalsIgnoreCase("red"))
            return Color.red;
        if (color.equalsIgnoreCase("orange"))
            return Color.orange;
        if (color.equalsIgnoreCase("cyan"))
            return Color.cyan;
        if (color.equalsIgnoreCase("magenta"))
            return Color.magenta;
        if (color.equalsIgnoreCase("darkgray"))
            return Color.darkGray;
        if (color.equalsIgnoreCase("lightgray"))
            return Color.lightGray;
        if (color.equalsIgnoreCase("pink"))
            return Color.pink;
        if (color.equalsIgnoreCase("white"))
            return Color.white;

        throw new RuntimeException("Unsupported chart color:" + color);
    }
}

From source file:nl.detoren.ijsco.io.ExcelExport.java

public void exportGroepen(Groepen groepen) {
    String password = "abcd";
    try {//from   w  w  w  .  j av a  2 s .  c  o  m
        if (groepen == null)
            return;
        // sheetindx geeft index in Excel template op basis van groepsgrootte. -1: geen sheet voor groepsgrootte 
        int[] sheetindx = new int[] { -1, -1, -1, -1, 5, -1, 4, -1, 3, -1, 2, -1, 1, -1, 0, -1, -1, -1 };
        // columnsize geeft lengte in Excel template op basis van groepsgrootte. -1: geen sheet voor groepsgrootte
        int[] columnsize = new int[] { -1, -1, -1, -1, 20, -1, 35, -1, 54, -1, 77, -1, 100, -1, 127, -1, -1,
                -1 };
        // pagelngth geeft lengte in Excel template op basis van groepsgrootte. -1: geen sheet voor groepsgrootte
        int[] pagelngth = new int[] { -1, -1, -1, -1, 20, -1, 35, -1, 54, -1, 77, -1, 100, -1, 127, -1, -1,
                -1 };
        int sheet2row = 2;
        int sheet3row = 2;
        FileInputStream file = new FileInputStream("Indeling.xlsm");
        XSSFWorkbook workbook = new XSSFWorkbook(file);
        XSSFCellStyle style1 = workbook.createCellStyle();
        style1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        style1.setFillForegroundColor(new XSSFColor(new java.awt.Color(180, 180, 180)));
        XSSFCellStyle my_style = workbook.createCellStyle();
        XSSFColor my_foreground = new XSSFColor(Color.ORANGE);
        XSSFColor my_background = new XSSFColor(Color.RED);
        my_style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        my_style.setFillForegroundColor(my_foreground);
        my_style.setFillBackgroundColor(my_background);
        XSSFSheet sheet2 = workbook.getSheet("Groepsindeling");
        XSSFSheet sheet3 = workbook.getSheet("Deelnemerslijst");
        updateCell(sheet3, sheet3row, 0, "Naam", style1);
        updateCell(sheet3, sheet3row, 1, "KNSB nr", style1);
        updateCell(sheet3, sheet3row, 2, "rating", style1);
        updateCell(sheet3, sheet3row, 3, "groep", style1);
        sheet3row++;
        for (Groep groep : groepen) {
            logger.log(Level.INFO, "Exporteer groep : " + groep.getNaam());
            XSSFSheet sheet = workbook.cloneSheet(sheetindx[groep.getGrootte()], groep.getNaam());
            updateCell(sheet, 0, 6, groep.getNaam());
            updateCell(sheet2, sheet2row, 1, groep.getNaam());
            sheet2row++;
            updateCell(sheet2, sheet2row, 0, "nr", style1);
            updateCell(sheet2, sheet2row, 1, "Naam", style1);
            updateCell(sheet2, sheet2row, 2, "KNSB nr", style1);
            updateCell(sheet2, sheet2row, 3, "rating", style1);
            sheet2row++;
            for (int i = 0; i < groep.getGrootte(); i++) {
                updateCell(sheet, 3 + i, 2, groep.getSpeler(i).getNaam());
                updateCell(sheet, 3 + i, 3, groep.getSpeler(i).getKnsbnummer());
                updateCell(sheet, 3 + i, 5, groep.getSpeler(i).getRating());
                updateCell(sheet2, sheet2row, 0, i + 1);
                updateCell(sheet2, sheet2row, 1,
                        "'" + sheet.getSheetName() + "'!"
                                + org.apache.poi.ss.util.CellReference.convertNumToColString(2) + (4 + i),
                        true);
                updateCell(sheet2, sheet2row, 2,
                        "'" + sheet.getSheetName() + "'!"
                                + org.apache.poi.ss.util.CellReference.convertNumToColString(3) + (4 + i),
                        true);
                updateCell(sheet2, sheet2row, 3,
                        "'" + sheet.getSheetName() + "'!"
                                + org.apache.poi.ss.util.CellReference.convertNumToColString(5) + (4 + i),
                        true);
                if (groep.getSpeler(i).getNaam() != "Bye") {
                    updateCell(sheet3, sheet3row, 0,
                            "'" + sheet.getSheetName() + "'!"
                                    + org.apache.poi.ss.util.CellReference.convertNumToColString(2) + (4 + i),
                            true);
                    updateCell(sheet3, sheet3row, 1,
                            "'" + sheet.getSheetName() + "'!"
                                    + org.apache.poi.ss.util.CellReference.convertNumToColString(3) + (4 + i),
                            true);
                    updateCell(sheet3, sheet3row, 2,
                            "'" + sheet.getSheetName() + "'!"
                                    + org.apache.poi.ss.util.CellReference.convertNumToColString(5) + (4 + i),
                            true);
                    updateCell(sheet3, sheet3row, 3, groep.getNaam());
                }
                sheet2row++;
                sheet3row++;
            }
            sheet2row++;
            sheet.setForceFormulaRecalculation(true);
            // Set print margins
            XSSFPrintSetup ps = sheet.getPrintSetup();
            ps.setLandscape(true);
            ps.setFitWidth((short) 1);
            sheet.setFitToPage(true);
            sheet.setAutobreaks(false);
            workbook.setPrintArea(workbook.getSheetIndex(sheet), 1, 26, 0, pagelngth[groep.getGrootte()]);
            sheet.setColumnBreak(18);
            sheet.protectSheet(password);
            sheet.enableLocking();
        }
        XSSFSheet sheet4 = workbook.cloneSheet(workbook.getSheetIndex(sheet3), "Deelnemerslijst (naam)");
        sortSheet(sheet4, 1, 3, 62);
        //XSSFSheet sheet5 = workbook.cloneSheet(workbook.getSheetIndex(sheet3), "Deelnemerslijst (rating)");
        //sortSheet(sheet5, 1,4);
        sheet2.protectSheet(password);
        sheet3.protectSheet(password);
        sheet4.protectSheet(password);
        //sheet5.protectSheet(password);
        // Remove template sheets
        for (int i = 0; i < 6; i++) {
            workbook.removeSheetAt(0);
        }

        // Close input file
        file.close();
        // Store Excel to new file
        String filename = "Indeling resultaat.xlsm";
        File outputFile = new File(filename);
        FileOutputStream outFile = new FileOutputStream(outputFile);
        workbook.write(outFile);
        // Close output file
        workbook.close();
        outFile.close();
        // And open it in the system editor
        Desktop.getDesktop().open(outputFile);
    } catch (IOException e) {
        logger.log(Level.SEVERE, "Fout bij maken indeling excel : " + e.getMessage());

    }
}

From source file:org.gvsig.gui.beans.graphic.GraphicChartPanel.java

/**
 * Creates a chart.//w w  w  . j a v a 2 s  .com
 * @param dataset the dataset.
 * @return A chart.
 */
private void createChart() {
    chart = ChartFactory.createXYLineChart(null, null, null, dataset, PlotOrientation.VERTICAL, false, true,
            true);

    // Definir la lista de colores
    XYPlot plot = chart.getXYPlot();
    plot.getRenderer().setSeriesPaint(0, Color.red);
    plot.getRenderer().setSeriesPaint(1, Color.green);
    plot.getRenderer().setSeriesPaint(2, Color.blue);
    plot.getRenderer().setSeriesPaint(3, Color.cyan);
    plot.getRenderer().setSeriesPaint(4, Color.black);
    plot.getRenderer().setSeriesPaint(5, Color.darkGray);
    plot.getRenderer().setSeriesPaint(6, Color.gray);
    plot.getRenderer().setSeriesPaint(7, Color.magenta);
    plot.getRenderer().setSeriesPaint(8, Color.yellow);
    plot.getRenderer().setSeriesPaint(9, Color.orange);

    Image img = new ImageIcon(getClass().getResource("images/splash.png")).getImage();
    plot.setBackgroundPaint(null);
    plot.setBackgroundImageAlpha(0.18f);
    plot.setBackgroundImage(img);
}

From source file:umontreal.iro.lecuyer.charts.DiscreteDistIntChart.java

private void init() {
    int m = b - a + 1;
    double[][] cdf = new double[2][m];
    double[][] probability = new double[2][m];

    for (int i = 0; i < m; i++) {
        cdf[0][i] = i + a;//from   w ww.ja  v  a  2  s.com
        cdf[1][i] = dist.cdf(i + a);
        probability[0][i] = i + a;
        probability[1][i] = dist.prob(i + a);
    }

    double[][] cdfFinal = new double[2][2 * (m - 1)];
    for (int i = 0; i < m - 1; i++) {
        cdfFinal[0][2 * i] = cdf[0][i];
        cdfFinal[0][2 * i + 1] = cdf[0][i + 1];
        cdfFinal[1][2 * i] = cdf[1][i];
        cdfFinal[1][2 * i + 1] = cdf[1][i];
    }

    cdfChart = new XYLineChart("cdf: " + dist.toString(), "", "", cdfFinal);
    probChart = new XYLineChart("probability: " + dist.toString(), "", "", probability);
    cdfChart.setprobFlag(true);
    probChart.setprobFlag(true);

    // Only for tikZ
    XYListSeriesCollection collec = cdfChart.getSeriesCollection();
    collec.setColor(0, Color.BLUE);
    collec.setPlotStyle(0, "thick");
    collec.setMarksType(0, "only marks");

    collec = probChart.getSeriesCollection();
    collec.setColor(0, Color.ORANGE);
    collec.setPlotStyle(0, "ycomb");
    collec.setMarksType(0, "*");
    collec.setDashPattern(0, "solid");
}

From source file:edu.ku.brc.ui.skin.SkinsMgr.java

/**
 * Loads the skins from XML./*from  ww w.  j  a v  a 2s .  co m*/
 */
@SuppressWarnings("unchecked")
protected static Hashtable<String, Skin> load() {
    XStream xstream = new XStream();
    config(xstream);

    if (false) {
        Hashtable<String, Skin> skinsHash = new Hashtable<String, Skin>();

        /*
         giraffe_tile.png
        giraffe_tile1.png
        metal.jpg
        reptile_tiled.jpg
        reptile_tiled.png
         */
        String p = "/Users/rods/workspace/Specify6/";
        Skin skin1 = new Skin("metal", "metal desc");
        skin1.getItems().put("item1", new SkinItem("n1", "fn", 10, "plain", Color.BLACK, Color.MAGENTA,
                p + "giraffe_tile.png", "desc"));
        skin1.getItems().put("item2", new SkinItem("n2", "fn", 10, "bold", Color.BLACK, Color.ORANGE,
                p + "giraffe_tile.png", "desc"));

        Skin skin2 = new Skin("giraffe", "metal desc");
        skin2.getItems().put("item1",
                new SkinItem("n1", "fn", 10, "bolditalic", Color.GREEN, Color.YELLOW, p + "metal.jpg", "desc"));
        skin2.getItems().put("item2",
                new SkinItem("n2", "fn", 10, "italic", Color.BLUE, Color.RED, p + "metal.jpg", "desc"));

        skinsHash.put(skin1.getName(), skin1);
        skinsHash.put(skin2.getName(), skin2);

        File skinsFile = new File(XMLHelper.getConfigDirPath("skins.xml"));
        try {
            FileUtils.writeStringToFile(skinsFile, xstream.toXML(skinsHash));
        } catch (IOException ex) {
            edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
            edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SkinsMgr.class, ex);
            ex.printStackTrace();
        }
    }

    File skinsFile = new File(XMLHelper.getConfigDirPath("skins.xml"));
    if (skinsFile.exists()) {
        return (Hashtable<String, Skin>) xstream.fromXML(XMLHelper.getContents(skinsFile));
    }
    return null;
}

From source file:cs.ucy.ac.cy.osslicense.model.editor.visualizer.LicenseVisualizer.java

public VisualizationViewer<String, Edge> generateGraphView() {

    Transformer<String, Paint> vertexColor = new Transformer<String, Paint>() {
        public Paint transform(String licenseTerm) {
            if (licenseTerm.contains("May"))
                return Color.GREEN;
            if (licenseTerm.contains("Must"))
                return Color.ORANGE;
            if (licenseTerm.equals("LimitedLiability") || licenseTerm.equals("ProvideWithoutWarranty"))
                return Color.CYAN;
            return Color.YELLOW;
        }/*from  w  w  w .j  a  v a2s.  c  o m*/
    };

    Layout<String, Edge> layout = new CircleLayout<String, Edge>(this.licenseGraph);
    layout.setSize(new Dimension(1024, 768));
    VisualizationViewer<String, Edge> vv = new VisualizationViewer<String, Edge>(layout);
    vv.setPreferredSize(new Dimension(1024, 768));

    vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);
    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<Edge>());

    AbstractModalGraphMouse gm = new DefaultModalGraphMouse<String, Edge>();
    vv.setGraphMouse(gm);

    popupMenu = new LicenseTermPopupMenu<>(licenseModel);
    gm.add(popupMenu);

    return vv;
}

From source file:uk.co.modularaudio.mads.base.stereo_compressor.ui.OutSignalAmpMeter.java

private Color getColorForDb(final float dbValue) {
    if (dbValue == Float.NEGATIVE_INFINITY) {
        return Color.green;
    } else if (dbValue > ORANGE_THRESHOLD_DB) {
        return Color.RED;
    } else if (dbValue > GREEN_THRESHOLD_DB) {
        return Color.orange;
    } else {//from ww  w.j av a2 s .  c  o  m
        return Color.green;
    }
}

From source file:uk.co.modularaudio.mads.base.stereo_compressor.ui.SourceSignalAmpMeter.java

private Color getColorForDb(final float dbValue) {
    if (dbValue == Float.NEGATIVE_INFINITY) {
        return UNDER_THRESHOLD_COLOR;
    } else if (dbValue <= currentThresholdValueDb) {
        return UNDER_THRESHOLD_COLOR;
    } else if (dbValue > currentThresholdValueDb) {
        return OVER_THRESHOLD_COLOR;
    } else {/*from   w  w w  .  j  a  va 2  s .  co  m*/
        return Color.ORANGE;
    }
}

From source file:org.deeplearning4j.ui.TestRendering.java

@Ignore
@Test/* w w  w.  ja v a  2 s.  c  om*/
public void test() throws Exception {

    List<Component> list = new ArrayList<>();

    //Common style for all of the charts
    StyleChart s = new StyleChart.Builder().width(640, LengthUnit.Px).height(480, LengthUnit.Px)
            .margin(LengthUnit.Px, 100, 40, 40, 20).strokeWidth(2).pointSize(4)
            .seriesColors(Color.GREEN, Color.MAGENTA).titleStyle(new StyleText.Builder().font("courier")
                    .fontSize(16).underline(true).color(Color.GRAY).build())
            .build();

    //Line chart with vertical grid
    Component c1 = new ChartLine.Builder("Line Chart!", s)
            .addSeries("series0", new double[] { 0, 1, 2, 3 }, new double[] { 0, 2, 1, 4 })
            .addSeries("series1", new double[] { 0, 1, 2, 3 }, new double[] { 0, 1, 0.5, 2.5 })
            .setGridWidth(1.0, null) //Vertical grid lines, no horizontal grid
            .build();
    list.add(c1);

    //Scatter chart
    Component c2 = new ChartScatter.Builder("Scatter!", s)
            .addSeries("series0", new double[] { 0, 1, 2, 3 }, new double[] { 0, 2, 1, 4 }).showLegend(true)
            .setGridWidth(0, 0).build();
    list.add(c2);

    //Histogram with variable sized bins
    Component c3 = new ChartHistogram.Builder("Histogram!", s).addBin(-1, -0.5, 0.2).addBin(-0.5, 0, 0.5)
            .addBin(0, 1, 2.5).addBin(1, 2, 0.5).build();
    list.add(c3);

    //Stacked area chart
    Component c4 = new ChartStackedArea.Builder("Area Chart!", s).setXValues(new double[] { 0, 1, 2, 3, 4, 5 })
            .addSeries("series0", new double[] { 0, 1, 0, 2, 0, 1 })
            .addSeries("series1", new double[] { 2, 1, 2, 0.5, 2, 1 }).build();
    list.add(c4);

    //Table
    StyleTable ts = new StyleTable.Builder().backgroundColor(Color.LIGHT_GRAY).headerColor(Color.ORANGE)
            .borderWidth(1).columnWidths(LengthUnit.Percent, 20, 40, 40).width(500, LengthUnit.Px)
            .height(200, LengthUnit.Px).build();

    Component c5 = new ComponentTable.Builder(ts).header("H1", "H2", "H3").content(
            new String[][] { { "row0col0", "row0col1", "row0col2" }, { "row1col0", "row1col1", "row1col2" } })
            .build();
    list.add(c5);

    //Accordion decorator, with the same chart
    StyleAccordion ac = new StyleAccordion.Builder().height(480, LengthUnit.Px).width(640, LengthUnit.Px)
            .build();

    Component c6 = new DecoratorAccordion.Builder(ac).title("Accordion - Collapsed By Default!")
            .setDefaultCollapsed(true).addComponents(c5).build();
    list.add(c6);

    //Text with styling
    Component c7 = new ComponentText.Builder("Here's some blue text in a green div!",
            new StyleText.Builder().font("courier").fontSize(30).underline(true).color(Color.BLUE).build())
                    .build();

    //Div, with a chart inside
    Style divStyle = new StyleDiv.Builder().width(30, LengthUnit.Percent).height(200, LengthUnit.Px)
            .backgroundColor(Color.GREEN).floatValue(StyleDiv.FloatValue.right).build();
    Component c8 = new ComponentDiv(divStyle, c7,
            new ComponentText("(Also: it's float right, 30% width, 200 px high )", null));
    list.add(c8);

    //Timeline chart:
    List<ChartTimeline.TimelineEntry> entries = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        entries.add(new ChartTimeline.TimelineEntry("e0-" + i, 10 * i, 10 * i + 5, Color.BLUE));
    }
    List<ChartTimeline.TimelineEntry> entries2 = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        entries2.add(new ChartTimeline.TimelineEntry("e1-" + i, (int) (5 * i + 0.2 * i * i),
                (int) (5 * i + 0.2 * i * i) + 3, Color.ORANGE));
    }
    List<ChartTimeline.TimelineEntry> entries3 = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        entries3.add(new ChartTimeline.TimelineEntry("e2-" + i, (int) (2 * i + 0.6 * i * i + 3),
                (int) (2 * i + 0.6 * i * i + 3) + 2 * i + 1));
    }
    Color[] c = new Color[] { Color.CYAN, Color.YELLOW, Color.GREEN, Color.PINK };
    List<ChartTimeline.TimelineEntry> entries4 = new ArrayList<>();
    Random r = new Random(12345);
    for (int i = 0; i < 10; i++) {
        entries4.add(new ChartTimeline.TimelineEntry("e3-" + i, (int) (2 * i + 0.6 * i * i + 3),
                (int) (2 * i + 0.6 * i * i + 3) + i + 1, c[r.nextInt(c.length)]));
    }
    Component c9 = new ChartTimeline.Builder("Title", s).addLane("Lane 0", entries).addLane("Lane 1", entries2)
            .addLane("Lane 2", entries3).addLane("Lane 3", entries4).build();
    list.add(c9);

    //Generate HTML
    StringBuilder sb = new StringBuilder();
    sb.append("<!DOCTYPE html>\n" + "<html lang=\"en\">\n" + "<head>\n" + "    <meta charset=\"UTF-8\">\n"
            + "    <title>Title</title>\n" + "</head>\n" + "<body>\n" + "\n" + "    <div id=\"maindiv\">\n"
            + "\n" + "    </div>\n" + "\n" + "\n"
            + "    <script src=\"//code.jquery.com/jquery-1.10.2.js\"></script>\n"
            + "    <script src=\"https://code.jquery.com/ui/1.11.4/jquery-ui.min.js\"></script>\n"
            + "    <link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\">\n"
            + "    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js\"></script>\n"
            + "    <script src=\"src/main/resources/assets/dl4j-ui.js\"></script>\n" + "\n" + "    <script>\n");

    ObjectMapper om = new ObjectMapper();
    for (int i = 0; i < list.size(); i++) {
        Component component = list.get(i);
        sb.append("        ").append("var str").append(i).append(" = '")
                .append(om.writeValueAsString(component).replaceAll("'", "\\\\'")).append("';\n");

        sb.append("        ").append("var obj").append(i).append(" = Component.getComponent(str").append(i)
                .append(");\n");
        sb.append("        ").append("obj").append(i).append(".render($('#maindiv'));\n");
        sb.append("\n\n");
    }

    sb.append("    </script>\n" + "\n" + "</body>\n" + "</html>");

    FileUtils.writeStringToFile(new File("TestRendering.html"), sb.toString());
}

From source file:uk.co.modularaudio.mads.base.common.ampmeter.BIAmpMeter.java

private Color getColorForDb(final float dbValue) {
    if (dbValue == Float.NEGATIVE_INFINITY) {
        return Color.green;
    } else if (dbValue > AmpMeter.ORANGE_THRESHOLD_DB) {
        return Color.RED;
    } else if (dbValue > AmpMeter.GREEN_THRESHOLD_DB) {
        return Color.orange;
    } else {/*  w  w  w . j a v a  2  s .  c o  m*/
        return Color.green;
    }
}