Example usage for java.awt Color PINK

List of usage examples for java.awt Color PINK

Introduction

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

Prototype

Color PINK

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

Click Source Link

Document

The color pink.

Usage

From source file:org.osjava.reportrunner_plugins.renderers.jfreechart.creators.TexturedBarRenderer.java

public java.awt.Paint getSeriesPaint(int row) {
    BufferedImage bufferedImage = new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB);
    Graphics2D big = bufferedImage.createGraphics();
    TexturePaint texture = null;//from   www . j  a v a2  s . co m
    int rowNum = row + 1;
    int patNum = 13;
    int formula = rowNum - ((rowNum / patNum) * patNum);

    if (formula == 0) {
        big.setColor(Color.orange);
        big.fillRect(0, 0, 5, 5);
        big.fillRect(1, 0, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);

    } else if (formula == 1) {
        big.setColor(Color.red);
        big.fillRect(0, 0, 5, 5);
        big.fillRect(1, 0, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 2) {
        Color color = Color.blue;
        big.setColor(Color.white);
        big.fillRect(0, 0, 5, 5);
        big.setColor(color);
        big.fillRect(0, 1, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);

        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 3) {
        Color color = Color.yellow;
        big.setColor(Color.orange);
        big.fillRect(0, 0, 5, 5);
        big.setColor(color);
        big.fillRect(1, 1, 4, 4);
        Rectangle r = new Rectangle(0, 0, 5, 5);

        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 4) {
        big.setColor(Color.green);
        big.fillRect(0, 0, 5, 5);
        big.fillRect(1, 0, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 5) {
        big.setColor(Color.magenta);
        big.fillRect(0, 0, 5, 5);
        big.setColor(Color.pink);
        big.fillRect(0, 0, 4, 4);

        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 6) {
        float[] x = { .5f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f };
        float[] y = { .5f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f };
        GeneralPath path = new GeneralPath();
        path.moveTo(x[0], y[0]);
        for (int j = 1; j < x.length; j++) {
            path.lineTo(x[j], y[j]);
        }

        big.setColor(new Color(226, 199, 252));
        big.fillRect(0, 0, 5, 5);
        big.setColor(Color.blue);
        big.setStroke(new BasicStroke(1.0f));

        big.draw(path);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 7) {
        big.setColor(Color.lightGray);
        big.fillRect(0, 0, 5, 5);
        big.setColor(Color.red);
        big.fillRect(1, 0, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 8) {
        float[] x = { .5f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f };
        float[] y = { .5f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f };
        GeneralPath path = new GeneralPath();
        path.moveTo(x[0], y[0]);
        for (int j = 1; j < x.length; j++) {
            path.lineTo(x[j], y[j]);

        }
        big.setColor(Color.blue);
        big.fillRect(0, 0, 5, 5);
        big.setColor(Color.cyan);
        big.setStroke(new BasicStroke(2.0f));
        big.draw(path);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 9) {
        Color color = new Color(0xBBBBDD);
        big.setColor(color);
        big.fillRect(0, 0, 5, 5);
        big.setColor(new Color(199, 201, 230));
        big.fillRect(1, 0, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 10) {
        float[] x = { 1, 2, 3, 4, 5 };
        float[] y = { 1, 2, 3, 4, 5 };
        GeneralPath path = new GeneralPath();
        path.moveTo(x[0], y[1]);
        path.lineTo(x[1], y[0]);
        path.moveTo(x[0], y[2]);
        path.lineTo(x[2], y[0]);
        path.moveTo(x[0], y[3]);
        path.lineTo(x[3], y[0]);
        path.moveTo(x[0], y[4]);
        path.lineTo(x[4], y[0]);
        big.setColor(Color.red);
        big.fillRect(0, 0, 5, 5);
        big.setColor(new Color(242, 242, 193));
        big.setStroke(new BasicStroke(3.0f));
        big.draw(path);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 11) {
        big.setColor(new Color(252, 169, 171));
        big.fillOval(0, 0, 5, 6);
        big.setColor(new Color(252, 230, 230));
        big.fillOval(0, 0, 3, 3);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    } else if (formula == 12) {
        big.setColor(Color.green);
        big.fillRect(0, 0, 5, 5);
        big.setColor(new Color(20, 178, 38));
        big.fillRect(2, 2, 5, 5);
        Rectangle r = new Rectangle(0, 0, 5, 5);
        texture = new TexturePaint(bufferedImage, r);
    }
    return texture;

}

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 {// w  w  w.j av a  2s  .  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:ar.com.fdvs.dj.test.StylesReport2Test.java

public DynamicReport buildReport() throws Exception {

    //      Style detailStyle = new Style();
    Style detailStyle = new StyleBuilder(false).setTransparency(Transparency.OPAQUE)
            .setBackgroundColor(new Color(200, 200, 230)).build();

    Style headerStyle = new Style();
    headerStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
    headerStyle.getFont().setItalic(true);
    headerStyle.setBorderTop(Border.PEN_2_POINT);
    headerStyle.setBorderBottom(Border.THIN);
    headerStyle.setBackgroundColor(Color.blue);
    headerStyle.setTransparency(Transparency.OPAQUE);
    headerStyle.setTextColor(Color.white);
    headerStyle.setHorizontalAlign(HorizontalAlign.CENTER);
    headerStyle.setVerticalAlign(VerticalAlign.MIDDLE);
    headerStyle.setRotation(Rotation.LEFT);

    Style titleStyle = new Style();
    titleStyle.setFont(new Font(10, Font._FONT_VERDANA, true));
    Style numberStyle = new Style();
    numberStyle.setHorizontalAlign(HorizontalAlign.RIGHT);
    Style amountStyle = new Style();
    amountStyle.setHorizontalAlign(HorizontalAlign.RIGHT);
    amountStyle.setBackgroundColor(Color.cyan);
    amountStyle.setTransparency(Transparency.OPAQUE);
    amountStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
    amountStyle.getFont().setUnderline(true);
    amountStyle.setPaddingBottom(new Integer(5));
    Style oddRowStyle = new Style();
    oddRowStyle.setBorder(Border.NO_BORDER);
    Color veryLightGrey = new Color(230, 230, 230);
    oddRowStyle.setBackgroundColor(veryLightGrey);
    oddRowStyle.setTransparency(Transparency.OPAQUE);

    Style variableStyle = new Style();
    BeanUtils.copyProperties(variableStyle, amountStyle);
    variableStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
    variableStyle.setBackgroundColor(Color.PINK);

    Style variableStyle2 = new Style();
    BeanUtils.copyProperties(variableStyle2, amountStyle);
    variableStyle2.setFont(Font.ARIAL_MEDIUM_BOLD);
    variableStyle2.setBackgroundColor(Color.ORANGE);

    DynamicReportBuilder drb = new DynamicReportBuilder();
    Integer margin = new Integer(20);

    drb.setTitle("November 2006 sales report") //defines the title of the report
            .setSubtitle("The items in this report correspond "
                    + "to the main products: DVDs, Books, Foods and Magazines")
            .setTitleStyle(titleStyle).setTitleHeight(new Integer(30))
            .setDefaultStyles(null, null, null, detailStyle).setSubtitleHeight(new Integer(20))
            .setDetailHeight(new Integer(15))
            //         .setLeftMargin(margin)
            //         .setRightMargin(margin)
            //         .setTopMargin(margin)
            //         .setBottomMargin(margin)
            .setPrintBackgroundOnOddRows(true).setOddRowBackgroundStyle(oddRowStyle)
            .setColumnsPerPage(new Integer(1)).setColumnSpace(new Integer(5));

    AbstractColumn columnState = ColumnBuilder.getNew().setColumnProperty("state", String.class.getName())
            .setTitle("State").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle)
            .build();/*from  ww w  .j  av  a  2 s  . c  o  m*/

    AbstractColumn columnBranch = ColumnBuilder.getNew().setColumnProperty("branch", String.class.getName())
            .setTitle("Branch").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle)
            .build();

    AbstractColumn columnaProductLine = ColumnBuilder.getNew()
            .setColumnProperty("productLine", String.class.getName()).setTitle("Product Line")
            .setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle).build();

    AbstractColumn columnaItem = ColumnBuilder.getNew().setColumnProperty("item", String.class.getName())
            .setTitle("item").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle)
            .build();

    AbstractColumn columnCode = ColumnBuilder.getNew().setColumnProperty("id", Long.class.getName())
            .setTitle("ID").setWidth(new Integer(40)).setStyle(numberStyle).setHeaderStyle(headerStyle).build();

    AbstractColumn columnaCantidad = ColumnBuilder.getNew().setColumnProperty("quantity", Long.class.getName())
            .setTitle("Quantity").setWidth(new Integer(80)).setStyle(numberStyle).setHeaderStyle(headerStyle)
            .build();

    AbstractColumn columnAmount = ColumnBuilder.getNew().setColumnProperty("amount", Float.class.getName())
            .setTitle("Amount").setWidth(new Integer(90)).setPattern("$ 0.00").setStyle(amountStyle)
            .setHeaderStyle(headerStyle).build();

    drb.addColumn(columnState);
    drb.addColumn(columnaItem);
    drb.addColumn(columnBranch);
    drb.addColumn(columnaProductLine);
    drb.addColumn(columnCode);
    drb.addColumn(columnaCantidad);
    drb.addColumn(columnAmount);

    DJGroup group = new GroupBuilder().setCriteriaColumn((PropertyColumn) columnState)
            .addFooterVariable(columnAmount, DJCalculation.SUM, variableStyle).build();
    drb.addGroup(group);

    DJGroup group2 = new GroupBuilder().setCriteriaColumn((PropertyColumn) columnaItem)
            .addFooterVariable(columnAmount, DJCalculation.SUM).build();
    drb.addGroup(group2);

    group2.setDefaulFooterVariableStyle(variableStyle2);

    drb.setUseFullPageWidth(true);

    DynamicReport dr = drb.build();
    //      saveXML(dr,"dynamicReport");
    return dr;
}

