source: src/main/java/negotiator/onetomany/Main.java@ 224

Last change on this file since 224 was 224, checked in by Faria Nassiri Mofakham, 6 years ago

PortfolioDrawing, DemandPlanDrawing, GUI, and Main updated. DemandPlanDrwaing lists products in multiple rows. Drwaing1, Drawing2, Circle are deleted. Bob name changed to PutImage.

File size: 984 bytes
RevLine 
[209]1package negotiator.onetomany;
2
[211]3import java.awt.Color;
[219]4import java.awt.List;
5import java.util.Iterator;
[211]6
[209]7public class Main
8{
9 private Portfolio portfolio;
[215]10 private DemandPlan demandPlan;
[209]11
[224]12 private int numType = 7; // this could later be gained from Domain
13
[209]14 public Main()
15 {
[212]16 Product redProduct = new Product("Red");
17 Product pinkProduct = new Product("Pink");
18 Product blueProduct = new Product("Blue");
[211]19
[215]20
[209]21 portfolio = new Portfolio();
[215]22
[209]23 portfolio.addProduct(redProduct);
[212]24 portfolio.addProduct(pinkProduct);
[209]25 portfolio.addProduct(blueProduct);
[215]26
[222]27 demandPlan = new DemandPlan();
[224]28 for (Product product : portfolio.getPortfolio())
29 demandPlan.setQuantity(product, (int)(Math.random()*numType+1));
30// demandPlan.setQuantity(redProduct, 2);
[222]31
[224]32// System.out.println(demandPlan);
[219]33
[209]34 }
[219]35
[209]36
37 public Portfolio getPortfolio()
38 {
39 return portfolio;
40 }
[215]41
[219]42 public DemandPlan getDemandPlan()
43 {
44 return demandPlan;
45 }
[209]46
47}
[215]48
Note: See TracBrowser for help on using the repository browser.