no message

This commit is contained in:
2024-10-08 16:20:45 +03:00
parent e7939713e7
commit cba2c8ec34
17 changed files with 292 additions and 304 deletions

38
.idea/workspace.xml generated
View File

@@ -7,29 +7,23 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/Common/Mode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Utils/CommonUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/CommonUtils.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/CurrentAnchestor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/CurrentAnchestor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Loggable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Loggable.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/Database/VisualiserDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Database/VisualiserDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Visual/DataSetControlForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Visual/DataSetControlForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common_old/Current.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common_old/Current.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common_old/Current.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common_old/Current.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common_old/GlobalProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common_old/GlobalProperties.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common_old/UI/DragDrop/ExampleDrop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Visual/DragDrop/ExampleDrop.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common_old/UI/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common_old/UI/UI.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common_old/UI/DragDrop/FileDrop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Visual/DragDrop/FileDrop.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/GlobalData/Grid/TableVisualData.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Grid/TableVisualData.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common_old/UI/Windows/Form.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common_old/UI/Windows/Form.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ProjectData/Messages/Message.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ProjectData/Messages/Message.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common_old/UI/Windows/SearchReplaceForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common_old/UI/Windows/SearchReplaceForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ProjectData/Project/db_project_info.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ProjectData/Project/db_project_info.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/GlobalData/FormsParams/DBForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FormsParams/DBForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Sapfor/Sapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Sapfor/Sapfor.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/GlobalData/FormsParams/FormsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FormsParams/FormsDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Group/Group.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Group/Group.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/GlobalDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/MachineProcess/MachineProcess.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/MachineProcess/MachineProcess.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/GlobalData/Tasks/CompilationTask/CompilationTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Tasks/CompilationTask/CompilationTask.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Test/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Test/Test.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/GlobalData/Tasks/RunTask/RunTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Tasks/RunTask/RunTask.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/ProjectData/Files/UI/FilesTree.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ProjectData/Files/UI/FilesTree.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/MainForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/MainForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteVersion.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteVersion.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/ProfilesForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/ProfilesForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/WelcomeForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/WelcomeForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_ParseFilesWithOrder.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_ParseFilesWithOrder.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Pass_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Pass_2021.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SapforAnalysis.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SapforAnalysis.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Global.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -128,8 +122,8 @@
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\files" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\files" />
</key> </key>
<key name="MoveMembersDialog.RECENTS_KEY"> <key name="MoveMembersDialog.RECENTS_KEY">
<recent name="Common.Utils.CommonUtils" />
<recent name="Common.CurrentAnchestor" /> <recent name="Common.CurrentAnchestor" />
<recent name="Common.Utils.CommonUtils" />
<recent name="Common.CommonConstants" /> <recent name="Common.CommonConstants" />
<recent name="Common.Visual.CommonUI" /> <recent name="Common.Visual.CommonUI" />
<recent name="Common_old.Constants" /> <recent name="Common_old.Constants" />

View File

@@ -1,10 +1,12 @@
package Common; package Common;
import Common.Database.Objects.iDBObject;
import Common.Utils.TextLog; import Common.Utils.TextLog;
import Common_old.Current;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
public interface CurrentAnchestor { public interface CurrentAnchestor {
//- default String getDescription(){
return "?";
}
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>(); LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
static Object get(CurrentAnchestor name) { static Object get(CurrentAnchestor name) {
if (!objects.containsKey(name)) if (!objects.containsKey(name))
@@ -17,14 +19,14 @@ public interface CurrentAnchestor {
else objects.put(name, object); else objects.put(name, object);
return object; return object;
} }
default String getDescription(){
return "?";
}
static boolean Check(TextLog Log, CurrentAnchestor... names) { static boolean Check(TextLog Log, CurrentAnchestor... names) {
for (CurrentAnchestor name : names) for (CurrentAnchestor name : names)
if (CurrentAnchestor.get(name) == null) if (CurrentAnchestor.get(name) == null)
Log.Writeln_(name.getDescription() + " не выбран(а)"); Log.Writeln_(name.getDescription() + " не выбран(а)");
return Log.isEmpty(); return Log.isEmpty();
} }
//применять только для наследников iDBObject
static boolean matchCurrentID(CurrentAnchestor name, int id) {
return (CurrentAnchestor.get(name) != null) && (((iDBObject) CurrentAnchestor.get(name)).id == id);
}
} }

View File

