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:uk.co.modularaudio.mads.base.soundfile_player.ui.SoundfilePlayerWaveOverviewUiJComponent.java

public SoundfilePlayerWaveOverviewUiJComponent(final SoundfilePlayerMadDefinition definition,
        final SoundfilePlayerMadInstance instance, final SoundfilePlayerMadUiInstance uiInstance,
        final int controlIndex) {
    this.uiInstance = uiInstance;

    setBackground(Color.ORANGE);
    setOpaque(true);/*w  w  w  . ja  va2s  .  co  m*/

    uiInstance.addSampleEventListener(this);

    waveOverviewPositionClickListener = new WaveOverviewPositionClickListener(this);

    this.addMouseListener(waveOverviewPositionClickListener);

    uiInstance.addAnalysisFillListener(this);
}

From source file:org.geopublishing.atlasStyler.classification.RasterClassification.java

@Override
public BufferedImage createHistogramImage(boolean showMean, boolean showSd, int histogramBins,
        String label_xachsis) throws InterruptedException, IOException {
    HistogramDataset hds = new HistogramDataset();

    DoubleArrayList valuesAL;/*from  ww  w.  j a  va  2s . c o m*/
    valuesAL = getStatistics().elements();
    double[] elements = Arrays.copyOf(valuesAL.elements(), getStatistics().size());
    hds.addSeries(1, elements, histogramBins);

    /** Statically label the Y Axis **/
    String label_yachsis = ASUtil.R("QuantitiesClassificationGUI.Histogram.YAxisLabel");

    JFreeChart chart = org.jfree.chart.ChartFactory.createHistogram(null, label_xachsis, label_yachsis, hds,
            PlotOrientation.VERTICAL, false, true, true);

    /***********************************************************************
     * Paint the classes into the JFreeChart
     */
    int countLimits = 0;
    for (Double cLimit : getClassLimits()) {
        ValueMarker marker = new ValueMarker(cLimit);
        XYPlot plot = chart.getXYPlot();
        marker.setPaint(Color.orange);
        marker.setLabel(String.valueOf(countLimits));
        marker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
        marker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
        plot.addDomainMarker(marker);

        countLimits++;
    }

    /***********************************************************************
     * Optionally painting SD and MEAN into the histogram
     */
    try {
        if (showSd) {
            ValueMarker marker;
            marker = new ValueMarker(getSD(), Color.green.brighter(), new BasicStroke(1.5f));
            XYPlot plot = chart.getXYPlot();
            marker.setLabel(ASUtil.R("QuantitiesClassificationGUI.Histogram.SD.ShortLabel"));
            marker.setLabelAnchor(RectangleAnchor.BOTTOM_LEFT);
            marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
            plot.addDomainMarker(marker);
        }

        if (showMean) {
            ValueMarker marker;
            marker = new ValueMarker(getMean(), Color.green.darker(), new BasicStroke(1.5f));
            XYPlot plot = chart.getXYPlot();
            marker.setLabel(ASUtil.R("QuantitiesClassificationGUI.Histogram.Mean.ShortLabel"));
            marker.setLabelAnchor(RectangleAnchor.BOTTOM_LEFT);
            marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
            plot.addDomainMarker(marker);
        }

    } catch (Exception e) {
        LOGGER.error("Painting SD and MEAN into the histogram", e);
    }

    /***********************************************************************
     * Render the Chart
     */
    BufferedImage image = chart.createBufferedImage(400, 200);

    return image;
}

From source file:com.view.TimeSeriesChartView.java