From source file:org.samjoey.graphing.GraphUtility.java

public static HashMap<String, ChartPanel> getGraphs(LinkedList<Game> games) {
    HashMap<String, XYSeriesCollection> datasets = new HashMap<>();
    for (int j = 0; j < games.size(); j++) {
        Game game = games.get(j);/*from  ww  w.j  a va2 s. c  o m*/
        if (game == null) {
            continue;
        }
        for (String key : game.getVarData().keySet()) {
            if (datasets.containsKey(key)) {
                try {
                    datasets.get(key).addSeries(createSeries(game.getVar(key), "" + game.getId()));
                } catch (Exception e) {
                }
            } else {
                datasets.put(key, new XYSeriesCollection());
                datasets.get(key).addSeries(createSeries(game.getVar(key), "" + game.getId()));
            }
        }
    }
    HashMap<String, ChartPanel> chartPanels = new HashMap<>();
    for (String key : datasets.keySet()) {
        JFreeChart chart = ChartFactory.createXYLineChart(key, // chart title
                "X", // x axis label
                "Y", // y axis label
                datasets.get(key), // data
                PlotOrientation.VERTICAL, false, // include legend
                true, // tooltips
                false // urls
        );
        XYPlot plot = chart.getXYPlot();
        XYItemRenderer rend = plot.getRenderer();
        for (int i = 0; i < games.size(); i++) {
            Game g = games.get(i);
            if (g.getWinner() == 1) {
                rend.setSeriesPaint(i, Color.RED);
            }
            if (g.getWinner() == 2) {
                rend.setSeriesPaint(i, Color.BLACK);
            }
            if (g.getWinner() == 0) {
                rend.setSeriesPaint(i, Color.PINK);
            }
        }
        ChartPanel chartPanel = new ChartPanel(chart);
        chartPanels.put(key, chartPanel);
    }
    return chartPanels;
}

