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

View File

@@ -1,10 +1,12 @@
package Common;
import Common.Database.Objects.iDBObject;
import Common.Utils.TextLog;
import Common_old.Current;
import java.util.LinkedHashMap;
public interface CurrentAnchestor {
//-
default String getDescription(){
return "?";
}
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
static Object get(CurrentAnchestor name) {
if (!objects.containsKey(name))
@@ -17,14 +19,14 @@ public interface CurrentAnchestor {
else objects.put(name, object);
return object;
}
default String getDescription(){
return "?";
}
static boolean Check(TextLog Log, CurrentAnchestor... names) {
for (CurrentAnchestor name : names)
if (CurrentAnchestor.get(name) == null)
Log.Writeln_(name.getDescription() + " не выбран(а)");
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;
import Common.Database.SQLITE.SQLiteDatabase;
import GlobalData.FormsParams.FormsDBTable;
import GlobalData.Grid.TablesVisualDatasDBTable;
import GlobalData.Splitter.SplittersDBTable;
import Visual_DVM_2021.Passes.PassCode_2021;
import java.io.File;
public class VisualiserDatabase extends SQLiteDatabase {
public FormsDBTable forms;
public TablesVisualDatasDBTable tablesVisualData;
public SplittersDBTable splitters;
public VisualiserDatabase(File file_in) {
@@ -13,6 +15,7 @@ public class VisualiserDatabase extends SQLiteDatabase {
}
@Override
protected void initAllTables() throws Exception {
addTable(forms = new FormsDBTable());
addTable(tablesVisualData = new TablesVisualDatasDBTable());
addTable(splitters = new SplittersDBTable());
}

View File

@@ -1,4 +1,4 @@
package Common_old.UI.DragDrop;
package Common.Visual.DragDrop;
import javax.swing.*;
/**
* 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 java.awt.datatransfer.DataFlavor;

View File

@@ -1,7 +1,5 @@
package Common_old;
import Common.CurrentAnchestor;
import Common.Database.Objects.iDBObject;
import _VisualDVM.Syntax.VisualiserTheme;
import GlobalData.Account.Account;
import GlobalData.Compiler.Compiler;
import GlobalData.Machine.Machine;
@@ -23,6 +21,7 @@ import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.UI.PassForm;
import _VisualDVM.Syntax.VisualiserTheme;
import javax.swing.tree.DefaultMutableTreeNode;
import java.io.File;
@@ -108,252 +107,6 @@ public enum Current implements CurrentAnchestor {
SapforSettings,
SapforSettingsCommand,
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
public String getDescription() {
switch (this) {
@@ -459,4 +212,237 @@ public enum Current implements CurrentAnchestor {
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() {
return "";
}
protected FormType getFormType() {
return FormType.Undefined;
protected String getFormType() {
return null;
}
protected void SetListener() {
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
@@ -73,8 +73,9 @@ public abstract class Form extends JFrame implements ThemeElement {
}
public void AfterClose() {
}
public void LoadWindowParameters() throws SQLException, InstantiationException, IllegalAccessException, NoSuchFieldException {
if (!getFormType().equals(FormType.Undefined))
//todo поменять на json? вместе с окном компонент
public void LoadWindowParameters() throws Exception {
if (getFormType()!=null)
if (((GlobalDatabase)CommonUtils.db).forms.Data.containsKey(getFormType())) {
info = ((GlobalDatabase)CommonUtils.db).forms.Data.get(getFormType());
info.Apply(this);
@@ -84,7 +85,7 @@ public abstract class Form extends JFrame implements ThemeElement {
setLocationRelativeTo(getRelative());
}
public void SaveWindowParameters() throws Exception {
if (!getFormType().equals(FormType.Undefined)) {
if (getFormType()!=null) {
if (info != null) {
info.Init(this);
CommonUtils.db.Update(info);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@ package ProjectData.Files.UI;
import Common.CurrentAnchestor;
import Common_old.Current;
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.ProjectFilesMenu;
import Common_old.UI.UI;

View File

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

View File

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