public JFreeChart getVendorTimeSeriesChart(Excel theExcel, String vendor) {
    int vendorCode = Integer.parseInt(vendor);
    ArrayList<Receiving> theReceiving = theExcel.getSheetReceiving();

    //        HashMap<Month, Integer> item1Map = new HashMap<>();
    //        HashMap<Month, Integer> item2Map = new HashMap<>();
    //        HashMap<Month, Integer> item3Map = new HashMap<>();
    Set vendorItem = new HashSet();
    for (int i = 0; i < theReceiving.size(); i++) {
        vendorItem.add(theReceiving.get(i).getItem());
    }/*from  ww w  .  j a  v a  2  s .co  m*/
    TimeSeries data[] = new TimeSeries[vendorItem.size()];
    HashMap<Month, Integer> itemMap[] = new HashMap[vendorItem.size()];
    for (int i = 0; i < vendorItem.size(); i++) {
        String itemName = "item" + i;
        data[i] = new TimeSeries(itemName);
        itemMap[i] = new HashMap<>();
    }
    Calendar cal = Calendar.getInstance();
    for (int i = 0; i < theReceiving.size(); i++) {
        cal.setTime(theReceiving.get(i).getDate());
        int month = cal.get(Calendar.MONTH) + 1;
        int year = cal.get(Calendar.YEAR);
        int quantity = 0;
        if (theReceiving.get(i).getVendor() == vendorCode) {
            quantity = theReceiving.get(i).getQuantity();
            Month theMonth = new Month(month, year);
            int itemNum = theReceiving.get(i).getItem() - 1;
            itemMap[itemNum].put(theMonth, updateItemMap(itemMap[itemNum], theMonth, quantity));
        }
    }
    TimeSeriesCollection my_data_series = new TimeSeriesCollection();
    for (int i = 0; i < vendorItem.size(); i++) {
        for (Map.Entry<Month, Integer> entry : itemMap[i].entrySet()) {
            data[i].add(entry.getKey(), entry.getValue());
        }
        my_data_series.addSeries(data[i]);
    }

    JFreeChart chart = ChartFactory.createTimeSeriesChart("Receiving", "Month", "Quantity", my_data_series,
            true, true, false);
    chart.setBackgroundPaint(Color.YELLOW);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.GREEN);
    plot.setRangeGridlinePaint(Color.orange);
    plot.setAxisOffset(new RectangleInsets(50, 0, 20, 5));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();

    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);

    DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("MM.yyyy"));
    return chart;
}

From source file:org.nbheaven.sqe.codedefects.dashboard.controlcenter.panels.Statistics.java

private static JFreeChart createOverviewPanel(DefaultCategoryDataset dataSet) {

    JFreeChart overview = org.jfree.chart.ChartFactory.createStackedBarChart(null, null, "CodeDefects", dataSet,
            PlotOrientation.HORIZONTAL, false, true, false);
    overview.setBorderVisible(false);//from w w w. ja  va2 s  .  co m
    overview.setBackgroundPaint(Color.WHITE);
    overview.setAntiAlias(true);
    overview.setNotify(true);

    CategoryPlot overviewPlot = overview.getCategoryPlot();
    overviewPlot.setRangeGridlinePaint(Color.BLACK);
    overviewPlot.setDomainGridlinePaint(Color.BLACK);
    overviewPlot.setBackgroundPaint(Color.WHITE);
    overviewPlot.setForegroundAlpha(0.7f);
    overviewPlot.setRangeAxisLocation(AxisLocation.getOpposite(overviewPlot.getRangeAxisLocation()));

    CategoryAxis domainAxis = overviewPlot.getDomainAxis();
    domainAxis.setVisible(true);

    LogarithmicAxis rangeAxis = new LogarithmicAxis("CodeDefects");
    rangeAxis.setLabel(null);
    rangeAxis.setStrictValuesFlag(false);
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    overviewPlot.setRangeAxis(rangeAxis);

    CategoryItemRenderer categoryItemRenderer = new StackedBarRenderer(); //3D();
    //        categoryItemRenderers[0].setPaint(Color.RED);
    categoryItemRenderer.setSeriesPaint(0, Color.RED);
    categoryItemRenderer.setSeriesPaint(1, Color.ORANGE);
    categoryItemRenderer.setSeriesPaint(2, Color.YELLOW);

    categoryItemRenderer.setBaseItemLabelsVisible(true);

    overviewPlot.setRenderer(categoryItemRenderer);

    return overview;
}

