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:cs.ucy.ac.cy.osslicense.model.editor.visualizer.LicenseVisualizer.java

public void displayLicenseGraph() {

    Transformer<String, Paint> vertexColor = new Transformer<String, Paint>() {
        public Paint transform(String licenseTerm) {
            if (licenseTerm.contains("May"))
                return Color.GREEN;
            if (licenseTerm.contains("Must"))
                return Color.ORANGE;
            if (licenseTerm.equals("LimitedLiability") || licenseTerm.equals("ProvideWithoutWarranty"))
                return Color.CYAN;
            return Color.YELLOW;
        }/*  w  w w  .java 2 s.  co  m*/
    };

    Layout<String, Edge> layout = new CircleLayout<String, Edge>(this.licenseGraph);
    layout.setSize(new Dimension(1024, 768));
    VisualizationViewer<String, Edge> vv = new VisualizationViewer<String, Edge>(layout);
    vv.setPreferredSize(new Dimension(1024, 768));

    vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);
    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<Edge>());

    AbstractModalGraphMouse gm = new DefaultModalGraphMouse<String, Edge>();
    vv.setGraphMouse(gm);

    LicenseTermPopupMenu<String, Edge> popupMenu = new LicenseTermPopupMenu<>(licenseModel);
    gm.add(popupMenu);

    JFrame frame = new JFrame("Interactive Graph View 1");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(vv);

    frame.pack();
    frame.setVisible(true);

}

From source file:ChartPanelMaker.java

public static ChartPanel createChart(ArrayList<Voter> voters, ArrayList<Candidate> candidates,
        ArrayList<Candidate> committee, String title) {
    XYSeriesCollection dataset = new XYSeriesCollection();
    XYSeries comitteeDataset = new XYSeries("Committee");
    for (Candidate c : committee) {
        comitteeDataset.add(c.getX(), c.getY());
    }//  w w  w.  jav  a  2 s .  c o m
    dataset.addSeries(comitteeDataset);

    int n = voters.size();
    int m = candidates.size();

    int skipN = n / 150;
    if (skipN < 1) {
        skipN = 1;
    }

    int skipM = m / 150;
    if (skipM < 1) {
        skipM = 1;
    }

    Collections.sort(voters, Election.VoterNameComparator);
    Collections.sort(candidates, Election.CandidateNameComparator);

    XYSeries voterDataset = new XYSeries("Voters");
    for (int i = 0; i < n; i++) {
        Voter v = voters.get(i);
        if (i % skipN == 0) {
            voterDataset.add(v.getX(), v.getY());
        }
    }
    dataset.addSeries(voterDataset);

    XYSeries candidateDataset = new XYSeries("Candidates");
    for (int i = 0; i < m; i++) {
        Candidate c = candidates.get(i);
        if (i % skipM == 0) {
            candidateDataset.add(c.getX(), c.getY());
        }
    }
    dataset.addSeries(candidateDataset);

    Shape committeeShape = ShapeUtilities.createDiamond(5);
    Shape voterShape = ShapeUtilities.createDownTriangle(3);
    Shape candidateShape = ShapeUtilities.createUpTriangle(3);

    Color committeeColor = Color.DARK_GRAY;
    Color voterColor = Color.ORANGE;
    Color candidateColor = Color.LIGHT_GRAY;

    JFreeChart chart = ChartFactory.createScatterPlot(title, "", "", dataset, PlotOrientation.VERTICAL, true,
            true, true);
    XYPlot plot = chart.getXYPlot();
    XYItemRenderer r = plot.getRenderer();
    r.setSeriesShape(0, committeeShape);
    r.setSeriesPaint(0, committeeColor);
    r.setSeriesShape(1, voterShape);
    r.setSeriesPaint(1, voterColor);
    r.setSeriesShape(2, candidateShape);
    r.setSeriesPaint(2, candidateColor);
    ChartPanel chartPanel = new ChartPanel(chart);

    return chartPanel;
}

From source file:TelasBanzos.TelaRelatorioDiadaSemana.java

/**
 * Creates new form TelaNovoOrcamento/*  w w  w.j  a v a  2 s  . c  o m*/
 */
