source: src/main/java/genius/gui/tournamentvars/ParameterVarUI.java@ 345

Last change on this file since 345 was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 1.1 KB
Line 
1package genius.gui.tournamentvars;
2
3import java.awt.Panel;
4import java.awt.Frame;
5import java.awt.BorderLayout;
6import java.util.ArrayList;
7import java.util.Vector;
8
9import javax.swing.JComboBox;
10
11import genius.core.AgentParam;
12import genius.gui.panels.DefaultOKCancelDialog;
13/**
14 * this shows a dialog where the user can select the parameter name
15 * @author wouter
16 *
17 */
18
19public class ParameterVarUI extends DefaultOKCancelDialog {
20
21 private static final long serialVersionUID = -6545959412141722703L;
22 Panel panel;
23 JComboBox combobox;
24
25 ParameterVarUI(Frame owner,ArrayList<AgentParam> selectableparameters) throws Exception {
26 super(owner, "Agent Parameter Selector");
27 if (selectableparameters==null || selectableparameters.size()==0)
28 throw new IllegalArgumentException("There are no selectable parameters because there are no selectable agents with parameters");
29 panel=new Panel(new BorderLayout());
30 combobox=new JComboBox(new Vector<AgentParam>(selectableparameters));
31 panel.add(combobox,BorderLayout.CENTER);
32 }
33
34 public Panel getPanel() {
35 return panel;
36 }
37
38 public Object ok() {
39 return combobox.getSelectedItem();
40 }
41}
Note: See TracBrowser for help on using the repository browser.