Перенос.
This commit is contained in:
165
src/TestingSystem/Configuration/UI/ConfigurationDBTable.java
Normal file
165
src/TestingSystem/Configuration/UI/ConfigurationDBTable.java
Normal file
@@ -0,0 +1,165 @@
|
||||
package TestingSystem.Configuration.UI;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.DBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Tables.TableRenderers;
|
||||
import Common.UI.VisualiserStringList;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Configuration.Configuration;
|
||||
import TestingSystem.Configuration.ConfigurationInterface;
|
||||
public class ConfigurationDBTable extends DBTable<String, Configuration> {
|
||||
public static boolean email = false;
|
||||
public ConfigurationDBTable() {
|
||||
super(String.class, Configuration.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.Configuration;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "конфигурация тестирования";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "конфигурации";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
// columns.get(0).setVisible(false);
|
||||
columns.get(4).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(5).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(12).setRenderer(TableRenderers.RendererMultiline);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"флаги",
|
||||
"окружение",
|
||||
"c_time",
|
||||
"куб",
|
||||
"max",
|
||||
"min dim",
|
||||
"max dim",
|
||||
"r_time",
|
||||
"usr.par"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(Configuration object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.description;
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return Utils.unpackStrings(object.flags, true);
|
||||
case 5:
|
||||
return Utils.unpackStrings(object.environments, true);
|
||||
case 6:
|
||||
return object.c_maxtime;
|
||||
case 7:
|
||||
return object.cube;
|
||||
case 8:
|
||||
return object.max_proc_count;
|
||||
case 9:
|
||||
return object.min_dim_proc_count;
|
||||
case 10:
|
||||
return object.max_dim_proc_count;
|
||||
case 11:
|
||||
return object.r_maxtime;
|
||||
case 12:
|
||||
return Utils.unpackStrings(object.usr_par, true);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<Configuration, ConfigurationFields> getDialog() {
|
||||
return new DBObjectDialog<Configuration, ConfigurationFields>(ConfigurationFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 480;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 1000;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
int min = (int) fields.sMinDimProc.getValue();
|
||||
int max = (int) fields.sMaxDimProc.getValue();
|
||||
if (max < min)
|
||||
Log.Writeln_("Некорректный диапазон размерностей: максимум меньше минимума");
|
||||
if ((min == 0) && (max != 0) || (min != 0) && (max == 0))
|
||||
Log.Writeln_("Некорректный диапазон размерностей. " +
|
||||
"'0' допускается только одновременно на обеих границах,\n" +
|
||||
"и подразумевает единственный запуск без решётки");
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
fields.tfName.setText(Result.description);
|
||||
//------->>>>
|
||||
((VisualiserStringList) (fields.flagsList)).fill(ConfigurationInterface.getFlags(Result));
|
||||
((VisualiserStringList) (fields.environmentsList)).fill(ConfigurationInterface.getEnvironments(Result));
|
||||
((VisualiserStringList) (fields.parList)).fill(ConfigurationInterface.getParams(Result));
|
||||
//------->>>>
|
||||
fields.sCompilationMaxtime.setValue(Result.c_maxtime);
|
||||
//-
|
||||
fields.sMinDimProc.setValue(Result.min_dim_proc_count);
|
||||
fields.sMaxDimProc.setValue(Result.max_dim_proc_count);
|
||||
fields.cbCube.setSelected(Result.cube == 1);
|
||||
fields.sRunMaxtime.setValue(Result.r_maxtime);
|
||||
//-
|
||||
fields.sMaxProc.setValue(Result.max_proc_count);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.c_maxtime = (int) fields.sCompilationMaxtime.getValue();
|
||||
Result.min_dim_proc_count = (int) fields.sMinDimProc.getValue();
|
||||
Result.max_dim_proc_count = (int) fields.sMaxDimProc.getValue();
|
||||
Result.cube = fields.cbCube.isSelected() ? 1 : 0;
|
||||
Result.max_proc_count = (int) fields.sMaxProc.getValue();
|
||||
Result.r_maxtime = (int) fields.sRunMaxtime.getValue();
|
||||
Result.flags = ((VisualiserStringList) (fields.flagsList)).pack();
|
||||
Result.environments = ((VisualiserStringList) (fields.environmentsList)).pack();
|
||||
Result.usr_par = ((VisualiserStringList) (fields.parList)).pack();
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
fields.tfName.setEnabled(false);
|
||||
fields.sCompilationMaxtime.setEnabled(false);
|
||||
fields.sRunMaxtime.setEnabled(false);
|
||||
fields.sMinDimProc.setEnabled(false);
|
||||
fields.sMaxDimProc.setEnabled(false);
|
||||
fields.cbCube.setEnabled(false);
|
||||
fields.sMaxProc.setEnabled(false);
|
||||
fields.bAddFlags.setEnabled(false);
|
||||
fields.bDeleteFlags.setEnabled(false);
|
||||
fields.bAddEnvironments.setEnabled(false);
|
||||
fields.bDeleteEnvironment.setEnabled(false);
|
||||
fields.bAddPar.setEnabled(false);
|
||||
fields.bDeletePar.setEnabled(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public boolean ShowEditObjectDialog(DBObject object) {
|
||||
return (Current.getAccount().CheckAccessRights(((Configuration) object).sender_address, null)) ? super.ShowEditObjectDialog(object) : ViewObject(object);
|
||||
}
|
||||
}
|
||||
402
src/TestingSystem/Configuration/UI/ConfigurationFields.form
Normal file
402
src/TestingSystem/Configuration/UI/ConfigurationFields.form
Normal file
@@ -0,0 +1,402 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TestingSystem.Configuration.UI.ConfigurationFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="821" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="78a2d" binding="SC1">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="500"/>
|
||||
<dividerSize value="3"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="ee2fd" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="259d7" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="название"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="264c1">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="6795f" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="200" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="200" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9219f" class="javax.swing.JSpinner" binding="sMinDimProc">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="5686a" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="мин. число процессоров по измерению"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="79cbe" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. число процессоров по измерению"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="33803" class="javax.swing.JSpinner" binding="sMaxDimProc">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9b066" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. время компиляции"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d706b" class="javax.swing.JSpinner" binding="sCompilationMaxtime">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="a3108" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. время выполнения"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="22d31" class="javax.swing.JSpinner" binding="sRunMaxtime">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="cda3" class="javax.swing.JCheckBox" binding="cbCube">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<horizontalAlignment value="0"/>
|
||||
<icon value="icons/NotPick.png"/>
|
||||
<selectedIcon value="icons/Pick.png"/>
|
||||
<text value="кубические решётки"/>
|
||||
<toolTipText value="матрица с одинаковым размером измерений"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a79b8" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. число процессоров"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a6c17" class="javax.swing.JSpinner" binding="sMaxProc">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="f79b4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="bd8be" binding="SC2">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="180"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="a9834" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<toolbar id="4f6a1" binding="flagsTools">
|
||||
<constraints border-constraint="North"/>
|
||||
<properties>
|
||||
<floatable value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="566f4" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="79287" class="javax.swing.JButton" binding="bAddFlags">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Menu/Regions.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1cb75" class="javax.swing.JButton" binding="bDeleteFlags">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</toolbar>
|
||||
<scrollpane id="99ead">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="c0373" class="javax.swing.JList" binding="flagsList" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="b9287" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="53277" binding="SC3">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="85"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="3d5c8" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<toolbar id="612de" binding="parTools">
|
||||
<constraints border-constraint="North"/>
|
||||
<properties>
|
||||
<floatable value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="4a428" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="usr par"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1d160" class="javax.swing.JButton" binding="bAddPar">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/RedAdd.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить параметр DVM системы"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="61ba8" class="javax.swing.JButton" binding="bDeletePar">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить параметр DVM системы"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</toolbar>
|
||||
<scrollpane id="d0f3b">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="7cdd5" class="javax.swing.JList" binding="parList" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="4c856" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<toolbar id="81953" binding="environmentsTools">
|
||||
<constraints border-constraint="North"/>
|
||||
<properties>
|
||||
<floatable value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="cec3c" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="окружение"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1e835" class="javax.swing.JButton" binding="bAddEnvironments">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Menu/Regions.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить набор переменных окружения"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="b9e9d" class="javax.swing.JButton" binding="bDeleteEnvironment">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить переменную окружения"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</toolbar>
|
||||
<scrollpane id="f94f5">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="951ed" class="javax.swing.JList" binding="environmentsList" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
106
src/TestingSystem/Configuration/UI/ConfigurationFields.java
Normal file
106
src/TestingSystem/Configuration/UI/ConfigurationFields.java
Normal file
@@ -0,0 +1,106 @@
|
||||
package TestingSystem.Configuration.UI;
|
||||
import Common.Current;
|
||||
import Common.UI.VisualiserStringList;
|
||||
import Common.UI.TextField.StyledTextField;
|
||||
import Common.UI.Windows.Dialog.DialogFields;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public class ConfigurationFields implements DialogFields {
|
||||
public JTextField tfName;
|
||||
public JSpinner sMinDimProc;
|
||||
public JSpinner sMaxDimProc;
|
||||
public JSpinner sCompilationMaxtime;
|
||||
public JSpinner sRunMaxtime;
|
||||
public JCheckBox cbCube;
|
||||
public JSpinner sMaxProc;
|
||||
public JList<String> flagsList;
|
||||
public JList<String> environmentsList;
|
||||
public JList<String> parList;
|
||||
//-
|
||||
private JPanel content;
|
||||
private JSplitPane SC1;
|
||||
private JSplitPane SC2;
|
||||
private JToolBar flagsTools;
|
||||
public JButton bAddFlags;
|
||||
public JButton bDeleteFlags;
|
||||
private JSplitPane SC3;
|
||||
private JToolBar parTools;
|
||||
public JButton bAddPar;
|
||||
public JButton bDeletePar;
|
||||
private JToolBar environmentsTools;
|
||||
public JButton bAddEnvironments;
|
||||
public JButton bDeleteEnvironment;
|
||||
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
//-
|
||||
flagsList = new VisualiserStringList();
|
||||
environmentsList = new VisualiserStringList();
|
||||
parList = new VisualiserStringList();
|
||||
}
|
||||
public ConfigurationFields(){
|
||||
sMinDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxProc.setModel(new SpinnerNumberModel(0, 0, 128, 1));
|
||||
sCompilationMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
sRunMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
bAddFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.PickCompilerOptions);
|
||||
if (pass.Do(Current.getCompiler()))
|
||||
((VisualiserStringList) flagsList).addElement((String) pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
((VisualiserStringList) flagsList).removeElement(flagsList.getSelectedValue());
|
||||
}
|
||||
});
|
||||
bAddEnvironments.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.PickCompilerEnvironmentsForTesting);
|
||||
if (pass.Do(Current.getCompiler()))
|
||||
((VisualiserStringList) environmentsList).addElement((String) pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteEnvironment.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
((VisualiserStringList) environmentsList).removeElement(environmentsList.getSelectedValue());
|
||||
}
|
||||
});
|
||||
bDeletePar.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
((VisualiserStringList) parList).removeElement(parList.getSelectedValue());
|
||||
}
|
||||
});
|
||||
bAddPar.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.AddDVMParameterForTesting);
|
||||
if (pass.Do()) {
|
||||
((VisualiserStringList) parList).addElement((String) pass.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user