Example usage for java.awt Color magenta

List of usage examples for java.awt Color magenta

Introduction

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

Prototype

Color magenta

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

Click Source Link

Document

The color magenta.

Usage

From source file:com.mergano.core.AreaChart.java

private JFreeChart createChart(final CategoryDataset dataset) {

    final JFreeChart chart = ChartFactory.createAreaChart("Order statistic", // chart title
            "Days", // domain axis label
            "Order Average", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            false, // tooltips
            false // urls
    );// w w w  .  j av a 2s  .c  o  m

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
    // set the background color for the chart...
    //        final StandardLegend legend = (StandardLegend) chart.getLegend();
    //      legend.setAnchor(StandardLegend.SOUTH);
    chart.setBackgroundPaint(Color.white);
    chart.setAntiAlias(true);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.getRenderer().setSeriesPaint(0, new Color(0, 191, 165));
    plot.setForegroundAlpha(0.75f);
    plot.setBackgroundPaint(Color.white);

    plot.setDomainCrosshairVisible(false);
    plot.setRangeCrosshairVisible(false);
    // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0)); // disable this
    plot.setDomainGridlinesVisible(false);
    plot.setDomainGridlinePaint(new Color(240, 240, 240));
    plot.setRangeGridlinesVisible(false);
    plot.setRangeGridlinePaint(new Color(240, 240, 240));
    plot.setDomainCrosshairPaint(Color.MAGENTA);
    plot.setRangeCrosshairPaint(Color.CYAN);

    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    domainAxis.setLowerMargin(0.0);
    domainAxis.setUpperMargin(0.0);
    domainAxis.addCategoryLabelToolTip("Type 1", "The first type.");
    domainAxis.addCategoryLabelToolTip("Type 2", "The second type.");
    domainAxis.addCategoryLabelToolTip("Type 3", "The third type.");

    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setLabelAngle(0 * Math.PI / 2.0);
    // OPTIONAL CUSTOMISATION COMPLETED.

    return chart;

}

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

/**
 * @param filename/*from  ww  w  .j  a v  a  2  s. c  o  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:net.sf.dynamicreports.test.jasper.chart.ChartSeriesOrderTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<String> column1;
    TextColumnBuilder<String> column2;
    TextColumnBuilder<Integer> column3;
    TextColumnBuilder<String> column4;

    colors = new HashMap<String, Color>();
    colors.put("a", Color.BLUE);
    colors.put("b", Color.YELLOW);
    colors.put("c", Color.GREEN);
    colors.put("d", Color.MAGENTA);

    rb.setPageFormat(PageType.A3, PageOrientation.PORTRAIT)
            .columns(column1 = col.column("Column1", "field1", String.class),
                    column2 = col.column("Column2", "field2", String.class),
                    column3 = col.column("Column3", "field3", Integer.class),
                    column4 = col.column("Column4", "field4", String.class))
            .summary(//from  w w  w . ja v a 2s. c om
                    cmp.horizontalList(
                            cht.barChart().seriesColorsByName(colors).setSeriesOrderType(OrderType.ASCENDING)
                                    .setCategory(column1).series(cht.serie(column3).setSeries(column2)),
                            cht.groupedStackedBarChart().seriesColorsByName(colors)
                                    .setSeriesOrderType(OrderType.ASCENDING).setCategory(column1)
                                    .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))),
                    cmp.horizontalList(cht.barChart().seriesColorsByName(colors)
                            .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1).series(cht
                                    .serie(column3).setSeries(column2)),
                            cht.groupedStackedBarChart().seriesColorsByName(colors)
                                    .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1)
                                    .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))),
                    cmp.horizontalList(cht.barChart().seriesColorsByName(colors)
                            .setSeriesOrderBy(Arrays.asList("c", "b", "a", "d")).setCategory(column1)
                            .series(cht.serie(column3).setSeries(column2)),
                            cht.groupedStackedBarChart().seriesColorsByName(colors)
                                    .setSeriesOrderBy(Arrays.asList("c", "b", "a", "d")).setCategory(column1)
                                    .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))),
                    cmp.horizontalList(
                            cht.barChart().seriesColorsByName(colors).seriesOrderBy("c", "b", "a", "d")
                                    .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1)
                                    .series(cht.serie(column3).setSeries(column2)),
                            cht.groupedStackedBarChart().seriesColorsByName(colors)
                                    .seriesOrderBy("c", "b", "a", "d").setSeriesOrderType(OrderType.DESCENDING)
                                    .setCategory(column1)
                                    .series(cht.groupedSerie(column3).setSeries(column2).setGroup(column4))),
                    cmp.horizontalList(
                            cht.barChart().seriesColorsByName(colors).seriesOrderBy("c", "e", "d")
                                    .setCategory(column1).series(cht.serie(column3).setSeries(column2)),
                            cht.barChart().seriesColorsByName(colors).seriesOrderBy("g", "e", "d")
                                    .setSeriesOrderType(OrderType.DESCENDING).setCategory(column1)
                                    .series(cht.serie(column3).setSeries(column2))));
}

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   www .j a v a  2s .co  m
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:mls.FramePlot.java

private JFreeChart createChartVarianza(final XYDataset datasetVarianza) {
    final JFreeChart result = ChartFactory.createXYLineChart("Varianza campionaria", "n", "vc", datasetVarianza,
            PlotOrientation.VERTICAL, false, true, false);
    final XYPlot plot = result.getXYPlot();
    ValueAxis axis = plot.getDomainAxis();
    axis.setAutoRange(true);/*from www  .j a  v  a  2s  .  co  m*/
    axis.setFixedAutoRange(1500);

    axis = plot.getRangeAxis();
    axis.setAutoRange(true);
    axis.setRange(10, 100);
    plot.getRenderer().setSeriesPaint(0, Color.MAGENTA);
    return result;
}

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  ww  w  . j  av a  2 s. co m

}

