Example usage for java.awt Color YELLOW

List of usage examples for java.awt Color YELLOW

Introduction

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

Prototype

Color YELLOW

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

Click Source Link

Document

The color yellow.

Usage

From source file:amicity.graph.pc.gui.JungGraphViewer.java

public JungGraphViewer(JungGraph aGraph) {
    this.graph = aGraph;

    this.setLayout(new BorderLayout());
    layout = new StaticLayout<Node, Edge>(graph);
    vv = new VisualizationViewer<Node, Edge>(layout);

    vv.setBackground(Color.white);

    vv.getRenderContext().setVertexLabelTransformer(new NodeTransformer());
    vv.getRenderContext().setEdgeLabelTransformer(new EdgeTransformer());
    vv.getRenderContext().setVertexStrokeTransformer(new NodeStrokeTransformer(vv));
    vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.YELLOW));
    vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);

    Transformer<Node, Shape> vertexSize = new Transformer<Node, Shape>() {
        public Shape transform(Node i) {
            int length = i.getLabel().length() * 10;
            length = length > 30 ? length : 30;
            return new Rectangle(-20, -10, length, 30);
        }/*from www  .j  a v a  2s .com*/
    };
    vv.getRenderContext().setVertexShapeTransformer(vertexSize);

    final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
    panel.setPreferredSize(new Dimension(400, 400));
    add(panel, BorderLayout.CENTER);
}

From source file:ws.moor.bt.gui.charts.BlockOrigin.java

private JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart3D("Block Origin", dataset, false, false, false);
    chart.setBackgroundPaint(Color.white);

    ((PiePlot3D) chart.getPlot()).setSectionPaint(0, Color.YELLOW);
    ((PiePlot3D) chart.getPlot()).setSectionPaint(0, Color.GREEN);

    return chart;
}

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  .  j  a  va 2  s. co m
            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  w  w w .jav  a 2 s  .  com*/

    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:de.berlios.statcvs.xml.report.AuthorsActivityChart.java

public AuthorsActivityChart(CvsContent content, ReportSettings settings) {
    super(settings, "activity.png", I18n.tr("Author Activity"), null, "%");

    CategoryPlot plot = getChart().getCategoryPlot();
    plot.getRenderer().setSeriesPaint(REMOVING, Color.red);
    plot.getRenderer().setSeriesPaint(CHANGING, Color.yellow);
    plot.getRenderer().setSeriesPaint(ADDING, Color.green);
    plot.getRangeAxis().setUpperBound(100);

    Collection auts = content.getAuthors();
    Iterator it = auts.iterator();
    while (it.hasNext()) {
        Author author = (Author) it.next();
        authors.add(author.getName());/*from w w  w.j a  v a  2s  .co m*/
    }
    Collections.sort(authors);
    double[][] categories;
    categories = new double[3][authors.size()];
    for (int j = 0; j < authors.size(); j++) {
        categories[REMOVING][j] = 0;
        categories[CHANGING][j] = 0;
        categories[ADDING][j] = 0;
    }

    Iterator revIt = settings.getRevisionIterator(content);
    CommitListBuilder commitList = new CommitListBuilder(revIt);
    List commits = commitList.createCommitList();
    Iterator commitIt = commits.iterator();
    while (commitIt.hasNext()) {
        Commit commit = (Commit) commitIt.next();
        Set commitRevList = commit.getRevisions();
        Iterator commitRevIt = commitRevList.iterator();
        int author = authors.indexOf(commit.getAuthor().getName());
        int linesAdded = 0;
        int linesRemoved = 0;
        while (commitRevIt.hasNext()) {
            CvsRevision revision = (CvsRevision) commitRevIt.next();
            linesAdded += revision.getNewLines();
            linesRemoved += revision.getNewLines() - revision.getReplacedLines();
        }
        if (linesAdded == linesRemoved) {
            categories[CHANGING][author] += linesAdded;
        }
        if (linesAdded < linesRemoved) {
            categories[CHANGING][author] += linesAdded;
            categories[REMOVING][author] += linesRemoved - linesAdded;
        }
        if (linesAdded > linesRemoved) {
            categories[ADDING][author] += linesAdded - linesRemoved;
            categories[CHANGING][author] += linesRemoved;
        }
    }

    for (int i = 0; i < authors.size(); i++) {
        double maxLines = categories[REMOVING][i] + categories[CHANGING][i] + categories[ADDING][i];
        for (int k = 0; k < 3; k++) {
            categories[k][i] *= (100 / maxLines);
            dataset.addValue(categories[k][i], topics[k], (String) authors.get(i));
        }
    }
    setup(true);
}

