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.JPanel;
34import javax.swing.JScrollPane;
35import javax.swing.JTextField;
36import javax.swing.SwingConstants;
77 super.allParams.add(inputParsPane);
78 super.tabbedPane.addTab(
"Input/Output Files",
null, inputParsPane,
null);
82 super.allParams.add(fitParsPane);
83 super.tabbedPane.addTab(
"Fitness Provider",
null, fitParsPane,
null);
110 String
NL = System.getProperty(
"line.separator");
115 this.setLayout(
new BorderLayout());
117 block =
new JPanel();
118 JScrollPane scrollablePane =
new JScrollPane(
block);
119 block.setLayout(
new BoxLayout(
block, SwingConstants.VERTICAL));
121 String toolTipInFile =
"Pathname of the SDF file with the candidate to evaluate.";
122 JPanel LineInFile =
new JPanel(
new FlowLayout(FlowLayout.LEFT));
123 JLabel lblInFile =
new JLabel(
"Input SDF file:", SwingConstants.LEFT);
125 lblInFile.setToolTipText(toolTipInFile);
130 JButton btnInFile =
new JButton(
"Browse");
131 btnInFile.addActionListener(
new ActionListener() {
132 public void actionPerformed(ActionEvent e) {
136 LineInFile.add(lblInFile);
138 LineInFile.add(btnInFile);
142 block.add(LineInFile);
144 String toolTipOutFile =
"Pathname of the SDF file where to write the results of the evaluation.";
145 JPanel LineOutFile =
new JPanel(
new FlowLayout(FlowLayout.LEFT));
146 JLabel lblOutFile =
new JLabel(
"Output SDF file:", SwingConstants.LEFT);
148 lblOutFile.setToolTipText(toolTipOutFile);
153 JButton btnOutFile =
new JButton(
"Browse");
154 btnOutFile.addActionListener(
new ActionListener() {
155 public void actionPerformed(ActionEvent e) {
159 LineOutFile.add(lblOutFile);
161 LineOutFile.add(btnOutFile);
165 block.add(LineOutFile);
167 block.add(super.getPanelForUnformattedInput());
169 this.add(scrollablePane);
198 String valueFieldClass;
202 valueFieldClass = valueField.getClass().toString();
210 switch (valueFieldClass)
212 case "class javax.swing.JTextField":
213 if (key.toUpperCase().equals(
keyInFile.toUpperCase()))
215 value = value.trim();
217 ((JTextField) valueField).setText(value);
221 throw new Exception(
"<html>Unexpected type for parameter: "
222 + key +
" (" + valueFieldClass
223 +
").<br>Please report this to"
224 +
"the DEMOPTIM team.</html>");
234 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.