21import java.awt.BorderLayout;
22import java.awt.Dimension;
23import java.awt.FlowLayout;
24import java.awt.event.ActionEvent;
25import java.awt.event.ActionListener;
26import java.util.HashMap;
28import java.util.concurrent.atomic.AtomicInteger;
30import javax.swing.BoxLayout;
31import javax.swing.JButton;
32import javax.swing.JLabel;
33import javax.swing.JOptionPane;
34import javax.swing.JPanel;
35import javax.swing.JScrollPane;
36import javax.swing.JTextField;
37import javax.swing.SwingConstants;
38import javax.swing.UIManager;
79 super.allParams.add(inputParsPane);
80 super.tabbedPane.addTab(
"Input/Output Files",
null, inputParsPane,
null);
84 super.allParams.add(fitParsPane);
85 super.tabbedPane.addTab(
"Fitness Provider",
null, fitParsPane,
null);
112 String
NL = System.getProperty(
"line.separator");
117 this.setLayout(
new BorderLayout());
119 block =
new JPanel();
120 JScrollPane scrollablePane =
new JScrollPane(
block);
121 block.setLayout(
new BoxLayout(
block, SwingConstants.VERTICAL));
123 String toolTipInFile =
"Pathname of the SDF file with the candidate to evaluate.";
124 JPanel LineInFile =
new JPanel(
new FlowLayout(FlowLayout.LEFT));
125 JLabel lblInFile =
new JLabel(
"Input SDF file:", SwingConstants.LEFT);
127 lblInFile.setToolTipText(toolTipInFile);
132 JButton btnInFile =
new JButton(
"Browse");
133 btnInFile.addActionListener(
new ActionListener() {
134 public void actionPerformed(ActionEvent e) {
138 LineInFile.add(lblInFile);
140 LineInFile.add(btnInFile);
144 block.add(LineInFile);
146 String toolTipOutFile =
"Pathname of the SDF file where to write the results of the evaluation.";
147 JPanel LineOutFile =
new JPanel(
new FlowLayout(FlowLayout.LEFT));
148 JLabel lblOutFile =
new JLabel(
"Output SDF file:", SwingConstants.LEFT);
150 lblOutFile.setToolTipText(toolTipOutFile);
155 JButton btnOutFile =
new JButton(
"Browse");
156 btnOutFile.addActionListener(
new ActionListener() {
157 public void actionPerformed(ActionEvent e) {
161 LineOutFile.add(lblOutFile);
163 LineOutFile.add(btnOutFile);
167 block.add(LineOutFile);
169 block.add(super.getPanelForUnformattedInput());
171 this.add(scrollablePane);
200 String valueFieldClass;
204 valueFieldClass = valueField.getClass().toString();
212 switch (valueFieldClass)
214 case "class javax.swing.JTextField":
215 if (key.toUpperCase().equals(
keyInFile.toUpperCase()))
217 value = value.trim();
219 ((JTextField) valueField).setText(value);
223 throw new Exception(
"<html>Unexpected type for parameter: "
224 + key +
" (" + valueFieldClass
225 +
").<br>Please report this to"
226 +
"the DEMOPTIM team.</html>");
236 sb.append(
"# Fitness Runner - parameters").append(
NL);
GUIMainPanel mainPanel
The main panel (cards deck)
File opener for DENOPTIM GUI.
static File pickFileForTxtField(JTextField txtField, Component parent)
The main panel is a deck of cards that occupies all the GUI frame.
Form that allows to test the configuration of a fitness provider.
static final long serialVersionUID
Version UID.
void initialize()
Initialize the contents of the frame.
static AtomicInteger testFitnessTabUID
Unique identified for instances of this form.
GUIPrepareFitnessRunner(GUIMainPanel mainPanel)
Constructor.
Class representing the general structure of a form including a specific set of parameter collections.