[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;
|
---|
[209] | 21 | import net.miginfocom.swing.MigLayout;
|
---|
| 22 |
|
---|
[210] | 23 | /**
|
---|
| 24 | * @author Faria Nassiri-Mofakham
|
---|
| 25 | *
|
---|
| 26 | */
|
---|
[209] | 27 | public class GUI extends JFrame
|
---|
| 28 | {
|
---|
| 29 | Main main;
|
---|
[211] | 30 |
|
---|
[209] | 31 | public GUI(Main m)
|
---|
| 32 | {
|
---|
| 33 | super("MigLayout Basic");
|
---|
| 34 | main = m;
|
---|
| 35 |
|
---|
[211] | 36 | int squareDimension = 100;
|
---|
| 37 | int circleRadius = 5;
|
---|
| 38 |
|
---|
[209] | 39 | // Show the GUI
|
---|
| 40 | setLayout(new MigLayout("", "[grow]", "[grow]"));
|
---|
[211] | 41 |
|
---|
[212] | 42 | add(new JLabel("Portfolio:" + main.getPortfolio()), "right, wrap");
|
---|
[209] | 43 |
|
---|
[211] | 44 |
|
---|
| 45 | // add(new JLabel("Portfolio:"), "right, wrap");
|
---|
| 46 |
|
---|
| 47 | // //draw square border for product portfolio
|
---|
| 48 | // Square s = new Square(null,squareDimension, Color.BLACK);
|
---|
| 49 | // super.paint(s);
|
---|
| 50 | //
|
---|
| 51 | // //draw colored dots
|
---|
| 52 | // for (int i=0; i<p.size(); i++)
|
---|
| 53 | // {
|
---|
| 54 | // Portfolio p = main.getPortfolio();
|
---|
| 55 | // Circle c = new Circle(null,circleRadius, p.getProduct(i));
|
---|
| 56 | // super.paint(c);
|
---|
| 57 | // }
|
---|
| 58 |
|
---|
[212] | 59 | Canvas canvas = new Drawing(m.getPortfolio());
|
---|
| 60 | canvas.setSize(400, 400);
|
---|
| 61 | add(canvas, "growx, left, wrap, w 100");
|
---|
[211] | 62 |
|
---|
[212] | 63 | // add(new JTextField(), "growx, left, wrap, w 100");
|
---|
[209] | 64 | add(new JLabel("Password:"), "right");
|
---|
| 65 | add(new JPasswordField(), "growx, left, wrap, w 100");
|
---|
| 66 | add(new JCheckBox("Remember Me"), "center, wrap, span");
|
---|
| 67 | add(new JButton("Login"), "split 2, span 2, center");
|
---|
| 68 | add(new JButton("Close"));
|
---|
[211] | 69 |
|
---|
[209] | 70 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
---|
| 71 | pack();
|
---|
| 72 | setLocationRelativeTo(null);
|
---|
| 73 | setVisible(true);
|
---|
| 74 | }
|
---|
[211] | 75 |
|
---|
[210] | 76 | /**
|
---|
| 77 | * @param args
|
---|
| 78 | */
|
---|
[209] | 79 | public static void main(String[] args)
|
---|
| 80 | {
|
---|
| 81 | Main main = new Main();
|
---|
| 82 | GUI gui = new GUI(main);
|
---|
[211] | 83 |
|
---|
[209] | 84 | }
|
---|
| 85 |
|
---|
[211] | 86 |
|
---|
| 87 |
|
---|
[209] | 88 | }
|
---|