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

public Main() {
    getContentPane().setLayout(new FlowLayout());
    JLabel labelTwo = new JLabel("www.java2s.com");
    labelTwo.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.red, Color.black));

    add(labelTwo);/*from   w  ww  .ja  v  a2 s  .  c  om*/

    JLabel labelThree = new JLabel("MatteBorder");
    labelThree.setBorder(BorderFactory.createMatteBorder(10, 10, 10, 10, Color.pink));
    add(labelThree);

    JLabel labelFour = new JLabel("TitledBorder");
    labelFour.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(10, 10, 10, 10, Color.pink),
                    "Title", TitledBorder.RIGHT, TitledBorder.BOTTOM));
    add(labelFour);

    JLabel labelSix = new JLabel("CompoundBorder");
    Border one = BorderFactory.createEtchedBorder();
    Border two = BorderFactory.createMatteBorder(4, 4, 4, 4, Color.blue);
    labelSix.setBorder(BorderFactory.createCompoundBorder(one, two));
    add(labelSix);

}

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

/**
 *
 * @param games the games to graph//  www.ja v a2s  .  co  m
 * @param key the variable to create the graph with
 * @param start if index, the index at which to start, else the percent in
 * the game at which to start
 * @param stop if index, the index at which to end, else the percent in the
 * game at which to end
 * @param index
 * @return
 */
