Example usage for java.awt Color cyan

List of usage examples for java.awt Color cyan

Introduction

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

Prototype

Color cyan

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

Click Source Link

Document

The color cyan.

Usage

From source file:com.joey.software.regionSelectionToolkit.controlers.ImageProfileTool.java

public BufferedImage getFlattenedImage(boolean overlayAscan) {

    ROIPanel pan = view;/*from   ww  w . ja va2s .  c o  m*/
    BufferedImage rst = previewPanel.getImage();
    if (axis == AXIS_Y) {
        int wide = 0;
        for (int i = 0; i < pan.getImage().getWidth(); i++) {
            if (getUseData(i)) {
                wide++;
            }
        }

        if (rst == null || rst.getWidth() != wide || rst.getHeight() != pan.getImage().getHeight()) {
            rst = ImageOperations.getBi(wide, pan.getImage().getHeight());
        } else {
            ImageOperations.setImage(Color.BLACK, rst);
        }
        // This will get the smoothed out aScan from the Dynamic?Range panel
        int posX = 0;
        int posY = 0;

        for (int i = 0; i < pan.getImage().getWidth(); i++) {
            posY = 0;

            if (getUseData(i)) {
                int start = (int) (pan.getImage().getHeight() * (1 - getSelectionValue(i)));
                for (int j = start; j < pan.getImage().getHeight(); j++) {
                    if (j > 0 && i > 0) {
                        try {
                            rst.setRGB(posX, posY, pan.getImage().getRGB(i, j));
                        } catch (Exception e) {
                            System.out.println("Org [" + i + "," + j + "], Pos :[" + posX + "," + posY);
                        }
                    }
                    posY++;
                }
                posX++;
            }

        }
    } else if (axis == AXIS_X) {
        int high = 0;
        for (int i = 0; i < pan.getImage().getHeight(); i++) {
            if (getUseData(i)) {
                high++;
            }
        }

        if (rst == null || rst.getHeight() != high || rst.getWidth() != pan.getImage().getWidth()) {
            rst = ImageOperations.getBi(pan.getImage().getWidth(), high);
        } else {
            ImageOperations.setImage(Color.BLACK, rst);
        }
        // This will get the smoothed out aScan from the Dynamic?Range panel
        int posX = 0;
        int posY = 0;

        for (int i = 0; i < pan.getImage().getHeight(); i++) {
            posX = 0;

            if (getUseData(i)) {
                int start = (int) (pan.getImage().getWidth() * (1 - getSelectionValue(i)));
                for (int j = start; j < pan.getImage().getWidth(); j++) {
                    if (j > 0 && i > 0) {
                        try {
                            rst.setRGB(posX, posY, pan.getImage().getRGB(j, i));
                        } catch (Exception e) {
                            System.out.println("Org [" + i + "," + j + "], Pos :[" + posX + "," + posY);
                        }
                    }
                    posX++;
                }
                posY++;
            }

        }
    }

    if (overlayAscan) {
        Graphics2D g = rst.createGraphics();
        g.setColor(Color.cyan);
        GraphicsToolkit.setRenderingQuality(g, GraphicsToolkit.HIGH_QUALITY);
        float max = DataAnalysisToolkit.getMaxf(aScan);
        float min = DataAnalysisToolkit.getMinf(aScan);
        Line2D.Double line = new Line2D.Double();

        GeneralPath path = new GeneralPath();
        for (int i = 0; i < aScan.length; i++) {
            int xP = 0;
            int yP = 0;

            float p1 = ((aScan[i] - min) / (max - min));

            double x = 0;
            double y = 0;

            if (axis == AXIS_Y) {

                y = rst.getHeight() / (double) (aScan.length - 1) * i;
                x = rst.getWidth() * (1 - p1);

            } else if (axis == AXIS_X) {
                x = rst.getWidth() / (double) (aScan.length - 1) * i;
                y = rst.getHeight() * (1 - p1);

            }

            if (i == 0) {
                path.moveTo(x, y);
            } else {
                path.lineTo(x, y);
            }

        }
        g.draw(path);
    }
    return rst;
}

From source file:com.icesoft.faces.component.outputchart.AbstractChart.java