From source file:org.jfree.chart.demo.selection.SelectionDemo3.java

private static JFreeChart createChart(XYDataset dataset, DatasetSelectionExtension<XYCursor> ext) {
    JFreeChart chart = ChartFactory.createScatterPlot("SelectionDemo3", "X", "Y", dataset);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setNoDataMessage("NO DATA");

    plot.setDomainPannable(true);//from   ww w  .  ja  va  2s  .c om
    plot.setRangePannable(true);
    plot.setDomainZeroBaselineVisible(true);
    plot.setRangeZeroBaselineVisible(true);

    plot.setDomainGridlineStroke(new BasicStroke(0.0f));
    plot.setRangeGridlineStroke(new BasicStroke(0.0f));

    plot.setDomainMinorGridlinesVisible(true);
    plot.setRangeMinorGridlinesVisible(true);

    //XYItemRenderer r = plot.getRenderer();
    XYDotRenderer r = new XYDotRenderer();
    r.setDotHeight(2);
    r.setDotWidth(2);

    r.setSeriesPaint(0, Color.blue);
    r.setSeriesPaint(1, Color.green);
    r.setSeriesPaint(2, Color.yellow);
    r.setSeriesPaint(3, Color.orange);
    plot.setRenderer(r);
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setAutoRangeIncludesZero(false);

    domainAxis.setTickMarkInsideLength(2.0f);
    domainAxis.setTickMarkOutsideLength(2.0f);

    domainAxis.setMinorTickMarksVisible(true);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setTickMarkInsideLength(2.0f);
    rangeAxis.setTickMarkOutsideLength(2.0f);
    rangeAxis.setMinorTickMarksVisible(true);

    //add selection specific rendering
    IRSUtilities.setSelectedItemPaint(r, ext, Color.red);

    //register plot as selection change listener
    ext.addChangeListener(plot);

    return chart;
}

From source file:ancat.visualizers.UndirectedModelVisualizer.java