From source file:net.sf.dynamicreports.test.jasper.chart.DifferenceChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<Date> column1;
    TextColumnBuilder<Timestamp> column2;
    TextColumnBuilder<Integer> column3;
    TextColumnBuilder<Integer> column4;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", Date.class),
            column2 = col.column("Column2", "field2", Timestamp.class),
            column3 = col.column("Column3", "field3", Integer.class),
            column4 = col.column("Column4", "field4", Integer.class))
            .summary(/*from  w w  w . ja  v  a 2  s .co  m*/
                    cht.differenceChart().customizers(new ChartCustomizer()).setTimePeriod(column1)
                            .series(cht.serie(column3), cht.serie(column4)).setTimePeriodType(TimePeriod.DAY)
                            .setShowShapes(false).setPositiveColor(Color.BLUE).setNegativeColor(Color.MAGENTA),
                    cht.differenceChart().setTimePeriod(column1).series(cht.serie(column3))
                            .setTimeAxisFormat(cht.axisFormat().setLabel("time").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)
                                    .setVerticalTickLabels(true)),
                    cht.differenceChart().setTimePeriod(column2).series(cht.serie(column3))
                            .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00")
                                    .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1)
                                    .setRangeMaxValueExpression(15).setVerticalTickLabels(true)));
}

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

private static Paint[] createPaint() {
    Paint apaint[] = new Paint[5];
    apaint[0] = new GradientPaint(0.0F, 0.0F, Color.white, 0.0F, 0.0F, Color.red);
    apaint[1] = new GradientPaint(0.0F, 0.0F, Color.white, 0.0F, 0.0F, Color.green);
    apaint[2] = new GradientPaint(0.0F, 0.0F, Color.white, 0.0F, 0.0F, Color.blue);
    apaint[3] = new GradientPaint(0.0F, 0.0F, Color.white, 0.0F, 0.0F, Color.orange);
    apaint[4] = new GradientPaint(0.0F, 0.0F, Color.white, 0.0F, 0.0F, Color.magenta);
    return apaint;
}

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;// w w  w.  j a v  a  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:org.gvsig.gui.beans.graphic.GraphicChartPanel.java

/**
 * Creates a chart./*ww  w. j  a  v  a  2 s.c o  m*/
 * @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);
}