no message
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Compiler;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Validators.DVMHelpParser;
|
||||
@@ -182,10 +182,10 @@ public class Compiler extends iDBObject {
|
||||
return "";
|
||||
}
|
||||
public String getHelpCommand() {
|
||||
return CommonUtils.DQuotes(call_command) + " " + help_command;
|
||||
return Utils_.DQuotes(call_command) + " " + help_command;
|
||||
}
|
||||
public String getVersionCommand() {
|
||||
return CommonUtils.DQuotes(call_command) + " " + version_command;
|
||||
return Utils_.DQuotes(call_command) + " " + version_command;
|
||||
}
|
||||
public String getVersionInfo(){
|
||||
return "v="+version+" r="+revision;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Compiler;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.Visual.UI;
|
||||
@@ -47,7 +47,7 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
String home = fields.tfHome.getText();
|
||||
if (!home.isEmpty()) {
|
||||
if (home.startsWith("/")) {
|
||||
if (CommonUtils.ContainsCyrillic(home))
|
||||
if (Utils_.ContainsCyrillic(home))
|
||||
Log.Writeln("Расположение компилятора не может содержать кириллицу");
|
||||
else {
|
||||
new PathValidator(home, "Расположение компилятора", Log).Validate();
|
||||
@@ -60,7 +60,7 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
String call_command = fields.tfCallCommand.getText();
|
||||
if (call_command.isEmpty())
|
||||
Log.Writeln("Команда вызова компилятора не может быть пустой");
|
||||
else if (CommonUtils.ContainsCyrillic(call_command))
|
||||
else if (Utils_.ContainsCyrillic(call_command))
|
||||
Log.Writeln("Команда вызова компилятора не может содержать кириллицу");
|
||||
else {
|
||||
switch (call_command.charAt(0)) {
|
||||
@@ -78,11 +78,11 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
//самое опасное место. теоретически тут можно ввести любую команду ОС, в том числе rm -rf
|
||||
if (call_command.contains(" "))
|
||||
Log.Writeln("Прямая команда вызова не может содержать пробелы");
|
||||
if (!call_command.contains("+")&& CommonUtils.ContainsForbiddenName(call_command))
|
||||
if (!call_command.contains("+")&& Utils_.ContainsForbiddenName(call_command))
|
||||
Log.Writeln("Прямая команда вызова содержит запрещённые символы");
|
||||
else {
|
||||
if (Utils.isLinuxSystemCommand(call_command))
|
||||
Log.Writeln(CommonUtils.DQuotes(call_command) + " является системной командой Linux");
|
||||
Log.Writeln(Utils_.DQuotes(call_command) + " является системной командой Linux");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
fields.tfHelpCommand.setText(Result.help_command);
|
||||
fields.tfVersionCommand.setText(Result.version_command);
|
||||
fields.tfHome.setText(Result.home_path);
|
||||
CommonUI.TrySelect(fields.cbCompilerType, Result.type);
|
||||
UI_.TrySelect(fields.cbCompilerType, Result.type);
|
||||
fields.events_on = true;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Compiler.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
@@ -42,7 +42,7 @@ public class CompilerFields implements DialogFields {
|
||||
if (dst != null)
|
||||
tfHome.setText(dst);
|
||||
} else
|
||||
CommonUI.Info("Назначение домашней папки поддерживается только для dvm системы.");
|
||||
UI_.Info("Назначение домашней папки поддерживается только для dvm системы.");
|
||||
});
|
||||
tfHome.getDocument().addDocumentListener(new DocumentListener() {
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Tables.DBObjectEditor;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
||||
@@ -7,7 +7,7 @@ import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironment;
|
||||
public class CompilerEnvironmentValueEditor extends DBObjectEditor<CompilerEnvironment> {
|
||||
@Override
|
||||
public void Action() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setText(value.value.isEmpty() ? "не задано" : value.value);
|
||||
//-
|
||||
ComboTextDialog dialog = new ComboTextDialog() {
|
||||
@@ -20,7 +20,7 @@ public class CompilerEnvironmentValueEditor extends DBObjectEditor<CompilerEnvir
|
||||
};
|
||||
dialog.fields.setEditable(value.valueVariants.isEmpty());
|
||||
if (!value.value.isEmpty())
|
||||
CommonUI.TrySelect(dialog.fields, value.value);
|
||||
UI_.TrySelect(dialog.fields, value.value);
|
||||
if (dialog.ShowDialog("Изменить значение опции " + value.name,
|
||||
value.valueVariants
|
||||
)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Tables.DBObjectRenderer;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironment;
|
||||
@@ -8,7 +8,7 @@ public class CompilerEnvironmentValueRenderer extends DBObjectRenderer {
|
||||
public void Display() {
|
||||
if (value != null) {
|
||||
CompilerEnvironment environment = (CompilerEnvironment) value;
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setText(environment.value.isEmpty() ? "не задано" : environment.value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -26,7 +26,7 @@ public class CompilerOption extends DBObject {
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + (hasParameter() ? (parameterSeparator +
|
||||
(parameterValue.contains(" ") ? CommonUtils.DQuotes(parameterValue) : parameterValue)) : "");
|
||||
(parameterValue.contains(" ") ? Utils_.DQuotes(parameterValue) : parameterValue)) : "");
|
||||
}
|
||||
public void CheckParameterVariants() {
|
||||
for (String line : description)
|
||||
@@ -34,7 +34,7 @@ public class CompilerOption extends DBObject {
|
||||
}
|
||||
public boolean CheckLine(String line) {
|
||||
if (hasParameter()) {
|
||||
Pattern DVM_PARAM_VALUES_REGEX = Pattern.compile(CommonUtils.TBrackets(parameterName) + "\\s*=\\s*" + "\\w+(\\|\\w+)+", Pattern.CASE_INSENSITIVE);
|
||||
Pattern DVM_PARAM_VALUES_REGEX = Pattern.compile(Utils_.TBrackets(parameterName) + "\\s*=\\s*" + "\\w+(\\|\\w+)+", Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = DVM_PARAM_VALUES_REGEX.matcher(line);
|
||||
if (matcher.find()) {
|
||||
String s = line.substring(matcher.start(), matcher.end());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Tables.DBObjectRenderer;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
|
||||
@@ -9,10 +9,10 @@ public class CompilerOptionParameterNameRenderer extends DBObjectRenderer {
|
||||
if (value != null) {
|
||||
CompilerOption option = (CompilerOption) value;
|
||||
if (option.hasParameter()) {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setText(option.parameterName);
|
||||
} else {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.UnknownState));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.UnknownState));
|
||||
setText("нет");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Tables.DBObjectEditor;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
||||
@@ -8,13 +8,13 @@ public class CompilerOptionParameterValueEditor extends DBObjectEditor<CompilerO
|
||||
@Override
|
||||
public void Action() {
|
||||
if (value.hasParameter()) {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
//-
|
||||
setText(value.parameterValue.isEmpty() ? "не задано" : value.parameterValue);
|
||||
//-
|
||||
ComboTextDialog dialog = new ComboTextDialog();
|
||||
if (!value.parameterValue.isEmpty())
|
||||
CommonUI.TrySelect(dialog.fields, value.parameterValue);
|
||||
UI_.TrySelect(dialog.fields, value.parameterValue);
|
||||
dialog.fields.setEditable(value.parameterVariants.isEmpty());
|
||||
if (dialog.ShowDialog("Изменить значение опции " + value.name,
|
||||
value.parameterVariants)) {
|
||||
@@ -22,7 +22,7 @@ public class CompilerOptionParameterValueEditor extends DBObjectEditor<CompilerO
|
||||
setText(value.parameterValue.isEmpty() ? "не задано" : value.parameterValue);
|
||||
}
|
||||
} else {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.UnknownState));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.UnknownState));
|
||||
setText("нет");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Tables.DBObjectRenderer;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
|
||||
@@ -9,10 +9,10 @@ public class CompilerOptionParameterValueRenderer extends DBObjectRenderer {
|
||||
if (value != null) {
|
||||
CompilerOption option = (CompilerOption) value;
|
||||
if (option.hasParameter()) {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setText(option.parameterValue.isEmpty() ? "не задано" : option.parameterValue);
|
||||
} else {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.UnknownState));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.UnknownState));
|
||||
setText("нет");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
@@ -53,7 +53,7 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
return new DBObjectDialog<DVMParameter, DVMParameterFields>(DVMParameterFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
CommonUI.TrySelect(fields.cbName, Result.name);
|
||||
UI_.TrySelect(fields.cbName, Result.name);
|
||||
fields.tfValue.setText(Result.value);
|
||||
}
|
||||
//https://javarush.ru/groups/posts/regulyarnye-vyrazheniya-v-java
|
||||
@@ -69,16 +69,16 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
}
|
||||
*/
|
||||
if (Utils.isLinuxSystemCommand(name))
|
||||
Log.Writeln(CommonUtils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
Log.Writeln(Utils_.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
|
||||
/*
|
||||
if (value.contains("\"")) {
|
||||
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
|
||||
}
|
||||
*/
|
||||
for (DVMParameter par : ((GlobalDatabase)CommonUtils.db).dvmParameters.Data.values()) {
|
||||
for (DVMParameter par : ((GlobalDatabase) Utils_.db).dvmParameters.Data.values()) {
|
||||
if (par.isVisible() && (Result.id != par.id) && (par.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + CommonUtils.Brackets(name));
|
||||
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + Utils_.Brackets(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.EnvironmentValue;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
public class EnvironmentValue extends iDBObject {
|
||||
@@ -14,6 +14,6 @@ public class EnvironmentValue extends iDBObject {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + "=" + CommonUtils.DQuotes(value);
|
||||
return name + "=" + Utils_.DQuotes(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.EnvironmentValue;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
@@ -25,7 +25,7 @@ public class EnvironmentValuesDBTable extends iDBTable<EnvironmentValue> {
|
||||
return new DBObjectDialog<EnvironmentValue, EnvironmentValueFields>(EnvironmentValueFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
CommonUI.TrySelect(fields.cbName, Result.name);
|
||||
UI_.TrySelect(fields.cbName, Result.name);
|
||||
fields.tfValue.setText(Result.value);
|
||||
}
|
||||
//https://javarush.ru/groups/posts/regulyarnye-vyrazheniya-v-java
|
||||
@@ -39,13 +39,13 @@ public class EnvironmentValuesDBTable extends iDBTable<EnvironmentValue> {
|
||||
Log.Writeln("Имя переменной окружения может содержать только латинские буквы, цифры и подчёркивания");
|
||||
}
|
||||
if (Utils.isLinuxSystemCommand(name))
|
||||
Log.Writeln(CommonUtils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
Log.Writeln(Utils_.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
if (value.contains("\"")) {
|
||||
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
|
||||
}
|
||||
for (EnvironmentValue env : ((GlobalDatabase)CommonUtils.db).environmentValues.Data.values()) {
|
||||
for (EnvironmentValue env : ((GlobalDatabase) Utils_.db).environmentValues.Data.values()) {
|
||||
if (env.isVisible() && (Result.id != env.id) && (env.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задана переменная окружения с именем " + CommonUtils.Brackets(name));
|
||||
Log.Writeln("В конфигурации запуска уже задана переменная окружения с именем " + Utils_.Brackets(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.GlobalData;
|
||||
import Common.Current_;
|
||||
import Common.Database.VisualiserDatabase;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.Global;
|
||||
@@ -122,7 +122,7 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
try {
|
||||
Update((DBObject) Current_.get(Current.Credentials));
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
//--
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Machine;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
|
||||
@@ -23,13 +23,13 @@ public class Machine extends iDBObject {
|
||||
}
|
||||
public String getFullDescription() {
|
||||
return //this.equals(Constants.repository_machine) ? "Репозиторий визуализатора" :
|
||||
"Машина по адресу " + CommonUtils.Brackets(getURL());
|
||||
"Машина по адресу " + Utils_.Brackets(getURL());
|
||||
}
|
||||
public LinkedHashMap<Integer, Compiler> getCompilers() {
|
||||
return CommonUtils.db.getMapByFKi(this, Compiler.class);
|
||||
return Utils_.db.getMapByFKi(this, Compiler.class);
|
||||
}
|
||||
public LinkedHashMap<Integer, User> getUsers() {
|
||||
return CommonUtils.db.getMapByFKi(this, User.class);
|
||||
return Utils_.db.getMapByFKi(this, User.class);
|
||||
}
|
||||
@Override
|
||||
public String getDialogName() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Machine;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.Visual.UI;
|
||||
@@ -50,7 +50,7 @@ public class MachinesDBTable extends iDBTable<Machine> {
|
||||
fields.tfName.setText(Result.name);
|
||||
fields.tfAddress.setText(Result.address);
|
||||
fields.sPort.setValue(Result.port);
|
||||
CommonUI.TrySelect(fields.cbMachineType, Result.type);
|
||||
UI_.TrySelect(fields.cbMachineType, Result.type);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Makefile;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.Utils;
|
||||
@@ -25,10 +25,10 @@ public class Makefile extends ModuleAnchestor {
|
||||
return Current.HasMachine() && (machine_id == Current.getMachine().id);
|
||||
}
|
||||
public LinkedHashMap<LanguageName, Module> getActiveModules() {
|
||||
return CommonUtils.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class).values().stream().filter(Module::isSelected).collect(Collectors.toMap(module -> module.language, module -> module, (a, b) -> b, LinkedHashMap::new));
|
||||
return Utils_.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class).values().stream().filter(Module::isSelected).collect(Collectors.toMap(module -> module.language, module -> module, (a, b) -> b, LinkedHashMap::new));
|
||||
}
|
||||
public LinkedHashMap<LanguageName, Module> getModules() {
|
||||
return CommonUtils.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
|
||||
return Utils_.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
|
||||
}
|
||||
public String Generate(db_project_info project, boolean useFilesOrder, LinkedHashMap<LanguageName, Module> modules) throws Exception {
|
||||
Compiler linker = getCompiler();
|
||||
@@ -37,7 +37,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
Vector<String> titles = new Vector<>();
|
||||
Vector<String> objects = new Vector<>();
|
||||
Vector<String> bodies = new Vector<>();
|
||||
String binary = CommonUtils.DQuotes("0"); // Utils.DQuotes(project.name);
|
||||
String binary = Utils_.DQuotes("0"); // Utils.DQuotes(project.name);
|
||||
for (Module module : modules.values()) {
|
||||
//определить а активен ли модуль.
|
||||
//выбран ли он. есть ли у него компилятор. есть ли для него программы.
|
||||
@@ -61,7 +61,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
for (DBProjectFile program : programsToAssembly) {
|
||||
//--
|
||||
program.last_assembly_name = module.language.toString() + "_" + i + ".o";
|
||||
String object = CommonUtils.DQuotes(program.last_assembly_name);
|
||||
String object = Utils_.DQuotes(program.last_assembly_name);
|
||||
module_objects.add(object);
|
||||
module_body +=
|
||||
object + ":\n" +
|
||||
@@ -78,7 +78,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
++i;
|
||||
}
|
||||
titles.add(String.join("\n",
|
||||
LANG_ + "COMMAND=" + CommonUtils.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "COMMAND=" + Utils_.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "FLAGS=" + module.flags,
|
||||
LANG_ + "OBJECTS=" + String.join(" ", module_objects),
|
||||
""
|
||||
@@ -88,7 +88,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
}
|
||||
}
|
||||
return String.join("\n",
|
||||
"LINK_COMMAND=" + CommonUtils.DQuotes(linker.call_command) + " " + command,
|
||||
"LINK_COMMAND=" + Utils_.DQuotes(linker.call_command) + " " + command,
|
||||
"LINK_FLAGS=" + flags + "\n",
|
||||
String.join("\n", titles),
|
||||
"all: " + binary,
|
||||
@@ -124,7 +124,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
for (DBProjectFile program : programsToAssembly) {
|
||||
//--
|
||||
program.last_assembly_name = module.language.toString() + "_" + i + ".o";
|
||||
String object = CommonUtils.DQuotes(program.last_assembly_name);
|
||||
String object = Utils_.DQuotes(program.last_assembly_name);
|
||||
module_objects.add(object);
|
||||
module_body +=
|
||||
object + ":\n" +
|
||||
@@ -141,7 +141,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
++i;
|
||||
}
|
||||
titles.add(String.join("\n",
|
||||
LANG_ + "COMMAND=" + CommonUtils.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "COMMAND=" + Utils_.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "FLAGS=" + module.flags,
|
||||
LANG_ + "OBJECTS=" + String.join(" ", module_objects),
|
||||
""
|
||||
@@ -159,7 +159,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
//todo возможно улучшить
|
||||
//https://habr.com/ru/post/211751/
|
||||
public Machine getMachine() {
|
||||
return CommonUtils.db.getById(Machine.class, machine_id);
|
||||
return Utils_.db.getById(Machine.class, machine_id);
|
||||
}
|
||||
public boolean DependsToCompiler(Compiler compiler) {
|
||||
if (compiler_id == compiler.id) return true;
|
||||
@@ -178,7 +178,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
if (linker.type.equals(CompilerType.dvm)) {
|
||||
if (!Current.getProject().languageName.getDVMLink().equals(command))
|
||||
Log.Writeln("команда линковки " +
|
||||
CommonUtils.Quotes(command) +
|
||||
Utils_.Quotes(command) +
|
||||
" не соответствует языку текущего проекта "
|
||||
+ Current.getProject().languageName.getDescription() + "\n" +
|
||||
"Используйте команду " + Current.getProject().languageName.getDVMLink());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Module;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
@@ -29,9 +29,9 @@ public class Module extends ModuleAnchestor {
|
||||
public void Select(boolean flag) {
|
||||
on = flag ? 1 : 0;
|
||||
try {
|
||||
CommonUtils.db.Update(this);
|
||||
Utils_.db.Update(this);
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Module;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
public class ModuleAnchestor extends iDBObject {
|
||||
@@ -16,16 +16,16 @@ public class ModuleAnchestor extends iDBObject {
|
||||
return ((compiler = getCompiler()) == null) ? "" : compiler.getDescription();
|
||||
}
|
||||
public Compiler getCompiler() {
|
||||
return CommonUtils.db.getById(Compiler.class, compiler_id);
|
||||
return Utils_.db.getById(Compiler.class, compiler_id);
|
||||
}
|
||||
public String getDescription() {
|
||||
String res = "";
|
||||
if (getCompiler() != null) {
|
||||
res += CommonUtils.Brackets(getCompiler().getDescription());
|
||||
res += Utils_.Brackets(getCompiler().getDescription());
|
||||
if (!command.isEmpty())
|
||||
res += " " + CommonUtils.Brackets(command);
|
||||
res += " " + Utils_.Brackets(command);
|
||||
if (!flags.isEmpty())
|
||||
res += " " + CommonUtils.Brackets(flags);
|
||||
res += " " + Utils_.Brackets(flags);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Module.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Controls.StyledTextComboBox;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
@@ -32,14 +32,14 @@ public class ModuleAnchestorFields implements DialogFields {
|
||||
bHelp.addActionListener(e -> {
|
||||
if (cbCompilers.getSelectedItem() != null) {
|
||||
Pass.passes.get(PassCode.ShowCompilerHelp).Do(compiler, true);
|
||||
} else CommonUI.Info("Компилятор не выбран");
|
||||
} else UI_.Info("Компилятор не выбран");
|
||||
});
|
||||
BPickOptions.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass<String> pass = Pass.passes.get(PassCode.PickCompilerOptions);
|
||||
if (pass.Do(compiler)) {
|
||||
CommonUI.TrySelect(cbFlags, pass.target);
|
||||
UI_.TrySelect(cbFlags, pass.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -58,7 +58,7 @@ public class ModuleAnchestorFields implements DialogFields {
|
||||
cbCompilers.addActionListener(e -> {
|
||||
if (cbCompilers.getSelectedItem() instanceof Compiler) {
|
||||
Compiler compiler = ((Compiler) cbCompilers.getSelectedItem());
|
||||
CommonUI.TrySelect(cbCommands,
|
||||
UI_.TrySelect(cbCommands,
|
||||
linker ? compiler.getSpecialLinkCommand(languageName) : compiler.getSpecialCompilationCommand(languageName));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Module.UI;
|
||||
import Common.CommonConstants;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
@@ -93,9 +93,9 @@ public class ModuleAnchestorForm<T extends ModuleAnchestor> extends DBObjectDial
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
CommonUI.TrySelect(fields.cbFlags, Result.flags);
|
||||
CommonUI.TrySelect(fields.cbCommands, Result.command);
|
||||
CommonUI.TrySelect(fields.cbCompilers, Result.getCompiler());
|
||||
UI_.TrySelect(fields.cbFlags, Result.flags);
|
||||
UI_.TrySelect(fields.cbCommands, Result.command);
|
||||
UI_.TrySelect(fields.cbCompilers, Result.getCompiler());
|
||||
//--------------------------------------------
|
||||
fields.setListeners(Result);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.GlobalData.RemoteFile.UI;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Windows.Dialog.Dialog;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
@@ -31,7 +31,7 @@ public class RemoteFileChooser extends Dialog<String, RemoteFileChooserFields> {
|
||||
try {
|
||||
Refresh(session.user.connection.sftpChannel.pwd());
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
onCancel(); //закрываем окно.
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class RemoteFileChooser extends Dialog<String, RemoteFileChooserFields> {
|
||||
fields.treeForm.Show();
|
||||
fields.lCurrentFolder.setText(path);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
onCancel();
|
||||
}
|
||||
}
|
||||
@@ -77,14 +77,14 @@ public class RemoteFileChooser extends Dialog<String, RemoteFileChooserFields> {
|
||||
try {
|
||||
Refresh(session.user.connection.sftpChannel.getHome());
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
onCancel(); //закрываем окно.
|
||||
}
|
||||
}
|
||||
public void goUp() {
|
||||
if (!root_file.full_name.equals("/")) {
|
||||
Refresh(root_file.parent);
|
||||
} else CommonUI.Info("Корневая папка файловой системы достигнута.");
|
||||
} else UI_.Info("Корневая папка файловой системы достигнута.");
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.RemoteFile.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Trees.StyledTreeCellRenderer;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
@@ -16,7 +16,7 @@ public class RemoteFileRenderer extends StyledTreeCellRenderer {
|
||||
if (o instanceof RemoteFile) {
|
||||
RemoteFile file = (RemoteFile) o;
|
||||
setText(file.name);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
if (file.isDirectory())
|
||||
setIcon(new ImageIcon(getClass().getResource("/icons/Folder.png")));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
@@ -54,7 +54,7 @@ public class RunConfiguration extends iDBObject {
|
||||
try {
|
||||
dim = Integer.parseInt(dim_);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
res.add(dim);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class RunConfiguration extends iDBObject {
|
||||
}
|
||||
//---------------------------------------->
|
||||
public Compiler getCompiler() {
|
||||
return CommonUtils.db.getById(Compiler.class, compiler_id);
|
||||
return Utils_.db.getById(Compiler.class, compiler_id);
|
||||
}
|
||||
public boolean isCube() {
|
||||
return cube != 0;
|
||||
@@ -145,16 +145,16 @@ public class RunConfiguration extends iDBObject {
|
||||
public String getDescription() {
|
||||
String res = "";
|
||||
if (!LauncherCall.isEmpty()) {
|
||||
res += CommonUtils.Brackets(LauncherCall);
|
||||
res += Utils_.Brackets(LauncherCall);
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + CommonUtils.Brackets(LauncherOptions);
|
||||
res += " " + Utils_.Brackets(LauncherOptions);
|
||||
} else res = " — ";
|
||||
return res;
|
||||
}
|
||||
public String getLaunchScriptText(String binary_name, String task_matrix) {
|
||||
String res = "";
|
||||
if (!LauncherCall.isEmpty()) {
|
||||
res += CommonUtils.DQuotes(LauncherCall);
|
||||
res += Utils_.DQuotes(LauncherCall);
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + LauncherOptions;
|
||||
if (!task_matrix.isEmpty())
|
||||
@@ -162,7 +162,7 @@ public class RunConfiguration extends iDBObject {
|
||||
}
|
||||
if (!res.isEmpty())
|
||||
res += " ";
|
||||
res += CommonUtils.DQuotes("./" + binary_name);
|
||||
res += Utils_.DQuotes("./" + binary_name);
|
||||
if (!args.isEmpty())
|
||||
res += " " + args;
|
||||
return res;
|
||||
@@ -189,13 +189,13 @@ public class RunConfiguration extends iDBObject {
|
||||
return "run_configuration_id";
|
||||
}
|
||||
public Vector<String> getEnvList() {
|
||||
return CommonUtils.db.getVectorStringByFK(this, EnvironmentValue.class);
|
||||
return Utils_.db.getVectorStringByFK(this, EnvironmentValue.class);
|
||||
}
|
||||
public Vector<String> getParList() {
|
||||
return CommonUtils.db.getVectorStringByFK(this, DVMParameter.class);
|
||||
return Utils_.db.getVectorStringByFK(this, DVMParameter.class);
|
||||
}
|
||||
public LinkedHashMap<String, String> getEnvMap() {
|
||||
LinkedHashMap<Integer, EnvironmentValue> envs = CommonUtils.db.getMapByFKi(this, EnvironmentValue.class);
|
||||
LinkedHashMap<Integer, EnvironmentValue> envs = Utils_.db.getMapByFKi(this, EnvironmentValue.class);
|
||||
LinkedHashMap<String, String> res = new LinkedHashMap<>();
|
||||
for (EnvironmentValue e : envs.values()) {
|
||||
if (!res.containsKey(e.name))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -40,18 +40,18 @@ public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
|
||||
return new DBObjectDialog<RunConfiguration, RunConfigurationFields>(RunConfigurationFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
for (Compiler compiler : ((GlobalDatabase)CommonUtils.db).compilers.Data.values()) {
|
||||
for (Compiler compiler : ((GlobalDatabase) Utils_.db).compilers.Data.values()) {
|
||||
if (compiler.isVisible() && compiler.type.equals(CompilerType.dvm))
|
||||
fields.cbLauncherCall.addItem(compiler);
|
||||
}
|
||||
CommonUI.TrySelect_s(fields.cbLauncherCall, Result.LauncherCall);
|
||||
CommonUI.TrySelect(fields.cbLaunchOptions, Result.LauncherOptions);
|
||||
UI_.TrySelect_s(fields.cbLauncherCall, Result.LauncherCall);
|
||||
UI_.TrySelect(fields.cbLaunchOptions, Result.LauncherOptions);
|
||||
fields.tfArgs.setText(Result.args);
|
||||
fields.cbLauncherCall.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
|
||||
CommonUI.TrySelect(fields.cbLaunchOptions, "run");
|
||||
UI_.TrySelect(fields.cbLaunchOptions, "run");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Settings;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Visual.Menus.StableMenuItem;
|
||||
import _VisualDVM.Repository.Component.ComponentType;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
@@ -64,13 +64,13 @@ public class DBSetting extends DBObject {
|
||||
public void Mark() {
|
||||
switch (settingType) {
|
||||
case SapforFlag:
|
||||
getMenuItem().setIcon(CommonUtils.getIcon(toBoolean() ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
getMenuItem().setIcon(Utils_.getIcon(toBoolean() ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
break;
|
||||
case PercentField:
|
||||
getMenuItem().setText(Name.getDescription() + " : " + this + "%");
|
||||
break;
|
||||
case StringField:
|
||||
String valueToShow = Value.isEmpty()? "не задано": CommonUtils.Quotes(toString());
|
||||
String valueToShow = Value.isEmpty()? "не задано": Utils_.Quotes(toString());
|
||||
getMenuItem().setText(Name.getDescription() + " : " + valueToShow);
|
||||
break;
|
||||
case IntField:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Settings;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Repository.Component.ComponentType;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SettingsDBTable extends DBTable<SettingName, DBSetting> {
|
||||
AddSetting(new DBSetting(SettingName.Kernels, Utils.getHalfKernels(), SettingType.IntField, ComponentType.Visualiser));
|
||||
AddSetting(new DBSetting(SettingName.AutoBugReportsLoad, 0, SettingType.SapforFlag, ComponentType.Visualiser, true));
|
||||
AddSetting(new DBSetting(SettingName.AutoTestsLoad, 0, SettingType.SapforFlag, ComponentType.Visualiser, true));
|
||||
if (CommonUtils.isWindows())
|
||||
if (Utils_.isWindows())
|
||||
AddSetting(new DBSetting(SettingName.LocalMakePathWindows, "C:\\MinGW\\msys\\1.0\\bin\\make.exe", SettingType.StringField, ComponentType.Visualiser));
|
||||
AddSetting(new DBSetting(SettingName.SmallScreen, 0, SettingType.SapforFlag, ComponentType.Visualiser));
|
||||
//совместимость. указываем явно чтобы не были видны в меню.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Splitter;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -32,7 +32,7 @@ public class SplittersDBTable extends DBTable<String, Splitter> {
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
public void Save(Object form) {
|
||||
@@ -44,7 +44,7 @@ public class SplittersDBTable extends DBTable<String, Splitter> {
|
||||
getDb().Update(splitter);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.GlobalData.Tasks.CompilationTask;
|
||||
import Common.CommonConstants;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.Global;
|
||||
@@ -64,7 +64,7 @@ public class CompilationTask extends Task {
|
||||
break;
|
||||
}
|
||||
}
|
||||
CommonUtils.db.Update(this);
|
||||
Utils_.db.Update(this);
|
||||
}
|
||||
//---------------------------------------------------
|
||||
@Override
|
||||
@@ -80,7 +80,7 @@ public class CompilationTask extends Task {
|
||||
belongsToProject(Current.getProject());
|
||||
}
|
||||
public Makefile getMakefile() {
|
||||
return CommonUtils.db.getById(Makefile.class, makefile_id);
|
||||
return Utils_.db.getById(Makefile.class, makefile_id);
|
||||
}
|
||||
@Override
|
||||
public String getFullCommand() {
|
||||
@@ -90,7 +90,7 @@ public class CompilationTask extends Task {
|
||||
LinkedHashMap<Integer, RunTask> res = new LinkedHashMap<>();
|
||||
//так не получится. не правильно назвал ключевое поле. F...
|
||||
// return Global.db.getMapByFKi(this, RunTask.class);
|
||||
for (RunTask runTask : ((GlobalDatabase)CommonUtils.db).runTasks.Data.values()) {
|
||||
for (RunTask runTask : ((GlobalDatabase) Utils_.db).runTasks.Data.values()) {
|
||||
if (runTask.compilation_task_id == id)
|
||||
res.put(runTask.id, runTask);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class CompilationTask extends Task {
|
||||
String errors = getErrors();
|
||||
for (DBProjectFile file : project.db.files.Data.values()) {
|
||||
if (!file.last_assembly_name.isEmpty()) {
|
||||
String replacement = file.last_assembly_name + " " + CommonUtils.RBrackets(file.name);
|
||||
String replacement = file.last_assembly_name + " " + Utils_.RBrackets(file.name);
|
||||
output = output.replace(file.last_assembly_name, replacement);
|
||||
errors = errors.replace(file.last_assembly_name, replacement);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Passes;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Tasks.Supervisor.TaskSupervisor;
|
||||
import Visual_DVM_2021.Passes.ProcessPass;
|
||||
@@ -9,7 +9,7 @@ public abstract class TaskLocalPass<S extends TaskSupervisor> extends ProcessPas
|
||||
try {
|
||||
supervisor = s_class.newInstance();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.QueueSystem;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.Tasks.Task;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
public class QueueSystem {
|
||||
@@ -28,9 +28,9 @@ public class QueueSystem {
|
||||
}
|
||||
}
|
||||
public String getCheckTaskCommand(Task task) {
|
||||
return check_command + " " + CommonUtils.DQuotes(task.PID);
|
||||
return check_command + " " + Utils_.DQuotes(task.PID);
|
||||
}
|
||||
public String getCancelTaskCommand(Task task) {
|
||||
return cancel_command + " " + CommonUtils.DQuotes(task.PID);
|
||||
return cancel_command + " " + Utils_.DQuotes(task.PID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.GlobalData.Tasks.RunTask;
|
||||
import Common.CommonConstants;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.Global;
|
||||
@@ -39,7 +39,7 @@ public class RunTask extends Task {
|
||||
super.DropResults();
|
||||
Utils.forceDeleteWithCheck(getLocalStsFile());
|
||||
CleanTime = 0;
|
||||
CommonUtils.db.Update(this);
|
||||
Utils_.db.Update(this);
|
||||
}
|
||||
@Override
|
||||
public File getHome() {
|
||||
@@ -62,18 +62,18 @@ public class RunTask extends Task {
|
||||
compilation_task_id == Current.getCompilationTask().id;
|
||||
}
|
||||
public RunConfiguration getRunConfiguration() {
|
||||
return ((GlobalDatabase)CommonUtils.db).runConfigurations.Data.get(run_configuration_id);
|
||||
return ((GlobalDatabase) Utils_.db).runConfigurations.Data.get(run_configuration_id);
|
||||
}
|
||||
public CompilationTask getCompilationTask() {
|
||||
return ((GlobalDatabase)CommonUtils.db).compilationTasks.Data.get(compilation_task_id);
|
||||
return ((GlobalDatabase) Utils_.db).compilationTasks.Data.get(compilation_task_id);
|
||||
}
|
||||
public void UpdateLastStsName(String file_name) {
|
||||
if (!last_sts_name.equals(file_name)) {
|
||||
last_sts_name = file_name;
|
||||
try {
|
||||
CommonUtils.db.Update(this);
|
||||
Utils_.db.Update(this);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class RunTask extends Task {
|
||||
try {
|
||||
if (p != null) CleanTime = Double.parseDouble(p);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Linux;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
@@ -33,7 +33,7 @@ public class LinuxLocalCompilationSupervisor extends LinuxLocalTaskSupervisor<Co
|
||||
protected void ValidateTaskResults() throws Exception {
|
||||
if (getBinary().exists()) {
|
||||
File renamed_binary = Paths.get(getProjectCopy().getAbsolutePath(),
|
||||
CommonUtils.getDateName("spf")).toFile();
|
||||
Utils_.getDateName("spf")).toFile();
|
||||
task.binary_name = renamed_binary.getName();
|
||||
Files.move(getBinary().toPath(), renamed_binary.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
task.state = TaskState.Done;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Linux;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.Supervisor.Local.LocalTaskSupervisor;
|
||||
@@ -24,10 +24,10 @@ public abstract class LinuxLocalTaskSupervisor<T extends Task> extends LocalTask
|
||||
User user = task.getUser();
|
||||
return
|
||||
String.join(" ",
|
||||
CommonUtils.DQuotes(user.getStarterFile()),
|
||||
CommonUtils.DQuotes(user.getLauncherFile()),
|
||||
Utils_.DQuotes(user.getStarterFile()),
|
||||
Utils_.DQuotes(user.getLauncherFile()),
|
||||
String.valueOf(task.maxtime),
|
||||
CommonUtils.DQuotes(getCoupDeGrace()),
|
||||
Utils_.DQuotes(getCoupDeGrace()),
|
||||
task.getFullCommand()
|
||||
);
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public abstract class LinuxLocalTaskSupervisor<T extends Task> extends LocalTask
|
||||
if (task.PID.isEmpty())
|
||||
throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
task.StartDate = (new Date()).getTime();
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + CommonUtils.Brackets(task.PID));
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + Utils_.Brackets(task.PID));
|
||||
RefreshProgress();
|
||||
do {
|
||||
Thread.sleep(getTaskCheckPeriod() * 1000L);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
@@ -44,7 +44,7 @@ public abstract class LocalTaskSupervisor<T extends Task> extends TaskSupervisor
|
||||
return Paths.get(task.getUser().getLocalProjectsDir().getAbsolutePath(), project.getUniqKey()).toFile();
|
||||
}
|
||||
protected File getBinary() {
|
||||
return Paths.get(getProjectCopy().getAbsolutePath(), "0" + (CommonUtils.isWindows() ? ".exe" : "")).toFile();
|
||||
return Paths.get(getProjectCopy().getAbsolutePath(), "0" + (Utils_.isWindows() ? ".exe" : "")).toFile();
|
||||
}
|
||||
protected File getProjectOutput() {
|
||||
return Paths.get(getProjectCopy().getAbsolutePath(), Constants.out_file).toFile();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
@@ -19,7 +19,7 @@ public class WindowsLocalCompilationSupervisor extends WindowsLocalTaskSuperviso
|
||||
}
|
||||
@Override
|
||||
protected String getScriptText() {
|
||||
return CommonUtils.DQuotes(((GlobalDatabase)CommonUtils.db).settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
|
||||
return Utils_.DQuotes(((GlobalDatabase) Utils_.db).settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
|
||||
}
|
||||
//скорее всего как то выделить подготовку к компиляции как метод предка.
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class WindowsLocalCompilationSupervisor extends WindowsLocalTaskSuperviso
|
||||
protected void ValidateTaskResults() throws Exception {
|
||||
if (getBinary().exists()) {
|
||||
File renamed_binary = Paths.get(getProjectCopy().getAbsolutePath(),
|
||||
CommonUtils.getDateName("spf") + ".exe").toFile();
|
||||
Utils_.getDateName("spf") + ".exe").toFile();
|
||||
task.binary_name = renamed_binary.getName();
|
||||
Files.move(getBinary().toPath(), renamed_binary.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
task.state = TaskState.Done;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.Tasks.Supervisor.Local.LocalTaskSupervisor;
|
||||
import _VisualDVM.GlobalData.Tasks.Task;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
@@ -21,7 +21,7 @@ public abstract class WindowsLocalTaskSupervisor<T extends Task> extends LocalTa
|
||||
try {
|
||||
AbortTask();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
task.state = TaskState.AbortedByTimeout;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.Tasks.QueueSystem.MVS;
|
||||
@@ -32,7 +32,7 @@ public class MVSRunSupervisor extends ServerRunSupervisor {
|
||||
String env = String.join(" ", Current.getRunConfiguration().getEnvList());
|
||||
mvs_time = (task.maxtime / 60); //в минутах
|
||||
if (task.maxtime % 60 > 0) mvs_time += 1;
|
||||
String res = "maxtime=" + CommonUtils.DQuotes(mvs_time) + " ./run";
|
||||
String res = "maxtime=" + Utils_.DQuotes(mvs_time) + " ./run";
|
||||
if (!env.isEmpty())
|
||||
res = env + " " + res;
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
@@ -36,7 +36,7 @@ public class RemoteCompilationSupervisor extends RemoteTaskSupervisor<Compilatio
|
||||
@Override
|
||||
protected void ValidateTaskResults() throws Exception {
|
||||
if (pass.user.connection.Exists(getBinary())) {
|
||||
RemoteFile renamed_binary = new RemoteFile(getRemoteProject().full_name, CommonUtils.getDateName("spf_" + getBinary().name));
|
||||
RemoteFile renamed_binary = new RemoteFile(getRemoteProject().full_name, Utils_.getDateName("spf_" + getBinary().name));
|
||||
pass.user.connection.sftpChannel.rename(getBinary().full_name, renamed_binary.full_name);
|
||||
task.binary_name = renamed_binary.name;
|
||||
task.state = TaskState.Done;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.Tasks.Supervisor.TaskSupervisor;
|
||||
@@ -77,10 +77,10 @@ public abstract class RemoteTaskSupervisor<T extends Task> extends TaskSuperviso
|
||||
protected String getStartCommand() {
|
||||
String res =
|
||||
String.join(" ",
|
||||
CommonUtils.DQuotes(getStarter()),
|
||||
CommonUtils.DQuotes(getLauncher()),
|
||||
Utils_.DQuotes(getStarter()),
|
||||
Utils_.DQuotes(getLauncher()),
|
||||
String.valueOf(task.maxtime),
|
||||
CommonUtils.DQuotes(getCoupDeGrace()),
|
||||
Utils_.DQuotes(getCoupDeGrace()),
|
||||
task.getFullCommand()
|
||||
);
|
||||
return res;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.Tasks.Supervisor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.Task;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
@@ -16,7 +16,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
public void ShowTaskState(){
|
||||
|
||||
|
||||
CommonUtils.db.tables.get(task.getClass()).ShowUI(task.getPK());
|
||||
Utils_.db.tables.get(task.getClass()).ShowUI(task.getPK());
|
||||
}
|
||||
public void Init(T task_in, P pass_in, db_project_info project_in) {
|
||||
task = task_in;
|
||||
@@ -25,7 +25,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
try {
|
||||
project.CleanInterruptFile();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
protected void PrepareWorkspace() throws Exception {
|
||||
@@ -96,7 +96,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
task.state = TaskState.AbortedByUser;
|
||||
ShowTaskState();
|
||||
}
|
||||
pass.ShowMessage1("Задача " + CommonUtils.Brackets(task.state.getDescription()));
|
||||
pass.ShowMessage1("Задача " + Utils_.Brackets(task.state.getDescription()));
|
||||
task.EndDate = (new Date()).getTime();
|
||||
pass.ShowMessage2("Получение результатов");
|
||||
AchieveResults();
|
||||
@@ -119,7 +119,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
if (task.PID.isEmpty())
|
||||
throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
task.StartDate = (new Date()).getTime();
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + CommonUtils.Brackets(task.PID));
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + Utils_.Brackets(task.PID));
|
||||
RefreshProgress();
|
||||
do {
|
||||
Thread.sleep(getTaskCheckPeriod() * 1000);
|
||||
@@ -132,6 +132,6 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
}
|
||||
}
|
||||
public void UpdateTask() throws Exception {
|
||||
CommonUtils.db.Update(task);
|
||||
Utils_.db.Update(task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Tasks;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Utils;
|
||||
@@ -44,7 +44,7 @@ public abstract class Task extends iDBObject {
|
||||
EndDate = 0;
|
||||
Time = 0;
|
||||
state = TaskState.Inactive;
|
||||
CommonUtils.db.Update(this);
|
||||
Utils_.db.Update(this);
|
||||
}
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="локальные файлы">
|
||||
@@ -66,10 +66,10 @@ public abstract class Task extends iDBObject {
|
||||
return new Date(EndDate);
|
||||
}
|
||||
public Machine getMachine() {
|
||||
return CommonUtils.db.getById(Machine.class, machine_id);
|
||||
return Utils_.db.getById(Machine.class, machine_id);
|
||||
}
|
||||
public User getUser() {
|
||||
return CommonUtils.db.getById(User.class, user_id);
|
||||
return Utils_.db.getById(User.class, user_id);
|
||||
}
|
||||
protected String getTextResult(File file) {
|
||||
return (file.exists()) ? Utils.ReadAllText(file) : "файл не найден. Задача еще не выполнялась или была завершена некорректно";
|
||||
@@ -92,9 +92,9 @@ public abstract class Task extends iDBObject {
|
||||
if (state != state_in) {
|
||||
state = state_in;
|
||||
try {
|
||||
CommonUtils.db.Update(this);
|
||||
Utils_.db.Update(this);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.GlobalData.User.UI;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Menus.TextEditorMenu;
|
||||
import Common.Visual.TextField.StyledPasswordField;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
@@ -27,7 +27,7 @@ public class UserFields implements DialogFields {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
password_visible = !password_visible;
|
||||
tfPassword.setEchoChar(password_visible ? unmask : mask);
|
||||
bPasswordVisibility.setIcon(CommonUtils.getIcon("/icons/" + (password_visible ? "Show" : "Hide") + "Password.png"));
|
||||
bPasswordVisibility.setIcon(Utils_.getIcon("/icons/" + (password_visible ? "Show" : "Hide") + "Password.png"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user