[209] | 1 | package negotiator.onetomany;
|
---|
| 2 |
|
---|
[212] | 3 | import java.awt.Canvas;
|
---|
[215] | 4 | import java.awt.geom.Line2D;
|
---|
[211] | 5 |
|
---|
[215] | 6 | import javax.swing.ImageIcon;
|
---|
[209] | 7 | import javax.swing.JButton;
|
---|
| 8 | import javax.swing.JFrame;
|
---|
| 9 | import javax.swing.JLabel;
|
---|
| 10 |
|
---|
[212] | 11 | import negotiator.onetomany.etc.Drawing;
|
---|
[215] | 12 | import negotiator.onetomany.etc.Line;
|
---|
[209] | 13 | import net.miginfocom.swing.MigLayout;
|
---|
| 14 |
|
---|
[210] | 15 | /**
|
---|
| 16 | * @author Faria Nassiri-Mofakham
|
---|
| 17 | *
|
---|
| 18 | */
|
---|
[215] | 19 | /**
|
---|
| 20 | * @author Faria Nassiri-Mofakham
|
---|
| 21 | *
|
---|
| 22 | */
|
---|
[209] | 23 | public class GUI extends JFrame
|
---|
| 24 | {
|
---|
| 25 | Main main;
|
---|
[211] | 26 |
|
---|
[209] | 27 | public GUI(Main m)
|
---|
| 28 | {
|
---|
[215] | 29 | super("Bob gets ready for negotiation ...");
|
---|
[209] | 30 | main = m;
|
---|
| 31 |
|
---|
[211] | 32 |
|
---|
[215] | 33 |
|
---|
[209] | 34 | // Show the GUI
|
---|
[215] | 35 | setLayout(new MigLayout("", "", ""));
|
---|
[211] | 36 |
|
---|
[215] | 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");
|
---|
[211] | 39 |
|
---|
[215] | 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");
|
---|
[211] | 60 |
|
---|
[215] | 61 | add(new JLabel("--------------------------------------------------------------------------------------------------"), "center, wrap, w 100");
|
---|
[211] | 62 |
|
---|
[215] | 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");
|
---|
[211] | 69 |
|
---|
[215] | 70 |
|
---|
[209] | 71 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
---|
| 72 | pack();
|
---|
| 73 | setLocationRelativeTo(null);
|
---|
| 74 | setVisible(true);
|
---|
| 75 | }
|
---|
[211] | 76 |
|
---|
[210] | 77 | /**
|
---|
| 78 | * @param args
|
---|
| 79 | */
|
---|
[209] | 80 | public static void main(String[] args)
|
---|
| 81 | {
|
---|
| 82 | Main main = new Main();
|
---|
| 83 | GUI gui = new GUI(main);
|
---|
[211] | 84 |
|
---|
[209] | 85 | }
|
---|
| 86 |
|
---|
[211] | 87 |
|
---|
| 88 |
|
---|
[209] | 89 | }
|
---|