[209] | 1 | package negotiator.onetomany;
|
---|
| 2 |
|
---|
[212] | 3 | import java.awt.Canvas;
|
---|
[211] | 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 |
|
---|
[209] | 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;
|
---|
[211] | 17 | import javax.swing.JTextField;
|
---|
[209] | 18 |
|
---|
[211] | 19 | import negotiator.onetomany.etc.Circle;
|
---|
[212] | 20 | import negotiator.onetomany.etc.Drawing;
|
---|
[211] | 21 | import negotiator.onetomany.etc.Square;
|
---|
[209] | 22 | import net.miginfocom.swing.MigLayout;
|
---|
| 23 |
|
---|
[210] | 24 | /**
|
---|
| 25 | * @author Faria Nassiri-Mofakham
|
---|
| 26 | *
|
---|
| 27 | */
|
---|
[209] | 28 | public class GUI extends JFrame
|
---|
| 29 | {
|
---|
| 30 | Main main;
|
---|
[211] | 31 |
|
---|
[209] | 32 | public GUI(Main m)
|
---|
| 33 | {
|
---|
| 34 | super("MigLayout Basic");
|
---|
| 35 | main = m;
|
---|
| 36 |
|
---|
[211] | 37 | int squareDimension = 100;
|
---|
| 38 | int circleRadius = 5;
|
---|
| 39 |
|
---|
[209] | 40 | // Show the GUI
|
---|
| 41 | setLayout(new MigLayout("", "[grow]", "[grow]"));
|
---|
[211] | 42 |
|
---|
[212] | 43 | add(new JLabel("Portfolio:" + main.getPortfolio()), "right, wrap");
|
---|
[209] | 44 |
|
---|
[211] | 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 |
|
---|
[212] | 60 | Canvas canvas = new Drawing(m.getPortfolio());
|
---|
| 61 | canvas.setSize(400, 400);
|
---|
| 62 | add(canvas, "growx, left, wrap, w 100");
|
---|
[211] | 63 |
|
---|
[212] | 64 | // add(new JTextField(), "growx, left, wrap, w 100");
|
---|
[209] | 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"));
|
---|
[211] | 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 | }
|
---|