private void produce(String fileName) {
    _currentLayout.setSize(new Dimension(600, 600));

    VisualizationImageServer<V, E> vv = new VisualizationImageServer<V, E>(_currentLayout,
            new Dimension(600, 600));

    vv.setPreferredSize(new Dimension(600, 600));

    // Setup up a new vertex to paint transformer...
    Transformer<V, Paint> vertexPaint = new Transformer<V, Paint>() {
        public Paint transform(V v) {
            //return Color.GREEN;
            ancat.common.Vertex vertex = (Vertex) v;

            if (vertex instanceof ancat.common.ExecutableFile)
                return Color.BLUE;

            if (vertex instanceof ancat.common.DynamicLibrary)
                return Color.YELLOW;

            if (vertex instanceof ancat.common.ConfigurationFile)
                return Color.ORANGE;

            if (vertex instanceof ancat.common.Unspecified)
                return Color.RED;

            return Color.darkGray;
        }/*from  w  w  w .  j a va 2 s  .  co  m*/
    };
    // Set up a new stroke Transformer for the edges
    float dash[] = { 10.0f };

    final Stroke edgeStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash,
            0.0f);

    Transformer<E, Stroke> edgeStrokeTransformer = new Transformer<E, Stroke>() {
        public Stroke transform(E s) {
            return edgeStroke;
        }
    };

    Transformer<E, Font> edgeFontTransformer = new Transformer<E, Font>() {
        public Font transform(E e) {
            return new Font("Dialog", Font.PLAIN, 10);
        }
    };

    Transformer<E, String> lblTransformer = new Transformer<E, String>() {
        public String transform(E e) {
            Edge edge = (Edge) e;
            //return edge.getXMLId();
            return edge.getXMLId() != null ? edge.getXMLId() : "";
        }
    };

    Transformer<V, Font> vertexFontTransformer = new Transformer<V, Font>() {
        public Font transform(V v) {
            return new Font("Dialog", Font.PLAIN, 10);
        }
    };

    Transformer<V, String> vLblTransformer = new Transformer<V, String>() {
        public String transform(V v) {
            Vertex vertex = (Vertex) v;
            return vertex.getElementID();
        }
    };

    vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
    vv.getRenderContext().setEdgeStrokeTransformer(edgeStrokeTransformer);
    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<V>());
    vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<E>());
    // ---->
    vv.getRenderContext().setEdgeFontTransformer(edgeFontTransformer);
    vv.getRenderContext().setLabelOffset(20);
    vv.getRenderContext().setEdgeLabelTransformer(lblTransformer);

    vv.getRenderContext().setVertexFontTransformer(vertexFontTransformer);
    vv.getRenderContext().setVertexLabelTransformer(vLblTransformer);

    vv.getRenderer().getVertexLabelRenderer().setPosition(Position.N);

    BufferedImage img = new BufferedImage((int) _currentLayout.getSize().getWidth(),
            (int) _currentLayout.getSize().getHeight(), BufferedImage.TYPE_INT_ARGB);

    vv.getImage(new Point(0, 0), new Dimension(700, 700));

    Graphics2D g2d = (Graphics2D) img.getGraphics();

    vv.paint(g2d);

    setDisclaimer(g2d);

    g2d.dispose();

    try {
        File file = new File(fileName);

        ImageIO.write(img, "png", file);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:gov.llnl.lc.infiniband.opensm.plugin.graph.decorators.IB_EdgeFillTransformer.java

public Paint transform(IB_Edge e) {
    if (e.Decorator.Congestion)
        return Color.RED;
    if (e.Decorator.ForwardPath)
        return Color.GREEN;
    if (e.Decorator.ReturnPath)
        return Color.ORANGE;
    return null;//from   w ww  .  j ava 2 s.  c o  m
}

From source file:org.openiot.gsn.vsensor.DemoVSensor.java

public void dataAvailable(String inputStreamName, StreamElement data) {
    if (inputStreamName.equalsIgnoreCase("SSTREAM")) {
        String action = (String) data.getData("STATUS");
        /**/* ww w  .  ja  v  a 2 s  .c  o m*/
         * 
         */
        String moteId = (String) data.getData("ID");
        if (moteId.toLowerCase().indexOf("mica") < 0)
            return;
        if (action.toLowerCase().indexOf("add") >= 0)
            counter++;
        if (action.toLowerCase().indexOf("remove") >= 0)
            counter--;
    }
    if (inputStreamName.equalsIgnoreCase("CSTREAM")) {

        BufferedImage bufferedImage = null;
        outputStream.reset();
        byte[] rawData = (byte[]) data.getData("IMAGE");
        input = new ByteArrayInputStream(rawData);
        try {
            bufferedImage = ImageIO.read(input);
        } catch (IOException e) {
            e.printStackTrace();
        }
        Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics();
        int size = 30;
        int locX = 0;
        int locY = 0;
        if (counter < 0)
            counter = 0;
        switch (counter) {
        case 0:
            graphics.setColor(Color.RED);
            break;
        case 1:
            graphics.setColor(Color.ORANGE);
            break;

        case 2:
            graphics.setColor(Color.YELLOW);
            break;

        case 3:
            graphics.setColor(Color.GREEN);
            break;
        default:
            logger.warn(
                    new StringBuilder().append("Shouldn't happen.>").append(counter).append("<").toString());
        }
        graphics.fillOval(locX, locY, size, size);
        try {
            ImageIO.write(bufferedImage, "jpeg", outputStream);
            outputStream.close();

        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }

        StreamElement outputSE = new StreamElement(OUTPUT_FIELDS, OUTPUT_TYPES,
                new Serializable[] { outputStream.toByteArray() }, data.getTimeStamp());
        dataProduced(outputSE);
    }
    if (logger.isInfoEnabled())
        logger.info(new StringBuilder().append("Data received under the name: ").append(inputStreamName)
                .toString());
}

From source file:org.jfree.expdemo.SelectionDemo3.java

private static JFreeChart createChart(XYDataset dataset, DatasetSelectionExtension ext) {
    JFreeChart chart = ChartFactory.createScatterPlot("SelectionDemo3", "X", "Y", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setNoDataMessage("NO DATA");

    plot.setDomainPannable(true);/*w w  w  .ja v  a2s.  c  o m*/
    plot.setRangePannable(true);
    plot.setDomainZeroBaselineVisible(true);
    plot.setRangeZeroBaselineVisible(true);

    plot.setDomainGridlineStroke(new BasicStroke(0.0f));
    plot.setRangeGridlineStroke(new BasicStroke(0.0f));

    plot.setDomainMinorGridlinesVisible(true);
    plot.setRangeMinorGridlinesVisible(true);

    //XYItemRenderer r = plot.getRenderer();
    XYDotRenderer r = new XYDotRenderer();
    r.setDotHeight(2);
    r.setDotWidth(2);

    r.setSeriesPaint(0, Color.blue);
    r.setSeriesPaint(1, Color.green);
    r.setSeriesPaint(2, Color.yellow);
    r.setSeriesPaint(3, Color.orange);
    plot.setRenderer(r);
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setAutoRangeIncludesZero(false);

    domainAxis.setTickMarkInsideLength(2.0f);
    domainAxis.setTickMarkOutsideLength(2.0f);

    domainAxis.setMinorTickCount(2);
    domainAxis.setMinorTickMarksVisible(true);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setTickMarkInsideLength(2.0f);
    rangeAxis.setTickMarkOutsideLength(2.0f);
    rangeAxis.setMinorTickCount(2);
    rangeAxis.setMinorTickMarksVisible(true);

    //add selection specific rendering
    IRSUtilities.setSelectedItemPaint(r, ext, Color.red);

    //register plot as selection change listener
    ext.addSelectionChangeListener(plot);

    return chart;
}

From source file:gsn.vsensor.DemoVSensor.java

public void dataAvailable(String inputStreamName, StreamElement data) {
    if (inputStreamName.equalsIgnoreCase("SSTREAM")) {
        String action = (String) data.getData("STATUS");
        /**/*  w  w w  .  j  a va2 s . co m*/
         * 
         */
        String moteId = (String) data.getData("ID");
        if (moteId.toLowerCase().indexOf("mica") < 0)
            return;
        if (action.toLowerCase().indexOf("add") >= 0)
            counter++;
        if (action.toLowerCase().indexOf("remove") >= 0)
            counter--;
    }
    if (inputStreamName.equalsIgnoreCase("CSTREAM")) {

        BufferedImage bufferedImage = null;
        outputStream.reset();
        byte[] rawData = (byte[]) data.getData("IMAGE");
        input = new ByteArrayInputStream(rawData);
        try {
            bufferedImage = ImageIO.read(input);
        } catch (IOException e) {
            logger.error(e.getMessage(), e);
        }
        Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics();
        int size = 30;
        int locX = 0;
        int locY = 0;
        if (counter < 0)
            counter = 0;
        switch (counter) {
        case 0:
            graphics.setColor(Color.RED);
            break;
        case 1:
            graphics.setColor(Color.ORANGE);
            break;

        case 2:
            graphics.setColor(Color.YELLOW);
            break;

        case 3:
            graphics.setColor(Color.GREEN);
            break;
        default:
            logger.warn(
                    new StringBuilder().append("Shouldn't happen.>").append(counter).append("<").toString());
        }
        graphics.fillOval(locX, locY, size, size);
        try {
            ImageIO.write(bufferedImage, "jpeg", outputStream);
            outputStream.close();

        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }

        StreamElement outputSE = new StreamElement(OUTPUT_FIELDS, OUTPUT_TYPES,
                new Serializable[] { outputStream.toByteArray() }, data.getTimeStamp());
        dataProduced(outputSE);
    }
    logger.info(
            new StringBuilder().append("Data received under the name: ").append(inputStreamName).toString());
}