public TelaRelatorioDiadaSemana() {
    initComponents();

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.setValue(2, "3", "Domingo");
    dataset.setValue(5, "3", "Segunda");
    dataset.setValue(4, "3", "Tera");
    dataset.setValue(7, "3", "Quarta");
    dataset.setValue(6, "3", "Quinta");
    dataset.setValue(2, "3", "Sexta");
    dataset.setValue(4, "3", "Sbado");

    JFreeChart chart = ChartFactory.createBarChart("Alunos matriculados por dia da semana", "Dia da semana",
            "Quantidade Alunos", dataset, PlotOrientation.VERTICAL, false, true, false);
    ChartPanel myChartPanel = new ChartPanel(chart, true);
    pnGraf.add(myChartPanel);

    //colocar cor nas barras
    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer render = (BarRenderer) plot.getRenderer();
    render.setSeriesPaint(0, Color.ORANGE);

    setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("BanzosIcon.png")));//para setar um icone na janela
}

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]);// ww w  . ja va  2s. c om
            g2.fill(ellipse);
        }
    }
}

From source file:com.crunchify.jsp.servlet.BarServlet.java

public JFreeChart getChart() {

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(15, "1", "451");
    dataset.addValue(12, "1", "851");
    dataset.addValue(10, "2", "362");
    dataset.addValue(5, "2", "142");

    JFreeChart chart = ChartFactory.createBarChart("Bar Chart Demo 3", // chart title
            "Category", // domain axis label
            "Value", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // the plot orientation
            false, // include legend
            true, false);/*from ww w  .j a v a2  s .  co m*/

    chart.setBackgroundPaint(Color.lightGray);

    // get a reference to the plot for further customisation...
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setNoDataMessage("NO DATA!");

    CategoryItemRenderer renderer = new CustomRenderer(new Paint[] { Color.red, Color.blue, Color.green,
            Color.yellow, Color.orange, Color.cyan, Color.magenta, Color.blue });

    renderer.setItemLabelsVisible(true);
    ItemLabelPosition p = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER,
            45.0);
    renderer.setPositiveItemLabelPosition(p);
    plot.setRenderer(renderer);

    // change the margin at the top of the range axis...
    ValueAxis rangeAxis = plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setLowerMargin(0.15);
    rangeAxis.setUpperMargin(0.15);

    return chart;

}

From source file:org.jboss.forge.netbeans.ui.output.NbUIOutput.java

@Override
public void warn(PrintStream out, String message) {
    try {/*from ww  w.  j a va 2s.  c  o m*/
        this.io.select();
        IOColorLines.println(io, "***WARNING*** " + message, Color.ORANGE);
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }

}

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;/*ww w .java  2 s .  c om*/
    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:motordrivertxrx.View.MainView.java

/**
 * Creates new form MainView/*from   w  w w  .ja v a2s  . c o  m*/
 */
public MainView() {
    initComponents();

    this.dataset1 = new DefaultValueDataset(10.0);
    this.dataset2 = new DefaultValueDataset(50.0);

    // get data for diagrams
    DialPlot plot = new DialPlot();
    plot.setView(0.0, 0.0, 1.0, 1.0);
    plot.setDataset(0, this.dataset1);
    plot.setDataset(1, this.dataset2);
    SimpleDialFrame dialFrame = new SimpleDialFrame();
    dialFrame.setBackgroundPaint(Color.lightGray);
    dialFrame.setForegroundPaint(Color.DARK_GRAY);
    plot.setDialFrame(dialFrame);
    /*
    GradientPaint gp = new GradientPaint(new Point(), 
        new Color(255, 255, 255), new Point(), 
        new Color(170, 170, 220));
    */
    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), Color.ORANGE);

    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    plot.setBackground(db);

    DialTextAnnotation annotation1 = new DialTextAnnotation("Velocidad");
    annotation1.setFont(new Font("Dialog", Font.BOLD, 14));
    annotation1.setRadius(0.7);

    plot.addLayer(annotation1);

    DialValueIndicator dvi = new DialValueIndicator(0, "c");
    dvi.setFont(new Font("Dialog", Font.PLAIN, 10));
    dvi.setOutlinePaint(Color.darkGray);
    dvi.setRadius(0.60);
    dvi.setAngle(-103.0);
    plot.addLayer(dvi);

    DialValueIndicator dvi2 = new DialValueIndicator(1, "c");
    dvi2.setFont(new Font("Dialog", Font.PLAIN, 10));
    dvi2.setOutlinePaint(Color.red);
    dvi2.setRadius(0.60);
    dvi2.setAngle(-77.0);
    plot.addLayer(dvi2);

    StandardDialScale scale = new StandardDialScale(0, 127, -120, -300);
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 14));
    plot.addScale(0, scale);

    StandardDialScale scale2 = new StandardDialScale(0, 100, -120, -300);
    scale2.setTickRadius(0.50);
    scale2.setTickLabelOffset(0.15);
    scale2.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
    scale2.setMajorTickPaint(Color.red);
    plot.addScale(1, scale2);
    plot.mapDatasetToScale(1, 1);

    DialPointer needle2 = new DialPointer.Pin(1);
    needle2.setRadius(0.55);
    plot.addLayer(needle2);

    DialPointer needle = new DialPointer.Pointer(0);
    plot.addLayer(needle);

    DialCap cap = new DialCap();
    cap.setRadius(0.10);
    plot.setCap(cap);

    JFreeChart chart1 = new JFreeChart(plot);
    chart1.setTitle("Velocidad motor");
    ChartPanel cp1 = new ChartPanel(chart1);
    cp1.setPreferredSize(new Dimension(400, 400));

    /*JPanel sliderPanel = new JPanel(new GridLayout(2, 2));
    sliderPanel.add(new JLabel("Outer Needle:"));
    sliderPanel.add(new JLabel("Inner Needle:"));
    this.slider1 = new JSlider(-40, 60);
    this.slider1.setMajorTickSpacing(20);
    this.slider1.setPaintTicks(true);
    this.slider1.setPaintLabels(true);
    this.slider1.addChangeListener(this);
    sliderPanel.add(this.slider1);
    sliderPanel.add(this.slider1);
    this.slider2 = new JSlider(0, 100);
    this.slider2.setMajorTickSpacing(20);
    this.slider2.setPaintTicks(true);
    this.slider2.setPaintLabels(true);
    this.slider2.addChangeListener(this);
    sliderPanel.add(this.slider2);*/

    velocimetroPanel.add(cp1);

}