public ColorMap() {
    this.put("black", Color.BLACK);
    this.put("blue", Color.BLUE);
    this.put("cyan", Color.CYAN);
    this.put("darkGray", Color.DARK_GRAY);
    this.put("gray", Color.GRAY);
    this.put("green", Color.GREEN);
    this.put("lightGray", Color.LIGHT_GRAY);
    this.put("magenta", Color.MAGENTA);
    this.put("orange", Color.ORANGE);
    this.put("pink", Color.PINK);
    this.put("red", Color.RED);
    this.put("white", Color.WHITE);
    this.put("yellow", Color.YELLOW);
}

From source file:piilSource.BarChart.java

private JFreeChart createChart(String title, final CategoryDataset dataset, String metaLabel) {

    // create the chart...
    final JFreeChart chart = ChartFactory.createBarChart(
            "Barplot of the " + metaLabel + " values for all samples - " + title, // chart title
            "Samples", // domain axis label
            metaLabel + " values", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, // tooltips?
            false // URLs?
    );/*from  ww w . ja  v a 2s .c o m*/

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);

    // get a reference to the plot for further customisation...
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.red);
    plot.setRangeGridlinePaint(Color.white);

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    if (metaLabel.equals("beta")) {
        rangeAxis.setRange(0, 1);
        rangeAxis.setTickUnit(new NumberTickUnit(0.2));
    }

    // disable bar outlines...
    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    // set up gradient paints for series...
    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.blue);
    final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.green);
    final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.red);
    final GradientPaint gp3 = new GradientPaint(0.0f, 0.0f, Color.yellow, 0.0f, 0.0f, Color.yellow);
    final GradientPaint gp4 = new GradientPaint(0.0f, 0.0f, Color.cyan, 0.0f, 0.0f, Color.cyan);
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);
    renderer.setSeriesPaint(3, gp3);
    renderer.setSeriesPaint(4, gp4);

    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    if (dataset.getColumnCount() > 40) {
        domainAxis.setTickLabelFont(new Font("Serif", Font.PLAIN, 10));
        domainAxis
                .setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2));
    }
    return chart;
}

From source file:analisis_proyecto1.Ventana_principal.java

private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseClicked
    //Generando el arreglo visual de numeros

    this.HeapSort.setVisible(false);
    heap.setTitle("Laurenn Alecxandra Cruz| 11211190");
    heap.setSize(900, 500);// w w  w.  j av a  2  s  .  c  o m
    heap.setVisible(true);
    JLabel titulo = new JLabel("Arreglo Inicial: ");
    titulo.setFont(new Font("Consolas", Font.BOLD, 14));
    Panelarreglo.add(titulo);
    this.panelgenera.setForeground(Color.cyan);

    JButton[] arreglo = new JButton[this.heap_sort_numbers.size()];
    for (int i = 0; i < this.heap_sort_numbers.size(); i++) {
        arreglo[i] = new JButton();
        arreglo[i].setText(Integer.toString(this.heap_sort_numbers.get(i)));
        arreglo[i].setBackground(Color.GREEN);
        Panelarreglo.add(arreglo[i]);
    }

    int[] array = new int[this.heap_sort_numbers.size()];

    //convierte ArreyList a arreglo
    for (int i = 0; i < this.heap_sort_numbers.size(); i++) {
        array[i] = this.heap_sort_numbers.get(i);
    }

    //LLamado a la funcion Heapsort
    Heapsort ordenamiento = new Heapsort(array);
    ordenamiento.ordenar();
    this.arboles = ordenamiento.getArbolesDelegate();
    //Visualizacion del arbol

    //---------------------Antes----------------------
    JButton preview = new JButton("Antes");
    preview.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            int x = IncrementarIndice(1);

            if (x >= 0) {
                if (vs != null) {
                    PanelArbol.remove(vs);
                }
                //-----------Dibujar arbol---------
                vs = new BasicVisualizationServer<String, String>(
                        new TreeLayout<String, String>(arboles.get(x)), new Dimension(300, 300));
                Transformer<String, Paint> vertexPaint = new Transformer<String, Paint>() {
                    public Paint transform(String i) {
                        return Color.GREEN;
                    }
                };

                RenderContext<String, String> renderContext = vs.getRenderContext();
                renderContext.setVertexFillPaintTransformer(vertexPaint);
                Transformer<String, String> transformer = new ToStringLabeller<String>();
                renderContext.setEdgeLabelTransformer(transformer);
                Transformer<String, String> vertexTransformer = new ToStringLabeller<String>();
                renderContext.setVertexLabelTransformer(vertexTransformer);
                vs.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
                PanelArbol.add(vs);
                PanelArbol.updateUI();

            } else {
                indice = 0;
            }

        }
    });

    //-------------------Despues------------------------
    JButton next = new JButton("Siguiente");
    next.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            int x = IncrementarIndice(0);

            if (x < arboles.size()) {
                if (vs != null) {
                    PanelArbol.remove(vs);
                }
                //-----------Dibujar arbol---------
                vs = new BasicVisualizationServer<String, String>(
                        new TreeLayout<String, String>(arboles.get(x)), new Dimension(250, 250));
                Transformer<String, Paint> vertexPaint = new Transformer<String, Paint>() {
                    public Paint transform(String i) {
                        return Color.GREEN;
                    }
                };

                RenderContext<String, String> renderContext = vs.getRenderContext();
                renderContext.setVertexFillPaintTransformer(vertexPaint);
                Transformer<String, String> transformer = new ToStringLabeller<String>();
                renderContext.setEdgeLabelTransformer(transformer);
                Transformer<String, String> vertexTransformer = new ToStringLabeller<String>();
                renderContext.setVertexLabelTransformer(vertexTransformer);
                vs.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
                PanelArbol.add(vs);
                PanelArbol.updateUI();
                heap.repaint();

            } else {
                indice = arboles.size() - 1;
            }

        }
    });

    //---------------Terminar accion--------------------------
    JButton terminar = new JButton("Salir");
    terminar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            heap_sort_numbers = new ArrayList();
            arboles = new ArrayList();
            indice = -1;
            PanelArbol = new JPanel();
            grid = new GridLayout(2, 0);
            flow = new FlowLayout();
            panelgenera = new JPanel(grid);
            Panelarreglo = new JPanel(flow);

            heap.dispose();
            HeapSort.dispose();
            heap = new JFrame();
            heap.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

        }
    });

    next.setBackground(Color.BLUE);
    preview.setBackground(Color.BLUE);
    terminar.setBackground(Color.BLUE);
    Panelarreglo.add(preview);
    Panelarreglo.add(next);
    Panelarreglo.add(terminar);

    this.panelgenera.add(Panelarreglo);
    this.panelgenera.add(PanelArbol);
    this.heap.add(panelgenera);
    heap.repaint();
    paintComponents(getGraphics());

    this.heap.setVisible(true);

}