public static ChartPanel getCustomGraph(Game[] games, String key, double start, double stop, boolean index) {
    XYSeriesCollection dataset = new XYSeriesCollection();
    for (Game game : games) {
        ArrayList<Double> data = game.getVar(key);
        int begin;
        int end;
        if (index) {
            begin = (int) start;
            end = (int) stop;
        } else {
            begin = (int) (data.size() / start);
            end = (int) (data.size() / stop);
        }
        XYSeries series = GraphUtility.createSeries(data.subList(begin, end), "" + game.getId());
        dataset.addSeries(series);
    }
    JFreeChart chart = ChartFactory.createXYLineChart(key, // chart title
            "X", // x axis label
            "Y", // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, false, // include legend
            true, // tooltips
            false // urls
    );
    XYPlot plot = chart.getXYPlot();
    XYItemRenderer rend = plot.getRenderer();
    for (int i = 0; i < games.length; i++) {
        Game g = games[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);
    return chartPanel;
}

From source file:uk.ac.abdn.csd.p2p.server.VertexPainter.java

/**
 * Method to tranform the colour asscoiated with a {@code Vertex}
 * @param v Instance of a {@code Vertex}
 * @return Instance of {@code Paint} object
 *//*from   w w  w.  j a  va2  s.  c  om*/
public Paint transform(Vertex v) //So for each node that we draw...
{
    //We check the member variable, mColor, of the node.
    if (v.getColor().equalsIgnoreCase("yellow")) //If the node's mColor value is "yellow" we...
        return (Color.yellow); // Return our color, Color.yellow.
    else if (v.getColor().equalsIgnoreCase("red"))
        return (Color.red);
    else if (v.getColor().equalsIgnoreCase("blue"))
        return (Color.blue);
    else if (v.getColor().equalsIgnoreCase("green"))
        return (Color.green);
    else if (v.getColor().equalsIgnoreCase("orange"))
        return (Color.orange);
    else if (v.getColor().equalsIgnoreCase("pink"))
        return (Color.pink);
    else if (v.getColor().equalsIgnoreCase("black"))
        return (Color.black);
    else if (v.getColor().equalsIgnoreCase("cyan"))
        return (Color.cyan);
    else if (v.getColor().equalsIgnoreCase("dark_grey"))
        return (Color.DARK_GRAY);
    else if (v.getColor().equalsIgnoreCase("grey"))
        return (Color.gray);
    else if (v.getColor().equalsIgnoreCase("light_grey"))
        return (Color.lightGray);
    else if (v.getColor().equalsIgnoreCase("white"))
        return (Color.white);
    else
        return (Color.MAGENTA);
}

From source file:ShowOff.java

protected void drawBackground(Graphics2D g2) {
    int side = 45;
    int width = getSize().width;
    int height = getSize().height;
    Color[] colors = { Color.yellow, Color.cyan, Color.orange, Color.pink, Color.magenta, Color.lightGray };
    for (int y = 0; y < height; y += side) {
        for (int x = 0; x < width; x += side) {
            Ellipse2D ellipse = new Ellipse2D.Float(x, y, side, side);
            int index = (x + y) / side % colors.length;
            g2.setPaint(colors[index]);//from   w ww  . j  a  v  a2s . co m
            g2.fill(ellipse);
        }
    }
}

From source file:de.fhg.igd.iva.explorer.main.JStatBar.java

@Override
protected void paintComponent(Graphics g1) {
    super.paintComponent(g1);

    Graphics2D g = (Graphics2D) g1;

    int width = getWidth() - 1;
    int height = getHeight() - 1;

    int whiskerSize = 6;

    // fill background rect
    g.setColor(Color.WHITE);//w w  w.j a v a 2 s  . c  om
    g.fillRect(insetX, insetY, width - 2 * insetX, height - 2 * insetY);

    int q10X = mapXToScreen(stats.getPercentile(10.0), width);
    int q25X = mapXToScreen(stats.getPercentile(25.0), width);
    int q50X = mapXToScreen(stats.getPercentile(50.0), width);
    int q75X = mapXToScreen(stats.getPercentile(75.0), width);
    int q90X = mapXToScreen(stats.getPercentile(90.0), width);

    g.setColor(Color.PINK);
    int leftX = Math.min(q25X, q75X);
    int rightX = Math.max(q25X, q75X);

    g.fillRect(insetX + leftX, insetY + 1, rightX - leftX, height - 2 * insetY - 1);
    g.drawLine(insetX + q10X, height / 2, insetX + q90X, height / 2);
    g.drawLine(insetX + q10X, (height - whiskerSize) / 2, insetX + q10X, (height + whiskerSize) / 2);
    g.drawLine(insetX + q10X, height / 2, insetX + q90X, height / 2);
    g.drawLine(insetX + q90X, (height - whiskerSize) / 2, insetX + q90X, (height + whiskerSize) / 2);

    g.setColor(Color.RED);
    g.drawLine(insetX + q50X, insetY + 1, insetX + q50X, height - insetY - 1);

    // draw outline border rect
    g.setColor(Color.BLACK);
    g.drawRect(insetX, insetY, width - 2 * insetX, height - 2 * insetY);

    int buttonX = mapXToScreen(quality, width);
    drawButton(g, buttonX, height);
}

From source file:monitor.processing.OLD.SoccerField.java

public void drawTree(BaseNode n, RealVector v) {

    Color c = Color.WHITE;

    if (n instanceof TransformNode) {
        v = ((TransformNode) n).getTrasformMatrix().operate(v);

        c = Color.ORANGE;/*from  w w w. j  a va  2s  . c  o  m*/
    } else if (n instanceof StaticMesh) {
        StaticMesh sm = (StaticMesh) n;

        if (sm.isTransparent()) {
            c = Color.BLUE;
        } else if (sm.isVisible()) {
            //                System.out.println(n.getInfo());
            //                System.out.println(v);
            c = Color.RED;
            if (sm.getModel().contains("naohead") || sm.getModel().contains("naobody")) {
                c = Color.PINK;
            }
        } else {
            c = Color.CYAN;
        }

    } else if (n instanceof StaticMeshNode) {
        StaticMeshNode smn = (StaticMeshNode) n;

        if (smn.isTransparent()) {
            c = Color.GREEN;
            //                cameraSceneX = (float)v.getEntry(0);
            //                cameraSceneY = (float)v.getEntry(1);
            //                cameraSceneZ = (float)v.getEntry(2);
        } else if (smn.isVisible()) {
            c = Color.YELLOW;
        } else {
            c = Color.MAGENTA;
        }

    }

    pushMatrix();
    fill(100);

    //        c = Color.getHSBColor(n.getAddress()*0.05f, 1, 1);
    stroke(c.getRed(), c.getGreen(), c.getBlue());
    translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)),
            (float) (scale * v.getEntry(2)));
    box(5);
    popMatrix();

    for (int a = n.getChildren().size() - 1; a >= 0; a--) {
        drawTree(((ArrayList<BaseNode>) n.getChildren()).get(a), v);
    }

}

From source file:test.uk.co.modularaudio.util.audio.gui.buffervis.BufferVisualiser.java

public void regenerateFromBuffers(final String labelOne, final float[] buffer, final int numSamples,
        final String labelTwo, final float[] bufferTwo) {
    biG2d.setColor(Color.BLACK);//  w  w w .j  a  va 2s  .c o  m
    biG2d.fillRect(0, 0, GRAPH_WIDTH, GRAPH_HEIGHT);

    //      biG2d.setColor( Color.RED );
    //      biG2d.drawRect( 1, 1, GRAPH_WIDTH - 2, GRAPH_HEIGHT - 2 );

    computeMinMax(bufferTwo, numSamples);

    drawAxes(labelOne, Color.orange, labelTwo, Color.pink);

    plotCurve(Color.orange, buffer, numSamples);
    plotCurve(Color.pink, bufferTwo, numSamples);
}

From source file:de.berlios.statcvs.xml.chart.AbstractTimeSeriesChart.java

/**
 * @param filename//from  w ww  .  java2 s.co m
 * @param title
 */