@@ -1,11 +1,13 @@
package Common.Database; package Common.Database;
import Common.Database.SQLITE.SQLiteDatabase; import Common.Database.SQLITE.SQLiteDatabase;
import GlobalData.FormsParams.FormsDBTable;
import GlobalData.Grid.TablesVisualDatasDBTable; import GlobalData.Grid.TablesVisualDatasDBTable;
import GlobalData.Splitter.SplittersDBTable; import GlobalData.Splitter.SplittersDBTable;
import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.PassCode_2021;
import java.io.File; import java.io.File;
public class VisualiserDatabase extends SQLiteDatabase { public class VisualiserDatabase extends SQLiteDatabase {
public FormsDBTable forms;
public TablesVisualDatasDBTable tablesVisualData; public TablesVisualDatasDBTable tablesVisualData;
public SplittersDBTable splitters; public SplittersDBTable splitters;
public VisualiserDatabase(File file_in) { public VisualiserDatabase(File file_in) {
@@ -13,6 +15,7 @@ public class VisualiserDatabase extends SQLiteDatabase {
} }
@Override @Override
protected void initAllTables() throws Exception { protected void initAllTables() throws Exception {
addTable(forms = new FormsDBTable());
addTable(tablesVisualData = new TablesVisualDatasDBTable()); addTable(tablesVisualData = new TablesVisualDatasDBTable());
addTable(splitters = new SplittersDBTable()); addTable(splitters = new SplittersDBTable());
} }

View File

@@ -1,4 +1,4 @@
package Common_old.UI.DragDrop; package Common.Visual.DragDrop;
import javax.swing.*; import javax.swing.*;
/** /**
* A simple example showing how to use {@link FileDrop} * A simple example showing how to use {@link FileDrop}

View File

@@ -1,4 +1,4 @@
package Common_old.UI.DragDrop; package Common.Visual.DragDrop;
import Common.Utils.CommonUtils; import Common.Utils.CommonUtils;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;

View File

@@ -1,7 +1,5 @@
package Common_old; package Common_old;
import Common.CurrentAnchestor; import Common.CurrentAnchestor;
import Common.Database.Objects.iDBObject;
import _VisualDVM.Syntax.VisualiserTheme;
import GlobalData.Account.Account; import GlobalData.Account.Account;
import GlobalData.Compiler.Compiler; import GlobalData.Compiler.Compiler;
import GlobalData.Machine.Machine; import GlobalData.Machine.Machine;
@@ -23,6 +21,7 @@ import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration; import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings; import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.UI.PassForm; import Visual_DVM_2021.Passes.UI.PassForm;
import _VisualDVM.Syntax.VisualiserTheme;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import java.io.File; import java.io.File;
@@ -108,252 +107,6 @@ public enum Current implements CurrentAnchestor {
SapforSettings, SapforSettings,
SapforSettingsCommand, SapforSettingsCommand,
DVMSettings; DVMSettings;
public static boolean HasProject() {
return CurrentAnchestor.get(Project) != null;
}
public static boolean HasFile() {
return CurrentAnchestor.get(File) != null;
}
public static boolean HasSelectedFile() {
return CurrentAnchestor.get(SelectedFile) != null;
}
public static boolean HasAccount() {
return CurrentAnchestor.get(Account) != null;
}
public static boolean HasMachine() {
return CurrentAnchestor.get(Machine) != null;
}
public static boolean HasUser() {
return CurrentAnchestor.get(User) != null;
}
public static boolean HasCompiler() {
return CurrentAnchestor.get(Compiler) != null;
}
public static boolean HasRemoteFile() {
return CurrentAnchestor.get(RemoteFile) != null;
}
public static boolean HasMakefile() {
return CurrentAnchestor.get(Makefile) != null;
}
public static boolean HasRunConfiguration() {
return CurrentAnchestor.get(RunConfiguration) != null;
}
public static boolean HasCompilationTask() {
return CurrentAnchestor.get(CompilationTask) != null;
}
public static boolean HasRunTask() {
return CurrentAnchestor.get(RunTask) != null;
}
public static boolean HasPassForm() {
return CurrentAnchestor.get(PassForm) != null;
}
public static boolean HasProjectView() {
return CurrentAnchestor.get(ProjectView) != null;
}
//для быстрого доступа на чтение. слишком много на нем завязано.
public static SapforSettings getSapforSettings() {
return (SapforSettings) CurrentAnchestor.get(SapforSettings);
}
public static boolean HasSapforSettings() {
return CurrentAnchestor.get(SapforSettings) != null;
}
public static db_project_info getProject() {
return (db_project_info) CurrentAnchestor.get(Project);
}
public static DBProjectFile getFile() {
return (DBProjectFile) CurrentAnchestor.get(File);
}
public static Repository.Component.Component getComponent() {
return (Repository.Component.Component) CurrentAnchestor.get(Component);
}
public static Repository.BugReport.BugReport getBugReport() {
return (BugReport) CurrentAnchestor.get(BugReport);
}
public static db_project_info getRoot() {
return (db_project_info) CurrentAnchestor.get(Root);
}
public static boolean HasRoot() {
return CurrentAnchestor.get(Root) != null;
}
public static db_project_info getVersion() {
return (db_project_info) CurrentAnchestor.get(Version);
}
public static Account getAccount() {
return (Account) CurrentAnchestor.get(Account);
}
public static boolean HasSubscriber() {
return CurrentAnchestor.get(Current.Subscriber) != null;
}
public static Repository.Subscribes.Subscriber getSubscriber() {
return (Subscriber) CurrentAnchestor.get(Current.Subscriber);
}
public static Machine getMachine() {
return (Machine) CurrentAnchestor.get(Current.Machine);
}
public static User getUser() {
return (User) CurrentAnchestor.get(Current.User);
}
public static Compiler getCompiler() {
return (Compiler) CurrentAnchestor.get(Current.Compiler);
}
public static CompilationTask getCompilationTask() {
return (CompilationTask) CurrentAnchestor.get(Current.CompilationTask);
}
public static RunTask getRunTask() {
return (RunTask) CurrentAnchestor.get(Current.RunTask);
}
public static RemoteFile getRemoteFile() {
return (RemoteFile) CurrentAnchestor.get(Current.RemoteFile);
}
public static Makefile getMakefile() {
return (Makefile) CurrentAnchestor.get(Current.Makefile);
}
public static Module getModule() {
return (Module) CurrentAnchestor.get(Current.Module);
}
public static RunConfiguration getRunConfiguration() {
return (RunConfiguration) CurrentAnchestor.get(Current.RunConfiguration);
}
public static Repository.Component.Sapfor.Sapfor getSapfor() {
return (Repository.Component.Sapfor.Sapfor) CurrentAnchestor.get(Current.Sapfor);
}
public static boolean HasGroup() {
return CurrentAnchestor.get(Current.Group) != null;
}
public static TestingSystem.Common.Group.Group getGroup() {
return (TestingSystem.Common.Group.Group) CurrentAnchestor.get(Current.Group);
}
//--
public static boolean HasConfiguration() {
return CurrentAnchestor.get(Current.DVMConfiguration) != null;
}
public static DVMConfiguration getDVMConfiguration() {
return (DVMConfiguration) CurrentAnchestor.get(Current.DVMConfiguration);
}
public static SapforConfiguration getSapforConfiguration() {
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) CurrentAnchestor.get(Current.SapforConfiguration);
}
public static Test getTest() {
return (TestingSystem.Common.Test.Test) CurrentAnchestor.get(Current.Test);
}
public static boolean HasTest() {
return CurrentAnchestor.get(Current.Test) != null;
}
public static boolean HasVersion() {
return CurrentAnchestor.get(Current.Version) != null;
}
public static RemoteFile getComponentServerBackup() {
return (RemoteFile) CurrentAnchestor.get(Current.ComponentServerBackup);
}
public static boolean HasComponentServerBackup() {
return CurrentAnchestor.get(Current.ComponentServerBackup) != null;
}
//-
public static DefaultMutableTreeNode getProjectNode() {
return (DefaultMutableTreeNode) CurrentAnchestor.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) CurrentAnchestor.get(Current.SelectedDirectory);
}
public static DBProjectFile getSelectedFile() {
return (DBProjectFile) CurrentAnchestor.get(Current.SelectedFile);
}
//-
public static boolean HasBugReport() {
return CurrentAnchestor.get(Current.BugReport) != null;
}
public static PassForm getPassForm() {
return (Visual_DVM_2021.Passes.UI.PassForm) CurrentAnchestor.get(Current.PassForm);
}
public static VisualiserTheme getTheme() {
return (VisualiserTheme) CurrentAnchestor.get(Current.Theme);
}
//--------------------------------------------------------------------------------
public static ParallelRegion getParallelRegion() {
return (ParallelRegion) CurrentAnchestor.get(Current.ParallelRegion);
}
public static boolean HasParallelRegion() {
return CurrentAnchestor.get(Current.ParallelRegion) != null;
}
public static boolean HasFunction() {
return CurrentAnchestor.get(Current.Function) != null;
}
public static boolean HasSelectedFunction() {
return CurrentAnchestor.get(Current.SelectedFunction) != null;
}
public static FuncInfo getFunction() {
return (FuncInfo) CurrentAnchestor.get(Current.Function);
}
public static FuncInfo getSelectionFunction() {
return (FuncInfo) CurrentAnchestor.get(Current.SelectedFunction);
}
public static boolean HasScenario() {
return CurrentAnchestor.get(Current.Scenario) != null;
}
public static db_project_info getPackageVersion() {
return (db_project_info) CurrentAnchestor.get(Current.PackageVersion);
}
public static boolean HasPackageVersion() {
return CurrentAnchestor.get(Current.PackageVersion) != null;
}
public static boolean HasSapforConfiguration() {
return CurrentAnchestor.get(Current.SapforConfiguration) != null;
}
public static ProjectData.ProjectView getProjectView() {
return (ProjectData.ProjectView) CurrentAnchestor.get(ProjectView);
}
//-----------------------------------------
//применять только для наследников iDBObject
public static boolean CheckID(Current name, int id) {
return (CurrentAnchestor.get(name) != null) && (((iDBObject) CurrentAnchestor.get(name)).id == id);
}
public static boolean HasSapforProfile() {
return CurrentAnchestor.get(Current.SapforProfile) != null;
}
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
return (GlobalData.SapforProfile.SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
}
//сапфоры установленные на тестовый сервер.
public static boolean HasServerSapfor() {
return CurrentAnchestor.get(Current.ServerSapfor) != null;
}
public static TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) CurrentAnchestor.get(Current.ServerSapfor);
}
public static boolean HasSubscriberWorkspace() {
return CurrentAnchestor.get(Current.SubscriberWorkspace) != null;
}
public static Repository.SubscriberWorkspace.SubscriberWorkspace getSubscriberWorkspace() {
return (Repository.SubscriberWorkspace.SubscriberWorkspace) CurrentAnchestor.get(Current.SubscriberWorkspace);
}
//----->>
public static boolean HasDVMPackage() {
return CurrentAnchestor.get(Current.DVMPackage) != null;
}
public static TestingSystem.DVM.DVMPackage.DVMPackage getDVMPackage() {
return (TestingSystem.DVM.DVMPackage.DVMPackage) CurrentAnchestor.get(Current.DVMPackage);
}
public static boolean HasSapforPackage() {
return CurrentAnchestor.get(Current.SapforPackage) != null;
}
public static TestingSystem.SAPFOR.SapforPackage.SapforPackage getSapforPackage() {
return (TestingSystem.SAPFOR.SapforPackage.SapforPackage) CurrentAnchestor.get(Current.SapforPackage);
}
public static boolean HasDVMRunTask() {
return CurrentAnchestor.get(Current.DVMRunTask) != null;
}
public static TestingSystem.DVM.DVMTasks.DVMRunTask getDVMRunTask() {
return (TestingSystem.DVM.DVMTasks.DVMRunTask) CurrentAnchestor.get(Current.DVMRunTask);
}
//--------------------------------------------
@Override @Override
public String getDescription() { public String getDescription() {
switch (this) { switch (this) {
@@ -459,4 +212,237 @@ public enum Current implements CurrentAnchestor {
return ""; return "";
} }
} }
//------------------------------------------------------------------------------------->>
public static boolean HasProject() {
return CurrentAnchestor.get(Project) != null;
}
public static boolean HasFile() {
return CurrentAnchestor.get(File) != null;
}
public static boolean HasSelectedFile() {
return CurrentAnchestor.get(SelectedFile) != null;
}
public static boolean HasAccount() {
return CurrentAnchestor.get(Account) != null;
}
public static boolean HasMachine() {
return CurrentAnchestor.get(Machine) != null;
}
public static boolean HasUser() {
return CurrentAnchestor.get(User) != null;
}
public static boolean HasCompiler() {
return CurrentAnchestor.get(Compiler) != null;
}
public static boolean HasRemoteFile() {
return CurrentAnchestor.get(RemoteFile) != null;
}
public static boolean HasMakefile() {
return CurrentAnchestor.get(Makefile) != null;
}
public static boolean HasRunConfiguration() {
return CurrentAnchestor.get(RunConfiguration) != null;
}
public static boolean HasCompilationTask() {
return CurrentAnchestor.get(CompilationTask) != null;
}
public static boolean HasRunTask() {
return CurrentAnchestor.get(RunTask) != null;
}
public static boolean HasPassForm() {
return CurrentAnchestor.get(PassForm) != null;
}
public static boolean HasProjectView() {
return CurrentAnchestor.get(ProjectView) != null;
}
public static SapforSettings getSapforSettings() {
return (SapforSettings) CurrentAnchestor.get(SapforSettings);
}
public static boolean HasSapforSettings() {
return CurrentAnchestor.get(SapforSettings) != null;
}
public static db_project_info getProject() {
return (db_project_info) CurrentAnchestor.get(Project);
}
public static DBProjectFile getFile() {
return (DBProjectFile) CurrentAnchestor.get(File);
}
public static Repository.Component.Component getComponent() {
return (Repository.Component.Component) CurrentAnchestor.get(Component);
}
public static Repository.BugReport.BugReport getBugReport() {
return (BugReport) CurrentAnchestor.get(BugReport);
}
public static db_project_info getRoot() {
return (db_project_info) CurrentAnchestor.get(Root);
}
public static boolean HasRoot() {
return CurrentAnchestor.get(Root) != null;
}
public static db_project_info getVersion() {
return (db_project_info) CurrentAnchestor.get(Version);
}
public static Account getAccount() {
return (Account) CurrentAnchestor.get(Account);
}
public static boolean HasSubscriber() {
return CurrentAnchestor.get(Current.Subscriber) != null;
}
public static Repository.Subscribes.Subscriber getSubscriber() {
return (Subscriber) CurrentAnchestor.get(Current.Subscriber);
}
public static Machine getMachine() {
return (Machine) CurrentAnchestor.get(Current.Machine);
}
public static User getUser() {
return (User) CurrentAnchestor.get(Current.User);
}
public static Compiler getCompiler() {
return (Compiler) CurrentAnchestor.get(Current.Compiler);
}
public static CompilationTask getCompilationTask() {
return (CompilationTask) CurrentAnchestor.get(Current.CompilationTask);
}
public static RunTask getRunTask() {
return (RunTask) CurrentAnchestor.get(Current.RunTask);
}
public static RemoteFile getRemoteFile() {
return (RemoteFile) CurrentAnchestor.get(Current.RemoteFile);
}
public static Makefile getMakefile() {
return (Makefile) CurrentAnchestor.get(Current.Makefile);
}
public static Module getModule() {
return (Module) CurrentAnchestor.get(Current.Module);
}
public static RunConfiguration getRunConfiguration() {
return (RunConfiguration) CurrentAnchestor.get(Current.RunConfiguration);
}
public static Repository.Component.Sapfor.Sapfor getSapfor() {
return (Repository.Component.Sapfor.Sapfor) CurrentAnchestor.get(Current.Sapfor);
}
public static boolean HasGroup() {
return CurrentAnchestor.get(Current.Group) != null;
}
public static TestingSystem.Common.Group.Group getGroup() {
return (TestingSystem.Common.Group.Group) CurrentAnchestor.get(Current.Group);
}
public static boolean HasConfiguration() {
return CurrentAnchestor.get(Current.DVMConfiguration) != null;
}
public static DVMConfiguration getDVMConfiguration() {
return (DVMConfiguration) CurrentAnchestor.get(Current.DVMConfiguration);
}
public static SapforConfiguration getSapforConfiguration() {
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) CurrentAnchestor.get(Current.SapforConfiguration);
}
public static Test getTest() {
return (TestingSystem.Common.Test.Test) CurrentAnchestor.get(Current.Test);
}
public static boolean HasTest() {
return CurrentAnchestor.get(Current.Test) != null;
}
public static boolean HasVersion() {
return CurrentAnchestor.get(Current.Version) != null;
}
public static RemoteFile getComponentServerBackup() {
return (RemoteFile) CurrentAnchestor.get(Current.ComponentServerBackup);
}
public static boolean HasComponentServerBackup() {
return CurrentAnchestor.get(Current.ComponentServerBackup) != null;
}
public static DefaultMutableTreeNode getProjectNode() {
return (DefaultMutableTreeNode) CurrentAnchestor.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) CurrentAnchestor.get(Current.SelectedDirectory);
}
public static DBProjectFile getSelectedFile() {
return (DBProjectFile) CurrentAnchestor.get(Current.SelectedFile);
}
public static boolean HasBugReport() {
return CurrentAnchestor.get(Current.BugReport) != null;
}
public static PassForm getPassForm() {
return (Visual_DVM_2021.Passes.UI.PassForm) CurrentAnchestor.get(Current.PassForm);
}
public static VisualiserTheme getTheme() {
return (VisualiserTheme) CurrentAnchestor.get(Current.Theme);
}
public static ParallelRegion getParallelRegion() {
return (ParallelRegion) CurrentAnchestor.get(Current.ParallelRegion);
}
public static boolean HasParallelRegion() {
return CurrentAnchestor.get(Current.ParallelRegion) != null;
}
public static boolean HasFunction() {
return CurrentAnchestor.get(Current.Function) != null;
}
public static boolean HasSelectedFunction() {
return CurrentAnchestor.get(Current.SelectedFunction) != null;
}
public static FuncInfo getFunction() {
return (FuncInfo) CurrentAnchestor.get(Current.Function);
}
public static FuncInfo getSelectionFunction() {
return (FuncInfo) CurrentAnchestor.get(Current.SelectedFunction);
}
public static boolean HasScenario() {
return CurrentAnchestor.get(Current.Scenario) != null;
}
public static db_project_info getPackageVersion() {
return (db_project_info) CurrentAnchestor.get(Current.PackageVersion);
}
public static boolean HasPackageVersion() {
return CurrentAnchestor.get(Current.PackageVersion) != null;
}
public static boolean HasSapforConfiguration() {
return CurrentAnchestor.get(Current.SapforConfiguration) != null;
}
public static ProjectData.ProjectView getProjectView() {
return (ProjectData.ProjectView) CurrentAnchestor.get(ProjectView);
}
public static boolean HasSapforProfile() {
return CurrentAnchestor.get(Current.SapforProfile) != null;
}
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
return (GlobalData.SapforProfile.SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
}
public static boolean HasServerSapfor() {
return CurrentAnchestor.get(Current.ServerSapfor) != null;
}
public static TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) CurrentAnchestor.get(Current.ServerSapfor);
}
public static boolean HasSubscriberWorkspace() {
return CurrentAnchestor.get(Current.SubscriberWorkspace) != null;
}
public static Repository.SubscriberWorkspace.SubscriberWorkspace getSubscriberWorkspace() {
return (Repository.SubscriberWorkspace.SubscriberWorkspace) CurrentAnchestor.get(Current.SubscriberWorkspace);
}
public static boolean HasDVMPackage() {
return CurrentAnchestor.get(Current.DVMPackage) != null;
}
public static TestingSystem.DVM.DVMPackage.DVMPackage getDVMPackage() {
return (TestingSystem.DVM.DVMPackage.DVMPackage) CurrentAnchestor.get(Current.DVMPackage);
}
public static boolean HasSapforPackage() {
return CurrentAnchestor.get(Current.SapforPackage) != null;
}
public static TestingSystem.SAPFOR.SapforPackage.SapforPackage getSapforPackage() {
return (TestingSystem.SAPFOR.SapforPackage.SapforPackage) CurrentAnchestor.get(Current.SapforPackage);
}
public static boolean HasDVMRunTask() {
return CurrentAnchestor.get(Current.DVMRunTask) != null;
}
public static TestingSystem.DVM.DVMTasks.DVMRunTask getDVMRunTask() {
return (TestingSystem.DVM.DVMTasks.DVMRunTask) CurrentAnchestor.get(Current.DVMRunTask);
}
} }

View File

@@ -28,8 +28,8 @@ public abstract class Form extends JFrame implements ThemeElement {
public String getUTitleText() { public String getUTitleText() {
return ""; return "";
} }
protected FormType getFormType() { protected String getFormType() {
return FormType.Undefined; return null;
} }
protected void SetListener() { protected void SetListener() {
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
@@ -73,8 +73,9 @@ public abstract class Form extends JFrame implements ThemeElement {
} }
public void AfterClose() { public void AfterClose() {
} }
public void LoadWindowParameters() throws SQLException, InstantiationException, IllegalAccessException, NoSuchFieldException { //todo поменять на json? вместе с окном компонент
if (!getFormType().equals(FormType.Undefined)) public void LoadWindowParameters() throws Exception {
if (getFormType()!=null)
if (((GlobalDatabase)CommonUtils.db).forms.Data.containsKey(getFormType())) { if (((GlobalDatabase)CommonUtils.db).forms.Data.containsKey(getFormType())) {
info = ((GlobalDatabase)CommonUtils.db).forms.Data.get(getFormType()); info = ((GlobalDatabase)CommonUtils.db).forms.Data.get(getFormType());
info.Apply(this); info.Apply(this);
@@ -84,7 +85,7 @@ public abstract class Form extends JFrame implements ThemeElement {
setLocationRelativeTo(getRelative()); setLocationRelativeTo(getRelative());
} }
public void SaveWindowParameters() throws Exception { public void SaveWindowParameters() throws Exception {
if (!getFormType().equals(FormType.Undefined)) { if (getFormType()!=null) {
if (info != null) { if (info != null) {
info.Init(this); info.Init(this);
CommonUtils.db.Update(info); CommonUtils.db.Update(info);

View File

@@ -125,8 +125,8 @@ public class SearchReplaceForm extends Form {
lCount.setText(String.valueOf(result.getMarkedCount())); lCount.setText(String.valueOf(result.getMarkedCount()));
} }
@Override @Override
protected FormType getFormType() { protected String getFormType() {
return FormType.SearchReplace; return FormType.SearchReplace.toString();
} }
private void createUIComponents() { private void createUIComponents() {
// TODO: place custom component creation code here // TODO: place custom component creation code here

View File

@@ -6,12 +6,12 @@ import com.sun.org.glassfish.gmbal.Description;
import java.awt.*; import java.awt.*;
public class DBForm extends DBObject { public class DBForm extends DBObject {
@Description("PRIMARY KEY,UNIQUE, NOT NULL") @Description("PRIMARY KEY,UNIQUE, NOT NULL")
public FormType type = FormType.Undefined; public String type = null;
public int X = 0; public int X = 0;
public int Y = 0; public int Y = 0;
public int Width = 0; public int Width = 0;
public int Height = 0; public int Height = 0;
public DBForm(FormType type_, Window window) { public DBForm(String type_, Window window) {
type = type_; type = type_;
Init(window); Init(window);
} }

View File

@@ -1,12 +1,12 @@
package GlobalData.FormsParams; package GlobalData.FormsParams;
import Common.Database.Tables.DBTable; import Common.Database.Tables.DBTable;
import Common_old.UI.Windows.FormType; import Common_old.UI.Windows.FormType;
public class FormsDBTable extends DBTable<FormType, DBForm> { public class FormsDBTable extends DBTable<String, DBForm> {
public FormsDBTable() { public FormsDBTable() {
super(FormType.class, DBForm.class); super(String.class, DBForm.class);
} }
@Override @Override
public String getSingleDescription() { public String getSingleDescription() {
return "параметры окны"; return "параметры окна";
} }
} }

View File

@@ -50,7 +50,7 @@ public class GlobalDatabase extends VisualiserDatabase {
public DVMParameterDBTable dvmParameters; public DVMParameterDBTable dvmParameters;
public CredentialsDBTable credentials; public CredentialsDBTable credentials;
//----- ДАННЫЕ ВИЗУАЛИЗАТОРА--------------------------------- //----- ДАННЫЕ ВИЗУАЛИЗАТОРА---------------------------------
public FormsDBTable forms;
public MainFormParamsDBTable mainFormParams; public MainFormParamsDBTable mainFormParams;
public SettingsDBTable settings; public SettingsDBTable settings;
public LastProjectsDBTable lastProjects; public LastProjectsDBTable lastProjects;
@@ -77,7 +77,6 @@ public class GlobalDatabase extends VisualiserDatabase {
addTable(runConfigurations = new RunConfigurationsDBTable()); addTable(runConfigurations = new RunConfigurationsDBTable());
addTable(environmentValues = new EnvironmentValuesDBTable()); addTable(environmentValues = new EnvironmentValuesDBTable());
addTable(credentials = new CredentialsDBTable()); addTable(credentials = new CredentialsDBTable());
addTable(forms = new FormsDBTable());
addTable(settings = new SettingsDBTable()); addTable(settings = new SettingsDBTable());
addTable(mainFormParams = new MainFormParamsDBTable()); addTable(mainFormParams = new MainFormParamsDBTable());
addTable(lastProjects = new LastProjectsDBTable()); addTable(lastProjects = new LastProjectsDBTable());

View File

@@ -1,5 +1,6 @@
package GlobalData.Tasks.CompilationTask; package GlobalData.Tasks.CompilationTask;
import Common.CommonConstants; import Common.CommonConstants;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils; import Common.Utils.CommonUtils;
import Common_old.Current; import Common_old.Current;
import GlobalData.GlobalDatabase; import GlobalData.GlobalDatabase;
@@ -73,8 +74,8 @@ public class CompilationTask extends Task {
@Override @Override
public boolean isVisible() { public boolean isVisible() {
return return
Current.CheckID(Current.Machine, machine_id) && CurrentAnchestor.matchCurrentID(Current.Machine, machine_id) &&
Current.CheckID(Current.User, user_id) && CurrentAnchestor.matchCurrentID(Current.User, user_id) &&
Current.HasProject() && Current.HasProject() &&
belongsToProject(Current.getProject()); belongsToProject(Current.getProject());
} }

View File

@@ -1,5 +1,6 @@
package GlobalData.Tasks.RunTask; package GlobalData.Tasks.RunTask;
import Common.CommonConstants; import Common.CommonConstants;
import Common.CurrentAnchestor;
import Common.Utils.CommonUtils; import Common.Utils.CommonUtils;
import Common_old.Current; import Common_old.Current;
import GlobalData.GlobalDatabase; import GlobalData.GlobalDatabase;
@@ -52,9 +53,9 @@ public class RunTask extends Task {
@Override @Override
public boolean isVisible() { public boolean isVisible() {
return return
Current.CheckID(Current.Machine, machine_id) && CurrentAnchestor.matchCurrentID(Current.Machine, machine_id) &&
Current.CheckID(Current.User, user_id) && CurrentAnchestor.matchCurrentID(Current.User, user_id) &&
Current.CheckID(Current.RunConfiguration, run_configuration_id) && CurrentAnchestor.matchCurrentID(Current.RunConfiguration, run_configuration_id) &&
Current.HasProject() && Current.HasProject() &&
belongsToProject(Current.getProject()) && belongsToProject(Current.getProject()) &&
Current.HasCompilationTask() && Current.HasCompilationTask() &&

View File

@@ -2,7 +2,7 @@ package ProjectData.Files.UI;
import Common.CurrentAnchestor; import Common.CurrentAnchestor;
import Common_old.Current; import Common_old.Current;
import _VisualDVM.Global; import _VisualDVM.Global;
import Common_old.UI.DragDrop.FileDrop; import Common.Visual.DragDrop.FileDrop;
import Common_old.UI.Menus.GraphMenu; import Common_old.UI.Menus.GraphMenu;
import Common_old.UI.Menus.ProjectFilesMenu; import Common_old.UI.Menus.ProjectFilesMenu;
import Common_old.UI.UI; import Common_old.UI.UI;

View File

@@ -35,8 +35,8 @@ public class MainForm extends Form implements MainWindow {
return Content; return Content;
} }
@Override @Override
protected FormType getFormType() { protected String getFormType() {
return FormType.Main; return FormType.Main.toString();
} }
@Override @Override
public String getIconName() { public String getIconName() {

View File

@@ -4,6 +4,7 @@ import Common_old.UI.Windows.Dialog.Dialog;
import Common_old.UI.Windows.FormType; import Common_old.UI.Windows.FormType;
import GlobalData.FormsParams.DBForm; import GlobalData.FormsParams.DBForm;
import GlobalData.GlobalDatabase; import GlobalData.GlobalDatabase;
//todo разобраться с DBform
public class ProfilesForm extends Dialog<Object, ProfilesFields> { public class ProfilesForm extends Dialog<Object, ProfilesFields> {
private DBForm info = null; private DBForm info = null;
public ProfilesForm() { public ProfilesForm() {
@@ -55,8 +56,8 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
} }
} }
public void LoadWindowParameters() throws Exception { public void LoadWindowParameters() throws Exception {
if (((GlobalDatabase)CommonUtils.db).forms.Data.containsKey(FormType.Profiles)) { if (((GlobalDatabase)CommonUtils.db).forms.Data.containsKey(FormType.Profiles.toString())) {
info = ((GlobalDatabase)CommonUtils.db).forms.Data.get(FormType.Profiles); info = ((GlobalDatabase)CommonUtils.db).forms.Data.get(FormType.Profiles.toString());
info.Apply(this); info.Apply(this);
return; return;
} }
@@ -67,6 +68,6 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
info.Init(this); info.Init(this);
CommonUtils.db.Update(info); CommonUtils.db.Update(info);
} else } else
CommonUtils.db.Insert(new DBForm(FormType.Profiles, this)); CommonUtils.db.Insert(new DBForm(FormType.Profiles.toString(), this));
} }
} }

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.UI.Main; package Visual_DVM_2021.UI.Main;
import Common_old.UI.DragDrop.FileDrop; import Common.Visual.DragDrop.FileDrop;
import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021; import Visual_DVM_2021.Passes.Pass_2021;