From source file:bicat.gui.GraphicPane.java

/**
 * Default constructor, initializes some values.
 *//*from ww w .  jav  a 2s . co  m*/
public GraphicPane() {

    geneList = null;
    graphDataList = null;
    filledRect = new Rectangle(0, 0);
    xStep = 10;
    yStep = 160; // sta ovo tacno znaci??? (size of the cells of the
    // visualized matrix?)

    colorWheel = new Color[8]; // samo 8?
    colorWheel[0] = Color.BLUE;
    colorWheel[1] = Color.CYAN;
    colorWheel[2] = Color.GREEN;
    colorWheel[3] = Color.MAGENTA;
    colorWheel[4] = Color.ORANGE;
    colorWheel[5] = Color.PINK;
    colorWheel[6] = Color.RED;
    colorWheel[7] = Color.YELLOW;

    //

    /*
     * DefaultPieDataset dpd = new DefaultPieDataset();
     * dpd.setValue("Category 1",50); dpd.setValue("Category 2",50);
     */

    // create a dataset...
    /*
     * DefaultPieDataset data = new DefaultPieDataset();
     * data.setValue("Java", new Double(43.2)); data.setValue("Visual
     * Basic", new Double(0.0)); data.setValue("C/C++", new Double(17.5));
     * 
     * JFreeChart chart = ChartFactory.createPieChart("Sample",data,
     * true,true,false); ChartFrame frame = new ChartFrame("See", chart);
     * frame.pack(); // this.add(frame); //frame.pack();
     * frame.setVisible(true);
     */

    /*
     * chart = ChartFactory.createXYLineChart("Expression Profiles of a
     * Bicluster","genes","conditions", new
     * org.jfree.data.xy.DefaultTableXYDataset(),
     * org.jfree.chart.plot.PlotOrientation.HORIZONTAL, false,false,false);
     * 
     * //ChartPanel cp = new ChartPanel(chart_1); chartPanel = new
     * ChartPanel(chart); this.add(chartPanel); //cp);
     * //,BorderLayout.WEST); this.setVisible(true);
     * //this.add("Proba",chart_1); //ChartFrame frame_1 = new
     * ChartFrame("XY",chart_1); //frame_1.pack();
     * //frame_1.setVisible(true);
     */

}

