рефакторинг. переносил текущие объекты в другое место

This commit is contained in:
2024-10-13 22:08:13 +03:00
parent 09b64218bd
commit 6afa2dc892
240 changed files with 1472 additions and 1518 deletions

View File

@@ -20,7 +20,7 @@ public class Module extends ModuleAnchestor {
}
@Override
public boolean isVisible() {
return Current.HasMakefile() && (makefile_id == Current.getMakefile().id);
return Global.mainModule.matchCurrentID(Current.Makefile, makefile_id);
}
@Override
public boolean isSelected() {

View File

@@ -3,6 +3,7 @@ import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.Controls.StyledTextComboBox;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.Module.Module;
@@ -27,7 +28,7 @@ public class ModuleAnchestorFields implements DialogFields {
//считаем что машина есть.
public ModuleAnchestorFields() {
//-
LinkedHashMap<Integer, Compiler> compilers = Current.getMachine().getCompilers();
LinkedHashMap<Integer, Compiler> compilers = Global.mainModule.getMachine().getCompilers();
compilers.values().forEach(compiler -> cbCompilers.addItem(compiler));
bHelp.addActionListener(e -> {
if (cbCompilers.getSelectedItem() != null) {
@@ -53,7 +54,7 @@ public class ModuleAnchestorFields implements DialogFields {
public void setListeners(ModuleAnchestor target) {
boolean linker = (target instanceof Makefile);
LanguageName languageName = linker ?
(Current.HasProject() ? Current.getProject().languageName : LanguageName.n) :
(Global.mainModule.HasProject() ? Global.mainModule.getProject().languageName : LanguageName.n) :
((Module) target).language;
cbCompilers.addActionListener(e -> {
if (cbCompilers.getSelectedItem() instanceof Compiler) {

View File

@@ -3,6 +3,7 @@ import Common.CommonConstants;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.Makefile.Makefile;
@@ -101,7 +102,7 @@ public class ModuleAnchestorForm<T extends ModuleAnchestor> extends DBObjectDial
}
@Override
public void ProcessResult() {
Result.machine_id = Current.getMachine().id;
Result.machine_id = Global.mainModule.getMachine().id;
Compiler compiler = (Compiler) fields.cbCompilers.getSelectedItem();
Result.compiler_id = (compiler != null) ? compiler.id : CommonConstants.Nan;
Result.command = command;