1 | package negotiator.onetomany;
|
---|
2 |
|
---|
3 | import java.awt.Color;
|
---|
4 | import java.awt.Graphics;
|
---|
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 |
|
---|
18 | import negotiator.onetomany.etc.Circle;
|
---|
19 | import net.miginfocom.swing.MigLayout;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * @author Faria Nassiri-Mofakham
|
---|
23 | *
|
---|
24 | */
|
---|
25 | public class GUITest extends JFrame
|
---|
26 | {
|
---|
27 | Main main;
|
---|
28 |
|
---|
29 | public GUITest(Main m)
|
---|
30 | {
|
---|
31 | super("MigLayout Basic");
|
---|
32 | main = m;
|
---|
33 |
|
---|
34 | int squareDimension = 100;
|
---|
35 | int circleRadius = 5;
|
---|
36 |
|
---|
37 | // Point n = new Point(100,200);
|
---|
38 | int[] spans = {0, 50, 100, 150, 200, 250, 300};
|
---|
39 |
|
---|
40 | // Show the GUI
|
---|
41 | setLayout(new MigLayout("", "[grow]", "[grow]"));
|
---|
42 |
|
---|
43 |
|
---|
44 | // showPortfolioBorder(squareDimension);
|
---|
45 |
|
---|
46 | // showPortfolio(circleRadius);
|
---|
47 |
|
---|
48 |
|
---|
49 | // add(new JLabel("Portfolio:"), "right, wrap");
|
---|
50 | //
|
---|
51 | // //draw square border for product portfolio
|
---|
52 | // Square s = new Square(null,squareDimension, Color.BLACK);
|
---|
53 | // super.paint(s);
|
---|
54 | //
|
---|
55 | // //draw colored dots
|
---|
56 | // for (int i=0; i<p.size(); i++)
|
---|
57 | // {
|
---|
58 | // Portfolio p = main.getPortfolio();
|
---|
59 | // Circle c = new Circle(null,circleRadius, p.getProduct(i));
|
---|
60 | // super.paint(c);
|
---|
61 | // }
|
---|
62 |
|
---|
63 |
|
---|
64 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
---|
65 | pack();
|
---|
66 | setLocationRelativeTo(null);
|
---|
67 | setVisible(true);
|
---|
68 | }
|
---|
69 |
|
---|
70 |
|
---|
71 |
|
---|
72 | // public void showPortfolio(int circleRadius)
|
---|
73 | // {
|
---|
74 | // for (int i=0; i<p.size(); i++)
|
---|
75 | // {
|
---|
76 | // Portfolio p = main.getPortfolio();
|
---|
77 | // Circle c = new Circle(null,circleRadius, p.getProduct(i).getColor());
|
---|
78 | // super.paint(c); // <--- here
|
---|
79 | // }
|
---|
80 | // }
|
---|
81 |
|
---|
82 | public static void main(String[] args)
|
---|
83 | {
|
---|
84 | Main main = new Main();
|
---|
85 | GUITest gui = new GUITest(main);
|
---|
86 |
|
---|
87 | }
|
---|
88 |
|
---|
89 | }
|
---|
90 |
|
---|