ext
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
- if (Current_.Check(Log, currentName())) {
- target = (C) Current_.get(currentName());
+ if (Global.mainModule.Check(Log, currentName())) {
+ target = (C) Global.mainModule.get(currentName());
return true;
}
return false;
diff --git a/src/Visual_DVM_2021/Passes/SilentSapforPass.java b/src/Visual_DVM_2021/Passes/SilentSapforPass.java
index 4e35c5db..77a308cd 100644
--- a/src/Visual_DVM_2021/Passes/SilentSapforPass.java
+++ b/src/Visual_DVM_2021/Passes/SilentSapforPass.java
@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
public class SilentSapforPass extends CurrentProjectPass {
protected Sapfor sapfor;
@@ -16,7 +17,7 @@ public class SilentSapforPass extends CurrentProjectPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
- return super.canStart(args) && ((sapfor = Current.getSapfor()) != null);
+ return super.canStart(args) && ((sapfor = Global.mainModule.getSapfor()) != null);
}
@Override
protected void performPreparation() throws Exception {
diff --git a/src/Visual_DVM_2021/Passes/StartTestingPackage.java b/src/Visual_DVM_2021/Passes/StartTestingPackage.java
index 7d01f919..3103fd6f 100644
--- a/src/Visual_DVM_2021/Passes/StartTestingPackage.java
+++ b/src/Visual_DVM_2021/Passes/StartTestingPackage.java
@@ -22,11 +22,11 @@ public abstract class StartTestingPackage extends Publ
protected abstract Current getCurrentName();
@Override
protected boolean canStart(Object... args) throws Exception {
- if (!Current.getAccount().CheckRegistered(Log)) {
+ if (!Global.mainModule.getAccount().CheckRegistered(Log)) {
return false;
}
- if (Current_.Check(Log, getCurrentName())) {
- target = (P) Current_.get(getCurrentName());
+ if (Global.mainModule.Check(Log, getCurrentName())) {
+ target = (P) Global.mainModule.get(getCurrentName());
//-
if (!target.state.equals(TasksPackageState.Draft)) {
Log.Writeln_("Возможно запустить только пакет, готовящийся к публикации!");
diff --git a/src/Visual_DVM_2021/Passes/Transformation.java b/src/Visual_DVM_2021/Passes/Transformation.java
index bf8275cc..a64cbe7d 100644
--- a/src/Visual_DVM_2021/Passes/Transformation.java
+++ b/src/Visual_DVM_2021/Passes/Transformation.java
@@ -1,6 +1,7 @@
package Visual_DVM_2021.Passes;
import Common.Current_;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.PassMenuItem;
import _VisualDVM.Visual.UI;
import _VisualDVM.ProjectData.Project.db_project_info;
@@ -39,7 +40,7 @@ public class Transformation extends CurrentProjectPass {
@Override
protected void showFinish() throws Exception {
super.showFinish();
- Current_.set(Current.ProjectView, ProjectView.Files);
+ Global.mainModule.set(Current.ProjectView, ProjectView.Files);
UI.getMainWindow().getProjectWindow().ShowProjectView();
}
@Override
diff --git a/src/Visual_DVM_2021/Passes/UI/CopyProjectFields.java b/src/Visual_DVM_2021/Passes/UI/CopyProjectFields.java
index 8175dd68..80e0a9bb 100644
--- a/src/Visual_DVM_2021/Passes/UI/CopyProjectFields.java
+++ b/src/Visual_DVM_2021/Passes/UI/CopyProjectFields.java
@@ -3,6 +3,7 @@ import _VisualDVM.Current;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.Windows.Dialog.DialogFields;
import Common.Visual.Windows.Dialog.VDirectoryChooser;
+import _VisualDVM.Global;
import javax.swing.*;
import java.awt.*;
@@ -17,7 +18,7 @@ public class CopyProjectFields implements DialogFields {
private JPanel content;
private JButton bBrowse;
public CopyProjectFields() {
- tfName.setText(Current.getProject().name + "_copy");
+ tfName.setText(Global.mainModule.getProject().name + "_copy");
bBrowse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
diff --git a/src/Visual_DVM_2021/Passes/VariantsMassPass.java b/src/Visual_DVM_2021/Passes/VariantsMassPass.java
index 7f3a116d..8d7d3ec9 100644
--- a/src/Visual_DVM_2021/Passes/VariantsMassPass.java
+++ b/src/Visual_DVM_2021/Passes/VariantsMassPass.java
@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Variants.ParallelVariant;
@@ -13,7 +14,7 @@ public abstract class VariantsMassPass extends CurrentProjectPass {
}
@Override
public void Interrupt() throws Exception {
- Current.getSapfor().Interrupt();
+ Global.mainModule.getSapfor().Interrupt();
}
@Override
protected boolean canStart(Object... args) throws Exception {
@@ -43,7 +44,7 @@ public abstract class VariantsMassPass extends CurrentProjectPass {
@Override
protected void performFinish() throws Exception {
//распаковку соо делаем только 1 раз. после всей массы вариантов.
- Sapfor sapfor = Current.getSapfor();
+ Sapfor sapfor = Global.mainModule.getSapfor();
target.unpackMessagesAndLog(sapfor.getOutputMessage(), sapfor.getOutput());
}
@Override
@@ -59,7 +60,7 @@ public abstract class VariantsMassPass extends CurrentProjectPass {
UI.getMainWindow().getProjectWindow().FocusFile();
}
//-
- if (Current.HasFile())
- Current.getFile().form.ShowMessages();
+ if (Global.mainModule.HasFile())
+ Global.mainModule.getFile().form.ShowMessages();
}
}
diff --git a/src/_VisualDVM/Current.java b/src/_VisualDVM/Current.java
index 26a2d6a5..3a1da2a4 100644
--- a/src/_VisualDVM/Current.java
+++ b/src/_VisualDVM/Current.java
@@ -203,234 +203,4 @@ public enum Current implements Current_ {
return "";
}
}
- //------------------------------------------------------------------------------------->>
- public static boolean HasProject() {
- return Current_.get(Project) != null;
- }
- public static boolean HasFile() {
- return Current_.get(File) != null;
- }
- public static boolean HasSelectedFile() {
- return Current_.get(SelectedFile) != null;
- }
- public static boolean HasAccount() {
- return Current_.get(Account) != null;
- }
- public static boolean HasMachine() {
- return Current_.get(Machine) != null;
- }
- public static boolean HasUser() {
- return Current_.get(User) != null;
- }
- public static boolean HasCompiler() {
- return Current_.get(Compiler) != null;
- }
- public static boolean HasRemoteFile() {
- return Current_.get(RemoteFile) != null;
- }
- public static boolean HasMakefile() {
- return Current_.get(Makefile) != null;
- }
- public static boolean HasRunConfiguration() {
- return Current_.get(RunConfiguration) != null;
- }
- public static boolean HasCompilationTask() {
- return Current_.get(CompilationTask) != null;
- }
- public static boolean HasRunTask() {
- return Current_.get(RunTask) != null;
- }
- public static boolean HasPassForm() {
- return Current_.get(PassForm) != null;
- }
- public static boolean HasProjectView() {
- return Current_.get(ProjectView) != null;
- }
- public static SapforSettings getSapforSettings() {
- return (SapforSettings) Current_.get(SapforSettings);
- }
- public static boolean HasSapforSettings() {
- return Current_.get(SapforSettings) != null;
- }
- public static db_project_info getProject() {
- return (db_project_info) Current_.get(Project);
- }
- public static DBProjectFile getFile() {
- return (DBProjectFile) Current_.get(File);
- }
- public static _VisualDVM.Repository.Component.Component getComponent() {
- return (_VisualDVM.Repository.Component.Component) Current_.get(Component);
- }
- public static _VisualDVM.Repository.BugReport.BugReport getBugReport() {
- return (BugReport) Current_.get(BugReport);
- }
- public static db_project_info getRoot() {
- return (db_project_info) Current_.get(Root);
- }
- public static boolean HasRoot() {
- return Current_.get(Root) != null;
- }
- public static db_project_info getVersion() {
- return (db_project_info) Current_.get(Version);
- }
- public static Account getAccount() {
- return (Account) Current_.get(Account);
- }
- public static boolean HasSubscriber() {
- return Current_.get(Current.Subscriber) != null;
- }
- public static _VisualDVM.Repository.Subscribes.Subscriber getSubscriber() {
- return (Subscriber) Current_.get(Current.Subscriber);
- }
- public static Machine getMachine() {
- return (Machine) Current_.get(Current.Machine);
- }
- public static User getUser() {
- return (User) Current_.get(Current.User);
- }
- public static Compiler getCompiler() {
- return (Compiler) Current_.get(Current.Compiler);
- }
- public static CompilationTask getCompilationTask() {
- return (CompilationTask) Current_.get(Current.CompilationTask);
- }
- public static RunTask getRunTask() {
- return (RunTask) Current_.get(Current.RunTask);
- }
- public static RemoteFile getRemoteFile() {
- return (RemoteFile) Current_.get(Current.RemoteFile);
- }
- public static Makefile getMakefile() {
- return (Makefile) Current_.get(Current.Makefile);
- }
- public static Module getModule() {
- return (Module) Current_.get(Current.Module);
- }
- public static RunConfiguration getRunConfiguration() {
- return (RunConfiguration) Current_.get(Current.RunConfiguration);
- }
- public static _VisualDVM.Repository.Component.Sapfor.Sapfor getSapfor() {
- return (_VisualDVM.Repository.Component.Sapfor.Sapfor) Current_.get(Current.Sapfor);
- }
- public static boolean HasGroup() {
- return Current_.get(Current.Group) != null;
- }
- public static _VisualDVM.TestingSystem.Common.Group.Group getGroup() {
- return (_VisualDVM.TestingSystem.Common.Group.Group) Current_.get(Current.Group);
- }
- public static boolean HasConfiguration() {
- return Current_.get(Current.DVMConfiguration) != null;
- }
- public static DVMConfiguration getDVMConfiguration() {
- return (DVMConfiguration) Current_.get(Current.DVMConfiguration);
- }
- public static SapforConfiguration getSapforConfiguration() {
- return (_VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) Current_.get(Current.SapforConfiguration);
- }
- public static Test getTest() {
- return (_VisualDVM.TestingSystem.Common.Test.Test) Current_.get(Current.Test);
- }
- public static boolean HasTest() {
- return Current_.get(Current.Test) != null;
- }
- public static boolean HasVersion() {
- return Current_.get(Current.Version) != null;
- }
- public static RemoteFile getComponentServerBackup() {
- return (RemoteFile) Current_.get(Current.ComponentServerBackup);
- }
- public static boolean HasComponentServerBackup() {
- return Current_.get(Current.ComponentServerBackup) != null;
- }
- public static DefaultMutableTreeNode getProjectNode() {
- return (DefaultMutableTreeNode) Current_.get(Current.ProjectNode);
- }
- public static DefaultMutableTreeNode getProjectCurrentParentNode() {
- DefaultMutableTreeNode node = Current.getProjectNode();
- //если в дереве еще никто не выделялся, берем корень.
- if (node == null)
- return Current.getProject().filesTreeRoot;
- return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
- }
- public static File getSelectedDirectory() {
- return (File) Current_.get(Current.SelectedDirectory);
- }
- public static DBProjectFile getSelectedFile() {
- return (DBProjectFile) Current_.get(Current.SelectedFile);
- }
- public static boolean HasBugReport() {
- return Current_.get(Current.BugReport) != null;
- }
- public static PassForm getPassForm() {
- return (Visual_DVM_2021.Passes.UI.PassForm) Current_.get(Current.PassForm);
- }
- public static ParallelRegion getParallelRegion() {
- return (ParallelRegion) Current_.get(Current.ParallelRegion);
- }
- public static boolean HasParallelRegion() {
- return Current_.get(Current.ParallelRegion) != null;
- }
- public static boolean HasFunction() {
- return Current_.get(Current.Function) != null;
- }
- public static boolean HasSelectedFunction() {
- return Current_.get(Current.SelectedFunction) != null;
- }
- public static FuncInfo getFunction() {
- return (FuncInfo) Current_.get(Current.Function);
- }
- public static FuncInfo getSelectionFunction() {
- return (FuncInfo) Current_.get(Current.SelectedFunction);
- }
- public static boolean HasScenario() {
- return Current_.get(Current.Scenario) != null;
- }
- public static db_project_info getPackageVersion() {
- return (db_project_info) Current_.get(Current.PackageVersion);
- }
- public static boolean HasPackageVersion() {
- return Current_.get(Current.PackageVersion) != null;
- }
- public static boolean HasSapforConfiguration() {
- return Current_.get(Current.SapforConfiguration) != null;
- }
- public static _VisualDVM.ProjectData.ProjectView getProjectView() {
- return (_VisualDVM.ProjectData.ProjectView) Current_.get(ProjectView);
- }
- public static boolean HasSapforProfile() {
- return Current_.get(Current.SapforProfile) != null;
- }
- public static _VisualDVM.GlobalData.SapforProfile.SapforProfile getSapforProfile() {
- return (_VisualDVM.GlobalData.SapforProfile.SapforProfile) Current_.get(Current.SapforProfile);
- }
- public static boolean HasServerSapfor() {
- return Current_.get(Current.ServerSapfor) != null;
- }
- public static _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
- return (_VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) Current_.get(Current.ServerSapfor);
- }
- public static boolean HasSubscriberWorkspace() {
- return Current_.get(Current.SubscriberWorkspace) != null;
- }
- public static _VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace getSubscriberWorkspace() {
- return (_VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace) Current_.get(Current.SubscriberWorkspace);
- }
- public static boolean HasDVMPackage() {
- return Current_.get(Current.DVMPackage) != null;
- }
- public static _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage getDVMPackage() {
- return (_VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage) Current_.get(Current.DVMPackage);
- }
- public static boolean HasSapforPackage() {
- return Current_.get(Current.SapforPackage) != null;
- }
- public static _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage getSapforPackage() {
- return (_VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage) Current_.get(Current.SapforPackage);
- }
- public static boolean HasDVMRunTask() {
- return Current_.get(Current.DVMRunTask) != null;
- }
- public static _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask getDVMRunTask() {
- return (_VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask) Current_.get(Current.DVMRunTask);
- }
}
diff --git a/src/_VisualDVM/Global.java b/src/_VisualDVM/Global.java
index f1b60e99..a0149fc9 100644
--- a/src/_VisualDVM/Global.java
+++ b/src/_VisualDVM/Global.java
@@ -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();
diff --git a/src/_VisualDVM/GlobalData/Compiler/Compiler.java b/src/_VisualDVM/GlobalData/Compiler/Compiler.java
index c334c821..168f4a17 100644
--- a/src/_VisualDVM/GlobalData/Compiler/Compiler.java
+++ b/src/_VisualDVM/GlobalData/Compiler/Compiler.java
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Compiler;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.iDBObject;
+import _VisualDVM.Global;
import _VisualDVM.Validators.DVMHelpParser;
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironmentsSet;
import _VisualDVM.GlobalData.CompilerOption.CompilerOptionsSet;
@@ -85,7 +86,7 @@ public class Compiler extends iDBObject {
}
@Override
public boolean isVisible() {
- return Current.HasMachine() && Current.getMachine().id == machine_id;
+ return Global.mainModule.matchCurrentID(Current.Machine, machine_id);
}
//todo понять как извлекать версию чтобы выдавать нормальную инфу.
@Override
diff --git a/src/_VisualDVM/GlobalData/Compiler/CompilersDBTable.java b/src/_VisualDVM/GlobalData/Compiler/CompilersDBTable.java
index f107156a..2b38876d 100644
--- a/src/_VisualDVM/GlobalData/Compiler/CompilersDBTable.java
+++ b/src/_VisualDVM/GlobalData/Compiler/CompilersDBTable.java
@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.DataSetControlForm;
+import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.Utils;
@@ -101,7 +102,7 @@ public class CompilersDBTable extends iDBTable {
}
@Override
public void ProcessResult() {
- Result.machine_id = Current.getMachine().id;
+ Result.machine_id = Global.mainModule.getMachine().id;
Result.description = fields.tfDescription.getText();
Result.call_command = fields.tfCallCommand.getText();
Result.help_command = fields.tfHelpCommand.getText();
diff --git a/src/_VisualDVM/GlobalData/Compiler/UI/CompilerFields.java b/src/_VisualDVM/GlobalData/Compiler/UI/CompilerFields.java
index 07d3eb58..74348f3b 100644
--- a/src/_VisualDVM/GlobalData/Compiler/UI/CompilerFields.java
+++ b/src/_VisualDVM/GlobalData/Compiler/UI/CompilerFields.java
@@ -4,6 +4,7 @@ import _VisualDVM.Current;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.Windows.Dialog.DialogFields;
import Common.Visual.Windows.Dialog.VDirectoryChooser;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.Machine.MachineType;
import Visual_DVM_2021.Passes.PassCode;
@@ -31,13 +32,13 @@ public class CompilerFields implements DialogFields {
CompilerType type = (CompilerType) cbCompilerType.getSelectedItem();
if (type == CompilerType.dvm) {
String dst = null;
- if (Current.getMachine().type.equals(MachineType.Local)) {
+ if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
File file = directoryChooser.ShowDialog();
if (file != null)
dst = file.getAbsolutePath();
} else {
if (Pass.passes.get(PassCode.SelectRemoteFile).Do(true))
- dst = Current.getRemoteFile().full_name;
+ dst = Global.mainModule.getRemoteFile().full_name;
}
if (dst != null)
tfHome.setText(dst);
diff --git a/src/_VisualDVM/GlobalData/DVMParameter/DVMParameterDBTable.java b/src/_VisualDVM/GlobalData/DVMParameter/DVMParameterDBTable.java
index e0000fe9..afb7e2f1 100644
--- a/src/_VisualDVM/GlobalData/DVMParameter/DVMParameterDBTable.java
+++ b/src/_VisualDVM/GlobalData/DVMParameter/DVMParameterDBTable.java
@@ -86,8 +86,8 @@ public class DVMParameterDBTable extends iDBTable {
}
@Override
public void ProcessResult() {
- Result.machine_id = Current.getMachine().id;
- Result.run_configuration_id = Current.getRunConfiguration().id;
+ Result.machine_id = Global.mainModule.getMachine().id;
+ Result.run_configuration_id = Global.mainModule.getRunConfiguration().id;
Result.name = (String) fields.cbName.getSelectedItem();
Result.value = fields.tfValue.getText();
}
diff --git a/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValue.java b/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValue.java
index cc5cab4f..d4c3fe96 100644
--- a/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValue.java
+++ b/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValue.java
@@ -3,6 +3,7 @@ import Common.CommonConstants;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.iDBObject;
+import _VisualDVM.Global;
public class EnvironmentValue extends iDBObject {
public String name = "";
public String value = "";
@@ -10,7 +11,7 @@ public class EnvironmentValue extends iDBObject {
public int run_configuration_id = CommonConstants.Nan;
@Override
public boolean isVisible() {
- return Current.HasRunConfiguration() && (run_configuration_id == Current.getRunConfiguration().id);
+ return Global.mainModule.matchCurrentID(Current.RunConfiguration, run_configuration_id);
}
@Override
public String toString() {
diff --git a/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValuesDBTable.java b/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValuesDBTable.java
index ec523d9e..ede6cdbd 100644
--- a/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValuesDBTable.java
+++ b/src/_VisualDVM/GlobalData/EnvironmentValue/EnvironmentValuesDBTable.java
@@ -53,8 +53,8 @@ public class EnvironmentValuesDBTable extends iDBTable {
}
@Override
public void ProcessResult() {
- Result.machine_id = Current.getMachine().id;
- Result.run_configuration_id = Current.getRunConfiguration().id;
+ Result.machine_id = Global.mainModule.getMachine().id;
+ Result.run_configuration_id = Global.mainModule.getRunConfiguration().id;
Result.name = (String) fields.cbName.getSelectedItem();
Result.value = fields.tfValue.getText();
}
diff --git a/src/_VisualDVM/GlobalData/GlobalDatabase.java b/src/_VisualDVM/GlobalData/GlobalDatabase.java
index 42098e1a..9675b8d2 100644
--- a/src/_VisualDVM/GlobalData/GlobalDatabase.java
+++ b/src/_VisualDVM/GlobalData/GlobalDatabase.java
@@ -84,11 +84,11 @@ public class GlobalDatabase extends VisualiserDatabase {
//---------------------------------------------------------------------------------
@Override
public void Init() throws Exception {
- Current_.set(Current.Account,
+ Global.mainModule.set(Current.Account,
accounts.Data.isEmpty() ? Insert(new Account()) :
accounts.getFirstRecord()
);
- Current_.set(Current.Credentials,
+ Global.mainModule.set(Current.Credentials,
credentials.Data.isEmpty() ? Insert(new Credentials()) :
credentials.getFirstRecord());
//настройки компонент
@@ -101,17 +101,17 @@ public class GlobalDatabase extends VisualiserDatabase {
}
public void SaveCredentials(){
try {
- Credentials credentials = (Credentials) Current_.get(Current.Credentials);
- if (Current.HasMachine())
- credentials.machine_id = Current.getMachine().id;
- if (Current.HasUser())
- credentials.user_id = Current.getUser().id;
- if (Current.HasCompiler())
- credentials.compiler_id = Current.getCompiler().id;
- if (Current.HasMakefile())
- credentials.makefile_id = Current.getMakefile().id;
- if (Current.HasRunConfiguration())
- credentials.runconfiguration_id = Current.getRunConfiguration().id;
+ Credentials credentials = Global.mainModule.getCredentials();
+ if (Global.mainModule.HasMachine())
+ credentials.machine_id = Global.mainModule.getMachine().id;
+ if (Global.mainModule.HasUser())
+ credentials.user_id = Global.mainModule.getUser().id;
+ if (Global.mainModule.HasCompiler())
+ credentials.compiler_id = Global.mainModule.getCompiler().id;
+ if (Global.mainModule.HasMakefile())
+ credentials.makefile_id = Global.mainModule.getMakefile().id;
+ if (Global.mainModule.HasRunConfiguration())
+ credentials.runconfiguration_id = Global.mainModule.getRunConfiguration().id;
Update(credentials);
}
catch (Exception ex){
@@ -120,7 +120,7 @@ public class GlobalDatabase extends VisualiserDatabase {
}
public void UpdateCredentials() {
try {
- Update((DBObject) Current_.get(Current.Credentials));
+ Update(Global.mainModule.getCredentials());
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}
diff --git a/src/_VisualDVM/GlobalData/Makefile/Makefile.java b/src/_VisualDVM/GlobalData/Makefile/Makefile.java
index cd9d9e2c..d381e396 100644
--- a/src/_VisualDVM/GlobalData/Makefile/Makefile.java
+++ b/src/_VisualDVM/GlobalData/Makefile/Makefile.java
@@ -23,7 +23,7 @@ public class Makefile extends ModuleAnchestor {
}
@Override
public boolean isVisible() {
- return Current.HasMachine() && (machine_id == Current.getMachine().id);
+ return Global.mainModule.matchCurrentID(Current.Machine, machine_id);
}
public LinkedHashMap getActiveModules() {
return Global.mainModule.getDb().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));
@@ -177,26 +177,26 @@ public class Makefile extends ModuleAnchestor {
Log.Writeln("Линковщик не выбран");
else {
if (linker.type.equals(CompilerType.dvm)) {
- if (!Current.getProject().languageName.getDVMLink().equals(command))
+ if (!Global.mainModule.getProject().languageName.getDVMLink().equals(command))
Log.Writeln("команда линковки " +
Utils_.Quotes(command) +
" не соответствует языку текущего проекта "
- + Current.getProject().languageName.getDescription() + "\n" +
- "Используйте команду " + Current.getProject().languageName.getDVMLink());
+ + Global.mainModule.getProject().languageName.getDescription() + "\n" +
+ "Используйте команду " + Global.mainModule.getProject().languageName.getDVMLink());
}
}
LinkedHashMap modules = getModules();
for (Module module : modules.values()) {
- boolean isMain = module.language.equals(Current.getProject().languageName);
+ boolean isMain = module.language.equals(Global.mainModule.getProject().languageName);
if (module.isSelected()) {
if (module.getCompiler() == null)
Log.Writeln("Не назначен компилятор для языка " + module.language.getDescription());
- if (isMain && Current.getProject().getPrograms().get(module.language).isEmpty())
+ if (isMain && Global.mainModule.getProject().getPrograms().get(module.language).isEmpty())
Log.Writeln("В текущем проекте не найдено ни одной программы на языке " + module.language.getDescription());
} else {
if (isMain)
Log.Writeln("Языковой модуль, соответствующий языку текущего проекта " +
- Current.getProject().languageName.getDescription() + " не помечен как активный.");
+ Global.mainModule.getProject().languageName.getDescription() + " не помечен как активный.");
}
}
}
diff --git a/src/_VisualDVM/GlobalData/Module/Module.java b/src/_VisualDVM/GlobalData/Module/Module.java
index 9d68988f..07c2fd84 100644
--- a/src/_VisualDVM/GlobalData/Module/Module.java
+++ b/src/_VisualDVM/GlobalData/Module/Module.java
@@ -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() {
diff --git a/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorFields.java b/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorFields.java
index f2230672..08db2bff 100644
--- a/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorFields.java
+++ b/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorFields.java
@@ -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 compilers = Current.getMachine().getCompilers();
+ LinkedHashMap 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) {
diff --git a/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorForm.java b/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorForm.java
index 8784beb1..da0d30ff 100644
--- a/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorForm.java
+++ b/src/_VisualDVM/GlobalData/Module/UI/ModuleAnchestorForm.java
@@ -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 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;
diff --git a/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFileChooser.java b/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFileChooser.java
index c0867ec5..21440fad 100644
--- a/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFileChooser.java
+++ b/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFileChooser.java
@@ -4,6 +4,7 @@ import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.Windows.Dialog.Dialog;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import Visual_DVM_2021.Passes.SSH.ConnectionPass;
import com.jcraft.jsch.ChannelSftp.LsEntry;
@@ -36,11 +37,11 @@ public class RemoteFileChooser extends Dialog {
}
}
public void ShowCurrentRemoteFile() {
- fields.lCurrentFile.setText(Current.getRemoteFile().full_name);
+ fields.lCurrentFile.setText(Global.mainModule.getRemoteFile().full_name);
}
public void Refresh(String path) {
try {
- Current_.set(Current.RemoteFile, null);//сброс текущего файла перед любым обновлением.
+ Global.mainModule.set(Current.RemoteFile, null);//сброс текущего файла перед любым обновлением.
fields.lCurrentFile.setText("?");
//-------------------------------------------------------------------
root_file = new RemoteFile(path, true);
@@ -89,8 +90,8 @@ public class RemoteFileChooser extends Dialog {
@Override
public void validateFields() {
String target_name = target_is_directory ? "папка" : "файл";
- if (Current.HasRemoteFile()) {
- if (target_is_directory != Current.getRemoteFile().isDirectory)
+ if (Global.mainModule.HasRemoteFile()) {
+ if (target_is_directory != Global.mainModule.getRemoteFile().isDirectory)
Log.Writeln("Выбранный объект - не " + target_name);
} else Log.Writeln(target_name + " не выбран(а)");
}
diff --git a/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFilesTree.java b/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFilesTree.java
index 17a5f78d..54fd4854 100644
--- a/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFilesTree.java
+++ b/src/_VisualDVM/GlobalData/RemoteFile/UI/RemoteFilesTree.java
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.RemoteFile.UI;
import _VisualDVM.Current;
import Common.Visual.Trees.DataTree;
import Common.Visual.Trees.TreeRenderers;
+import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
public class RemoteFilesTree extends DataTree {
public RemoteFilesTree() {
@@ -21,8 +22,8 @@ public class RemoteFilesTree extends DataTree {
}
@Override
public void LeftMouseAction2() {
- if (Current.HasRemoteFile() && Current.getRemoteFile().isDirectory()) {
- UI.getRemoteFileChooser().Refresh(Current.getRemoteFile().full_name);
+ if (Global.mainModule.HasRemoteFile() && Global.mainModule.getRemoteFile().isDirectory()) {
+ UI.getRemoteFileChooser().Refresh(Global.mainModule.getRemoteFile().full_name);
}
}
}
diff --git a/src/_VisualDVM/GlobalData/RunConfiguration/RunConfiguration.java b/src/_VisualDVM/GlobalData/RunConfiguration/RunConfiguration.java
index 6c63c592..66b6edef 100644
--- a/src/_VisualDVM/GlobalData/RunConfiguration/RunConfiguration.java
+++ b/src/_VisualDVM/GlobalData/RunConfiguration/RunConfiguration.java
@@ -183,7 +183,7 @@ public class RunConfiguration extends iDBObject {
}
@Override
public boolean isVisible() {
- return Current.HasMachine() && (machine_id == Current.getMachine().id);
+ return Global.mainModule.matchCurrentID(Current.Machine, machine_id);
}
@Override
public String getFKName() {
diff --git a/src/_VisualDVM/GlobalData/RunConfiguration/RunConfigurationsDBTable.java b/src/_VisualDVM/GlobalData/RunConfiguration/RunConfigurationsDBTable.java
index ce054ef0..6fcf87d6 100644
--- a/src/_VisualDVM/GlobalData/RunConfiguration/RunConfigurationsDBTable.java
+++ b/src/_VisualDVM/GlobalData/RunConfiguration/RunConfigurationsDBTable.java
@@ -65,11 +65,11 @@ public class RunConfigurationsDBTable extends iDBTable {
fields.maxMatrixPanel.add(fields.maxMatrixBar = new MatrixBar(Result.maxMatrix));
//------------------------------------------->>>
if (!edit)
- fields.sMaxDim.setValue(Current.getProject().maxdim);
+ fields.sMaxDim.setValue(Global.mainModule.getProject().maxdim);
}
@Override
public void ProcessResult() {
- Result.machine_id = Current.getMachine().id;
+ Result.machine_id = Global.mainModule.getMachine().id;
Result.LauncherCall = fields.cbLauncherCall.getSelectedItem().toString();
Result.LauncherOptions = (String) fields.cbLaunchOptions.getSelectedItem();
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
diff --git a/src/_VisualDVM/GlobalData/SapforProfileSetting/SapforProfileSetting.java b/src/_VisualDVM/GlobalData/SapforProfileSetting/SapforProfileSetting.java
index 9011c0a0..71084d90 100644
--- a/src/_VisualDVM/GlobalData/SapforProfileSetting/SapforProfileSetting.java
+++ b/src/_VisualDVM/GlobalData/SapforProfileSetting/SapforProfileSetting.java
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.SapforProfileSetting;
import Common.CommonConstants;
import _VisualDVM.Current;
import Common.Database.Objects.iDBObject;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.Settings.SettingName;
import com.sun.org.glassfish.gmbal.Description;
public class SapforProfileSetting extends iDBObject {
@@ -13,6 +14,6 @@ public class SapforProfileSetting extends iDBObject {
public int sapforprofile_id = CommonConstants.Nan;
@Override
public boolean isVisible() {
- return Current.HasSapforProfile() && Current.getSapforProfile().id == sapforprofile_id;
+ return Global.mainModule.matchCurrentID(Current.SapforProfile, sapforprofile_id);
}
}
diff --git a/src/_VisualDVM/GlobalData/Tasks/CompilationTask/CompilationTask.java b/src/_VisualDVM/GlobalData/Tasks/CompilationTask/CompilationTask.java
index c9bba1c1..be264911 100644
--- a/src/_VisualDVM/GlobalData/Tasks/CompilationTask/CompilationTask.java
+++ b/src/_VisualDVM/GlobalData/Tasks/CompilationTask/CompilationTask.java
@@ -74,10 +74,10 @@ public class CompilationTask extends Task {
@Override
public boolean isVisible() {
return
- Current_.matchCurrentID(Current.Machine, machine_id) &&
- Current_.matchCurrentID(Current.User, user_id) &&
- Current.HasProject() &&
- belongsToProject(Current.getProject());
+ Global.mainModule.matchCurrentID(Current.Machine, machine_id) &&
+ Global.mainModule.matchCurrentID(Current.User, user_id) &&
+ Global.mainModule.HasProject() &&
+ belongsToProject(Global.mainModule.getProject());
}
public Makefile getMakefile() {
return Global.mainModule.getDb().getById(Makefile.class, makefile_id);
diff --git a/src/_VisualDVM/GlobalData/Tasks/Passes/TaskLocalPass.java b/src/_VisualDVM/GlobalData/Tasks/Passes/TaskLocalPass.java
index ac73b441..4370f43b 100644
--- a/src/_VisualDVM/GlobalData/Tasks/Passes/TaskLocalPass.java
+++ b/src/_VisualDVM/GlobalData/Tasks/Passes/TaskLocalPass.java
@@ -1,6 +1,7 @@
package _VisualDVM.GlobalData.Tasks.Passes;
import Common.Utils.Utils_;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.Tasks.Supervisor.TaskSupervisor;
import Visual_DVM_2021.Passes.ProcessPass;
public abstract class TaskLocalPass extends ProcessPass {
@@ -26,6 +27,6 @@ public abstract class TaskLocalPass extends ProcessPas
}
@Override
public void Interrupt() throws Exception {
- Current.getProject().CreateInterruptFile();
+ Global.mainModule.getProject().CreateInterruptFile();
}
}
diff --git a/src/_VisualDVM/GlobalData/Tasks/RunTask/RunTask.java b/src/_VisualDVM/GlobalData/Tasks/RunTask/RunTask.java
index b4282aba..7925f2b8 100644
--- a/src/_VisualDVM/GlobalData/Tasks/RunTask/RunTask.java
+++ b/src/_VisualDVM/GlobalData/Tasks/RunTask/RunTask.java
@@ -53,13 +53,13 @@ public class RunTask extends Task {
@Override
public boolean isVisible() {
return
- Current_.matchCurrentID(Current.Machine, machine_id) &&
- Current_.matchCurrentID(Current.User, user_id) &&
- Current_.matchCurrentID(Current.RunConfiguration, run_configuration_id) &&
- Current.HasProject() &&
- belongsToProject(Current.getProject()) &&
- Current.HasCompilationTask() &&
- compilation_task_id == Current.getCompilationTask().id;
+ Global.mainModule.matchCurrentID(Current.Machine, machine_id) &&
+ Global.mainModule.matchCurrentID(Current.User, user_id) &&
+ Global.mainModule.matchCurrentID(Current.RunConfiguration, run_configuration_id) &&
+ Global.mainModule.HasProject() &&
+ belongsToProject(Global.mainModule.getProject()) &&
+ Global.mainModule.HasCompilationTask() &&
+ compilation_task_id == Global.mainModule.getCompilationTask().id;
}
public RunConfiguration getRunConfiguration() {
return (Global.mainModule.getDb()).runConfigurations.Data.get(run_configuration_id);
diff --git a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Linux/LinuxLocalRunSupervisor.java b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Linux/LinuxLocalRunSupervisor.java
index 767e3ec6..483f8a8e 100644
--- a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Linux/LinuxLocalRunSupervisor.java
+++ b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Linux/LinuxLocalRunSupervisor.java
@@ -1,5 +1,6 @@
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Linux;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
import java.util.Map;
@@ -16,7 +17,7 @@ public class LinuxLocalRunSupervisor extends LinuxLocalTaskSupervisor {
}
@Override
protected Map getEnvs() {
- return Current.getRunConfiguration().getEnvMap();
+ return Global.mainModule.getRunConfiguration().getEnvMap();
}
@Override
protected String getScriptText() {
diff --git a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Windows/WindowsLocalRunSupervisor.java b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Windows/WindowsLocalRunSupervisor.java
index 79113394..aa5d6001 100644
--- a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Windows/WindowsLocalRunSupervisor.java
+++ b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Local/Windows/WindowsLocalRunSupervisor.java
@@ -1,5 +1,6 @@
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Windows;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
import java.util.Map;
@@ -25,7 +26,7 @@ public class WindowsLocalRunSupervisor extends WindowsLocalTaskSupervisor getEnvs() {
- return Current.getRunConfiguration().getEnvMap();
+ return Global.mainModule.getRunConfiguration().getEnvMap();
}
void kill_mpi() throws Exception {
}
diff --git a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/MVSRunSupervisor.java b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/MVSRunSupervisor.java
index 3acbeb47..02b7c31c 100644
--- a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/MVSRunSupervisor.java
+++ b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/MVSRunSupervisor.java
@@ -1,6 +1,7 @@
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
import Common.Utils.Utils_;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.GlobalData.Tasks.QueueSystem.MVS;
import _VisualDVM.GlobalData.Tasks.TaskState;
@@ -29,7 +30,7 @@ public class MVSRunSupervisor extends ServerRunSupervisor {
}
@Override
protected void StartTask() throws Exception {
- String env = String.join(" ", Current.getRunConfiguration().getEnvList());
+ String env = String.join(" ", Global.mainModule.getRunConfiguration().getEnvList());
mvs_time = (task.maxtime / 60); //в минутах
if (task.maxtime % 60 > 0) mvs_time += 1;
String res = "maxtime=" + Utils_.DQuotes(mvs_time) + " ./run";
diff --git a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/ServerRunSupervisor.java b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/ServerRunSupervisor.java
index 266e8696..f36a2294 100644
--- a/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/ServerRunSupervisor.java
+++ b/src/_VisualDVM/GlobalData/Tasks/Supervisor/Remote/ServerRunSupervisor.java
@@ -1,5 +1,6 @@
package _VisualDVM.GlobalData.Tasks.Supervisor.Remote;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
@@ -14,7 +15,7 @@ public class ServerRunSupervisor extends RemoteTaskSupervisor {
@Override
protected void StartTask() throws Exception {
String res = "./run";
- String env = String.join(" ", Current.getRunConfiguration().getEnvList());
+ String env = String.join(" ", Global.mainModule.getRunConfiguration().getEnvList());
if (!env.isEmpty()) res = env + " " + res;
//--
task.PID = pass.user.connection.startShellProcess(getRemoteProject(),"PID",
diff --git a/src/_VisualDVM/GlobalData/User/User.java b/src/_VisualDVM/GlobalData/User/User.java
index 8ac6f573..f7d7ca31 100644
--- a/src/_VisualDVM/GlobalData/User/User.java
+++ b/src/_VisualDVM/GlobalData/User/User.java
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.User;
import Common.CommonConstants;
import _VisualDVM.Current;
import Common.Database.Objects.iDBObject;
+import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.TestingSystem.DVM.UserConnection;
import com.sun.org.glassfish.gmbal.Description;
@@ -38,7 +39,7 @@ public class User extends iDBObject {
}
@Override
public boolean isVisible() {
- return Current.HasMachine() && Current.getMachine().id == machine_id;
+ return Global.mainModule.matchCurrentID(Current.Machine, machine_id);
}
@Override
public String getDialogName() {
diff --git a/src/_VisualDVM/GlobalData/User/UsersDBTable.java b/src/_VisualDVM/GlobalData/User/UsersDBTable.java
index 7d139ac8..ee4fb201 100644
--- a/src/_VisualDVM/GlobalData/User/UsersDBTable.java
+++ b/src/_VisualDVM/GlobalData/User/UsersDBTable.java
@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.User;
import _VisualDVM.Current;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.TableRenderers;
+import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import Common.Database.Objects.DBObject;
@@ -43,7 +44,7 @@ public class UsersDBTable extends iDBTable {
}
@Override
public void fillFields() {
- if (Current.getMachine().type.equals(MachineType.Local)) {
+ if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
Result.login = "этот пользователь";
fields.tfLogin.setEditable(false);
}
@@ -58,7 +59,7 @@ public class UsersDBTable extends iDBTable {
}
@Override
public void ProcessResult() {
- Result.machine_id = Current.getMachine().id;
+ Result.machine_id =Global.mainModule.getMachine().id;
Result.login = fields.tfLogin.getText();
Result.authentication = UserAuthentication.password;
Result.password = new String(fields.tfPassword.getPassword());
diff --git a/src/_VisualDVM/MainModule.java b/src/_VisualDVM/MainModule.java
index 23e357b1..55d05d3a 100644
--- a/src/_VisualDVM/MainModule.java
+++ b/src/_VisualDVM/MainModule.java
@@ -1,8 +1,291 @@
package _VisualDVM;
+import Common.Current_;
import MainModule_.MainModule_;
+import Visual_DVM_2021.Passes.UI.PassForm;
+import _VisualDVM.GlobalData.Account.Account;
+import _VisualDVM.GlobalData.Compiler.Compiler;
+import _VisualDVM.GlobalData.Credentials.Credentials;
import _VisualDVM.GlobalData.GlobalDatabase;
+import _VisualDVM.GlobalData.Machine.Machine;
+import _VisualDVM.GlobalData.Makefile.Makefile;
+import _VisualDVM.GlobalData.Module.Module;
+import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
+import _VisualDVM.GlobalData.RunConfiguration.RunConfiguration;
+import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
+import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
+import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
+import _VisualDVM.GlobalData.User.User;
+import _VisualDVM.ProjectData.Files.DBProjectFile;
+import _VisualDVM.ProjectData.Project.db_project_info;
+import _VisualDVM.ProjectData.ProjectView;
+import _VisualDVM.ProjectData.SapforData.Functions.FuncInfo;
+import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
+import _VisualDVM.Repository.BugReport.BugReport;
+import _VisualDVM.Repository.Component.Component;
+import _VisualDVM.Repository.Component.Sapfor.Sapfor;
+import _VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace;
+import _VisualDVM.Repository.Subscribes.Subscriber;
+import _VisualDVM.TestingSystem.Common.Group.Group;
+import _VisualDVM.TestingSystem.Common.Test.Test;
+import _VisualDVM.TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
+import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
+import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
+import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
+import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
+import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
+import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import java.io.File;
public class MainModule extends MainModule_ {
public MainModule() {
super(GlobalDatabase.class);
}
+ //--
+ public boolean HasProject() {return get(Current.Project) != null;}
+ public db_project_info getProject() {
+ return (db_project_info) get(Current.Project);
+ }
+ //--
+ public boolean HasFile() {
+ return get(Current.File) != null;
+ }
+ public boolean HasAccount() { return get(Current.Account) != null; }
+ public boolean HasMachine() {
+ return get(Current.Machine) != null;
+ }
+ public boolean HasUser() {
+ return get(Current.User) != null;
+ }
+ public boolean HasCompiler() {
+ return get(Current.Compiler) != null;
+ }
+ public boolean HasRemoteFile() {
+ return get(Current.RemoteFile) != null;
+ }
+ public boolean HasMakefile() {
+ return get(Current.Makefile) != null;
+ }
+ public boolean HasRunConfiguration() {
+ return get(Current.RunConfiguration) != null;
+ }
+ public boolean HasCompilationTask() {
+ return get(Current.CompilationTask) != null;
+ }
+ public boolean HasRunTask() {
+ return get(Current.RunTask) != null;
+ }
+ public boolean HasPassForm() {
+ return get(Current.PassForm) != null;
+ }
+ public boolean HasProjectView() {
+ return get(Current.ProjectView) != null;
+ }
+ public Credentials getCredentials(){
+ return (Credentials) get(Current.Credentials);
+ }
+ public SapforSettings getSapforSettings() {
+ return (SapforSettings) get(Current.SapforSettings);
+ }
+ public boolean HasSapforSettings() {
+ return get(Current.SapforSettings) != null;
+ }
+ public DBProjectFile getFile() {
+ return (DBProjectFile) get(Current.File);
+ }
+ public Component getComponent() {
+ return (Component) get(Current.Component);
+ }
+ public BugReport getBugReport() {
+ return (BugReport) get(Current.BugReport);
+ }
+ public db_project_info getRoot() {
+ return (db_project_info) get(Current.Root);
+ }
+ public boolean HasRoot() {
+ return get(Current.Root) != null;
+ }
+ public db_project_info getVersion() {
+ return (db_project_info) get(Current.Version);
+ }
+ public Account getAccount() {
+ return (Account) get(Current.Account);
+ }
+ public boolean HasSubscriber() {
+ return get(Current.Subscriber) != null;
+ }
+ public Subscriber getSubscriber() {
+ return (Subscriber) get(Current.Subscriber);
+ }
+ public Machine getMachine() {
+ return (Machine) get(Current.Machine);
+ }
+ public User getUser() {
+ return (User) get(Current.User);
+ }
+ public Compiler getCompiler() {
+ return (Compiler) get(Current.Compiler);
+ }
+ public CompilationTask getCompilationTask() {
+ return (CompilationTask) get(Current.CompilationTask);
+ }
+ public RunTask getRunTask() {
+ return (RunTask) get(Current.RunTask);
+ }
+ public RemoteFile getRemoteFile() {
+ return (RemoteFile) get(Current.RemoteFile);
+ }
+ public Makefile getMakefile() {
+ return (Makefile) get(Current.Makefile);
+ }
+ public Module getModule() {
+ return (Module) get(Current.Module);
+ }
+ public RunConfiguration getRunConfiguration() {
+ return (RunConfiguration) get(Current.RunConfiguration);
+ }
+ public Sapfor getSapfor() {
+ return (Sapfor) get(Current.Sapfor);
+ }
+ public boolean HasGroup() {
+ return get(Current.Group) != null;
+ }
+ public Group getGroup() {
+ return (Group) get(Current.Group);
+ }
+ public boolean HasConfiguration() {
+ return get(Current.DVMConfiguration) != null;
+ }
+ public DVMConfiguration getDVMConfiguration() {
+ return (DVMConfiguration) get(Current.DVMConfiguration);
+ }
+ public SapforConfiguration getSapforConfiguration() {
+ return (SapforConfiguration) get(Current.SapforConfiguration);
+ }
+ public Test getTest() {
+ return (Test) get(Current.Test);
+ }
+ public boolean HasTest() {
+ return get(Current.Test) != null;
+ }
+ public boolean HasVersion() {
+ return get(Current.Version) != null;
+ }
+ public RemoteFile getComponentServerBackup() {
+ return (RemoteFile) get(Current.ComponentServerBackup);
+ }
+ public boolean HasComponentServerBackup() {
+ return get(Current.ComponentServerBackup) != null;
+ }
+ public DefaultMutableTreeNode getProjectNode() {
+ return (DefaultMutableTreeNode) get(Current.ProjectNode);
+ }
+ public DefaultMutableTreeNode getProjectCurrentParentNode() {
+ DefaultMutableTreeNode node = getProjectNode();
+ //если в дереве еще никто не выделялся, берем корень.
+ if (node == null)
+ return getProject().filesTreeRoot;
+ return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
+ }
+ public File getSelectedDirectory() {
+ return (File) get(Current.SelectedDirectory);
+ }
+ public DBProjectFile getSelectedFile() {
+ return (DBProjectFile) get(Current.SelectedFile);
+ }
+ public boolean HasBugReport() {
+ return get(Current.BugReport) != null;
+ }
+ public PassForm getPassForm() {
+ return (PassForm) get(Current.PassForm);
+ }
+ public ParallelRegion getParallelRegion() {
+ return (ParallelRegion) get(Current.ParallelRegion);
+ }
+ public boolean HasParallelRegion() {
+ return get(Current.ParallelRegion) != null;
+ }
+ public boolean HasFunction() {
+ return get(Current.Function) != null;
+ }
+ public boolean HasSelectedFunction() {
+ return get(Current.SelectedFunction) != null;
+ }
+ public FuncInfo getFunction() {
+ return (FuncInfo) get(Current.Function);
+ }
+ public FuncInfo getSelectionFunction() {
+ return (FuncInfo) get(Current.SelectedFunction);
+ }
+ public boolean HasScenario() {
+ return get(Current.Scenario) != null;
+ }
+ public db_project_info getPackageVersion() {
+ return (db_project_info) get(Current.PackageVersion);
+ }
+ public boolean HasPackageVersion() {
+ return get(Current.PackageVersion) != null;
+ }
+ public boolean HasSapforConfiguration() {
+ return get(Current.SapforConfiguration) != null;
+ }
+ public ProjectView getProjectView() {
+ return (ProjectView) get(Current.ProjectView);
+ }
+ public boolean HasSapforProfile() {
+ return get(Current.SapforProfile) != null;
+ }
+ public SapforProfile getSapforProfile() {
+ return (SapforProfile) get(Current.SapforProfile);
+ }
+ public boolean HasServerSapfor() {
+ return get(Current.ServerSapfor) != null;
+ }
+ public ServerSapfor getServerSapfor() {
+ return (ServerSapfor) get(Current.ServerSapfor);
+ }
+ public boolean HasSubscriberWorkspace() {
+ return get(Current.SubscriberWorkspace) != null;
+ }
+ public SubscriberWorkspace getSubscriberWorkspace() {
+ return (SubscriberWorkspace) get(Current.SubscriberWorkspace);
+ }
+ public boolean HasDVMPackage() {
+ return get(Current.DVMPackage) != null;
+ }
+ public DVMPackage getDVMPackage() {
+ return (DVMPackage) get(Current.DVMPackage);
+ }
+ public boolean HasSapforPackage() {
+ return get(Current.SapforPackage) != null;
+ }
+ public SapforPackage getSapforPackage() {
+ return (SapforPackage) get(Current.SapforPackage);
+ }
+ public boolean HasDVMRunTask() {
+ return get(Current.DVMRunTask) != null;
+ }
+ public DVMRunTask getDVMRunTask() {
+ return (DVMRunTask) get(Current.DVMRunTask);
+ }
+ public void DropCurrentFile(){
+ set(Current.File, null);
+ set(Current.FileGraphElement, null);
+ set(Current.Notes, null);
+ set(Current.Warnings, null);
+ set(Current.Errors, null);
+ }
+ public void DropCurrentProject(){
+ set(Current.Project, null);
+ set(Current.File, null);
+ set(Current.Function, null);
+ set(Current.SelectedFunction,null);
+ set(Current.ProjectNode, null);
+ set(Current.SelectedFile, null);
+ set(Current.SelectedDirectory, null);
+ set(Current.ParallelVariant, null);
+ set(Current.Dimensions, null);
+ set(Current.Array, null);
+ set(Current.DBArray, null);
+ }
}
diff --git a/src/_VisualDVM/ProjectData/Files/DBProjectFile.java b/src/_VisualDVM/ProjectData/Files/DBProjectFile.java
index 7d9a8a93..2018700d 100644
--- a/src/_VisualDVM/ProjectData/Files/DBProjectFile.java
+++ b/src/_VisualDVM/ProjectData/Files/DBProjectFile.java
@@ -2,6 +2,7 @@ package _VisualDVM.ProjectData.Files;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Current;
+import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.ProjectData.GCOV.GCOV_info;
import _VisualDVM.ProjectData.LanguageName;
@@ -356,7 +357,7 @@ public class DBProjectFile extends ProjectFile {
for (FuncInfo fi : function_decls.values()) {
for (FuncCall fc : fi.calls) {
if ((fc.line == form.getEditor().getCurrentLine()) &&
- !Current.getSapfor().isIntrinsic(fc.funcName)
+ !Global.mainModule.getSapfor().isIntrinsic(fc.funcName)
) {
return fc;
}
@@ -416,7 +417,7 @@ public class DBProjectFile extends ProjectFile {
break;
}
languageName = parent.languageName;
- if (sapforStyle) style = Current.getSapfor().getStyle();
+ if (sapforStyle) style = Global.mainModule.getSapfor().getStyle();
else style = parent.style;
}
public void importSourceCodeSettings(DBProjectFile parent, boolean sapforStyle) throws Exception {
@@ -430,7 +431,7 @@ public class DBProjectFile extends ProjectFile {
break;
}
languageName = parent.languageName;
- if (sapforStyle) style = Current.getSapfor().getStyle();
+ if (sapforStyle) style =Global.mainModule.getSapfor().getStyle();
else style = parent.style;
}
//------------------
diff --git a/src/_VisualDVM/ProjectData/Files/UI/Editor/SPFEditor.java b/src/_VisualDVM/ProjectData/Files/UI/Editor/SPFEditor.java
index 03c434df..474252dc 100644
--- a/src/_VisualDVM/ProjectData/Files/UI/Editor/SPFEditor.java
+++ b/src/_VisualDVM/ProjectData/Files/UI/Editor/SPFEditor.java
@@ -65,7 +65,7 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
if (!switching_language) {
file.NeedsSave = true;
if (Global.enable_text_changed && file.state != FileState.Excluded) {
- Current.getSapfor().ResetAllAnalyses();
+ Global.mainModule.getSapfor().ResetAllAnalyses();
//текст изменился, значит M ка более не актуальна.
file.father.dropLastModification();
}
diff --git a/src/_VisualDVM/ProjectData/Files/UI/FileGraphTree.java b/src/_VisualDVM/ProjectData/Files/UI/FileGraphTree.java
index d853c65a..0277125d 100644
--- a/src/_VisualDVM/ProjectData/Files/UI/FileGraphTree.java
+++ b/src/_VisualDVM/ProjectData/Files/UI/FileGraphTree.java
@@ -3,6 +3,7 @@ import Common.Current_;
import _VisualDVM.Current;
import Common.Visual.Trees.DataTree;
import Common.Visual.Trees.TreeRenderers;
+import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.FileObject;
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
@@ -22,11 +23,11 @@ public class FileGraphTree extends DataTree {
}
@Override
public void ShowCurrentObject() throws Exception {
- Current.getFile().form.EventsOff();
- Object o = Current_.get(getCurrent());
- Current.getFile().form.getEditor().gotoLine((o instanceof FileObjectWithMessages) ? (((FileObjectWithMessages) o).line) : 1);
- Current.getFile().form.ShowMessages();
- Current.getFile().form.EventsOn();
+ Global.mainModule.getFile().form.EventsOff();
+ Object o = Global.mainModule.get(getCurrent());
+ Global.mainModule.getFile().form.getEditor().gotoLine((o instanceof FileObjectWithMessages) ? (((FileObjectWithMessages) o).line) : 1);
+ Global.mainModule.getFile().form.ShowMessages();
+ Global.mainModule.getFile().form.EventsOn();
}
@Override
protected boolean findNode(Object userObject, Object criteria) {
diff --git a/src/_VisualDVM/ProjectData/Files/UI/FilesTree.java b/src/_VisualDVM/ProjectData/Files/UI/FilesTree.java
index 40afbaa5..f983ad62 100644
--- a/src/_VisualDVM/ProjectData/Files/UI/FilesTree.java
+++ b/src/_VisualDVM/ProjectData/Files/UI/FilesTree.java
@@ -19,7 +19,7 @@ import java.awt.event.KeyEvent;
import java.io.File;
public class FilesTree extends StyledTree {
public FilesTree() {
- super(Current.getProject().filesTreeRoot);
+ super(Global.mainModule.getProject().filesTreeRoot);
this.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
@@ -48,10 +48,10 @@ public class FilesTree extends StyledTree {
new FileDrop(System.out, this, files -> {
Pass.passes.get(PassCode.ImportFiles).Do(files);
});
- Current_.set(Current.File, null);
+ Global.mainModule.set(Current.File, null);
}
private static void forkFD(PassCode file_pass, PassCode folder_pass) {
- DefaultMutableTreeNode node = Current.getProjectNode();
+ DefaultMutableTreeNode node = Global.mainModule.getProjectNode();
if (node != null)
Pass.passes.get((node.getUserObject() instanceof DBProjectFile) ?
file_pass : folder_pass).Do();
@@ -67,24 +67,24 @@ public class FilesTree extends StyledTree {
@Override
public void SelectionAction(TreePath e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getLastPathComponent();
- Current_.set(Current.ProjectNode, node);
+ Global.mainModule.set(Current.ProjectNode, node);
Object o = node.getUserObject();
if (o instanceof File) {
- Current_.set(Current.SelectedDirectory, o);
- Current_.set(Current.SelectedFile, null);
+ Global.mainModule.set(Current.SelectedDirectory, o);
+ Global.mainModule.set(Current.SelectedFile, null);
UI.getMainWindow().getProjectWindow().ShowNoSelectedFile();
} else if (o instanceof DBProjectFile) {
- Current_.set(Current.SelectedFile, o);
+ Global.mainModule.set(Current.SelectedFile, o);
File file = ((DBProjectFile) o).file;
- Current_.set(Current.SelectedDirectory, file.getParentFile());
+ Global.mainModule.set(Current.SelectedDirectory, file.getParentFile());
UI.getMainWindow().getProjectWindow().ShowSelectedFile();
}
UI.getMainWindow().getProjectWindow().ShowSelectedDirectory();
}
@Override
public void LeftMouseAction2() {
- if (Current.getProjectNode() != null) {
- Object o = Current.getProjectNode().getUserObject();
+ if (Global.mainModule.getProjectNode() != null) {
+ Object o = Global.mainModule.getProjectNode().getUserObject();
if (o instanceof DBProjectFile) {
//очень важно. иначе по открытии файла дерево остается в фокусе.
//и не происходит прокрутки скролла к строке!!
@@ -95,8 +95,8 @@ public class FilesTree extends StyledTree {
}
@Override
public void LeftMouseAction1() {
- if (Global.files_multiselection && Current.getSelectedFile() != null) {
- Current.getSelectedFile().SwitchSelection();
+ if (Global.files_multiselection && Global.mainModule.getSelectedFile() != null) {
+ Global.mainModule.getSelectedFile().SwitchSelection();
updateUI();
}
}
diff --git a/src/_VisualDVM/ProjectData/Messages/Message.java b/src/_VisualDVM/ProjectData/Messages/Message.java
index 45aa14cf..a34d0b1a 100644
--- a/src/_VisualDVM/ProjectData/Messages/Message.java
+++ b/src/_VisualDVM/ProjectData/Messages/Message.java
@@ -449,8 +449,8 @@ public class Message extends FileObject {
}
@Override
public boolean isVisible() {
- if (Current.HasFile() && Current.getFile().name.equals(file)) {
- Object o = Current_.get(Current.FileGraphElement);
+ if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(file)) {
+ Object o =Global.mainModule.get(Current.FileGraphElement);
return !(o instanceof FileObjectWithMessages) || ((FileObjectWithMessages) o).HasMessage(this);
} else return false;
}
diff --git a/src/_VisualDVM/ProjectData/Messages/MessagesDBTable.java b/src/_VisualDVM/ProjectData/Messages/MessagesDBTable.java
index 84fab383..ee29bd9b 100644
--- a/src/_VisualDVM/ProjectData/Messages/MessagesDBTable.java
+++ b/src/_VisualDVM/ProjectData/Messages/MessagesDBTable.java
@@ -5,6 +5,7 @@ import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.ColumnFilter;
import Common.Visual.Tables.TableRenderers;
+import _VisualDVM.Global;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -23,7 +24,7 @@ public class MessagesDBTable extends iDBTable {
@Override
public void ShowCurrentObject() throws Exception {
super.ShowCurrentObject();
- Current.getFile().form.getEditor().gotoLine(getCurrent().line);
+ Global.mainModule.getFile().form.getEditor().gotoLine(getCurrent().line);
}
@Override
protected void AdditionalInitColumns() {
diff --git a/src/_VisualDVM/ProjectData/Project/UI/VersionsTree.java b/src/_VisualDVM/ProjectData/Project/UI/VersionsTree.java
index d6d26a67..b5664b82 100644
--- a/src/_VisualDVM/ProjectData/Project/UI/VersionsTree.java
+++ b/src/_VisualDVM/ProjectData/Project/UI/VersionsTree.java
@@ -15,7 +15,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class VersionsTree extends DataTree {
public VersionsTree() {
- super(Current.getRoot().node);
+ super(Global.mainModule.getRoot().node);
SelectCurrentProject();
this.addKeyListener(new KeyAdapter() {
@Override
@@ -25,8 +25,8 @@ public class VersionsTree extends DataTree {
Pass.passes.get(PassCode.DeleteVersion).Do();
break;
case KeyEvent.VK_ENTER:
- if (Current.HasVersion())
- Pass.passes.get(PassCode.OpenCurrentProject).Do(Current.getVersion());
+ if (Global.mainModule.HasVersion())
+ Pass.passes.get(PassCode.OpenCurrentProject).Do(Global.mainModule.getVersion());
break;
}
}
@@ -41,7 +41,7 @@ public class VersionsTree extends DataTree {
return Current.Version;
}
public void SelectCurrentProject() {
- setSelectionPath(new TreePath(Current.getProject().node.getPath()));
+ setSelectionPath(new TreePath(Global.mainModule.getProject().node.getPath()));
}
@Override
protected GraphMenu createMenu() {
@@ -51,7 +51,7 @@ public class VersionsTree extends DataTree {
public void LeftMouseAction1() {
if (Global.versions_multiselection) {
// только если есть режим выбора версий.
- Object element = Current_.get(getCurrent());
+ Object element = Global.mainModule.get(getCurrent());
if ((element instanceof Selectable)) {
((Selectable) element).SwitchSelection();
updateUI();
@@ -60,7 +60,7 @@ public class VersionsTree extends DataTree {
}
@Override
public void LeftMouseAction2() {
- Pass.passes.get(PassCode.OpenCurrentProject).Do(Current.getVersion());
+ Pass.passes.get(PassCode.OpenCurrentProject).Do(Global.mainModule.getVersion());
}
@Override
protected int getStartLine() {
diff --git a/src/_VisualDVM/ProjectData/Project/UI/VersionsTreeCellRenderer.java b/src/_VisualDVM/ProjectData/Project/UI/VersionsTreeCellRenderer.java
index 4966902c..75bd6374 100644
--- a/src/_VisualDVM/ProjectData/Project/UI/VersionsTreeCellRenderer.java
+++ b/src/_VisualDVM/ProjectData/Project/UI/VersionsTreeCellRenderer.java
@@ -24,9 +24,9 @@ public class VersionsTreeCellRenderer extends StyledTreeCellRenderer {
setIcon(((Selectable) o).GetSelectionIcon());
} else {
URL imageUrl = null;
- boolean current = Current.HasProject() && version.Home.equals(Current.getProject().Home);
+ boolean current = Global.mainModule.HasProject() && version.Home.equals(Global.mainModule.getProject().Home);
String type_image_key = "";
- if (version.Home.equals(Current.getRoot().Home))
+ if (version.Home.equals(Global.mainModule.getRoot().Home))
type_image_key = "Root";
else if (version.IsMCopy())
type_image_key = "M";
diff --git a/src/_VisualDVM/ProjectData/Project/db_project_info.java b/src/_VisualDVM/ProjectData/Project/db_project_info.java
index 56f8466c..ccb290a0 100644
--- a/src/_VisualDVM/ProjectData/Project/db_project_info.java
+++ b/src/_VisualDVM/ProjectData/Project/db_project_info.java
@@ -435,8 +435,8 @@ public class db_project_info extends DBObject {
db.ResetAI(MessageWarning.class);
db.ResetAI(MessageRecommendation.class);
//-
- Current_.set(Current.Function, null);
- Current_.set(Current.SelectedFunction, null);
+ Global.mainModule.set(Current.Function, null);
+ Global.mainModule.set(Current.SelectedFunction, null);
}
public void CleanVersions() throws Exception {
node.removeAllChildren();
@@ -660,7 +660,7 @@ public class db_project_info extends DBObject {
}
public Vector getFilesForComparsion() {
Vector res = new Vector<>();
- if (Current.HasProject() && this.Home.equals(Current.getProject().Home)) {
+ if (Global.mainModule.HasProject() && this.Home.equals(Global.mainModule.getProject().Home)) {
//
res = db.files.Data.values().stream().filter(file -> !file.state.equals(FileState.Excluded)).collect(Collectors.toCollection(Vector::new));
} else {
@@ -1069,7 +1069,7 @@ public class db_project_info extends DBObject {
target.Close();
}
public void undoLastTransformation() throws Exception {
- Current_.set(Current.Version, null);
+ Global.mainModule.set(Current.Version, null);
//---
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_version.node);
Utils.forceDeleteWithCheck(last_version.Home);
@@ -1498,8 +1498,8 @@ public class db_project_info extends DBObject {
}
public String getLocalName() {
//требует отображения рута. без него работать не будет.
- if (Current.HasRoot())
- return Home.getAbsolutePath().substring(Current.getRoot().Home.getParentFile().getAbsolutePath().length() + 1);
+ if (Global.mainModule.HasRoot())
+ return Home.getAbsolutePath().substring(Global.mainModule.getRoot().Home.getParentFile().getAbsolutePath().length() + 1);
else return Home.getName();
}
public void SelectAllFiles(boolean b) {
diff --git a/src/_VisualDVM/ProjectData/SapforData/Arrays/ArraysSet.java b/src/_VisualDVM/ProjectData/SapforData/Arrays/ArraysSet.java
index 430142fa..ec354147 100644
--- a/src/_VisualDVM/ProjectData/SapforData/Arrays/ArraysSet.java
+++ b/src/_VisualDVM/ProjectData/SapforData/Arrays/ArraysSet.java
@@ -79,6 +79,6 @@ public class ArraysSet extends DataSet {
}
@Override
public void CheckAll(boolean flag) {
- Pass.passes.get(PassCode.MassSelectArrays).Do(flag,new Vector(Current.getProject().declaratedArrays.Data.values()));
+ Pass.passes.get(PassCode.MassSelectArrays).Do(flag,new Vector(Global.mainModule.getProject().declaratedArrays.Data.values()));
}
}
diff --git a/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java b/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java
index 3191e89a..62fdd103 100644
--- a/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java
+++ b/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java
@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import Common.Utils.Index;
+import _VisualDVM.Global;
import _VisualDVM.ProjectData.DBArray.DBArray;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.Dimension;
@@ -104,7 +105,7 @@ public class ProjectArray extends DBObject {
int idxPl = 3;
for (int i = 0; i < numDeclPlaces; ++i, idxPl += 2) {
String declFile = Utils_.toW(localSplited[idxPl]);
- DBProjectFile file = Current.getProject().db.files.Data.get(declFile);
+ DBProjectFile file = Global.mainModule.getProject().db.files.Data.get(declFile);
int declLine = Integer.parseInt(localSplited[idxPl + 1]);
//declPlaces.add(new Pair<>(declFile, declLine));
ArrayDecl decl = new ArrayDecl(shortName, location, file, declLine);
@@ -219,8 +220,8 @@ public class ProjectArray extends DBObject {
}
public void CreateDimensions() {
for (BigInteger regID : regIDs) {
- ParallelRegion region = Current.getProject().parallelRegions.get(regID);
- for (int i = 0; i < Current.getProject().maxdim; ++i) {
+ ParallelRegion region = Global.mainModule.getProject().parallelRegions.get(regID);
+ for (int i = 0; i < Global.mainModule.getProject().maxdim; ++i) {
dimensions.add(new TemplateDimension(
i, this, region
));
@@ -254,9 +255,9 @@ public class ProjectArray extends DBObject {
if (!mask(banned_dimensions, binary)) {
if (filter) {
boolean valid = true;
- if (Current.getProject().f_distributed())
+ if (Global.mainModule.getProject().f_distributed())
valid = CheckFilterMask(i, true, binary);
- if (valid && Current.getProject().f_multiplied())
+ if (valid && Global.mainModule.getProject().f_multiplied())
valid = CheckFilterMask(i, false, binary);
if (valid)
varIDs.add(i);
@@ -275,9 +276,9 @@ public class ProjectArray extends DBObject {
if (!mask(banned_dimensions, binary)) {
if (filter) {
boolean valid = true;
- if (Current.getProject().f_distributed())
+ if (Global.mainModule.getProject().f_distributed())
valid = CheckFilterMask(i, true, binary);
- if (valid && Current.getProject().f_multiplied())
+ if (valid && Global.mainModule.getProject().f_multiplied())
valid = CheckFilterMask(i, false, binary);
return valid;
} else return true;
@@ -344,12 +345,12 @@ public class ProjectArray extends DBObject {
return CheckFilterMask(varID, distributed, "");
}
public void SaveUserState() throws Exception {
- if (Current.getProject().db.savedArrays.Data.containsKey(UniqKey)) {
- DBArray sa = Current.getProject().db.savedArrays.Data.get(UniqKey);
+ if (Global.mainModule.getProject().db.savedArrays.Data.containsKey(UniqKey)) {
+ DBArray sa = Global.mainModule.getProject().db.savedArrays.Data.get(UniqKey);
sa.State = State;
- Current.getProject().db.Update(sa);
+ Global.mainModule.getProject().db.Update(sa);
} else
- Current.getProject().db.Insert(new DBArray(this));
+ Global.mainModule.getProject().db.Insert(new DBArray(this));
}
//-----------------------------------------------------------------------
@Override
diff --git a/src/_VisualDVM/ProjectData/SapforData/Arrays/Templates/TemplateDimensionState.java b/src/_VisualDVM/ProjectData/SapforData/Arrays/Templates/TemplateDimensionState.java
index 3b5d20d7..3a987a6d 100644
--- a/src/_VisualDVM/ProjectData/SapforData/Arrays/Templates/TemplateDimensionState.java
+++ b/src/_VisualDVM/ProjectData/SapforData/Arrays/Templates/TemplateDimensionState.java
@@ -1,23 +1,24 @@
package _VisualDVM.ProjectData.SapforData.Arrays.Templates;
import _VisualDVM.Current;
+import _VisualDVM.Global;
public enum TemplateDimensionState {
multiplied, //0
distributed; //1
public String getMaskDescription() {
switch (this) {
case distributed:
- if (Current.getProject().f_distributed()) {
+ if (Global.mainModule.getProject().f_distributed()) {
return "BLOCK";
} else {
- if (Current.getProject().f_multiplied())
+ if (Global.mainModule.getProject().f_multiplied())
return " X ";
else return "BLOCK";
}
case multiplied:
- if (Current.getProject().f_multiplied()) {
+ if (Global.mainModule.getProject().f_multiplied()) {
return " * ";
} else {
- if (Current.getProject().f_distributed())
+ if (Global.mainModule.getProject().f_distributed())
return " X ";
else return " * ";
}
diff --git a/src/_VisualDVM/ProjectData/SapforData/Arrays/UI/DimensionsTableForm.java b/src/_VisualDVM/ProjectData/SapforData/Arrays/UI/DimensionsTableForm.java
index d88764ae..10b5990f 100644
--- a/src/_VisualDVM/ProjectData/SapforData/Arrays/UI/DimensionsTableForm.java
+++ b/src/_VisualDVM/ProjectData/SapforData/Arrays/UI/DimensionsTableForm.java
@@ -4,6 +4,7 @@ import _VisualDVM.Current;
import Common.Visual.ControlForm;
import Common.Visual.Tables.Grid.GridAnchestor;
import Common.Visual.Tables.StyledTable;
+import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
@@ -32,10 +33,10 @@ public class DimensionsTableForm extends ControlForm {
public void CreateControl() {
Vector columns = new Vector<>();
columns.add("шаблон");
- for (int i = 0; i < Current.getProject().maxdim; ++i)
+ for (int i = 0; i < Global.mainModule.getProject().maxdim; ++i)
columns.add(ProjectArray.alignNames[i]);
Vector