$darkmode
DENOPTIM
|
General structure of a form for collecting input parameters of various nature. More...
Classes | |
class | CmbFieldChange |
class | FieldListener |
class | RdbFieldChange |
class | TabFieldChange |
Public Member Functions | |
ParametersForm () | |
Empty constructor. More... | |
void | importParametersFromDenoptimParamsFile (String fileName) throws Exception |
void | importSingleParameter (String key, String value) throws Exception |
void | putParametersToString (StringBuilder sb) throws Exception |
boolean | hasUnsavedChanges () |
Returns the flag signaling unsaved changes. More... | |
void | setUnsavedChanges (boolean val) |
Set the status of the flag signaling unsaved changes. More... | |
void | showUnknownKeyWarning (Component parent, String paramType) |
Shown a warning dialog that informs the user about having found text that is not present in the ParametersForm implementation and is treated as free text. More... | |
void | importParametersFromDenoptimParamsFile (String fileName) throws Exception |
void | importSingleParameter (String key, String value) throws Exception |
void | putParametersToString (StringBuilder sb) throws Exception |
boolean | hasUnsavedChanges () |
void | setUnsavedChanges (boolean val) |
Protected Member Functions | |
String | getStringIfNotEmpty (String key, JTextField field, String prefix, String suffix) |
Produced the KEY:VALUE string for a general text field. More... | |
String | getStringIfNotEmpty (String key, JEditorPane field, boolean multipleLines) |
Produced the KEY:VALUE string for a general text editor pane The text can include numbers, characters, or both. More... | |
String | getStringIfNotEmpty (String key, JTextField field) |
Produced the KEY:VALUE string for a general text field. More... | |
String | getStringForKVLine (String key, JSpinner spinner) |
Produced the KEY:VALUE string for a general spinner. More... | |
String | getStringIfSelected (String key, JRadioButton btn) |
Produced the KEY:VALUE string for a on/off button. More... | |
String | getStringFromTable (String key, JTable tab) |
Produced an overall string including one or more KEY:VALUE strings taken from a table. More... | |
String | getStringFromTable (String key, JTable tab, boolean skipHeader) |
Produced an overall string including one or more KEY:VALUE strings taken from a table. More... | |
String | getStringFromTable (String key, JTable tab, int[] fields, boolean skipHeader) |
Produced an overall string including one or more KEY:VALUE strings taken from a table. More... | |
String | getStringFromTable (String key, JTable tab, int[] fields, String sep, boolean skipHeader) |
Produced an overall string including one or more KEY:VALUE strings taken from a table. More... | |
void | importParametersFromDenoptimParamsFile (String fileName, String keyRoot) throws Exception |
Reads in the parameters from a text file collecting DENOPTIM parameters in the form of KEY=VALUE lines. More... | |
void | preliminatyTasksUponImportingParams () |
Overwritten by subclasses. More... | |
void | adaptVisibility () |
Overwritten by subclasses. More... | |
void | importParameterFromLine (String line) throws Exception |
void | addToUnformattedTxt (String key, String value) |
JPanel | getPanelForUnformattedInput () |
String | getTextForUnformattedSettings () |
void | clearUnformattedTxtArea () |
Protected Attributes | |
boolean | unsavedChanges = false |
Flag notifying that some data was not saved. More... | |
FieldListener | fieldListener |
Listener for changes in parameters of this form. More... | |
RdbFieldChange | rdbFieldChange |
Listener for changes in radio button-bound parameters. More... | |
TabFieldChange | tabFieldChange |
Listener for changes in table-bound parameters. More... | |
CmbFieldChange | cmbFieldChange |
Listener for changes in combo box-bound parameters. More... | |
Map< String, Boolean > | checkedFlags = new HashMap<String,Boolean>() |
Map of keyword to search for when reading a parameters file. More... | |
JTextArea | txtUnformattedInput = new JTextArea(5,20) |
Storage of unformatted text for input files. More... | |
boolean | foundCLIOnlyContent = false |
Flag recording we have imported text containing a line that is not interpreted as a GUI-controllable parameter. More... | |
Package Attributes | |
final Dimension | fileLabelSize = new Dimension(250,28) |
Default sizes for file pathname labels. More... | |
final int | preferredHeight |
Default text field height. More... | |
final Dimension | fileFieldSize = new Dimension(350,preferredHeight) |
Default sizes for file pathname fields. More... | |
final Dimension | strFieldSize = new Dimension(75,preferredHeight) |
Default sizes for short pathname fields (i.e., string or number) More... | |
Private Member Functions | |
void | showPromptIfEmpty () |
Private Attributes | |
final String | NL = System.getProperty("line.separator") |
The newline character. More... | |
final String | UNSETUNFORMATTEDINPUTTXT |
final Color | UNSETUNFORMATTEDINPUTTXTCOLOR = Color.GRAY |
final Color | SETUNFORMATTEDINPUTTXTCOLOR = Color.BLACK |
Static Private Attributes | |
static final long | serialVersionUID = 3787855399355076733L |
Version. More... | |
General structure of a form for collecting input parameters of various nature.
Definition at line 67 of file ParametersForm.java.
denoptim.gui.ParametersForm.ParametersForm | ( | ) |
Empty constructor.
Definition at line 155 of file ParametersForm.java.
References denoptim.gui.ParametersForm.cmbFieldChange, denoptim.gui.ParametersForm.fieldListener, denoptim.gui.ParametersForm.rdbFieldChange, and denoptim.gui.ParametersForm.tabFieldChange.
|
protected |
Overwritten by subclasses.
Sets visibility of panels according to the current selections and field content.
Reimplemented in denoptim.gui.FitnessParametersForm.
Definition at line 490 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.importParametersFromDenoptimParamsFile().
|
protected |
Definition at line 643 of file ParametersForm.java.
References denoptim.constants.DENOPTIMConstants.EOL, denoptim.gui.ParametersForm.foundCLIOnlyContent, denoptim.gui.ParametersForm.SETUNFORMATTEDINPUTTXTCOLOR, denoptim.gui.ParametersForm.txtUnformattedInput, and denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXT.
Referenced by denoptim.gui.FitnessParametersForm.importSingleParameter(), denoptim.gui.FSEParametersForm.importSingleParameter(), denoptim.gui.FSParametersForm.importSingleParameter(), denoptim.gui.GAParametersForm.importSingleParameter(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.importSingleParameter().
|
protected |
Definition at line 726 of file ParametersForm.java.
References denoptim.gui.ParametersForm.txtUnformattedInput, denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXT, and denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXTCOLOR.
Referenced by denoptim.gui.FitnessParametersForm.importParametersFromDenoptimParamsFile(), denoptim.gui.FSEParametersForm.importParametersFromDenoptimParamsFile(), denoptim.gui.FSParametersForm.importParametersFromDenoptimParamsFile(), denoptim.gui.GAParametersForm.importParametersFromDenoptimParamsFile(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.importParametersFromDenoptimParamsFile().
|
protected |
Definition at line 657 of file ParametersForm.java.
References denoptim.gui.ParametersForm.showPromptIfEmpty(), denoptim.gui.ParametersForm.txtUnformattedInput, denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXT, and denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXTCOLOR.
|
protected |
Produced the KEY:VALUE string for a general spinner.
The text can include numbers, characters, or both.
key | the keyword |
field | the txt field |
Definition at line 250 of file ParametersForm.java.
References denoptim.gui.ParametersForm.NL.
Referenced by denoptim.gui.GAParametersForm.putParametersToString().
|
protected |
Produced an overall string including one or more KEY:VALUE strings taken from a table.
By default this method takes as VALUE only the first field of the table.
key | the keyword |
tab | the table |
Definition at line 293 of file ParametersForm.java.
References denoptim.gui.ParametersForm.getStringFromTable().
Referenced by denoptim.gui.ParametersForm.getStringFromTable(), and denoptim.gui.FSParametersForm.putParametersToString().
|
protected |
Produced an overall string including one or more KEY:VALUE strings taken from a table.
By default this method takes as VALUE only the first field of the table.
key | the keyword |
tab | the table |
skipHeader | use true to ignore first row |
Definition at line 311 of file ParametersForm.java.
References denoptim.gui.ParametersForm.getStringFromTable().
|
protected |
Produced an overall string including one or more KEY:VALUE strings taken from a table.
key | the keyword |
tab | the table |
fields | the id (0, n-1) of the fields to use as space-separated values |
skipHeader | use true to ignore first row |
Definition at line 331 of file ParametersForm.java.
References denoptim.gui.ParametersForm.getStringFromTable().
|
protected |
Produced an overall string including one or more KEY:VALUE strings taken from a table.
key | the keyword |
tab | the table |
fields | the indexes (0, n-1) of the fields to use as separated VALUEs |
sep | string separator for fields of a single VALUE |
skipHeader | use true to ignore first row |
Definition at line 352 of file ParametersForm.java.
References denoptim.gui.ParametersForm.NL.
|
protected |
Produced the KEY:VALUE string for a general text editor pane The text can include numbers, characters, or both.
key | the keyword |
field | the txt editor |
multipleLines | set to true to split the text into multiple KEY:VALUE lines (all with same KEY) |
Definition at line 199 of file ParametersForm.java.
References denoptim.gui.ParametersForm.NL.
|
protected |
Produced the KEY:VALUE string for a general text field.
The text can include numbers, characters, or both.
key | the keyword |
field | the txt field |
Definition at line 230 of file ParametersForm.java.
References denoptim.gui.ParametersForm.NL.
|
protected |
Produced the KEY:VALUE string for a general text field.
The text can include numbers, characters, or both.
key | the keyword. |
field | the txt field. |
prefix | string to be put before the VALUE. |
suffix | string to be put after the VALUE. |
Definition at line 175 of file ParametersForm.java.
References denoptim.gui.ParametersForm.NL.
Referenced by denoptim.gui.FitnessParametersForm.putParametersToString(), denoptim.gui.FSEParametersForm.putParametersToString(), denoptim.gui.FSParametersForm.putParametersToString(), denoptim.gui.GAParametersForm.putParametersToString(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.putParametersToString().
|
protected |
Produced the KEY:VALUE string for a on/off button.
key | the keyword |
btn | the on/off button |
Definition at line 270 of file ParametersForm.java.
References denoptim.gui.ParametersForm.NL.
Referenced by denoptim.gui.FSParametersForm.putParametersToString(), and denoptim.gui.GAParametersForm.putParametersToString().
|
protected |
Definition at line 702 of file ParametersForm.java.
References denoptim.gui.ParametersForm.txtUnformattedInput.
Referenced by denoptim.gui.FitnessParametersForm.putParametersToString(), denoptim.gui.FSEParametersForm.putParametersToString(), denoptim.gui.FSParametersForm.putParametersToString(), denoptim.gui.GAParametersForm.putParametersToString(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.putParametersToString().
boolean denoptim.gui.ParametersForm.hasUnsavedChanges | ( | ) |
Returns the flag signaling unsaved changes.
Implements denoptim.gui.IParametersForm.
Definition at line 535 of file ParametersForm.java.
References denoptim.gui.ParametersForm.unsavedChanges.
|
protected |
Definition at line 496 of file ParametersForm.java.
References denoptim.gui.ParametersForm.importSingleParameter().
Referenced by denoptim.gui.ParametersForm.importParametersFromDenoptimParamsFile().
void denoptim.gui.ParametersForm.importParametersFromDenoptimParamsFile | ( | String | fileName | ) | throws Exception |
Implements denoptim.gui.IParametersForm.
Reimplemented in denoptim.gui.FitnessParametersForm, denoptim.gui.FSEParametersForm, denoptim.gui.FSParametersForm, denoptim.gui.GAParametersForm, and denoptim.gui.GUIPrepareFitnessRunner.InputForm.
Definition at line 382 of file ParametersForm.java.
|
protected |
Reads in the parameters from a text file collecting
DENOPTIM parameters in the form of KEY=VALUE lines.
fileName | pathname to the parameters file |
keyRoot | initial part of keyword to select lines pertaining the present parameters set. For instance "GA-", "FSE-", etc. |
Definition at line 401 of file ParametersForm.java.
References denoptim.gui.ParametersForm.adaptVisibility(), denoptim.gui.ParametersForm.checkedFlags, denoptim.files.FileUtils.checkExists(), denoptim.gui.ParametersForm.importParameterFromLine(), and denoptim.gui.ParametersForm.preliminatyTasksUponImportingParams().
void denoptim.gui.ParametersForm.importSingleParameter | ( | String | key, |
String | value | ||
) | throws Exception |
Implements denoptim.gui.IParametersForm.
Reimplemented in denoptim.gui.FitnessParametersForm, denoptim.gui.FSEParametersForm, denoptim.gui.FSParametersForm, denoptim.gui.GAParametersForm, and denoptim.gui.GUIPrepareFitnessRunner.InputForm.
Definition at line 511 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.importParameterFromLine().
|
protected |
Overwritten by subclasses.
Does any preliminary tasks, such as cleaning
Reimplemented in denoptim.gui.FitnessParametersForm.
Definition at line 480 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.importParametersFromDenoptimParamsFile().
void denoptim.gui.ParametersForm.putParametersToString | ( | StringBuilder | sb | ) | throws Exception |
Implements denoptim.gui.IParametersForm.
Reimplemented in denoptim.gui.FitnessParametersForm, denoptim.gui.FSEParametersForm, denoptim.gui.FSParametersForm, denoptim.gui.GAParametersForm, and denoptim.gui.GUIPrepareFitnessRunner.InputForm.
Definition at line 523 of file ParametersForm.java.
void denoptim.gui.ParametersForm.setUnsavedChanges | ( | boolean | val | ) |
Set the status of the flag signaling unsaved changes.
val | the new status of the flag signaling unsaved changes |
Implements denoptim.gui.IParametersForm.
Definition at line 548 of file ParametersForm.java.
References denoptim.gui.ParametersForm.unsavedChanges.
|
private |
Definition at line 709 of file ParametersForm.java.
References denoptim.gui.ParametersForm.SETUNFORMATTEDINPUTTXTCOLOR, denoptim.gui.ParametersForm.txtUnformattedInput, denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXT, and denoptim.gui.ParametersForm.UNSETUNFORMATTEDINPUTTXTCOLOR.
Referenced by denoptim.gui.ParametersForm.getPanelForUnformattedInput().
void denoptim.gui.ParametersForm.showUnknownKeyWarning | ( | Component | parent, |
String | paramType | ||
) |
Shown a warning dialog that informs the user about having found text that is not present in the ParametersForm
implementation and is treated as free text.
parent | component used to place the dialog on screen. |
paramType | the kind of parameter collector. |
Definition at line 618 of file ParametersForm.java.
References denoptim.constants.DENOPTIMConstants.EOL, denoptim.gui.ParametersForm.foundCLIOnlyContent, and denoptim.gui.ParametersForm.txtUnformattedInput.
Referenced by denoptim.gui.FitnessParametersForm.importParametersFromDenoptimParamsFile(), denoptim.gui.FSEParametersForm.importParametersFromDenoptimParamsFile(), denoptim.gui.FSParametersForm.importParametersFromDenoptimParamsFile(), denoptim.gui.GAParametersForm.importParametersFromDenoptimParamsFile(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.importParametersFromDenoptimParamsFile().
|
protected |
Map of keyword to search for when reading a parameters file.
This is NOT a list of what will be read, but map of whether each given keyword is found (at the beginning of a line) in the parameters file, or not.
Definition at line 131 of file ParametersForm.java.
Referenced by denoptim.gui.GAParametersForm.importParametersFromDenoptimParamsFile(), and denoptim.gui.ParametersForm.importParametersFromDenoptimParamsFile().
|
protected |
Listener for changes in combo box-bound parameters.
Definition at line 124 of file ParametersForm.java.
Referenced by denoptim.gui.FSParametersForm.FSParametersForm(), denoptim.gui.GAParametersForm.GAParametersForm(), and denoptim.gui.ParametersForm.ParametersForm().
|
protected |
Listener for changes in parameters of this form.
Definition at line 109 of file ParametersForm.java.
Referenced by denoptim.gui.FitnessParametersForm.FitnessParametersForm(), denoptim.gui.FSEParametersForm.FSEParametersForm(), denoptim.gui.FSParametersForm.FSParametersForm(), denoptim.gui.GAParametersForm.GAParametersForm(), denoptim.gui.GUIPrepareFitnessRunner.InputForm.InputForm(), and denoptim.gui.ParametersForm.ParametersForm().
|
package |
Default sizes for file pathname fields.
Definition at line 89 of file ParametersForm.java.
Referenced by denoptim.gui.FitnessParametersForm.FitnessParametersForm(), denoptim.gui.FSEParametersForm.FSEParametersForm(), denoptim.gui.FSParametersForm.FSParametersForm(), denoptim.gui.GAParametersForm.GAParametersForm(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.InputForm().
|
package |
Default sizes for file pathname labels.
Definition at line 78 of file ParametersForm.java.
Referenced by denoptim.gui.FitnessParametersForm.FitnessParametersForm(), denoptim.gui.FSEParametersForm.FSEParametersForm(), denoptim.gui.FSParametersForm.FSParametersForm(), denoptim.gui.GAParametersForm.GAParametersForm(), and denoptim.gui.GUIPrepareFitnessRunner.InputForm.InputForm().
|
protected |
Flag recording we have imported text containing a line that is not interpreted as a GUI-controllable parameter.
Definition at line 142 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.addToUnformattedTxt(), and denoptim.gui.ParametersForm.showUnknownKeyWarning().
|
private |
The newline character.
Definition at line 99 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.getStringForKVLine(), denoptim.gui.ParametersForm.getStringFromTable(), denoptim.gui.ParametersForm.getStringIfNotEmpty(), and denoptim.gui.ParametersForm.getStringIfSelected().
|
package |
Default text field height.
Definition at line 83 of file ParametersForm.java.
Referenced by denoptim.gui.FitnessParametersForm.AtomSpecExpressionDefinition.AtomSpecExpressionDefinition(), denoptim.gui.FitnessParametersForm.FitnessParametersForm(), denoptim.gui.FSEParametersForm.FSEParametersForm(), denoptim.gui.FSParametersForm.FSParametersForm(), denoptim.gui.GAParametersForm.GAParametersForm(), and denoptim.gui.FitnessParametersForm.ParametrizedDescriptorDefinition.ParametrizedDescriptorDefinition().
|
protected |
Listener for changes in radio button-bound parameters.
Definition at line 114 of file ParametersForm.java.
Referenced by denoptim.gui.FSParametersForm.FSParametersForm(), denoptim.gui.GAParametersForm.GAParametersForm(), and denoptim.gui.ParametersForm.ParametersForm().
|
staticprivate |
Version.
Definition at line 73 of file ParametersForm.java.
|
private |
Definition at line 147 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.addToUnformattedTxt(), and denoptim.gui.ParametersForm.showPromptIfEmpty().
|
package |
Default sizes for short pathname fields (i.e., string or number)
Definition at line 94 of file ParametersForm.java.
Referenced by denoptim.gui.FSEParametersForm.FSEParametersForm(), denoptim.gui.FSParametersForm.FSParametersForm(), and denoptim.gui.GAParametersForm.GAParametersForm().
|
protected |
Listener for changes in table-bound parameters.
Definition at line 119 of file ParametersForm.java.
Referenced by denoptim.gui.FSParametersForm.FSParametersForm(), and denoptim.gui.ParametersForm.ParametersForm().
|
protected |
Storage of unformatted text for input files.
Definition at line 136 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.addToUnformattedTxt(), denoptim.gui.ParametersForm.clearUnformattedTxtArea(), denoptim.gui.ParametersForm.getPanelForUnformattedInput(), denoptim.gui.ParametersForm.getTextForUnformattedSettings(), denoptim.gui.ParametersForm.showPromptIfEmpty(), and denoptim.gui.ParametersForm.showUnknownKeyWarning().
|
protected |
Flag notifying that some data was not saved.
Definition at line 104 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.CmbFieldChange.actionPerformed(), denoptim.gui.ParametersForm.FieldListener.changedUpdate(), denoptim.gui.ParametersForm.hasUnsavedChanges(), denoptim.gui.ParametersForm.FieldListener.insertUpdate(), denoptim.gui.ParametersForm.FieldListener.removeUpdate(), denoptim.gui.ParametersForm.setUnsavedChanges(), denoptim.gui.ParametersForm.RdbFieldChange.stateChanged(), and denoptim.gui.ParametersForm.TabFieldChange.tableChanged().
|
private |
Definition at line 144 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.addToUnformattedTxt(), denoptim.gui.ParametersForm.clearUnformattedTxtArea(), denoptim.gui.ParametersForm.getPanelForUnformattedInput(), and denoptim.gui.ParametersForm.showPromptIfEmpty().
|
private |
Definition at line 146 of file ParametersForm.java.
Referenced by denoptim.gui.ParametersForm.clearUnformattedTxtArea(), denoptim.gui.ParametersForm.getPanelForUnformattedInput(), and denoptim.gui.ParametersForm.showPromptIfEmpty().