From source file:ClipArea.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    int w = getSize().width;
    int h = getSize().height;

    if (clip) {/*  w  w  w. j a va 2 s .  c om*/
        Ellipse2D e = new Ellipse2D.Float(w / 4.0f, h / 4.0f, w / 2.0f, h / 2.0f);
        g2.setClip(e);

        g2.setColor(Color.yellow);
        g2.fillRect(0, 0, w, h);
    }

    if (clipFurther) {
        Rectangle r = new Rectangle(w / 2, h / 2, w / 2, h / 2);
        g2.clip(r);

        g2.setColor(Color.green);
        g2.fillRect(0, 0, w, h);
    }
}

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.  j  av a 2 s .c  o  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:IHM.compargraph.java

/**
 *
 * @param title/*from ww w  . j  av  a  2  s  .  com*/
 * @param c1
 * @param c2
 * @param comp
 * 
 */
public compargraph(String title, ArrayList<ReleveMeteo> c1, ArrayList<ReleveMeteo> c2, String comp) {
    super(title);
    t1 = c1;
    t2 = c2;
    c = comp;

    // jp = new JInternalFrame("courbes");

    JFreeChart chart = createChart(createDataset());
    ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new Dimension(500, 300));
    setContentPane(panel);
    //  jp.add(panel, BorderLayout.EAST);
    //  jp.setVisible(true);
    panel.setVisible(true);
    XYPlot plot = chart.getXYPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    plot.setRenderer(renderer);
    renderer.setSeriesPaint(0, Color.RED);
    renderer.setSeriesPaint(1, Color.GREEN);
    renderer.setSeriesPaint(2, Color.YELLOW);
    // sets thickness for series (using strokes)
    renderer.setSeriesStroke(0, new BasicStroke(4.0f));
    renderer.setSeriesStroke(1, new BasicStroke(3.0f));
    renderer.setSeriesStroke(2, new BasicStroke(2.0f));
    plot.setRenderer(renderer);
    plot.setOutlinePaint(Color.BLUE);
    plot.setOutlineStroke(new BasicStroke(2.0f));
    plot.setBackgroundPaint(Color.DARK_GRAY);
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.BLACK);
    plot.setDomainGridlinesVisible(true);
    plot.setDomainGridlinePaint(Color.BLACK);

}

From source file:com.yanbang.portal.controller.PortalController.java

/**
 * ???/*from  w  ww .  j av a 2 s  . c om*/
 * 
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
@RequestMapping(params = "action=handleRnd")
public void handleRnd(HttpServletRequest request, HttpServletResponse response) throws Exception {
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Expires", 0L);
    response.setContentType("image/jpeg");
    BufferedImage image = new BufferedImage(65, 25, BufferedImage.TYPE_INT_RGB);
    Graphics g = image.getGraphics();
    g.setColor(Color.GRAY);
    g.fillRect(0, 0, 65, 25);
    g.setColor(Color.yellow);
    Font font = new Font("", Font.BOLD, 20);
    g.setFont(font);
    Random r = new Random();
    String rnd = "";
    int ir = r.nextInt(10);
    rnd = rnd + "" + ir;
    g.drawString("" + ir, 5, 18);
    g.setColor(Color.red);
    ir = r.nextInt(10);
    rnd = rnd + "" + ir;
    g.drawString("" + ir, 20, 18);
    g.setColor(Color.blue);
    ir = r.nextInt(10);
    rnd = rnd + "" + ir;
    g.drawString("" + ir, 35, 18);
    g.setColor(Color.green);
    ir = r.nextInt(10);
    rnd = rnd + "" + ir;
    g.drawString("" + ir, 50, 18);
    request.getSession().setAttribute("RND", rnd);
    ServletOutputStream out = response.getOutputStream();
    out.write(ImageUtil.imageToBytes(image, "gif"));
    out.flush();
    out.close();
}

From source file:es.bsc.autonomic.powermodeller.graphics.TotalPowerAndPredictionDifference.java

private static JFreeChart createChart() {
    JFreeChart jfreechart = ChartFactory.createTimeSeriesChart(NAME, "Power (Watts)", "Power (Watts)", data,
            true, true, false);/*from   www.j  ava2 s .  c om*/
    jfreechart.setBackgroundPaint(Color.white);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    XYDifferenceRenderer xydifferencerenderer = new XYDifferenceRenderer(Color.green, Color.yellow, false);
    xydifferencerenderer.setRoundXCoordinates(true);
    xyplot.setDomainCrosshairLockedOnData(true);
    xyplot.setRangeCrosshairLockedOnData(true);
    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);
    xyplot.setRenderer(xydifferencerenderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D));
    DateAxis dateaxis = new DateAxis("Samples");
    dateaxis.setTickLabelsVisible(false);
    dateaxis.setLowerMargin(0.0D);
    dateaxis.setUpperMargin(0.0D);
    xyplot.setDomainAxis(dateaxis);
    xyplot.setForegroundAlpha(0.5F);
    return jfreechart;
}