public AbstractTimeSeriesChart(ReportSettings settings, String filename, String title, String rangeLabel) {
    super(settings, filename, title);

    tsc = new TimeSeriesCollection();

    setChart(ChartFactory.createTimeSeriesChart(settings.getProjectName(), I18n.tr("Date"), rangeLabel, tsc,
            true, true, false));

    //Paint[] colors = new Paint[1];
    //colors[0] = Color.blue;
    //getChart().getPlot().setSeriesPaint(colors);

    // setup axis
    XYPlot plot = getChart().getXYPlot();
    ValueAxis axis = plot.getDomainAxis();
    axis.setVerticalTickLabels(true);
    plot.setRenderer(new XYStepRenderer());

    // the 4th color is yellow which has almost no contrast to the white 
    // background color, therefore we use a different color
    plot.getRenderer().setSeriesPaint(0, Color.red);
    plot.getRenderer().setSeriesPaint(1, Color.blue);
    plot.getRenderer().setSeriesPaint(2, Color.green);
    plot.getRenderer().setSeriesPaint(3, Color.magenta);
    plot.getRenderer().setSeriesPaint(4, Color.orange);
    plot.getRenderer().setSeriesPaint(5, Color.cyan);
    plot.getRenderer().setSeriesPaint(6, Color.pink);
}

From source file:gov.nih.nci.cma.web.graphing.CMAPrincipalComponentAnalysisPlot.java

public CMAPrincipalComponentAnalysisPlot(Collection<CMAPCADataPoint> dataPoints, PCAcomponent component1,
        PCAcomponent component2, Map<String, String> sampleGroupNames) { //, ColorByType colorBy) {
    //this.colorBy = colorBy;
    this.component1 = component1;
    this.component2 = component2;
    this.dataPoints = dataPoints;
    this.nf.setMaximumFractionDigits(1);
    this.sampleGroupNames = sampleGroupNames;
    colorMap.put("1", Color.GREEN);
    colorMap.put("2", Color.BLUE);
    colorMap.put("3", Color.YELLOW);
    colorMap.put("4", Color.CYAN);
    colorMap.put("5", Color.MAGENTA);
    colorMap.put("6", Color.ORANGE);
    colorMap.put("7", Color.PINK);
    colorMap.put("8", Color.RED);
    colorMap.put("9", Color.GRAY);

    createChart();/*from w ww  .j a  va2s. c o m*/

}

From source file:net.sf.mzmine.chartbasics.chartthemes.ChartThemeFactory.java

public static EStandardChartTheme createBlackNWhiteTheme() {
    EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW");
    // Fonts//ww  w. j  a  v a 2 s.c om
    theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
    theme.setLargeFont(new Font("Arial", Font.BOLD, 11));
    theme.setRegularFont(new Font("Arial", Font.PLAIN, 11));
    theme.setSmallFont(new Font("Arial", Font.PLAIN, 11));

    // Paints
    theme.setTitlePaint(Color.black);
    theme.setSubtitlePaint(Color.black);
    theme.setLegendItemPaint(Color.black);
    theme.setPlotOutlinePaint(Color.black);
    theme.setBaselinePaint(Color.black);
    theme.setCrosshairPaint(Color.black);
    theme.setLabelLinkPaint(Color.black);
    theme.setTickLabelPaint(Color.black);
    theme.setAxisLabelPaint(Color.black);
    theme.setShadowPaint(Color.black);
    theme.setItemLabelPaint(Color.black);

    theme.setLegendBackgroundPaint(Color.white);
    theme.setChartBackgroundPaint(Color.white);
    theme.setPlotBackgroundPaint(Color.white);

    // paint sequence: add black
    Paint[] colors = new Paint[] { Color.BLACK, new Color(0xFF, 0x55, 0x55), new Color(0x55, 0x55, 0xFF),
            new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55), new Color(0xFF, 0x55, 0xFF),
            new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray, ChartColor.DARK_RED, ChartColor.DARK_BLUE,
            ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW, ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN,
            Color.darkGray, ChartColor.LIGHT_RED, ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN,
            ChartColor.LIGHT_YELLOW, ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray,
            ChartColor.VERY_DARK_RED, ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN,
            ChartColor.VERY_DARK_YELLOW, ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN,
            ChartColor.VERY_LIGHT_RED, ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN,
            ChartColor.VERY_LIGHT_YELLOW, ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN };

    theme.setDrawingSupplier(
            new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
                    DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
                    DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
                    DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
                    DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
    theme.setErrorIndicatorPaint(Color.black);
    theme.setGridBandPaint(new Color(255, 255, 255, 20));
    theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40));

    // axis
    Color transp = new Color(0, 0, 0, 200);
    theme.setRangeGridlinePaint(transp);
    theme.setDomainGridlinePaint(transp);

    theme.setAxisLinePaint(Color.black);

    // axis offset
    theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));

    return theme;
}