From source file:UserInterface.WaterSupplyAdmin.UsagePatternJPanel.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

    int selectedRow = customerTable.getSelectedRow();
    if (selectedRow < 0) {
        JOptionPane.showMessageDialog(null, "Select a customer first");
        return;//w  w w.j a  v a  2 s .  com
    }

    Customer customer = (Customer) customerTable.getValueAt(selectedRow, 1);
    if (customer.getSourceSensor() == null) {
        JOptionPane.showMessageDialog(null, "Water Supply not available yet for this customer");
        return;
    }
    if (customer.getWaterUsageHistory().size() == 0) {
        JOptionPane.showMessageDialog(null, "No water usage yet");
        return;
    }
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    for (WaterUsage waterUsage : customer.getWaterUsageHistory()) {
        dataset.setValue(waterUsage.getUsageVolume(), waterUsage.getDate(), "Usage Volume");
    }

    JFreeChart chart = ChartFactory.createBarChart("Customer Water Usage Trends over a period of time",
            "Time of Usage", "Gallons", dataset, PlotOrientation.VERTICAL, true, true, true);
    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.cyan);
    ChartFrame frame = new ChartFrame("Bar Char for Weight", chart);

    frame.setVisible(true);
    frame.setSize(450, 350);

}

From source file:metdemo.Finance.Pluggable.java

public void startFunction(Graph g) throws IOException {
    pr = new PluggableRenderer();
    Layout layout = new FRLayout(g);
    vv = new VisualizationViewer(layout, pr);
    // add Shape based pick support
    vv.setPickSupport(new ShapePickSupport());
    PickedState picked_state = vv.getPickedState();

    affineTransformer = vv.getLayoutTransformer();

    // create decorators
    vcf = new SeedColor(picked_state);
    ewcs = new EdgeWeightStrokeFunction(edge_weight);
    vsh = new VertexStrokeHighlight(picked_state);
    ff = new FontHandler();
    vs_none = new ConstantVertexStringer(null);
    es_none = new ConstantEdgeStringer(null);
    vssa = new VertexShapeSizeAspect(voltages);
    show_edge = new DirectionDisplayPredicate(true, true);
    show_arrow = new DirectionDisplayPredicate(true, false);
    show_vertex = new VertexDisplayPredicate(false);

    // uses a gradient edge if unpicked, otherwise uses picked selection
    edgePaint = new GradientPickedEdgePaintFunction(
            new PickableEdgePaintFunction(picked_state, Color.black, Color.cyan), vv, vv, picked_state);

    pr.setVertexPaintFunction(vcf);/* w w  w.  j a  v a2  s.  c  o m*/
    pr.setVertexStrokeFunction(vsh);
    pr.setVertexStringer(vs_none);
    pr.setVertexFontFunction(ff);
    pr.setVertexShapeFunction(vssa);
    pr.setVertexIncludePredicate(show_vertex);

    pr.setEdgePaintFunction(edgePaint);
    pr.setEdgeStringer(es_none);
    pr.setEdgeFontFunction(ff);
    pr.setEdgeStrokeFunction(ewcs);
    pr.setEdgeIncludePredicate(show_edge);
    pr.setEdgeShapeFunction(new EdgeShape.Line());
    pr.setEdgeArrowPredicate(show_arrow);
    JPanel jp = new JPanel();
    jp.setLayout(new BorderLayout());

    vv.setBackground(Color.white);
    // Uncomment the following four lines, and comment the line
    // immediately following, to enable panning and zooming support
    // (including dragging of window to pan, and zooming with
    // mouse's scroll wheel).
    GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv);
    jp.add(scrollPane);
    gm = new DefaultModalGraphMouse();
    vv.setGraphMouse(gm);
    //gm.add(new PopupGraphMousePlugin());

    addBottomControls(jp);
    vssa.setScaling(true);

    vv.setToolTipFunction(new VoltageTips());
    vv.setToolTipText(
            "<html><center>Use the mouse wheel to zoom<p>Click and Drag the mouse to pan<p>Shift-click and Drag to Rotate</center></html>");

    //        return jp;

    JFrame jf = new JFrame();
    jf.getContentPane().add(jp);
    jf.pack();
    jf.setVisible(true);
}

