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

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

@@ -1,5 +1,4 @@
package _VisualDVM;
import Common.Current_;
import Common.Database.Tables.DataSet;
import Common.Mode;
import Common.Passes.Pass;
@@ -9,7 +8,6 @@ import Common.Visual.UI_;
import Visual_DVM_2021.Passes.PassCode;
import _VisualDVM.GlobalData.Account.Account;
import _VisualDVM.GlobalData.Account.AccountRole;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.DBSetting;
import _VisualDVM.GlobalData.Settings.SettingName;
import _VisualDVM.ProjectData.ProjectView;
@@ -155,7 +153,6 @@ public class Global {
//-
public static void FinishApplication() {
try {
// if (Utils_.db != null) Utils_.db.Disconnect();
mainModule.DeactivateDB();
if (componentsServer.db != null)
componentsServer.db.Disconnect();
@@ -228,8 +225,6 @@ public class Global {
//--
public static void NormalMode(int port) throws Exception {
mainModule= new MainModule();
//-------------------------------->>
//-------------------------------->>
UI_.active = true;
UI_.setTheme(new LightSPFEditorTheme());
@@ -254,9 +249,9 @@ public class Global {
//единственное меню до остальных.
UI_.menuBars.put(ComponentsSet.class, new ComponentsMenuBar());
Components = new ComponentsSet();
Current_.set(Current.ProjectView, ProjectView.Files);
mainModule.set(Current.ProjectView, ProjectView.Files);
Components.put(ComponentType.Visualiser, visualiser = new Visualiser());
Components.put(ComponentType.Sapfor_F, (Component) Current_.set(Current.Sapfor, new Sapfor_F()));
Components.put(ComponentType.Sapfor_F, (Component) mainModule.set(Current.Sapfor, new Sapfor_F()));
Components.put(ComponentType.Visualizer_2, visualizer_2);
Components.put(ComponentType.PerformanceAnalyzer, performanceAnalyzer = new PerformanceAnalyzer());
Components.put(ComponentType.Instruction, new Instruction());
@@ -288,11 +283,8 @@ public class Global {
}
} while (flag);
}
//---
mainModule.ActivateDB();
// ActivateDB(); //тут current getAccount; роль по умолчанию всегда неизвестна.
///--------------
Current_.set(Current.Account, new Account() {
mainModule.set(Current.Account, new Account() {
{
name = "M";
email = "vmk-post@yandex.ru";
@@ -311,14 +303,13 @@ public class Global {
if (mainModule.getDb().settings.get(SettingName.AutoTestsLoad).toBoolean())
Pass.passes.get(PassCode.SynchronizeTests).Do();
Pass.CheckAllStats();
Current.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
Global.mainModule.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
UI.CreateMenus();
UI.CreateWindows();
}
public static void ServerMode() throws Exception {
CheckServerDirectories();
CreateLogAtComponentsPath();
Utils.createEmptyFile("kek");
componentsServer = new ComponentsServer();
componentsServer.ActivateDB();
componentsServer.Start();