1 | package negotiator.onetomany;
|
---|
2 |
|
---|
3 | import java.awt.Canvas;
|
---|
4 | import java.awt.geom.Line2D;
|
---|
5 |
|
---|
6 | import javax.swing.ImageIcon;
|
---|
7 | import javax.swing.JButton;
|
---|
8 | import javax.swing.JFrame;
|
---|
9 | import javax.swing.JLabel;
|
---|
10 |
|
---|
11 | import negotiator.onetomany.etc.Drawing;
|
---|
12 | import negotiator.onetomany.etc.Line;
|
---|
13 | import net.miginfocom.swing.MigLayout;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * @author Faria Nassiri-Mofakham
|
---|
17 | *
|
---|
18 | */
|
---|
19 | /**
|
---|
20 | * @author Faria Nassiri-Mofakham
|
---|
21 | *
|
---|
22 | */
|
---|
23 | public class GUI extends JFrame
|
---|
24 | {
|
---|
25 | Main main;
|
---|
26 |
|
---|
27 | public GUI(Main m)
|
---|
28 | {
|
---|
29 | super("Bob gets ready for negotiation ...");
|
---|
30 | main = m;
|
---|
31 |
|
---|
32 |
|
---|
33 |
|
---|
34 | // Show the GUI
|
---|
35 | setLayout(new MigLayout("", "", ""));
|
---|
36 |
|
---|
37 | //add(new ImageIcon("/NegotiatorGUI/src/main/java/negotiator/onetomany/etc/Bob.png"), "growx, center, wrap");
|
---|
38 | add(new JLabel("`Rational Assistant' receives Bob's `PORTFOLIO' as follows:"), "center, wrap");
|
---|
39 |
|
---|
40 |
|
---|
41 | Canvas canvas1 = new Drawing(m.getPortfolio());
|
---|
42 | canvas1.setSize(200, 200);
|
---|
43 | add(canvas1, "growx, center, wrap");
|
---|
44 |
|
---|
45 | //add(new Line()); // for drawing a line!
|
---|
46 | //add(new Line2D.Float(100, 100, 400, 100), "center");
|
---|
47 |
|
---|
48 | add(new JLabel("--------------------------------------------------------------------------------------------------"), "center, wrap, w 100");
|
---|
49 |
|
---|
50 | add(new JLabel("It also receives Bob's `DEMAND PLAN' as follows:"), "center, wrap");
|
---|
51 |
|
---|
52 | // Canvas canvas2 = new Drawing(m.getDemandPlan());
|
---|
53 | // canvas2.setSize(200, 200);
|
---|
54 | // add(canvas2, "center");
|
---|
55 |
|
---|
56 | Canvas canvas2 = new Drawing(m.getPortfolio());
|
---|
57 | canvas2.setSize(200, 200);
|
---|
58 | //canvas2.setBounds(x, y, width, height); //for changing its margin !?
|
---|
59 | add(canvas2, "growx, growy, center, wrap");
|
---|
60 |
|
---|
61 | add(new JLabel("--------------------------------------------------------------------------------------------------"), "center, wrap, w 100");
|
---|
62 |
|
---|
63 |
|
---|
64 | //*********************
|
---|
65 | add(new JButton("Edit..."), "cell 0 10, center, w 90");
|
---|
66 | add(new JButton("Delete..."), "cell 0 10, center, w 90");
|
---|
67 | add(new JButton("Next..."), "cell 0 10,center, w 90");
|
---|
68 | add(new JButton("Close"), "cell 0 10, center, wrap, w 90");
|
---|
69 |
|
---|
70 |
|
---|
71 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
---|
72 | pack();
|
---|
73 | setLocationRelativeTo(null);
|
---|
74 | setVisible(true);
|
---|
75 | }
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * @param args
|
---|
79 | */
|
---|
80 | public static void main(String[] args)
|
---|
81 | {
|
---|
82 | Main main = new Main();
|
---|
83 | GUI gui = new GUI(main);
|
---|
84 |
|
---|
85 | }
|
---|
86 |
|
---|
87 |
|
---|
88 |
|
---|
89 | }
|
---|