From source file:com.bdb.weather.display.freeplot.SummaryFreePlot.java

/**
 * Create the JFreeChart series for the temperature values.
 * //from  w  w w  .  j av  a  2s  . c om
 * @param stroke The stroke for the series
 */
private List<FreePlotSeries<SummaryRecord>> createTemperatureSeries(Stroke stroke) {
    List<FreePlotSeries<SummaryRecord>> list = new ArrayList<>();

    int n = 0;
    list.add(new FreePlotSeries<>(HIGH_TEMPERATURE_SERIES_NAME, n++, Color.RED, stroke,
            SummaryRecord::getMaxOutdoorTemp, dateMethod, period));
    list.add(new FreePlotSeries<>(LOW_TEMPERATURE_SERIES_NAME, n++, Color.BLUE, stroke,
            SummaryRecord::getMinOutdoorTemp, dateMethod, period));
    list.add(new FreePlotSeries<>(MEAN_TEMPERATURE_SERIES_NAME, n++, Color.CYAN, stroke,
            SummaryRecord::getAvgOutdoorTemp, dateMethod, period));
    return list;
}

From source file:gui.MainGUI.java

private JFreeChart createKnowledgeChart(RealAgent agent[]) {
    XYSeriesCollection xyDataset = new XYSeriesCollection();
    JFreeChart chart = ChartFactory.createXYLineChart("Agent knowledge", // Title
            "Time", // X-Axis label
            "% map known", // Y-Axis label
            xyDataset, // Dataset
            PlotOrientation.VERTICAL, true, // Show legend
            true, // Tooltips
            false);//from ww  w .  j  a va 2 s  .  co  m
    for (int i = 0; i < agent.length; i++) {
        //update agent data
        //agent[i].updateTrueAreaKnown(simConfig.getEnv());
        agent[i].knowledgeData.put(simulation.getTimeElapsed(),
                (double) agent[i].getAreaKnown() / (double) simulation.getTotalArea());

        XYSeries series = new XYSeries("Agent " + i);
        Iterator it = agent[i].knowledgeData.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<Integer, Double> pairs = (Map.Entry) it.next();

            series.add(pairs.getKey(), pairs.getValue());
        }
        xyDataset.addSeries(series);
    }
    jointKnowledge.put(simulation.getTimeElapsed(),
            (double) simulation.getTrueJointAreaKnown() / (double) simulation.getTotalArea());
    XYSeries series = new XYSeries("Joint agent knowledge");
    Iterator it = jointKnowledge.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<Integer, Double> pairs = (Map.Entry) it.next();

        series.add(pairs.getKey(), pairs.getValue());
    }
    xyDataset.addSeries(series);
    chart.setBackgroundPaint(Color.white);
    chart.getPlot().setBackgroundPaint(Color.black);
    chart.getPlot().setForegroundAlpha(1f);
    chart.getXYPlot().getRenderer().setSeriesPaint(0, Color.RED);
    chart.getXYPlot().getRenderer().setSeriesStroke(0, new BasicStroke(5));
    chart.getXYPlot().getRenderer().setSeriesPaint(1, Color.BLUE);
    chart.getXYPlot().getRenderer().setSeriesPaint(2, Color.YELLOW);
    chart.getXYPlot().getRenderer().setSeriesPaint(3, Color.GREEN);
    chart.getXYPlot().getRenderer().setSeriesPaint(4, Color.cyan);
    chart.getXYPlot().getRenderer().setSeriesPaint(agent.length, Color.MAGENTA);
    chart.getXYPlot().getRenderer().setSeriesStroke(agent.length, new BasicStroke(3));
    return chart;
}

From source file:sentimentanalyzer.ChartController.java

public Color getRandomColor() {
    Color[] picker = new Color[10];
    picker[0] = Color.ORANGE;//from   w w w.j  a  v a  2  s .  c  om
    picker[1] = Color.BLUE;
    picker[2] = Color.GREEN;
    picker[3] = Color.YELLOW;
    picker[4] = Color.BLACK;
    picker[5] = Color.PINK;
    picker[6] = Color.CYAN;
    picker[7] = Color.MAGENTA;
    picker[8] = Color.RED;
    picker[9] = Color.GRAY;

    int index = new Random().nextInt(picker.length);
    return picker[index];
}