From source file:edu.jhuapl.graphs.jfreechart.BarEffectsTest.java

public static JFreeChartGraphSource getSource() throws GraphException {
    Map<String, Object> emptyMap = Collections.emptyMap();

    List<PointInterface> ps1 = new LinkedList<PointInterface>();
    ps1.add(new DataPoint(3, "Red", emptyMap));
    ps1.add(new DataPoint(5, "Green", emptyMap));
    ps1.add(new DataPoint(7, "Blue", emptyMap));

    Map<String, Object> s1Meta = new HashMap<String, Object>();
    s1Meta.put(GraphSource.SERIES_COLOR, Color.green);
    DataSeries s1 = new DataSeries(ps1, s1Meta);

    List<PointInterface> ps2 = new LinkedList<PointInterface>();

    Map<String, Object> redMap = new HashMap<String, Object>(1);
    redMap.put(GraphSource.ITEM_COLOR, Color.red);
    ps2.add(new DataPoint(5, "Red", redMap));

    Map<String, Object> greenMap = new HashMap<String, Object>(1);
    greenMap.put(GraphSource.ITEM_COLOR, Color.green);
    ps2.add(new DataPoint(2, "Green", greenMap));

    Map<String, Object> blueMap = new HashMap<String, Object>(1);
    blueMap.put(GraphSource.ITEM_COLOR, Color.blue);
    ps2.add(new DataPoint(14, "Blue", redMap));

    Map<String, Object> s2Meta = new HashMap<String, Object>();
    s2Meta.put(GraphSource.SERIES_COLOR, Color.orange);
    DataSeries s2 = new DataSeries(ps2, s2Meta);

    Map<String, Object> graphParams = new HashMap<String, Object>();
    graphParams.put(GraphSource.GRAPH_TYPE, GraphSource.GRAPH_TYPE_BAR);
    graphParams.put(JFreeChartBarGraphSource.PLOT_ORIENTATION, PlotOrientation.HORIZONTAL);
    graphParams.put(GraphSource.GRAPH_LEGEND, true);

    JFreeChartGraphSource source = new JFreeChartGraphSource();
    source.setData(Arrays.asList(s1, s2));
    source.setParams(graphParams);// ww  w .  j  ava2  s. c o m
    source.initialize();

    return source;
}

From source file:com.cedarsoft.test.io.CarSerializerTest.java

@Nonnull
@Override/*w  ww.  j  a  v a  2  s  .c  om*/
protected Iterable<? extends Car> createObjectsToSerialize() {
    return Arrays.asList(new Car(new Model("Toyota"), Color.BLACK, new Money(49000, 00)),
            new Car(new Model("Ford"), Color.ORANGE, new Money(19000, 00),
                    Arrays.asList(new Extra("Whoo effect", new Money(99, 98)),
                            new Extra("Better Whoo effect", new Money(199, 00)))));
}