1 | package genius.gui;
|
---|
2 |
|
---|
3 | import java.awt.Cursor;
|
---|
4 | import java.awt.Desktop;
|
---|
5 | import java.awt.Dimension;
|
---|
6 | import java.awt.Toolkit;
|
---|
7 | import java.awt.event.MouseAdapter;
|
---|
8 | import java.awt.event.MouseEvent;
|
---|
9 | import java.net.URI;
|
---|
10 |
|
---|
11 | import javax.swing.Icon;
|
---|
12 | import javax.swing.ImageIcon;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * The about menu created using Netbeans.
|
---|
16 | *
|
---|
17 | * @author Mark Hendrikx
|
---|
18 | */
|
---|
19 | public class About extends javax.swing.JFrame {
|
---|
20 |
|
---|
21 | private javax.swing.JLabel contributorsLabel;
|
---|
22 | private javax.swing.JTextArea contributorsValueLabel;
|
---|
23 | private javax.swing.JScrollPane contributorsValueScrollPane;
|
---|
24 | private javax.swing.JTextArea geniusDescription;
|
---|
25 | private javax.swing.JScrollPane geniusDescriptionScrollPane;
|
---|
26 | private javax.swing.JLabel logo;
|
---|
27 | private javax.swing.JLabel productVersionLabel;
|
---|
28 | private javax.swing.JLabel productVersionValueLable;
|
---|
29 | private javax.swing.JLabel websiteLabel;
|
---|
30 | private javax.swing.JLabel websiteValueLabel;
|
---|
31 | private final String GENIUSLINK = "http://ii.tudelft.nl/genius/";
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Creates new form About
|
---|
35 | */
|
---|
36 | public About() {
|
---|
37 | Toolkit tk = Toolkit.getDefaultToolkit();
|
---|
38 | Dimension screenSize = tk.getScreenSize();
|
---|
39 | this.setLocation(screenSize.width / 4, screenSize.height / 4);
|
---|
40 | initComponents();
|
---|
41 | }
|
---|
42 |
|
---|
43 | // <editor-fold defaultstate="collapsed" desc="Generated Code">
|
---|
44 | private void initComponents() {
|
---|
45 |
|
---|
46 | contributorsValueScrollPane = new javax.swing.JScrollPane();
|
---|
47 | contributorsValueLabel = new javax.swing.JTextArea();
|
---|
48 | logo = new javax.swing.JLabel();
|
---|
49 | productVersionLabel = new javax.swing.JLabel();
|
---|
50 | websiteLabel = new javax.swing.JLabel();
|
---|
51 | contributorsLabel = new javax.swing.JLabel();
|
---|
52 | productVersionValueLable = new javax.swing.JLabel();
|
---|
53 | websiteValueLabel = new javax.swing.JLabel();
|
---|
54 | geniusDescriptionScrollPane = new javax.swing.JScrollPane();
|
---|
55 | geniusDescription = new javax.swing.JTextArea();
|
---|
56 |
|
---|
57 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
---|
58 | setResizable(false);
|
---|
59 |
|
---|
60 | contributorsValueScrollPane
|
---|
61 | .setBackground(new java.awt.Color(255, 255, 255));
|
---|
62 |
|
---|
63 | contributorsValueLabel.setEditable(false);
|
---|
64 | contributorsValueLabel.setColumns(20);
|
---|
65 | contributorsValueLabel.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
|
---|
66 | contributorsValueLabel.setLineWrap(true);
|
---|
67 | contributorsValueLabel.setRows(5);
|
---|
68 | contributorsValueLabel.setText(
|
---|
69 | "R. Aydogan\nT. Baarslag\nA. Dirkzwager\nM. Hendrikx\nK. Hindriks\nW. Pasman\nD. Tykhonov\nD. Festen\nand others...");
|
---|
70 | contributorsValueLabel.setWrapStyleWord(true);
|
---|
71 | contributorsValueLabel.setOpaque(false);
|
---|
72 | contributorsValueScrollPane.setViewportView(contributorsValueLabel);
|
---|
73 |
|
---|
74 | Icon icon = new ImageIcon(getClass().getClassLoader()
|
---|
75 | .getResource("genius/gui/resources/GeniusLogo.png"));
|
---|
76 | logo.setIcon(icon); // NOI18N
|
---|
77 |
|
---|
78 | productVersionLabel.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
|
---|
79 | productVersionLabel.setText("Production version:");
|
---|
80 |
|
---|
81 | websiteLabel.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
|
---|
82 | websiteLabel.setText("Website:");
|
---|
83 |
|
---|
84 | contributorsLabel.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
|
---|
85 | contributorsLabel.setText("Contributors:");
|
---|
86 |
|
---|
87 | productVersionValueLable.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
|
---|
88 | productVersionValueLable
|
---|
89 | .setText(getClass().getPackage().getImplementationVersion());
|
---|
90 |
|
---|
91 | websiteValueLabel.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
|
---|
92 | websiteValueLabel
|
---|
93 | .setText("<html><a href=\"\">" + GENIUSLINK + "</a></html>");
|
---|
94 | websiteValueLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
---|
95 | websiteValueLabel.addMouseListener(new MouseAdapter() {
|
---|
96 | @Override
|
---|
97 | public void mouseClicked(MouseEvent e) {
|
---|
98 | try {
|
---|
99 | Desktop.getDesktop().browse(new URI(GENIUSLINK));
|
---|
100 | } catch (Exception e2) {
|
---|
101 | }
|
---|
102 | }
|
---|
103 | });
|
---|
104 |
|
---|
105 | geniusDescriptionScrollPane
|
---|
106 | .setBackground(new java.awt.Color(255, 255, 255));
|
---|
107 | geniusDescription.setFocusable(false);
|
---|
108 |
|
---|
109 | geniusDescription.setEditable(false);
|
---|
110 | geniusDescription.setColumns(20);
|
---|
111 | geniusDescription.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
|
---|
112 | geniusDescription.setLineWrap(true);
|
---|
113 | geniusDescription.setRows(5);
|
---|
114 | geniusDescription.setText(
|
---|
115 | "Genius is a negotiation environment that implements an open architecture for heterogeneous negotiating agents. Genius can be used to implement, or simulate, real life negotiations. This version includes a set of scenarios, negotiation strategies, and quality measures to quantify the performance of an agent.");
|
---|
116 | geniusDescription.setWrapStyleWord(true);
|
---|
117 | geniusDescription.setOpaque(false);
|
---|
118 | geniusDescriptionScrollPane.setViewportView(geniusDescription);
|
---|
119 |
|
---|
120 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
|
---|
121 | getContentPane());
|
---|
122 | getContentPane().setLayout(layout);
|
---|
123 | layout.setHorizontalGroup(layout
|
---|
124 | .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
---|
125 | .addGroup(layout.createSequentialGroup().addContainerGap()
|
---|
126 | .addGroup(layout
|
---|
127 | .createParallelGroup(
|
---|
128 | javax.swing.GroupLayout.Alignment.LEADING)
|
---|
129 | .addGroup(
|
---|
130 | javax.swing.GroupLayout.Alignment.TRAILING,
|
---|
131 | layout.createSequentialGroup()
|
---|
132 | .addGap(0, 0, Short.MAX_VALUE)
|
---|
133 | .addComponent(logo,
|
---|
134 | javax.swing.GroupLayout.PREFERRED_SIZE,
|
---|
135 | 582,
|
---|
136 | javax.swing.GroupLayout.PREFERRED_SIZE))
|
---|
137 | .addGroup(layout.createSequentialGroup()
|
---|
138 | .addGroup(layout
|
---|
139 | .createParallelGroup(
|
---|
140 | javax.swing.GroupLayout.Alignment.LEADING)
|
---|
141 | .addComponent(
|
---|
142 | geniusDescriptionScrollPane)
|
---|
143 | .addGroup(
|
---|
144 | layout.createSequentialGroup()
|
---|
145 | .addComponent(
|
---|
146 | contributorsLabel)
|
---|
147 | .addPreferredGap(
|
---|
148 | javax.swing.LayoutStyle.ComponentPlacement.RELATED,
|
---|
149 | javax.swing.GroupLayout.DEFAULT_SIZE,
|
---|
150 | Short.MAX_VALUE)
|
---|
151 | .addComponent(
|
---|
152 | contributorsValueScrollPane,
|
---|
153 | javax.swing.GroupLayout.PREFERRED_SIZE,
|
---|
154 | 442,
|
---|
155 | javax.swing.GroupLayout.PREFERRED_SIZE))
|
---|
156 | .addGroup(
|
---|
157 | layout.createSequentialGroup()
|
---|
158 | .addGroup(layout
|
---|
159 | .createParallelGroup(
|
---|
160 | javax.swing.GroupLayout.Alignment.LEADING)
|
---|
161 | .addGroup(
|
---|
162 | layout.createSequentialGroup()
|
---|
163 | .addComponent(
|
---|
164 | productVersionLabel)
|
---|
165 | .addPreferredGap(
|
---|
166 | javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
---|
167 | .addComponent(
|
---|
168 | productVersionValueLable,
|
---|
169 | javax.swing.GroupLayout.PREFERRED_SIZE,
|
---|
170 | 43,
|
---|
171 | javax.swing.GroupLayout.PREFERRED_SIZE))
|
---|
172 | .addGroup(
|
---|
173 | layout.createSequentialGroup()
|
---|
174 | .addComponent(
|
---|
175 | websiteLabel)
|
---|
176 | .addPreferredGap(
|
---|
177 | javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
---|
178 | .addComponent(
|
---|
179 | websiteValueLabel,
|
---|
180 | javax.swing.GroupLayout.PREFERRED_SIZE,
|
---|
181 | 390,
|
---|
182 | javax.swing.GroupLayout.PREFERRED_SIZE)))
|
---|
183 | .addGap(0, 0,
|
---|
184 | Short.MAX_VALUE)))
|
---|
185 | .addContainerGap()))));
|
---|
186 | layout.setVerticalGroup(layout
|
---|
187 | .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
---|
188 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout
|
---|
189 | .createSequentialGroup().addContainerGap()
|
---|
190 | .addComponent(logo,
|
---|
191 | javax.swing.GroupLayout.PREFERRED_SIZE, 234,
|
---|
192 | javax.swing.GroupLayout.PREFERRED_SIZE)
|
---|
193 | .addGap(13, 13, 13)
|
---|
194 | .addComponent(geniusDescriptionScrollPane,
|
---|
195 | javax.swing.GroupLayout.PREFERRED_SIZE,
|
---|
196 | javax.swing.GroupLayout.DEFAULT_SIZE,
|
---|
197 | javax.swing.GroupLayout.PREFERRED_SIZE)
|
---|
198 | .addPreferredGap(
|
---|
199 | javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
---|
200 | .addGroup(layout
|
---|
201 | .createParallelGroup(
|
---|
202 | javax.swing.GroupLayout.Alignment.BASELINE)
|
---|
203 | .addComponent(productVersionLabel)
|
---|
204 | .addComponent(productVersionValueLable))
|
---|
205 | .addGap(18, 18, 18)
|
---|
206 | .addGroup(layout
|
---|
207 | .createParallelGroup(
|
---|
208 | javax.swing.GroupLayout.Alignment.BASELINE)
|
---|
209 | .addComponent(websiteLabel)
|
---|
210 | .addComponent(websiteValueLabel))
|
---|
211 | .addGap(18, 18, 18)
|
---|
212 | .addGroup(layout
|
---|
213 | .createParallelGroup(
|
---|
214 | javax.swing.GroupLayout.Alignment.LEADING)
|
---|
215 | .addComponent(contributorsLabel)
|
---|
216 | .addComponent(contributorsValueScrollPane,
|
---|
217 | javax.swing.GroupLayout.PREFERRED_SIZE,
|
---|
218 | javax.swing.GroupLayout.DEFAULT_SIZE,
|
---|
219 | javax.swing.GroupLayout.PREFERRED_SIZE))
|
---|
220 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
|
---|
221 | Short.MAX_VALUE)));
|
---|
222 | setTitle("About");
|
---|
223 | pack();
|
---|
224 | }// </editor-fold>
|
---|
225 | }
|
---|