Рефакторинг конструкторов объектов тестирования.
This commit is contained in:
@@ -1,4 +1,88 @@
|
||||
package TestingSystem.DVM.DVMSettings;
|
||||
import Common.Database.DBObject;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import TestingSystem.Common.Settings.Settings;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DVMSettings extends Settings {
|
||||
//todo.хранить флаги и окружение в json чтобы можно было в форме их видеть.
|
||||
public String environments="";
|
||||
@Description("DEFAULT 0")
|
||||
public int Is_DVM_STAT= 0; //флаг вмест usr par, которые не использовались.
|
||||
// public String usr_par = "";
|
||||
//---
|
||||
public int cube = 0; //
|
||||
public int max_proc_count = 4;
|
||||
public int min_dim_proc_count = 1;
|
||||
public int max_dim_proc_count = 4;
|
||||
//
|
||||
public DVMSettings(){}
|
||||
public DVMSettings(DVMSettings src){
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
DVMSettings c = (DVMSettings) src;
|
||||
environments=c.environments;
|
||||
Is_DVM_STAT = c.Is_DVM_STAT;
|
||||
// usr_par=c.usr_par;
|
||||
//-
|
||||
cube= c.cube;
|
||||
max_proc_count=c.max_proc_count;
|
||||
min_dim_proc_count=c.min_dim_proc_count;
|
||||
max_dim_proc_count=c.max_dim_proc_count;
|
||||
}
|
||||
public String printUsrPar(){
|
||||
return "Is_DVM_STAT="+Is_DVM_STAT;
|
||||
}
|
||||
public Vector<String> getMatrixes(int testDim) {
|
||||
Vector<Vector<Integer>> res_ = new Vector<>();
|
||||
Vector<String> res = new Vector<>();
|
||||
if ((max_proc_count==0) || (min_dim_proc_count == 0 && max_dim_proc_count == 0)) {
|
||||
res.add("");
|
||||
} else {
|
||||
if (testDim > 0) {
|
||||
Vector<String> min_border = new Vector<>();
|
||||
Vector<String> max_border = new Vector<>();
|
||||
for (int i = 1; i <= testDim; ++i) {
|
||||
min_border.add(String.valueOf(min_dim_proc_count));
|
||||
max_border.add(String.valueOf(max_dim_proc_count));
|
||||
}
|
||||
Vector<Integer> from = RunConfiguration.getBounds(String.join(" ", min_border));
|
||||
Vector<Integer> to = RunConfiguration.getBounds(String.join(" ", max_border));
|
||||
if (from.size() != to.size()) {
|
||||
return res;
|
||||
}
|
||||
if (from.size() != testDim) {
|
||||
return res;
|
||||
}
|
||||
//1 стадия. заполнение.
|
||||
for (int j = from.get(0); j <= to.get(0); ++j) {
|
||||
Vector<Integer> m = new Vector<>();
|
||||
res_.add(m);
|
||||
m.add(j);
|
||||
}
|
||||
//---
|
||||
if (testDim > 1) RunConfiguration.gen_rec(from, to, res_, 1, testDim, cube == 1);
|
||||
for (Vector<Integer> m : res_) {
|
||||
Vector<String> ms = new Vector<>();
|
||||
int proc = 1;
|
||||
for (int i : m) {
|
||||
ms.add(String.valueOf(i));
|
||||
proc *= i;
|
||||
}
|
||||
if (proc <= max_proc_count)
|
||||
res.add(String.join(" ", ms));
|
||||
}
|
||||
} else res.add("");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public String getParamsText() {
|
||||
return "Is_DVM_STAT="+Is_DVM_STAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
149
src/TestingSystem/DVM/DVMSettings/DVMSettingsDBTable.java
Normal file
149
src/TestingSystem/DVM/DVMSettings/DVMSettingsDBTable.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package TestingSystem.DVM.DVMSettings;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.VisualiserStringList;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields;
|
||||
import TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields;
|
||||
public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
public DVMSettingsDBTable() {
|
||||
super(DVMSettings.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.DVMSettings;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "параметры тестирования DVM системы";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "параметры тестирования DVM системы";
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"флаги",
|
||||
"окружение",
|
||||
"usr.par",
|
||||
"куб",
|
||||
"max",
|
||||
"min dim",
|
||||
"max dim"
|
||||
};
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public Object getFieldAt(DVMSettings object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.description;
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return object.flags;
|
||||
case 5:
|
||||
return object.environments;
|
||||
case 6:
|
||||
return object.printUsrPar();
|
||||
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;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
/*
|
||||
columns.get(5).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(5).setMaxWidth(500);
|
||||
columns.get(7).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(8).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(15).setRenderer(TableRenderers.RendererMultiline);
|
||||
*/
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<DVMSettings, DVMSettingsFields> getDialog() {
|
||||
return new DBObjectDialog<DVMSettings, DVMSettingsFields>(DVMSettingsFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 400;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 800;
|
||||
}
|
||||
@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);
|
||||
//------->>>
|
||||
fields.tfFlags.setText(Result.flags);
|
||||
fields.tfEnvironments.setText(Result.environments);
|
||||
//------->>>
|
||||
fields.sMinDimProc.setValue(Result.min_dim_proc_count);
|
||||
fields.sMaxDimProc.setValue(Result.max_dim_proc_count);
|
||||
fields.cbCube.setSelected(Result.cube == 1);
|
||||
//-
|
||||
fields.sMaxProc.setValue(Result.max_proc_count);
|
||||
fields.cbDvmStat.setSelected(Result.Is_DVM_STAT!=0);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
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.flags = fields.tfFlags.getText();
|
||||
Result.environments = fields.tfEnvironments.getText();
|
||||
Result.Is_DVM_STAT = fields.cbDvmStat.isSelected()?1:0;
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
fields.tfName.setEnabled(false);
|
||||
fields.sMinDimProc.setEnabled(false);
|
||||
fields.sMaxDimProc.setEnabled(false);
|
||||
fields.cbCube.setEnabled(false);
|
||||
fields.sMaxProc.setEnabled(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public boolean ShowEditObjectDialog(DBObject object) {
|
||||
return (Current.getAccount().CheckAccessRights(((DVMSettings) object).sender_address, null)) ? super.ShowEditObjectDialog(object) : ViewObject(object);
|
||||
}
|
||||
}
|
||||
13
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsBar.java
Normal file
13
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsBar.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package TestingSystem.DVM.DVMSettings.UI;
|
||||
import Common.UI.Menus_2023.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DVMSettingsBar extends DataMenuBar {
|
||||
public DVMSettingsBar() {
|
||||
super("параметры тестированя",
|
||||
|
||||
PassCode_2021.PublishDVMSettings,
|
||||
PassCode_2021.EditDVMSettings,
|
||||
PassCode_2021.DeleteDVMSettings
|
||||
);
|
||||
}
|
||||
}
|
||||
227
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.form
Normal file
227
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.form
Normal file
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="777" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="e9baf" layout-manager="GridLayoutManager" row-count="9" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="8f4d9" 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="2176d">
|
||||
<constraints>
|
||||
<grid row="8" 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="c61a7" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="3" 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="a1d86" class="javax.swing.JSpinner" binding="sMinDimProc">
|
||||
<constraints>
|
||||
<grid row="5" column="3" 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="deae5" 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="61ffc" 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="380de" class="javax.swing.JSpinner" binding="sMaxDimProc">
|
||||
<constraints>
|
||||
<grid row="6" column="3" 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="9b010" class="javax.swing.JCheckBox" binding="cbCube">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="4" 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="bd5c7" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" 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="ad38a" class="javax.swing.JSpinner" binding="sMaxProc">
|
||||
<constraints>
|
||||
<grid row="4" column="3" 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="4d47b" 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="45943" 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="decc3" class="javax.swing.JTextField" binding="tfFlags">
|
||||
<constraints>
|
||||
<grid row="1" column="3" 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="400" height="30"/>
|
||||
<preferred-size width="400" height="30"/>
|
||||
<maximum-size width="400" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font size="10"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f6927" class="javax.swing.JTextField" binding="tfEnvironments">
|
||||
<constraints>
|
||||
<grid row="2" column="3" 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="400" height="30"/>
|
||||
<preferred-size width="400" height="30"/>
|
||||
<maximum-size width="400" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font size="10"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="265bb" class="javax.swing.JButton" binding="bAddFlags">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</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="77de1" class="javax.swing.JButton" binding="bAddEnvironments">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</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="7682" class="javax.swing.JButton" binding="bDeleteFlags">
|
||||
<constraints>
|
||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</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>
|
||||
<component id="6c384" class="javax.swing.JButton" binding="bDeleteEnvironment">
|
||||
<constraints>
|
||||
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</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>
|
||||
<component id="3f04c" class="javax.swing.JCheckBox" binding="cbDvmStat">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" 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="Is_DVM_STAT"/>
|
||||
<toolTipText value="сбор статистики DVM после запуска"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
68
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.java
Normal file
68
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package TestingSystem.DVM.DVMSettings.UI;
|
||||
import Common.Current;
|
||||
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 DVMSettingsFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JSpinner sMinDimProc;
|
||||
public JSpinner sMaxDimProc;
|
||||
public JSpinner sMaxProc;
|
||||
public JCheckBox cbCube;
|
||||
public JTextField tfFlags;
|
||||
public JTextField tfEnvironments;
|
||||
private JButton bAddFlags;
|
||||
private JButton bAddEnvironments;
|
||||
private JButton bDeleteFlags;
|
||||
private JButton bDeleteEnvironment;
|
||||
public JCheckBox cbDvmStat;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public DVMSettingsFields(){
|
||||
sMinDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxProc.setModel(new SpinnerNumberModel(0, 0, 128, 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())) {
|
||||
tfFlags.setText((String)pass.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
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()))
|
||||
tfEnvironments.setText((String)pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
tfFlags.setText("");
|
||||
}
|
||||
});
|
||||
bDeleteEnvironment.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
tfEnvironments.setText("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user