source: src/main/java/negotiator/onetomany/etc/Drawing.java@ 214

Last change on this file since 214 was 212, checked in by Faria Nassiri Mofakham, 6 years ago
File size: 569 bytes
Line 
1package negotiator.onetomany.etc;
2import java.awt.Canvas;
3import java.awt.Color;
4import java.awt.Graphics;
5import javax.swing.JFrame;
6
7import negotiator.onetomany.Portfolio;
8import negotiator.onetomany.Product;
9
10public class Drawing extends Canvas
11{
12 Portfolio p;
13
14 public Drawing(Portfolio p2)
15 {
16 p = p2;
17 }
18
19 public void paint(Graphics g)
20 {
21 int x = 100;
22 for (Product product : p.getPortfolio())
23 {
24 g.setColor(product.getColor());
25 g.fillOval(x, 100, 20, 20);
26 x += 50;
27 }
28
29 }
30}
Note: See TracBrowser for help on using the repository browser.