1 | package negotiator.onetomany;
|
---|
2 |
|
---|
3 | import java.awt.Canvas;
|
---|
4 | import java.awt.Color;
|
---|
5 | import java.awt.Point;
|
---|
6 | //import java.util.Iterator;
|
---|
7 |
|
---|
8 | //import javax.swing.*;
|
---|
9 | //import java.awt.*;
|
---|
10 |
|
---|
11 |
|
---|
12 | import javax.swing.JButton;
|
---|
13 | import javax.swing.JCheckBox;
|
---|
14 | import javax.swing.JFrame;
|
---|
15 | import javax.swing.JLabel;
|
---|
16 | import javax.swing.JPasswordField;
|
---|
17 | import javax.swing.JTextField;
|
---|
18 |
|
---|
19 | import negotiator.onetomany.etc.Circle;
|
---|
20 | import negotiator.onetomany.etc.Drawing;
|
---|
21 | import negotiator.onetomany.etc.Square;
|
---|
22 | import net.miginfocom.swing.MigLayout;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * @author Faria Nassiri-Mofakham
|
---|
26 | *
|
---|
27 | */
|
---|
28 | public class GUI extends JFrame
|
---|
29 | {
|
---|
30 | Main main;
|
---|
31 |
|
---|
32 | public GUI(Main m)
|
---|
33 | {
|
---|
34 | super("MigLayout Basic");
|
---|
35 | main = m;
|
---|
36 |
|
---|
37 | int squareDimension = 100;
|
---|
38 | int circleRadius = 5;
|
---|
39 |
|
---|
40 | // Show the GUI
|
---|
41 | setLayout(new MigLayout("", "[grow]", "[grow]"));
|
---|
42 |
|
---|
43 | add(new JLabel("Portfolio:" + main.getPortfolio()), "right, wrap");
|
---|
44 |
|
---|
45 |
|
---|
46 | // add(new JLabel("Portfolio:"), "right, wrap");
|
---|
47 |
|
---|
48 | // //draw square border for product portfolio
|
---|
49 | // Square s = new Square(null,squareDimension, Color.BLACK);
|
---|
50 | // super.paint(s);
|
---|
51 | //
|
---|
52 | // //draw colored dots
|
---|
53 | // for (int i=0; i<p.size(); i++)
|
---|
54 | // {
|
---|
55 | // Portfolio p = main.getPortfolio();
|
---|
56 | // Circle c = new Circle(null,circleRadius, p.getProduct(i));
|
---|
57 | // super.paint(c);
|
---|
58 | // }
|
---|
59 |
|
---|
60 | Canvas canvas = new Drawing(m.getPortfolio());
|
---|
61 | canvas.setSize(400, 400);
|
---|
62 | add(canvas, "growx, left, wrap, w 100");
|
---|
63 |
|
---|
64 | // add(new JTextField(), "growx, left, wrap, w 100");
|
---|
65 | add(new JLabel("Password:"), "right");
|
---|
66 | add(new JPasswordField(), "growx, left, wrap, w 100");
|
---|
67 | add(new JCheckBox("Remember Me"), "center, wrap, span");
|
---|
68 | add(new JButton("Login"), "split 2, span 2, center");
|
---|
69 | add(new JButton("Close"));
|
---|
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 | }
|
---|