no message

This commit is contained in:
2024-10-12 00:17:51 +03:00
parent f317ab1aa1
commit c826b4a4bd
102 changed files with 372 additions and 520 deletions

View File

@@ -68,7 +68,6 @@ public class Constants {
public static final String attachments = "attachments";
public static final String statistic = "statistic";
public static final String unknown_metric = "";
public static final String old_tests_db_name = "tests2026";
public static final String tests_db_name = "tests2027";
public static final String dateNaN = "NaN";
//------

View File

@@ -2,9 +2,11 @@ package _VisualDVM;
import Common.Current_;
import Common.Database.Tables.DataSet;
import Common.Mode;
import Common.Utils.Utils_;
import Common.Passes.Pass;
import Common.Utils.Loggable;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import Visual_DVM_2021.Passes.PassCode;
import _VisualDVM.GlobalData.Account.Account;
import _VisualDVM.GlobalData.Account.AccountRole;
import _VisualDVM.GlobalData.GlobalDatabase;
@@ -21,8 +23,6 @@ import _VisualDVM.TestingSystem.Common.TestingServer;
import _VisualDVM.TestingSystem.DVM.LocalDVMTestingPlanner;
import _VisualDVM.TestingSystem.DVM.RemoteDVMTestingPlanner;
import _VisualDVM.TestingSystem.SAPFOR.PackageModeSupervisor;
import Visual_DVM_2021.Passes.PassCode;
import Common.Passes.Pass;
import _VisualDVM.Visual.Syntax.LightSPFEditorTheme;
import _VisualDVM.Visual.UI;
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
@@ -32,6 +32,7 @@ import java.io.File;
import java.nio.file.Paths;
import java.util.Vector;
public class Global {
public static MainModule mainModule = null;
//Режим
public static Mode mode = Mode.Undefined;
//--------------------------------------------------
@@ -74,7 +75,6 @@ public class Global {
public static int bad_state = 0;
public static int need_update = 0;
public static int need_publish = 0;
public static void SynschronizeProperties() {
try {
File new_propertiesFile = new File(Utils_.getHomeDirectory(), "properties");
@@ -155,7 +155,8 @@ public class Global {
//-
public static void FinishApplication() {
try {
if (Utils_.db != null) Utils_.db.Disconnect();
// if (Utils_.db != null) Utils_.db.Disconnect();
mainModule.DeactivateDB();
if (componentsServer.db != null)
componentsServer.db.Disconnect();
if (testingServer.db != null)
@@ -175,13 +176,6 @@ public class Global {
}
System.exit(0);
}
public static void ActivateDB() throws Exception {
Utils_.db = new GlobalDatabase();
Utils_.db.Connect();
Utils_.db.CreateAllTables();
Utils_.db.prepareTablesStatements();
Utils_.db.Synchronize();
}
public static void RefreshUpdatesStatus() {
Components.RefreshUI();
ValidateComponentsStates();
@@ -225,32 +219,20 @@ public class Global {
forbidden.add(SettingName.Precompilation);
forbidden.add(SettingName.DVMConvertationOptions);
forbidden.add(SettingName.SaveModifications);
for (DBSetting setting : ((GlobalDatabase) Utils_.db).settings.getSettingsByOwner(ComponentType.SapforOptions)) {
for (DBSetting setting : mainModule.getDb().settings.getSettingsByOwner(ComponentType.SapforOptions)) {
if (!forbidden.contains(setting.Name))
res_.add(setting.Value);
}
return String.join("|", res_);
}
//--
public static void removeOldDatabases() {
File data = Paths.get(System.getProperty("user.dir"), "Data").toFile();
File[] files = data.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().contains(Constants.old_tests_db_name)) {
try {
Utils.forceDeleteWithCheck(file);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}
}
public static void NormalMode(int port) throws Exception {
mainModule= new MainModule();
//-------------------------------->>
//-------------------------------->>
UI_.active = true;
UI_.setTheme(new LightSPFEditorTheme());
removeOldDatabases();
CheckVisualiserDirectories();
CreateLogAtComponentsPath();
//-
@@ -307,7 +289,8 @@ public class Global {
} while (flag);
}
//---
ActivateDB(); //тут current getAccount; роль по умолчанию всегда неизвестна.
mainModule.ActivateDB();
// ActivateDB(); //тут current getAccount; роль по умолчанию всегда неизвестна.
///--------------
Current_.set(Current.Account, new Account() {
{
@@ -322,10 +305,10 @@ public class Global {
testingServer.ActivateDB();
//в проперти их!
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.AutoBugReportsLoad).toBoolean())
if (mainModule.getDb().settings.get(SettingName.AutoBugReportsLoad).toBoolean())
Pass.passes.get(PassCode.SynchronizeBugReports).Do();
//--
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.AutoTestsLoad).toBoolean())
if (mainModule.getDb().settings.get(SettingName.AutoTestsLoad).toBoolean())
Pass.passes.get(PassCode.SynchronizeTests).Do();
Pass.CheckAllStats();
Current.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.

View File

@@ -5,6 +5,7 @@ import _VisualDVM.Current;
import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.DVMParameter.UI.DVMParameterFields;
import _VisualDVM.GlobalData.GlobalDatabase;
@@ -76,7 +77,7 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
}
*/
for (DVMParameter par : ((GlobalDatabase) Utils_.db).dvmParameters.Data.values()) {
for (DVMParameter par : (Global.mainModule.getDb()).dvmParameters.Data.values()) {
if (par.isVisible() && (Result.id != par.id) && (par.name.equals(name))) {
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + Utils_.Brackets(name));
break;

View File

@@ -5,6 +5,7 @@ import _VisualDVM.Current;
import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.EnvironmentValue.UI.EnvironmentValueFields;
import _VisualDVM.GlobalData.GlobalDatabase;
@@ -43,7 +44,7 @@ public class EnvironmentValuesDBTable extends iDBTable<EnvironmentValue> {
if (value.contains("\"")) {
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
}
for (EnvironmentValue env : ((GlobalDatabase) Utils_.db).environmentValues.Data.values()) {
for (EnvironmentValue env : (Global.mainModule.getDb()).environmentValues.Data.values()) {
if (env.isVisible() && (Result.id != env.id) && (env.name.equals(name))) {
Log.Writeln("В конфигурации запуска уже задана переменная окружения с именем " + Utils_.Brackets(name));
break;

View File

@@ -58,7 +58,7 @@ public class GlobalDatabase extends VisualiserDatabase {
public SapforProfileSettingsDBTable sapforProfilesSettings = null;
//-
public GlobalDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", Global.properties.GlobalDBName).toFile());
super(Paths.get(System.getProperty("user.dir"), "Data", "db7.sqlite").toFile());
}
@Override
protected void initAllTables() throws Exception {

View File

@@ -1,6 +1,7 @@
package _VisualDVM.GlobalData.Machine;
import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.User.User;
@@ -26,10 +27,10 @@ public class Machine extends iDBObject {
"Машина по адресу " + Utils_.Brackets(getURL());
}
public LinkedHashMap<Integer, Compiler> getCompilers() {
return Utils_.db.getMapByFKi(this, Compiler.class);
return Global.mainModule.getDb().getMapByFKi(this, Compiler.class);
}
public LinkedHashMap<Integer, User> getUsers() {
return Utils_.db.getMapByFKi(this, User.class);
return Global.mainModule.getDb().getMapByFKi(this, User.class);
}
@Override
public String getDialogName() {

View File

@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Makefile;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Utils.TextLog;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
@@ -25,10 +26,10 @@ public class Makefile extends ModuleAnchestor {
return Current.HasMachine() && (machine_id == Current.getMachine().id);
}
public LinkedHashMap<LanguageName, Module> getActiveModules() {
return Utils_.db.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));
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));
}
public LinkedHashMap<LanguageName, Module> getModules() {
return Utils_.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
return Global.mainModule.getDb().getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
}
public String Generate(db_project_info project, boolean useFilesOrder, LinkedHashMap<LanguageName, Module> modules) throws Exception {
Compiler linker = getCompiler();
@@ -159,7 +160,7 @@ public class Makefile extends ModuleAnchestor {
//todo возможно улучшить
//https://habr.com/ru/post/211751/
public Machine getMachine() {
return Utils_.db.getById(Machine.class, machine_id);
return Global.mainModule.getDb().getById(Machine.class, machine_id);
}
public boolean DependsToCompiler(Compiler compiler) {
if (compiler_id == compiler.id) return true;

View File

@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Module;
import Common.CommonConstants;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.ProjectData.LanguageName;
public class Module extends ModuleAnchestor {
@@ -29,7 +30,7 @@ public class Module extends ModuleAnchestor {
public void Select(boolean flag) {
on = flag ? 1 : 0;
try {
Utils_.db.Update(this);
Global.mainModule.getDb().Update(this);
} catch (Exception e) {
Utils_.MainLog.PrintException(e);
}

View File

@@ -2,6 +2,7 @@ package _VisualDVM.GlobalData.Module;
import Common.CommonConstants;
import Common.Utils.Utils_;
import Common.Database.Objects.iDBObject;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
public class ModuleAnchestor extends iDBObject {
//--------------------------------------------------------------------------------------
@@ -16,7 +17,7 @@ public class ModuleAnchestor extends iDBObject {
return ((compiler = getCompiler()) == null) ? "" : compiler.getDescription();
}
public Compiler getCompiler() {
return Utils_.db.getById(Compiler.class, compiler_id);
return Global.mainModule.getDb().getById(Compiler.class, compiler_id);
}
public String getDescription() {
String res = "";

View File

@@ -4,6 +4,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.iDBObject;
import Common.Utils.TextLog;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
@@ -117,7 +118,7 @@ public class RunConfiguration extends iDBObject {
}
//---------------------------------------->
public Compiler getCompiler() {
return Utils_.db.getById(Compiler.class, compiler_id);
return Global.mainModule.getDb().getById(Compiler.class, compiler_id);
}
public boolean isCube() {
return cube != 0;
@@ -189,13 +190,13 @@ public class RunConfiguration extends iDBObject {
return "run_configuration_id";
}
public Vector<String> getEnvList() {
return Utils_.db.getVectorStringByFK(this, EnvironmentValue.class);
return Global.mainModule.getDb().getVectorStringByFK(this, EnvironmentValue.class);
}
public Vector<String> getParList() {
return Utils_.db.getVectorStringByFK(this, DVMParameter.class);
return Global.mainModule.getDb().getVectorStringByFK(this, DVMParameter.class);
}
public LinkedHashMap<String, String> getEnvMap() {
LinkedHashMap<Integer, EnvironmentValue> envs = Utils_.db.getMapByFKi(this, EnvironmentValue.class);
LinkedHashMap<Integer, EnvironmentValue> envs = Global.mainModule.getDb().getMapByFKi(this, EnvironmentValue.class);
LinkedHashMap<String, String> res = new LinkedHashMap<>();
for (EnvironmentValue e : envs.values()) {
if (!res.containsKey(e.name))

View File

@@ -10,6 +10,7 @@ import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Database.Tables.iDBTable;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
@@ -40,7 +41,7 @@ public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
return new DBObjectDialog<RunConfiguration, RunConfigurationFields>(RunConfigurationFields.class) {
@Override
public void fillFields() {
for (Compiler compiler : ((GlobalDatabase) Utils_.db).compilers.Data.values()) {
for (Compiler compiler : (Global.mainModule.getDb()).compilers.Data.values()) {
if (compiler.isVisible() && compiler.type.equals(CompilerType.dvm))
fields.cbLauncherCall.addItem(compiler);
}

View File

@@ -64,7 +64,7 @@ public class CompilationTask extends Task {
break;
}
}
Utils_.db.Update(this);
Global.mainModule.getDb().Update(this);
}
//---------------------------------------------------
@Override
@@ -80,7 +80,7 @@ public class CompilationTask extends Task {
belongsToProject(Current.getProject());
}
public Makefile getMakefile() {
return Utils_.db.getById(Makefile.class, makefile_id);
return Global.mainModule.getDb().getById(Makefile.class, makefile_id);
}
@Override
public String getFullCommand() {
@@ -90,7 +90,7 @@ public class CompilationTask extends Task {
LinkedHashMap<Integer, RunTask> res = new LinkedHashMap<>();
//так не получится. не правильно назвал ключевое поле. F...
// return Global.db.getMapByFKi(this, RunTask.class);
for (RunTask runTask : ((GlobalDatabase) Utils_.db).runTasks.Data.values()) {
for (RunTask runTask : (Global.mainModule.getDb()).runTasks.Data.values()) {
if (runTask.compilation_task_id == id)
res.put(runTask.id, runTask);
}

View File

@@ -39,7 +39,7 @@ public class RunTask extends Task {
super.DropResults();
Utils.forceDeleteWithCheck(getLocalStsFile());
CleanTime = 0;
Utils_.db.Update(this);
Global.mainModule.getDb().Update(this);
}
@Override
public File getHome() {
@@ -62,16 +62,16 @@ public class RunTask extends Task {
compilation_task_id == Current.getCompilationTask().id;
}
public RunConfiguration getRunConfiguration() {
return ((GlobalDatabase) Utils_.db).runConfigurations.Data.get(run_configuration_id);
return (Global.mainModule.getDb()).runConfigurations.Data.get(run_configuration_id);
}
public CompilationTask getCompilationTask() {
return ((GlobalDatabase) Utils_.db).compilationTasks.Data.get(compilation_task_id);
return (Global.mainModule.getDb()).compilationTasks.Data.get(compilation_task_id);
}
public void UpdateLastStsName(String file_name) {
if (!last_sts_name.equals(file_name)) {
last_sts_name = file_name;
try {
Utils_.db.Update(this);
Global.mainModule.getDb().Update(this);
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}

View File

@@ -1,5 +1,6 @@
package _VisualDVM.GlobalData.Tasks.Supervisor.Local.Windows;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Makefile.Makefile;
@@ -19,7 +20,7 @@ public class WindowsLocalCompilationSupervisor extends WindowsLocalTaskSuperviso
}
@Override
protected String getScriptText() {
return Utils_.DQuotes(((GlobalDatabase) Utils_.db).settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
return Utils_.DQuotes((Global.mainModule.getDb()).settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
}
//скорее всего как то выделить подготовку к компиляции как метод предка.
@Override

View File

@@ -1,5 +1,6 @@
package _VisualDVM.GlobalData.Tasks.Supervisor;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.Tasks.Task;
import _VisualDVM.GlobalData.Tasks.TaskState;
@@ -16,7 +17,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
public void ShowTaskState(){
Utils_.db.tables.get(task.getClass()).ShowUI(task.getPK());
Global.mainModule.getDb().tables.get(task.getClass()).ShowUI(task.getPK());
}
public void Init(T task_in, P pass_in, db_project_info project_in) {
task = task_in;
@@ -132,6 +133,6 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
}
}
public void UpdateTask() throws Exception {
Utils_.db.Update(task);
Global.mainModule.getDb().Update(task);
}
}

View File

@@ -3,6 +3,7 @@ import Common.CommonConstants;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.Objects.iDBObject;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
@@ -44,7 +45,7 @@ public abstract class Task extends iDBObject {
EndDate = 0;
Time = 0;
state = TaskState.Inactive;
Utils_.db.Update(this);
Global.mainModule.getDb().Update(this);
}
//</editor-fold>
//<editor-fold desc="локальные файлы">
@@ -66,10 +67,10 @@ public abstract class Task extends iDBObject {
return new Date(EndDate);
}
public Machine getMachine() {
return Utils_.db.getById(Machine.class, machine_id);
return Global.mainModule.getDb().getById(Machine.class, machine_id);
}
public User getUser() {
return Utils_.db.getById(User.class, user_id);
return Global.mainModule.getDb().getById(User.class, user_id);
}
protected String getTextResult(File file) {
return (file.exists()) ? Utils.ReadAllText(file) : "файл не найден. Задача еще не выполнялась или была завершена некорректно";
@@ -92,7 +93,7 @@ public abstract class Task extends iDBObject {
if (state != state_in) {
state = state_in;
try {
Utils_.db.Update(this);
Global.mainModule.getDb().Update(this);
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}

View File

@@ -57,8 +57,6 @@ public class GlobalProperties {
@Expose
public boolean FocusPassesResult = true;
@Expose
public String GlobalDBName = "db7.sqlite";
@Expose
public String ProjectDBName = "new_project_base.sqlite";
@Expose
public String BugReportsDBName = "bug_reports.sqlite";
@@ -134,7 +132,6 @@ public class GlobalProperties {
ConfirmPassesStart = p.ConfirmPassesStart;
ShowPassesDone = p.ShowPassesDone;
FocusPassesResult = p.FocusPassesResult;
GlobalDBName = p.GlobalDBName;
ProjectDBName = p.ProjectDBName;
BugReportsDBName = p.BugReportsDBName;
TestsDBName = p.TestsDBName;

View File

@@ -0,0 +1,8 @@
package _VisualDVM;
import MainModule_.MainModule_;
import _VisualDVM.GlobalData.GlobalDatabase;
public class MainModule extends MainModule_<GlobalDatabase> {
public MainModule() {
super(GlobalDatabase.class);
}
}

View File

@@ -46,7 +46,7 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
highlighter = (RSyntaxTextAreaHighlighter) getHighlighter();
autoComplete = new SapforAutoComplete(this);
//-------------------------
float font_size = (float) ((GlobalDatabase) Utils_.db).settings.get(SettingName.EditorFontSize).toInt32();
float font_size = (float) (Global.mainModule.getDb()).settings.get(SettingName.EditorFontSize).toInt32();
setFont(getFont().deriveFont(font_size));
//-------------------------
setText(Utils.ReadAllText(file.file).replace("\r", " "));
@@ -167,7 +167,7 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
Pair<Long, Integer> p = file.gcov_info.line_info.get(lineNum);
Color color = never;
if (p.getKey() > 0) {
color = (p.getValue() >= ((GlobalDatabase) Utils_.db).settings.get(SettingName.GCOVLimit).toInt32()) ?
color = (p.getValue() >= (Global.mainModule.getDb()).settings.get(SettingName.GCOVLimit).toInt32()) ?
new Color(255, 255, (100 - p.getValue()), 90) : null;
}
if (color != null) {

View File

@@ -31,7 +31,7 @@ public class Message extends FileObject {
(Global.mode != Mode.Normal)) {
value = value_in;
} else {
value = !((GlobalDatabase) Utils_.db).settings.get(SettingName.TRANSLATE_MESSAGES).toBoolean() ? value_in : decodeRussianMessage(value_in);
value = !(Global.mainModule.getDb()).settings.get(SettingName.TRANSLATE_MESSAGES).toBoolean() ? value_in : decodeRussianMessage(value_in);
}
}
// last code - 183

View File

@@ -172,7 +172,7 @@ public class db_project_info extends DBObject {
parent = parent_in;
name = parent.GenerateVersionName(letter_in);
languageName = parent.languageName;
style = ((GlobalDatabase) Utils_.db).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
style = ((Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed);
description = description_in;
original = original_in;
Home = Paths.get(parent_in.Home.getAbsolutePath(), name).toFile();
@@ -906,7 +906,7 @@ public class db_project_info extends DBObject {
}
}
public void createEmptyVersion(String versionLetter, String versionDescription) throws Exception {
boolean needsM = ((GlobalDatabase) Utils_.db).settings.get(SettingName.SaveModifications).toBoolean();
boolean needsM = (Global.mainModule.getDb()).settings.get(SettingName.SaveModifications).toBoolean();
if (needsM)
createModification();
last_version = new db_project_info(

View File

@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.SettingName;
import Visual_DVM_2021.Passes.PassCode;
@@ -39,7 +40,7 @@ public class ArraysSet extends DataSet<Long, ProjectArray> {
@Override
protected void AdditionalInitColumns() {
columns.get(0).setVisible(false);
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullArraysDeclarations).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ShowFullArraysDeclarations).toBoolean()) {
columns.get(4).setRenderer(RendererHyperlinks);
columns.get(4).setEditor(EditorHyperlinks);
} else {

View File

@@ -64,7 +64,7 @@ public class BugReport extends rDBObject {
project_version = version_in;
visualiser_version = Global.visualiser.version;
sapfor_version = Global.Components.get(ComponentType.Sapfor_F).version;
sapfor_settings = ((GlobalDatabase) Utils_.db).settings.getSapforSettingsText();
sapfor_settings = (Global.mainModule.getDb()).settings.getSapforSettingsText();
percentage = 0;
description = description_in;
date = new Date().getTime();

View File

@@ -366,7 +366,7 @@ public abstract class Sapfor extends OSDComponent {
//временный (?) проход, по тихому получить размерность теста, предварительно выполнив тихий парс.
//тут все одноразовое. считаем что таблицы бд уже заполнены как надо.
public LanguageStyle getStyle() throws Exception {
return ((GlobalDatabase) Utils_.db).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
return (Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
}
//----------
public static Vector<PassCode> getScenariosCodes() {
@@ -411,12 +411,12 @@ public abstract class Sapfor extends OSDComponent {
//------------------------------------------------------------------------------------------------------------------
public String getConsoleFlags() throws Exception {
Vector<String> res = new Vector<>();
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.FREE_FORM).toBoolean())
if ((Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean())
res.add("-f90");
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.STATIC_SHADOW_ANALYSIS).toBoolean())
if ((Global.mainModule.getDb()).settings.get(SettingName.STATIC_SHADOW_ANALYSIS).toBoolean())
res.add("-sh");
res.add("-shwidth " + ((GlobalDatabase) Utils_.db).settings.get(SettingName.MAX_SHADOW_WIDTH));
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.KEEP_SPF_DIRECTIVES).toBoolean())
res.add("-shwidth " + (Global.mainModule.getDb()).settings.get(SettingName.MAX_SHADOW_WIDTH));
if ((Global.mainModule.getDb()).settings.get(SettingName.KEEP_SPF_DIRECTIVES).toBoolean())
res.add("-keepSPF");
return String.join(" ", res);
}

View File

@@ -76,8 +76,8 @@ public class Visualiser extends Component {
System.exit(0);
}
public File getWorkspace() {
if (!((GlobalDatabase) Utils_.db).settings.get(SettingName.Workspace).toString().isEmpty()) {
File workspace = new File(((GlobalDatabase) Utils_.db).settings.get(SettingName.Workspace).toString());
if (!(Global.mainModule.getDb()).settings.get(SettingName.Workspace).toString().isEmpty()) {
File workspace = new File(Global.mainModule.getDb().settings.get(SettingName.Workspace).toString());
if (workspace.exists())
return workspace;
else

View File

@@ -665,7 +665,7 @@ public class Utils {
}
public static void RestoreSelectedDirectory(VFileChooser_ directoryChooser) {
String last_dir_home =
((GlobalDatabase) Utils_.db).settings.get(SettingName.ProjectsSearchDirectory).Value;
(Global.mainModule.getDb()).settings.get(SettingName.ProjectsSearchDirectory).Value;
if (!last_dir_home.isEmpty())
directoryChooser.SetCurrentDirectory(last_dir_home);
}
@@ -713,11 +713,11 @@ public class Utils {
break;
case ' ':
case '\t':
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.SpacesOn).toBoolean()) line.append(c);
if ((Global.mainModule.getDb()).settings.get(SettingName.SpacesOn).toBoolean()) line.append(c);
v_line.append(c);
break;
case '\n': //конец строки
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.FortranWrapsOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.FortranWrapsOn).toBoolean()) {
//оракул. лезем в начало следующей строки
//и анализируем первые 5 символов
boolean hasWrap = false;
@@ -743,7 +743,7 @@ public class Utils {
break;
}
//добавление строки в результат.
if ((line.length() > 0) || ((GlobalDatabase) Utils_.db).settings.get(SettingName.EmptyLinesOn).toBoolean()
if ((line.length() > 0) || (Global.mainModule.getDb()).settings.get(SettingName.EmptyLinesOn).toBoolean()
// Global.db.settings.get(SettingName.SpacesOn).toBoolean()
) {
lines.add(line.toString());
@@ -762,7 +762,7 @@ public class Utils {
if ((i > 0) && (c != '\n')) {
//строка оборвалась на EOF
//добавление строки в результат.
if ((line.length() > 0) ||((GlobalDatabase) Utils_.db).settings.get(SettingName.EmptyLinesOn).toBoolean()
if ((line.length() > 0) ||(Global.mainModule.getDb()).settings.get(SettingName.EmptyLinesOn).toBoolean()
// && Global.db.settings.get(SettingName.SpacesOn).toBoolean()
) {
lines.add(line.toString());
@@ -774,11 +774,11 @@ public class Utils {
public static boolean CompareLines(String line1_raw, String line2_raw) {
String line1 = line1_raw;
String line2 = line2_raw;
if (!((GlobalDatabase) Utils_.db).settings.get(SettingName.RegisterOn).toBoolean()) {
if (!(Global.mainModule.getDb()).settings.get(SettingName.RegisterOn).toBoolean()) {
line1 = line1.toUpperCase();
line2 = line2.toUpperCase();
}
if (!((GlobalDatabase) Utils_.db).settings.get(SettingName.SpacesOn).toBoolean()) {
if (!(Global.mainModule.getDb()).settings.get(SettingName.SpacesOn).toBoolean()) {
line1 = Utils_.removeCharacters(line1, " ", "\t");
line2 = Utils_.removeCharacters(line2, " ", "\t");
}

View File

@@ -1,10 +1,11 @@
package _VisualDVM.Visual.Interface;
import Common.Utils.Utils_;
import _VisualDVM.Global;
public interface FormWithSplitters {
default void LoadSplitters() {
Utils_.db.splitters.Load(this);
Global.mainModule.getDb().splitters.Load(this);
}
default void SaveSplitters() {
Utils_.db.splitters.Save(this);
Global.mainModule.getDb().splitters.Save(this);
}
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Menus.FastAccessMenuBar;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.SettingName;
@@ -40,7 +41,7 @@ public class FastAccessMenuBar extends VisualiserMenuBar {
if (pass.stats.HasUsages()) {
showPass(pass);
++i;
if (i > (((GlobalDatabase) Utils_.db).settings.get(SettingName.FastAccessPassesCount).toInt32())) break;
if (i > ((Global.mainModule.getDb()).settings.get(SettingName.FastAccessPassesCount).toInt32())) break;
}
}
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Menus.MainMenuBar;
import Common.Utils.Utils_;
import Common.Visual.Menus.VisualiserMenuItem;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.VisualiserMenu;
import _VisualDVM.GlobalData.DBLastProject.DBLastProject;
import _VisualDVM.GlobalData.GlobalDatabase;
@@ -21,7 +22,7 @@ public class LastOpenedProjectsMenu extends VisualiserMenu {
@Override
public void menuSelected(MenuEvent e) {
removeAll();
Vector<DBLastProject> projects = ((GlobalDatabase) Utils_.db).lastProjects.getOrdered();
Vector<DBLastProject> projects = (Global.mainModule.getDb()).lastProjects.getOrdered();
int k = 1;
for (DBLastProject p : projects) {
if (new File(p.HomePath).exists() && p.lastOpened != 0) {
@@ -34,7 +35,7 @@ public class LastOpenedProjectsMenu extends VisualiserMenu {
});
add(i);
++k;
if (k > (((GlobalDatabase) Utils_.db).settings.get(SettingName.LastOpenedProjectsCount).toInt32())) break;
if (k > ((Global.mainModule.getDb()).settings.get(SettingName.LastOpenedProjectsCount).toInt32())) break;
}
}
}

View File

@@ -1,5 +1,6 @@
package _VisualDVM.Visual.Menus.MainMenuBar.VisualiserSettingsMenu;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.PropertiesSubmenu;
import _VisualDVM.Visual.Menus.SettingsSubmenu;
import _VisualDVM.Visual.Menus.VisualiserMenu;
@@ -37,7 +38,7 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
SettingName.FortranWrapsOn,
SettingName.ComparsionDiffMergeOn
));
add(((GlobalDatabase) Utils_.db).settings.get(SettingName.Workspace).getMenuItem());
add(((GlobalDatabase) Utils_.db).settings.get(SettingName.BugReportsAgeLimit).getMenuItem());
add((Global.mainModule.getDb()).settings.get(SettingName.Workspace).getMenuItem());
add((Global.mainModule.getDb()).settings.get(SettingName.BugReportsAgeLimit).getMenuItem());
}
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Menus.ProjectMenuBar;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.LanguagesSubmenu;
import _VisualDVM.Visual.Menus.SettingsSubmenu;
import _VisualDVM.Visual.Menus.StylesSubmenu;
@@ -60,9 +61,9 @@ public class ProjectSettingsMenu extends VisualiserMenu {
SettingName.SaveModifications
));
addSeparator();
add(((GlobalDatabase) Utils_.db).settings.get(SettingName.TRANSLATE_MESSAGES).getMenuItem());
add(((GlobalDatabase) Utils_.db).settings.get(SettingName.DEBUG_PRINT_ON).getMenuItem());
add(((GlobalDatabase) Utils_.db).settings.get(SettingName.GCOVLimit).getMenuItem());
add((Global.mainModule.getDb()).settings.get(SettingName.TRANSLATE_MESSAGES).getMenuItem());
add((Global.mainModule.getDb()).settings.get(SettingName.DEBUG_PRINT_ON).getMenuItem());
add((Global.mainModule.getDb()).settings.get(SettingName.GCOVLimit).getMenuItem());
}
public void ShowLanguage() {
mLanguage.setText("Язык: " + Current.getProject().languageName.getDescription());

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Menus;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.GlobalDatabase;
import Common.Visual.Fonts.VisualiserFonts;
import _VisualDVM.GlobalData.Settings.SettingName;
@@ -13,7 +14,7 @@ public class SettingsSubmenu extends JMenu {
setIcon(Utils_.getIcon(icon));
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
for (SettingName c : settings) {
add(((GlobalDatabase) Utils_.db).settings.get(c).getMenuItem());
add((Global.mainModule.getDb()).settings.get(c).getMenuItem());
}
}
}

View File

@@ -4,6 +4,7 @@ import Common.Utils.Utils_;
import Common.Visual.UI_;
import Common.Visual.Menus.DataMenuBar;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.CredentialsBar.CredentialsBar;
import _VisualDVM.Visual.Menus.FastAccessMenuBar.FastAccessMenuBar;
import _VisualDVM.Visual.Menus.FileMenuBar.FileMenuBar;
@@ -260,7 +261,7 @@ public class UI {
ShowTabsNames(tabs, 0);
}
public static void ShowTabsNames(JTabbedPane tabs, int startIndex) {
boolean flag = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = Global.mainModule.getDb().settings.get(SettingName.ShowFullTabsNames).toBoolean();
for (int i = startIndex; i < tabs.getTabCount(); ++i)
tabs.setTitleAt(i, flag ? tabs.getToolTipTextAt(i) : "");
}

View File

@@ -163,7 +163,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
BugReportCommentAddition.setWrapStyleWord(true);
//----------------------------------------------
//тут развилка на то вкладки или поля.
SwitchScreen(((GlobalDatabase) Utils_.db).settings.get(SettingName.SmallScreen).toBoolean());
SwitchScreen((Global.mainModule.getDb()).settings.get(SettingName.SmallScreen).toBoolean());
//-
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
Global.componentsServer.db.subscribers.mountUI(subscribersPanel);

View File

@@ -1,5 +1,6 @@
package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.Visual.Interface.DebugWindow;
import _VisualDVM.Visual.Interface.FormWithSplitters;
@@ -68,22 +69,22 @@ public class DebugForm implements DebugWindow, FormWithSplitters {
//-
@Override
public void ShowAll() {
((GlobalDatabase) Utils_.db).makefiles.ShowUI();
((GlobalDatabase) Utils_.db).runConfigurations.ShowUI();
((GlobalDatabase) Utils_.db).compilationTasks.ShowUI(); //их видимость зависит от текущего проекта.
((GlobalDatabase) Utils_.db).runTasks.ShowUI();
Global.mainModule.getDb().makefiles.ShowUI();
Global.mainModule.getDb().runConfigurations.ShowUI();
Global.mainModule.getDb().compilationTasks.ShowUI(); //их видимость зависит от текущего проекта.
Global.mainModule.getDb().runTasks.ShowUI();
}
public DebugForm(){
LoadSplitters();
//--
((GlobalDatabase) Utils_.db).makefiles.mountUI(makefilesPanel);
((GlobalDatabase) Utils_.db).modules.mountUI(modulesPanel);
((GlobalDatabase) Utils_.db).runConfigurations.mountUI(runConfigurationsPanel);
((GlobalDatabase) Utils_.db).environmentValues.mountUI(environmentsPanel);
((GlobalDatabase) Utils_.db).dvmParameters.mountUI(dvmParametersPanel);
Global.mainModule.getDb().makefiles.mountUI(makefilesPanel);
Global.mainModule.getDb().modules.mountUI(modulesPanel);
Global.mainModule.getDb().runConfigurations.mountUI(runConfigurationsPanel);
Global.mainModule.getDb().environmentValues.mountUI(environmentsPanel);
Global.mainModule.getDb().dvmParameters.mountUI(dvmParametersPanel);
//-
((GlobalDatabase) Utils_.db).compilationTasks.mountUI(compilationTasksPanel);
((GlobalDatabase) Utils_.db).runTasks.mountUI(runTasksPanel);
Global.mainModule.getDb().compilationTasks.mountUI(compilationTasksPanel);
Global.mainModule.getDb().runTasks.mountUI(runTasksPanel);
//--
singleCompilationTaskMaster = new CompilationTasksComparisonForm(singleCompilationTaskSlave = new CompilationTasksComparisonForm(null));
singleRunTaskMaster = new RunTasksComparisonForm(singleRunTaskSlave = new RunTasksComparisonForm(null));

View File

@@ -173,29 +173,29 @@ public class FileForm implements FileWindow, FormWithSplitters {
//----
@Override
public void ShowWarningsCount() {
boolean flag = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(1, (flag ? "Предупреждения: " : "") + file.father.db.warnings.getVisibleKeys().size());
}
@Override
public void ShowErrorsCount() {
boolean flag = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(2, (flag ? "Ошибки: " : "") + file.father.db.errors.getVisibleKeys().size());
}
@Override
public void ShowNotesCount() {
boolean flag = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(0, (flag ? "Примечания: " : "") + file.father.db.notes.getVisibleKeys().size());
}
@Override
public void ShowRecommendationsCount() {
boolean flag = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(3, (flag ? "Рекомендации: " : "") + file.father.db.recommendations.getVisibleKeys().size());
}
//---
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(graphsTabs);
boolean flag = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
//--
ShowNotesCount();
ShowWarningsCount();
@@ -235,7 +235,7 @@ public class FileForm implements FileWindow, FormWithSplitters {
}
@Override
public void ShowNoMessages() {
boolean full_tiles = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean full_tiles = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
file.father.db.notes.ClearUI();
file.father.db.warnings.ClearUI();
file.father.db.errors.ClearUI();
@@ -367,7 +367,7 @@ public class FileForm implements FileWindow, FormWithSplitters {
//--
@Override
public void CollapseGraphs() {
Utils_.db.splitters.get("SC12").position = SC12.getDividerLocation();
Global.mainModule.getDb().splitters.get("SC12").position = SC12.getDividerLocation();
UI_.Clear(editorBackground);
editorBackground.add(editorPanel);
}
@@ -377,12 +377,12 @@ public class FileForm implements FileWindow, FormWithSplitters {
SC12.setRightComponent(editorPanel);
editorBackground.add(SC12);
//--
SC12.setDividerLocation(Utils_.db.splitters.get("SC12").position);
SC12.setDividerLocation(Global.mainModule.getDb().splitters.get("SC12").position);
SC12.updateUI();
}
@Override
public void CollapseMessages() {
Utils_.db.splitters.get("SC1").position = SC1.getDividerLocation();
Global.mainModule.getDb().splitters.get("SC1").position = SC1.getDividerLocation();
UI_.Clear(content);
content.add(editorBackground);
}
@@ -391,7 +391,7 @@ public class FileForm implements FileWindow, FormWithSplitters {
UI_.Clear(content);
SC1.setLeftComponent(editorBackground);
content.add(SC1);
SC1.setDividerLocation(Utils_.db.splitters.get("SC1").position);
SC1.setDividerLocation(Global.mainModule.getDb().splitters.get("SC1").position);
SC1.updateUI();
}
}

View File

@@ -61,7 +61,7 @@ public class MainForm extends Form implements MainWindow {
if (UI.getDebugWindow() != null)
((FormWithSplitters) UI.getDebugWindow()).SaveSplitters();
//--
((GlobalDatabase) Utils_.db).SaveCredentials();
Global.mainModule.getDb().SaveCredentials();
//--
Global.FinishApplication();
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.Visual.Interface.FormWithSplitters;
@@ -16,7 +17,7 @@ public class ProfilesFields implements DialogFields, FormWithSplitters {
return content;
}
public ProfilesFields(){
((GlobalDatabase) Utils_.db).sapforProfiles.mountUI(profilesPanel);
((GlobalDatabase) Utils_.db).sapforProfilesSettings.mountUI(settingsPanel);
(Global.mainModule.getDb()).sapforProfiles.mountUI(profilesPanel);
(Global.mainModule.getDb()).sapforProfilesSettings.mountUI(settingsPanel);
}
}

View File

@@ -2,6 +2,7 @@ package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.Dialog;
import Common.Database.Objects.DBForm.DBForm;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.GlobalDatabase;
//todo разобраться с DBform
public class ProfilesForm extends Dialog<Object, ProfilesFields> {
@@ -18,13 +19,13 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
}
@Override
public void Init(Object... params) {
if (((GlobalDatabase) Utils_.db).sapforProfiles.size() > 0) {
for (Object key : ((GlobalDatabase) Utils_.db).sapforProfiles.Data.keySet()) {
((GlobalDatabase) Utils_.db).sapforProfiles.ShowUI(key);
if ((Global.mainModule.getDb()).sapforProfiles.size() > 0) {
for (Object key : (Global.mainModule.getDb()).sapforProfiles.Data.keySet()) {
(Global.mainModule.getDb()).sapforProfiles.ShowUI(key);
return;
}
} else {
((GlobalDatabase) Utils_.db).sapforProfiles.ShowUI();
(Global.mainModule.getDb()).sapforProfiles.ShowUI();
}
}
@Override
@@ -58,8 +59,8 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
return "Profiles"; //можно было бы через имя класса
}
public void LoadWindowParameters() throws Exception {
if (((GlobalDatabase) Utils_.db).forms.Data.containsKey(getFormKey())) {
info = ((GlobalDatabase) Utils_.db).forms.Data.get(getFormKey());
if ((Global.mainModule.getDb()).forms.Data.containsKey(getFormKey())) {
info = (Global.mainModule.getDb()).forms.Data.get(getFormKey());
info.Apply(this);
return;
}
@@ -68,8 +69,8 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
public void SaveWindowParameters() throws Exception {
if (info != null) {
info.Init(this);
Utils_.db.Update(info);
Global.mainModule.getDb().Update(info);
} else
Utils_.db.Insert(new DBForm(getFormKey(), this));
Global.mainModule.getDb().Insert(new DBForm(getFormKey(), this));
}
}

View File

@@ -84,7 +84,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
UI.getDebugWindow().ShowAll();
ShowAllAnalyses();
ShowProjectView();
SwitchScreen(((GlobalDatabase) Utils_.db).settings.get(SettingName.SmallScreen).toBoolean());
SwitchScreen((Global.mainModule.getDb()).settings.get(SettingName.SmallScreen).toBoolean());
RefreshTabsNames();
//--
if (Global.properties.collapseProjectTrees)
@@ -294,7 +294,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
//--
@Override
public void CollapseProjectTrees() {
Utils_.db.splitters.get("SC3").position = SC3.getDividerLocation();
Global.mainModule.getDb().splitters.get("SC3").position = SC3.getDividerLocation();
//---
UI_.Clear(projectBackground);
projectBackground.add(fileBackground);
@@ -303,7 +303,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
public void ExpandProjectTrees() {
SC3.setLeftComponent(fileBackground);
projectBackground.add(SC3);
SC3.setDividerLocation(Utils_.db.splitters.get("SC3").position);
SC3.setDividerLocation(Global.mainModule.getDb().splitters.get("SC3").position);
SC3.updateUI();
}
}

View File

@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Current;
import Common.Visual.Controls.MenuBarButton;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.SettingName;
@@ -82,10 +83,10 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
} else {
if (isReady()) {
if (getMaster().isReady()) {
boolean ExtensionsOn = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ExtensionsOn).toBoolean();
boolean ExtensionsOn = (Global.mainModule.getDb()).settings.get(SettingName.ExtensionsOn).toBoolean();
String name1 = ExtensionsOn ? getMaster().file.file.getName() : Utils_.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : Utils_.getFileNameWithoutExtension(file.file);
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
} else
@@ -155,7 +156,7 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
cbFile.setSelectedIndex(-1);
for (int i = 0; i < cbFile.getItemCount(); ++i) {
ProjectFile projectFile = cbFile.getItemAt(i);
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ExtensionsOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ExtensionsOn).toBoolean()) {
//если учитываем расширения, ищем полное совпадение
if (projectFile.file.getName().equals(file_name)) {
cbFile.setSelectedIndex(i);

View File

@@ -2,6 +2,7 @@ package _VisualDVM.Visual.Windows;
import Common.Database.Objects.DBObject;
import Common.Utils.Utils_;
import Common.Visual.Controls.MenuBarButton;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.SettingName;
@@ -29,7 +30,7 @@ public abstract class TasksComparisonForm<T extends DBObject> extends Comparison
//в отличие от комбо боксов, тут события нажатия на кнопку, нет.
if (isReady()) {
if (slave.isReady()) {
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
DoComparePass(true);
} else
DoShowPass(true);
@@ -40,7 +41,7 @@ public abstract class TasksComparisonForm<T extends DBObject> extends Comparison
} else {
if (isReady()) {
if (master.isReady()) {
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
master.DoComparePass(true);
} else
master.DoShowPass(true);

View File

@@ -130,9 +130,9 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
SC65.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, sc65Listener);
SC66.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, sc66Listener);
//-
((GlobalDatabase) Utils_.db).machines.mountUI(machinesPanel);
((GlobalDatabase) Utils_.db).users.mountUI(usersPanel);
((GlobalDatabase) Utils_.db).compilers.mountUI(compilersPanel);
Global.mainModule.getDb().machines.mountUI(machinesPanel);
Global.mainModule.getDb().users.mountUI(usersPanel);
Global.mainModule.getDb().compilers.mountUI(compilersPanel);
//-
Global.testingServer.db.dvm_configurations.mountUI(configurationsPanel);
Global.testingServer.db.dvmPackages.mountUI(dvmPackagesPanel);
@@ -150,7 +150,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
//-
@Override
public void ShowAll() {
((GlobalDatabase) Utils_.db).machines.ShowUI();
Global.mainModule.getDb().machines.ShowUI();
Global.testingServer.db.dvm_configurations.ShowUI();
Global.testingServer.db.dvmPackages.ShowUI();
Global.testingServer.db.sapforPackages.ShowUI();
@@ -273,33 +273,33 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current_.get(Current.Credentials);
if (credentials.machine_id != CommonConstants.Nan) {
if (((GlobalDatabase) Utils_.db).machines.containsKey(credentials.machine_id)) {
((GlobalDatabase) Utils_.db).machines.ShowUI(credentials.machine_id);
if (((GlobalDatabase) Utils_.db).users.containsKey(credentials.user_id)) {
((GlobalDatabase) Utils_.db).users.ShowUI(credentials.user_id);
if (Global.mainModule.getDb().machines.containsKey(credentials.machine_id)) {
(Global.mainModule.getDb()).machines.ShowUI(credentials.machine_id);
if ((Global.mainModule.getDb()).users.containsKey(credentials.user_id)) {
(Global.mainModule.getDb()).users.ShowUI(credentials.user_id);
} else {
credentials.user_id = CommonConstants.Nan;
((GlobalDatabase) Utils_.db).UpdateCredentials();
(Global.mainModule.getDb()).UpdateCredentials();
}
if (((GlobalDatabase) Utils_.db).compilers.containsKey(credentials.compiler_id)) {
((GlobalDatabase) Utils_.db).compilers.ShowUI(credentials.compiler_id);
if ((Global.mainModule.getDb()).compilers.containsKey(credentials.compiler_id)) {
(Global.mainModule.getDb()).compilers.ShowUI(credentials.compiler_id);
} else {
credentials.compiler_id = CommonConstants.Nan;
((GlobalDatabase) Utils_.db).UpdateCredentials();
(Global.mainModule.getDb()).UpdateCredentials();
}
//-
if (((GlobalDatabase) Utils_.db).makefiles.containsKey(credentials.makefile_id)) {
((GlobalDatabase) Utils_.db).makefiles.ShowUI(credentials.makefile_id);
if ((Global.mainModule.getDb()).makefiles.containsKey(credentials.makefile_id)) {
(Global.mainModule.getDb()).makefiles.ShowUI(credentials.makefile_id);
} else {
credentials.makefile_id = CommonConstants.Nan;
((GlobalDatabase) Utils_.db).UpdateCredentials();
(Global.mainModule.getDb()).UpdateCredentials();
}
//-
if (((GlobalDatabase) Utils_.db).runConfigurations.containsKey(credentials.runconfiguration_id)) {
((GlobalDatabase) Utils_.db).runConfigurations.ShowUI(credentials.runconfiguration_id);
if ((Global.mainModule.getDb()).runConfigurations.containsKey(credentials.runconfiguration_id)) {
(Global.mainModule.getDb()).runConfigurations.ShowUI(credentials.runconfiguration_id);
} else {
credentials.runconfiguration_id = CommonConstants.Nan;
((GlobalDatabase) Utils_.db).UpdateCredentials();
(Global.mainModule.getDb()).UpdateCredentials();
}
} else {
credentials.machine_id = CommonConstants.Nan;
@@ -308,13 +308,13 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
credentials.remotesapfor_id = CommonConstants.Nan;
credentials.makefile_id = CommonConstants.Nan;
credentials.runconfiguration_id = CommonConstants.Nan;
((GlobalDatabase) Utils_.db).UpdateCredentials();
(Global.mainModule.getDb()).UpdateCredentials();
}
}
}
@Override
public void CollapseCredentials() {
Utils_.db.splitters.get("SC71").position = SC71.getDividerLocation();
Global.mainModule.getDb().splitters.get("SC71").position = SC71.getDividerLocation();
UI_.Clear(credentialsPanel);
credentialsPanel.add(UI.credentialsBar);
SC71.setDividerLocation(30);

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.GlobalData.Settings.SettingName;
@@ -35,10 +36,10 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
} else {
if (isReady()) {
if (getMaster().isReady()) {
boolean ExtensionsOn = ((GlobalDatabase) Utils_.db).settings.get(SettingName.ExtensionsOn).toBoolean();
boolean ExtensionsOn = (Global.mainModule.getDb()).settings.get(SettingName.ExtensionsOn).toBoolean();
String name1 = ExtensionsOn ? getMaster().file.file.getName() : Utils_.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : Utils_.getFileNameWithoutExtension(file.file);
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
} else
@@ -83,7 +84,7 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
cbFile.setSelectedIndex(-1);
for (int i = 0; i < cbFile.getItemCount(); ++i) {
ProjectFile projectFile = cbFile.getItemAt(i);
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.ExtensionsOn).toBoolean()) {
if ((Global.mainModule.getDb()).settings.get(SettingName.ExtensionsOn).toBoolean()) {
//если учитываем расширения, ищем полное совпадение
if (projectFile.file.getName().equals(file_in.file.getName())) {
cbFile.setSelectedIndex(i);
@@ -106,6 +107,6 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
}
@Override
protected boolean fortranWrapsOn() {
return ((GlobalDatabase) Utils_.db).settings.get(SettingName.FortranWrapsOn).toBoolean();
return (Global.mainModule.getDb()).settings.get(SettingName.FortranWrapsOn).toBoolean();
}
}