Last change
on this file since 346 was 1, checked in by Wouter Pasman, 6 years ago |
Initial import : Genius 9.0.0
|
File size:
1.1 KB
|
Line | |
---|
1 | package genius.gui.tournamentvars;
|
---|
2 |
|
---|
3 | import java.awt.Panel;
|
---|
4 | import java.awt.Frame;
|
---|
5 | import java.awt.BorderLayout;
|
---|
6 | import java.util.ArrayList;
|
---|
7 | import java.util.Vector;
|
---|
8 |
|
---|
9 | import javax.swing.JComboBox;
|
---|
10 |
|
---|
11 | import genius.core.AgentParam;
|
---|
12 | import genius.gui.panels.DefaultOKCancelDialog;
|
---|
13 | /**
|
---|
14 | * this shows a dialog where the user can select the parameter name
|
---|
15 | * @author wouter
|
---|
16 | *
|
---|
17 | */
|
---|
18 |
|
---|
19 | public 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.