From source file:view.statistics.RequestStatsAndPrediction.java

/**
 * Creates new form PredictRequests//w w w  . j a v  a2s .  c  o  m
 */
public RequestStatsAndPrediction() throws FileNotFoundException, IOException {
    initComponents();
    FileInputStream imgStream = null;
    File imgfile = new File("..\\BBMS\\src\\images\\drop.png");
    imgStream = new FileInputStream(imgfile);
    BufferedImage bi = ImageIO.read(imgStream);
    ImageIcon myImg = new ImageIcon(bi);
    this.setFrameIcon(myImg);
    setTitle("Request Statistics and Prediction");
    sdcontroller = new SampleDetailsController();
    Calendar calendar = Calendar.getInstance();
    yearChooser.setStartYear(calendar.get(Calendar.YEAR));
    monthChooser.setMonth(calendar.get(calendar.MONTH) + 1);

    int year = yearChooser.getYear();
    int month = monthChooser.getMonth() + 1;

    int currentYear = Calendar.getInstance().get(Calendar.YEAR);
    int currentMonth = Calendar.getInstance().get(Calendar.MONTH) + 1;

    int data[][] = null;

    try {
        data = sdcontroller.getYearlyRequestCountsOf(month);
    } catch (ClassNotFoundException ex) {
        Logger.getLogger(RequestStatsAndPrediction.class.getName()).log(Level.SEVERE, null, ex);
    } catch (SQLException ex) {
        Logger.getLogger(RequestStatsAndPrediction.class.getName()).log(Level.SEVERE, null, ex);
    }

    if (year >= currentYear && month >= currentMonth) {

        try {
            predictText.setText(Predictions.getPredictedRequestsOf(year, month) + "");
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(RequestStatsAndPrediction.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(RequestStatsAndPrediction.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else {
        JOptionPane.showMessageDialog(this,
                "Predictions available only for future months. Only the graph will be drawn", "Error",
                JOptionPane.ERROR_MESSAGE);
        predictText.setText("Invalid input!");
    }

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    if (data != null) {
        for (int i = 0; i < data[0].length; i++) {
            dataset.setValue(data[1][i], "Bla bla bla", data[0][i] + "");
        }
    }

    JFreeChart chart = ChartFactory.createLineChart3D(
            "Yearly Blood Request Count For The Month of " + getMontName(month + ""), "Year", "Request Count",
            dataset, PlotOrientation.VERTICAL, false, true, false);
    chart.setBackgroundPaint(Color.PINK);
    chart.getTitle().setPaint(Color.RED);
    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.BLUE);

    ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new java.awt.Dimension(200, 350));
    chartAreaPanel.setLayout(new GridLayout());
    chartAreaPanel.removeAll();
    chartAreaPanel.revalidate();
    chartAreaPanel.add(panel);
    chartAreaPanel.repaint();

    this.repaint();

}

From source file:SumUp.java

/** init() is an Applet method called by the browser to initialize */
public void init() {
    setBackground(Color.magenta);
    // The layout of the Applet is a Grid; always add things in pairs!
    setLayout(new GridLayout(0, 2));
    Choice c;/*w  w w.  j a v a  2s.  co  m*/
    add(new Label("Option 1"));
    add(c = new Choice());
    c.addItem("0");
    c.addItem("100");
    c.addItem("200");
    c.addItem("400");
    cs[numChoices++] = c;

    add(new Label("Option 2"));
    add(c = new Choice());
    c.addItem("0");
    c.addItem("100");
    c.addItem("200");
    c.addItem("400");
    cs[numChoices++] = c;

    Panel p = new Panel();
    p.setBackground(Color.pink);
    p.add(new Label("Total:"));
    p.add(resultField = new Label("000000"));
    add(p);

    sendButton = new Button("Send it");
    add(sendButton); // connect Button into Applet
    sendButton.addActionListener(this); // connect it back to Applet
}

From source file:oct.analysis.application.OCTSelection.java

public void drawSelection(Graphics g, int imageOffsetX, int imageOffsetY) {
    if (highlighted) {
        g.setColor(Color.pink);
    } else {//from   w  w w .j  av  a  2  s.c o m
        g.setColor(Color.green);
    }
    //draw lines arround the area that is the selection
    int leftEdge = getSelectionLeftEdgeCoordinate();
    int rightEdge = getSelectionRightEdgeCoordinate();
    //        g.drawRect(imageOffsetX + leftEdge - 1, imageOffsetY + yPositionOnOct - 1, width + 2, height + 2);
    //draw left line
    g.drawLine(imageOffsetX + leftEdge - 1, imageOffsetY + yPositionOnOct, imageOffsetX + leftEdge - 1,
            imageOffsetY + yPositionOnOct + height - 1);
    //draw right line
    g.drawLine(imageOffsetX + rightEdge + 1, imageOffsetY + yPositionOnOct, imageOffsetX + rightEdge + 1,
            imageOffsetY + yPositionOnOct + height - 1);
    //draw top line
    g.drawLine(imageOffsetX + leftEdge, imageOffsetY + yPositionOnOct, imageOffsetX + rightEdge,
            imageOffsetY + yPositionOnOct);
    //draw bottom line
    g.drawLine(imageOffsetX + leftEdge, imageOffsetY + yPositionOnOct + height, imageOffsetX + rightEdge,
            imageOffsetY + yPositionOnOct + height);
    //draw button for interacting with the selection
    drawSelectButton(g, imageOffsetX, imageOffsetY);
    drawn = true;
}

From source file:storybook.ui.chart.jfreechart.ChartUtil.java

public static Marker getDateIntervalMarker(Date paramDate1, Date paramDate2, String paramString) {
    double d1 = paramDate1.getTime();
    double d2 = paramDate2.getTime();
    BasicStroke localBasicStroke = new BasicStroke(0.3F);
    IntervalMarker localIntervalMarker = new IntervalMarker(d1, d2, Color.pink, localBasicStroke, Color.black,
            localBasicStroke, 0.5F);/*w w w  . j av  a  2 s .  c o  m*/
    localIntervalMarker.setLabel(paramString);
    localIntervalMarker.setLabelAnchor(RectangleAnchor.BOTTOM);
    localIntervalMarker.setLabelTextAnchor(TextAnchor.BOTTOM_CENTER);
    return localIntervalMarker;
}

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

private void initRenderer(CategoryItemRenderer renderer) {
    Color[] colors = new Color[] { Color.red, Color.blue, Color.orange, Color.cyan, Color.yellow, Color.magenta,
            Color.green, Color.pink, Color.black, Color.gray };

    if (!this.roadNetworkStatisticsList.isEmpty()) {
        for (int i = 0; i < this.roadNetworkStatisticsList.size(); i++) {
            renderer.setSeriesPaint(i, colors[i % colors.length]);
        }//from w  w w  .  j  a  v  a 2 s  .  c  o m
    }
}

From source file:com.att.aro.ui.view.diagnostictab.plot.NetworkTypePlot.java

private void setRenderingColorForDataSeries(XYItemRenderer renderer,
        final XYIntervalSeriesCollection dataSeries) {
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.none), Color.WHITE);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.LTE), Color.RED);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.WIFI), Color.BLUE);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.UMTS), Color.PINK);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.ETHERNET), Color.BLACK);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSDPA), Color.YELLOW);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSPA), Color.ORANGE);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSPAP), Color.MAGENTA);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSUPA), Color.CYAN);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.GPRS), Color.GRAY);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.EDGE), Color.LIGHT_GRAY);
}