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

This commit is contained in:
2024-10-13 22:08:13 +03:00
parent 09b64218bd
commit 6afa2dc892
240 changed files with 1472 additions and 1518 deletions

View File

@@ -5,6 +5,7 @@ import Common.Visual.Menus.VisualiserMenuItem;
import _VisualDVM.Current;
import Visual_DVM_2021.Passes.PassCode;
import Common.Passes.Pass;
import _VisualDVM.Global;
import javax.swing.*;
import java.awt.*;
@@ -21,7 +22,7 @@ public class AttachementsMenu extends StyledPopupMenu {
@Override
public void actionPerformed(ActionEvent e) {
try {
Desktop.getDesktop().open(Current.getProject().getAttachmentsDirectory());
Desktop.getDesktop().open(Global.mainModule.getProject().getAttachmentsDirectory());
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Menus.CredentialsBar;
import _VisualDVM.Current;
import Common.Visual.Controls.MenuBarButton;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
import Common.Visual.Fonts.VisualiserFonts;
import Visual_DVM_2021.Passes.PassCode;
@@ -42,10 +43,10 @@ public class CredentialsBar extends VisualiserMenuBar {
});
}
public void ShowMachine(){
MachineButton.setText(Current.getMachine().getURL());
MachineButton.setText(Global.mainModule.getMachine().getURL());
}
public void ShowUser(){
UserButton.setText(Current.getUser().login);
UserButton.setText(Global.mainModule.getUser().login);
}
public void ShowNoMachine(){
MachineButton.setText("?");

View File

@@ -1,5 +1,6 @@
package _VisualDVM.Visual.Menus.FileMenuBar;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.LanguagesSubmenu;
import _VisualDVM.Visual.Menus.StylesSubmenu;
import _VisualDVM.Visual.Menus.TypesSubmenu;
@@ -19,10 +20,10 @@ public class FileSettingsMenu extends VisualiserMenu {
add(mLanguage = new LanguagesSubmenu() {
@Override
public void action(LanguageName languageName) {
if (Current.getFile().UpdateLanguage(languageName)) {
Current.getSapfor().ResetAllAnalyses();
Current.getFile().form.ShowLanguage();
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Current.getFile().node);
if (Global.mainModule.getFile().UpdateLanguage(languageName)) {
Global.mainModule.getSapfor().ResetAllAnalyses();
Global.mainModule.getFile().form.ShowLanguage();
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Global.mainModule.getFile().node);
}
}
});
@@ -31,9 +32,9 @@ public class FileSettingsMenu extends VisualiserMenu {
add(mStyle = new StylesSubmenu() {
@Override
public void action(LanguageStyle languageStyle) {
if (Current.getFile().UpdateStyle(languageStyle)) {
Current.getSapfor().ResetAllAnalyses();
Current.getFile().form.ShowStyle();
if (Global.mainModule.getFile().UpdateStyle(languageStyle)) {
Global.mainModule.getSapfor().ResetAllAnalyses();
Global.mainModule.getFile().form.ShowStyle();
}
}
});
@@ -42,22 +43,22 @@ public class FileSettingsMenu extends VisualiserMenu {
add(mType = new TypesSubmenu() {
@Override
public void action(FileType fileType) {
if (Current.getFile().UpdateType(fileType)) {
Current.getSapfor().ResetAllAnalyses();
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Current.getFile().node);
Current.getFile().form.ShowType();
if (Global.mainModule.getFile().UpdateType(fileType)) {
Global.mainModule.getSapfor().ResetAllAnalyses();
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Global.mainModule.getFile().node);
Global.mainModule.getFile().form.ShowType();
}
}
});
ShowType();
}
public void ShowLanguage() {
mLanguage.setText("Язык: " + Current.getFile().languageName.getDescription());
mLanguage.setText("Язык: " + Global.mainModule.getFile().languageName.getDescription());
}
public void ShowStyle() {
mStyle.setText("Стиль: " + Current.getFile().style.getDescription());
mStyle.setText("Стиль: " + Global.mainModule.getFile().style.getDescription());
}
public void ShowType() {
mType.setText("Тип: " + Current.getFile().fileType.getDescription());
mType.setText("Тип: " + Global.mainModule.getFile().fileType.getDescription());
}
}

View File

@@ -2,6 +2,7 @@ package _VisualDVM.Visual.Menus;
import Common.Visual.Menus.StyledPopupMenu;
import Common.Visual.Menus.VisualiserMenuItem;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.LanguageStyle;
import javax.swing.*;
@@ -14,9 +15,9 @@ public class FileStyleMenu extends StyledPopupMenu {
new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (Current.getFile().UpdateStyle(s)) {
Current.getSapfor().ResetAllAnalyses();
Current.getFile().form.ShowStyle();
if (Global.mainModule.getFile().UpdateStyle(s)) {
Global.mainModule.getSapfor().ResetAllAnalyses();
Global.mainModule.getFile().form.ShowStyle();
}
}
});

View File

@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import Common.Visual.Menus.TextEditorMenu;
import Common.Visual.Menus.VisualiserMenuItem;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Editor.CaretInfo;
import _VisualDVM.Utils;
import _VisualDVM.ProjectData.Files.DBProjectFile;
@@ -117,7 +118,7 @@ public class MainEditorMenu extends TextEditorMenu {
String new_ = "";
String[] data = selectedText.split("\n");
int i = 0;
switch (Current.getFile().languageName) {
switch (Global.mainModule.getFile().languageName) {
case fortran:
for (String line : data) {
if (!line.startsWith("!")) {
@@ -153,7 +154,7 @@ public class MainEditorMenu extends TextEditorMenu {
String new_ = "";
String[] data = selectedText.split("\n");
int i = 0;
switch (Current.getFile().languageName) {
switch (Global.mainModule.getFile().languageName) {
case fortran:
for (String line : data) {
if (line.startsWith("!")) {
@@ -189,7 +190,7 @@ public class MainEditorMenu extends TextEditorMenu {
@Override
public void actionPerformed(ActionEvent e) {
try {
Current.getSapfor().UpdateProjectFiles(false);
Global.mainModule.getSapfor().UpdateProjectFiles(false);
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}
@@ -236,14 +237,14 @@ public class MainEditorMenu extends TextEditorMenu {
" . Выполните проход \"Граф процедур \"");
return;
}
if (Current.getSapfor().isIntrinsic(selectedText)) {
if (Global.mainModule.getSapfor().isIntrinsic(selectedText)) {
m_inline.setText("Невозможно подставить вызов процедуры " + Utils_.Brackets(selectedText) +
" . Процедура является стандартной.");
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры " + Utils_.Brackets(selectedText) +
" . Процедура является стандартной.");
return;
}
call = Current.getFile().find_func_call(selectedText);
call =Global.mainModule.getFile().find_func_call(selectedText);
if (call == null) {
m_inline.setText("Невозможно подставить вызов процедуры " + Utils_.Brackets(selectedText) +
" . Вызов не найден в текущей строке.");
@@ -251,7 +252,7 @@ public class MainEditorMenu extends TextEditorMenu {
" . Объявление процедуры уже находится в текущей строке.");
return;
}
decl = Current.getProject().allFunctions.get(call.funcName);
decl = Global.mainModule.getProject().allFunctions.get(call.funcName);
if (decl.type.equals(FunctionType.NotFound)) {
m_inline.setText("Невозможно подставить вызов процедуры " + Utils_.Brackets(selectedText) +
" . Объявление процедуры не найдено в проекте.");
@@ -281,11 +282,11 @@ public class MainEditorMenu extends TextEditorMenu {
m_gotoHeader.setText("Невозможно перейти к заголовочному файлу. Выполните проход \"Поиск зависимостей по включению\"");
return;
}
if (!Current.getFile().relativeHeaders.containsKey(header_)) {
if (!Global.mainModule.getFile().relativeHeaders.containsKey(header_)) {
m_gotoHeader.setText("Невозможно перейти к заголовочному файлу " + Utils_.Brackets(header_) + " . Файл не найден среди включений текущего файла.");
return;
}
header = Current.getFile().relativeHeaders.get(header_);
header = Global.mainModule.getFile().relativeHeaders.get(header_);
m_gotoHeader.setText("Переход к заголовочному файлу " + Utils_.Brackets(header_));
m_gotoHeader.setEnabled(true);
}
@@ -298,7 +299,7 @@ public class MainEditorMenu extends TextEditorMenu {
"Выполните проход \"Граф циклов\"");
return;
}
loop = Current.getFile().find_current_loop();
loop = Global.mainModule.getFile().find_current_loop();
if (loop == null) {
m_loop_union.setText("Невозможно объединить цикл в текущей строке со следующим. Не найдено циклов в текущей строке.");
return;
@@ -333,7 +334,7 @@ public class MainEditorMenu extends TextEditorMenu {
m_add_lines_to_region.setText("Добавить строки в область");
m_remove_lines_from_region.setText("Удалить строки из области");
}
if (Current.getSapfor().OldFiles.isEmpty()) {
if (Global.mainModule.getSapfor().OldFiles.isEmpty()) {
m_undo.setEnabled(false);
m_undo.setText("Невозможно отменить последнюю модификацию. Модификации отсутствуют.");
} else {

View File

@@ -30,7 +30,7 @@ public class ProjectFilesMenu extends GraphMenu {
@Override
public void actionPerformed(ActionEvent e) {
try {
Desktop.getDesktop().open(Current.getProject().Home);
Desktop.getDesktop().open(Global.mainModule.getProject().Home);
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}
@@ -49,8 +49,8 @@ public class ProjectFilesMenu extends GraphMenu {
add(new VisualiserMenuItem("Удалить текущий проект", "/icons/Delete.png") {
{
addActionListener(e -> {
if (Current.HasProject()) {
UI.getVersionsWindow().getVersionsForm().getTree().SelectNode(Current.getProject().node);
if (Global.mainModule.HasProject()) {
UI.getVersionsWindow().getVersionsForm().getTree().SelectNode(Global.mainModule.getProject().node);
Pass.passes.get(PassCode.DeleteVersion).Do();
}
});
@@ -62,7 +62,7 @@ public class ProjectFilesMenu extends GraphMenu {
m_multiselection.addActionListener(e -> {
Global.files_multiselection = !Global.files_multiselection;
m_multiselection.setIcon(Utils_.getIcon(Global.files_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
Current.getProject().SelectAllFiles(false);
Global.mainModule.getProject().SelectAllFiles(false);
UI.getMainWindow().getProjectWindow().RefreshProjectFiles();
//-
@@ -72,13 +72,13 @@ public class ProjectFilesMenu extends GraphMenu {
//-
m_select_all = new StableMenuItem("Выбрать всё", "/icons/SelectAll.png");
m_select_all.addActionListener(e -> {
Current.getProject().SelectAllFiles(true);
Global.mainModule.getProject().SelectAllFiles(true);
tree.updateUI();
});
add(m_select_all);
m_unselect_all = new StableMenuItem("Отменить всё", "/icons/UnselectAll.png");
m_unselect_all.addActionListener(e -> {
Current.getProject().SelectAllFiles(false);
Global.mainModule.getProject().SelectAllFiles(false);
tree.updateUI();
});
add(m_unselect_all);

View File

@@ -20,8 +20,8 @@ public class ProjectSettingsMenu extends VisualiserMenu {
add(mLanguage = new LanguagesSubmenu() {
@Override
public void action(LanguageName languageName) {
if (Current.getProject().UpdateLanguage(languageName)) {
Current.getSapfor().ResetAllAnalyses();
if (Global.mainModule.getProject().UpdateLanguage(languageName)) {
Global.mainModule.getSapfor().ResetAllAnalyses();
ShowLanguage();
}
}
@@ -31,7 +31,7 @@ public class ProjectSettingsMenu extends VisualiserMenu {
add(mStyle = new StylesSubmenu() {
@Override
public void action(LanguageStyle languageStyle) {
if (Current.getProject().UpdateStyle(languageStyle))
if (Global.mainModule.getProject().UpdateStyle(languageStyle))
ShowStyle();
}
});
@@ -66,9 +66,9 @@ public class ProjectSettingsMenu extends VisualiserMenu {
add((Global.mainModule.getDb()).settings.get(SettingName.GCOVLimit).getMenuItem());
}
public void ShowLanguage() {
mLanguage.setText("Язык: " + Current.getProject().languageName.getDescription());
mLanguage.setText("Язык: " + Global.mainModule.getProject().languageName.getDescription());
}
public void ShowStyle() {
mStyle.setText("Стиль: " + Current.getProject().style.getDescription());
mStyle.setText("Стиль: " + Global.mainModule.getProject().style.getDescription());
}
}

View File

@@ -3,6 +3,7 @@ import Common.Current_;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.VisualiserMenu;
import Common.Visual.Fonts.VisualiserFonts;
import _VisualDVM.Visual.UI;
@@ -21,7 +22,7 @@ public class ProjectViewMenu extends VisualiserMenu {
setIcon(Utils_.getIcon(view.getIcon()));
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
addActionListener(e -> {
Current_.set(Current.ProjectView, view);
Global.mainModule.set(Current.ProjectView, view);
UI.getMainWindow().getProjectWindow().ShowProjectView();
});
}

View File

@@ -5,6 +5,7 @@ import Common.Visual.Menus.VisualiserMenuItem;
import Common.Visual.Selectable;
import Common.Visual.Trees.DataTree;
import Common.Visual.Trees.SelectableTree;
import _VisualDVM.Global;
import javax.swing.*;
import java.awt.event.ActionEvent;
@@ -41,7 +42,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
m_select_for_current.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
Object o = Current_.get(tree.getCurrent());
Object o = Global.mainModule.get(tree.getCurrent());
if (o instanceof Selectable) {
((Selectable) o).SelectAllChildren(true);
}
@@ -54,7 +55,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
m_unselect_for_current.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
Object o = Current_.get(tree.getCurrent());
Object o = Global.mainModule.get(tree.getCurrent());
if (o instanceof Selectable) {
((Selectable) o).SelectAllChildren(false);
}
@@ -68,7 +69,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
public abstract void SelectAll(boolean select);
@Override
public void CheckElementsVisibility() {
Object current = Current_.get(tree.getCurrent());
Object current = Global.mainModule.get(tree.getCurrent());
if ((current != null) && (current.getClass().equals(getTargetClass()))) {
String name = ((Selectable) current).getSelectionText();
m_select_for_current.setText("Выбрать всё для " +

View File

@@ -21,7 +21,7 @@ public class VersionsMenu extends GraphMenu<DataTree> {
m_multiselection.addActionListener(e -> {
Global.versions_multiselection = !Global.versions_multiselection;
m_multiselection.setIcon(Utils_.getIcon(Global.versions_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
Current.getRoot().SelectAllVersions(false);
Global.mainModule.getRoot().SelectAllVersions(false);
UI.getVersionsWindow().getVersionsForm().getTree().updateUI();
});
add(m_multiselection);
@@ -30,13 +30,13 @@ public class VersionsMenu extends GraphMenu<DataTree> {
//-
m_select_all = new StableMenuItem("Выбрать всё, кроме резервных копий","/icons/SelectAll.png");
m_select_all.addActionListener(e -> {
Current.getRoot().SelectAllVersions(true);
Global.mainModule.getRoot().SelectAllVersions(true);
tree.updateUI();
});
add(m_select_all);
m_unselect_all = new StableMenuItem("Отменить всё","/icons/UnselectAll.png");
m_unselect_all.addActionListener(e -> {
Current.getRoot().SelectAllVersions(false);
Global.mainModule.getRoot().SelectAllVersions(false);
tree.updateUI();
});
add(m_unselect_all);

View File

@@ -266,7 +266,7 @@ public class UI {
tabs.setTitleAt(i, flag ? tabs.getToolTipTextAt(i) : "");
}
public static void CreateVersionsWindow() {
versionsWindow = new VersionsForm(Current.getRoot());
versionsWindow = new VersionsForm(Global.mainModule.getRoot());
}
//-
public static void ShowSearchForm(boolean replace) {

View File

@@ -1,5 +1,6 @@
package _VisualDVM.Visual.Windows;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Interface.AnalysisWindow;
import javax.swing.*;
@@ -16,7 +17,7 @@ public class AnalysisForm implements AnalysisWindow {
private JPanel regionsPanel;
public AnalysisForm() {
LoadSplitters();
Current.getProject().parallelRegions.mountUI(regionsPanel);
Global.mainModule.getProject().parallelRegions.mountUI(regionsPanel);
}
@Override
public JPanel getContent() {
@@ -24,7 +25,7 @@ public class AnalysisForm implements AnalysisWindow {
}
@Override
public void ShowProjectMaxDim() {
l_maxdim.setText("Наибольшая размерность DVM-шаблона: " + Current.getProject().maxdim);
l_maxdim.setText("Наибольшая размерность DVM-шаблона: " + Global.mainModule.getProject().maxdim);
}
@Override
public void ShowNoProjectMaxDim() {
@@ -32,9 +33,9 @@ public class AnalysisForm implements AnalysisWindow {
}
@Override
public void ShowMetrics() {
l_lines.setText("Общее количество строк кода: " + Current.getProject().LinesCount());
l_spf_dirs.setText("Всего объявлено SPF директив: " + Current.getProject().SPFCount());
l_dvm_dirs.setText("Всего объявлено DVM директив: " + Current.getProject().DVMCount());
l_lines.setText("Общее количество строк кода: " + Global.mainModule.getProject().LinesCount());
l_spf_dirs.setText("Всего объявлено SPF директив: " + Global.mainModule.getProject().SPFCount());
l_dvm_dirs.setText("Всего объявлено DVM директив: " + Global.mainModule.getProject().DVMCount());
}
@Override
public void ShowNoMetrics() {
@@ -44,22 +45,22 @@ public class AnalysisForm implements AnalysisWindow {
}
@Override
public void ShowRegions() {
Current.getProject().parallelRegions.ShowUI();
Global.mainModule.getProject().parallelRegions.ShowUI();
}
@Override
public void ShowNoRegions() {
Current.getProject().parallelRegions.ClearUI();
Global.mainModule.getProject().parallelRegions.ClearUI();
}
@Override
public void ShowLoopsCount() {
l_loops.setText("Общее количество циклов: " + Current.getProject().LoopsCount());
l_loops.setText("Общее количество циклов: " + Global.mainModule.getProject().LoopsCount());
}
@Override
public void ShowFunctionsCount() {
l_functions.setText("Всего объявлено процедур: " + Current.getProject().FunctionsCount());
l_functions.setText("Всего объявлено процедур: " + Global.mainModule.getProject().FunctionsCount());
}
@Override
public void ShowArraysCount() {
l_arrays.setText(" Всего объявлено массивов: " + Current.getProject().ArraysCount());
l_arrays.setText(" Всего объявлено массивов: " + Global.mainModule.getProject().ArraysCount());
}
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Windows;
import _VisualDVM.Current;
import Common.Visual.TextField.StyledTextField;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
import _VisualDVM.Visual.Interface.ArraysWindow;
@@ -21,8 +22,8 @@ public class ArraysForm implements ArraysWindow {
private JPanel savedArraysBackground;
public ArraysForm(){
LoadSplitters();
Current.getProject().declaratedArrays.mountUI(arraysPanel);
Current.getProject().db.savedArrays.mountUI(savedArraysPanel);
Global.mainModule.getProject().declaratedArrays.mountUI(arraysPanel);
Global.mainModule.getProject().db.savedArrays.mountUI(savedArraysPanel);
//--
filterName.setText(ProjectArray.filterName);
filterName.getDocument().addDocumentListener(new DocumentListener() {
@@ -115,13 +116,13 @@ public class ArraysForm implements ArraysWindow {
}
@Override
public void ShowArrays() {
Current.getProject().declaratedArrays.ShowUI();
Current.getProject().db.savedArrays.ShowUI();
Global.mainModule.getProject().declaratedArrays.ShowUI();
Global.mainModule.getProject().db.savedArrays.ShowUI();
}
@Override
public void ShowNoArrays() {
Current.getProject().declaratedArrays.ClearUI();
Current.getProject().db.savedArrays.ClearUI();
Global.mainModule.getProject().declaratedArrays.ClearUI();
Global.mainModule.getProject().db.savedArrays.ClearUI();
}
private void createUIComponents() {
// TODO: place custom component creation code here

View File

@@ -46,8 +46,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().descriptionAdditionDraft =
if (!Global.mainModule.getBugReport().state.equals(BugReportState.draft))
Global.mainModule.getBugReport().descriptionAdditionDraft =
BugReportDescriptionAddition.getText();
}
};
@@ -60,8 +60,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().commentAdditionDraft = BugReportCommentAddition.getText();
if (!Global.mainModule.getBugReport().state.equals(BugReportState.draft))
Global.mainModule.getBugReport().commentAdditionDraft = BugReportCommentAddition.getText();
}
};
DocumentListener descriptionListener = new DocumentListener() {
@@ -73,8 +73,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().description =
if (Global.mainModule.getBugReport().state.equals(BugReportState.draft))
Global.mainModule.getBugReport().description =
BugReportDescription.getText();
Global.componentsServer.db.bugReports.RefreshUI();
}
@@ -88,8 +88,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().comment = BugReportComment.getText();
if (Global.mainModule.getBugReport().state.equals(BugReportState.draft))
Global.mainModule.getBugReport().comment = BugReportComment.getText();
}
};
//-
@@ -436,10 +436,10 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void ShowAccount() {
lAccountName.setText(Utils_.Brackets(Current.getAccount().name));
lAccountMail.setText(Utils_.Brackets(Current.getAccount().email));
lAccountRole.setText(Utils_.Brackets(Current.getAccount().role.getDescription()));
switch (Current.getAccount().role) {
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
switch (Global.mainModule.getAccount().role) {
case Undefined:
/// UI.Clear(accountPanel);
// accountPanel.add(new CallbackWelcomeForm().content);
@@ -553,7 +553,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
public void ShowCurrentBugReport() {
SwitchListeners(false);
// currentBugReportTabs.setSelectedIndex(0);
BugReport target = Current.getBugReport();
BugReport target = Global.mainModule.getBugReport();
BugReportInterface.CheckSubscribers(target);
Global.componentsServer.db.subscribers.ShowUI();
//-
@@ -576,12 +576,12 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
if (target.state.equals(BugReportState.draft)) {
ShowDraft();
} else {
switch (Current.getAccount().role) {
switch (Global.mainModule.getAccount().role) {
case User:
if (Current.getAccount().email.equalsIgnoreCase(target.sender_address)) {
if (Global.mainModule.getAccount().email.equalsIgnoreCase(target.sender_address)) {
ShowSender(); //отправитель.может делать с багом все.
} else {
if (Current.getAccount().email.equalsIgnoreCase(target.executor_address)) {
if (Global.mainModule.getAccount().email.equalsIgnoreCase(target.executor_address)) {
ShowUserExecutor(); //исполнитель. может менять прогресс и дополнять комментарий.
} else ShowUser(); //недоступно ничего. и баг ему невидим. но на всякий случай.
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Visual.Windows;
import _VisualDVM.Current;
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import java.util.Vector;
@@ -15,7 +16,7 @@ public class CombineFilesDialog extends ComboTextDialog {
String fileName = (String) fields.getSelectedItem();
// тут 2 случая. если имя файла совпадает с 1 из существующих, то все хорошо.
//если нет. тогда проверяем отсуствие слешей и полная валидация имени одиночного файла.
Vector<String> files_order = Current.getProject().files_order;
Vector<String> files_order = Global.mainModule.getProject().files_order;
if (!files_order.contains(fileName))
Utils.validateFileShortNewName(fileName, Log);
}

View File

@@ -5,6 +5,7 @@ import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
import _VisualDVM.Visual.Editor.BaseEditor;
import _VisualDVM.Visual.Controls.ShortLabel;
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
@@ -76,8 +77,8 @@ public abstract class ComparisonForm<T> {
public void ApplyObject() {
RemoveObject();
TextLog log = new TextLog();
if (Current_.Check(log, getCurrentObjectName())) {
object = (T) Current_.get(getCurrentObjectName());
if (Global.mainModule.Check(log, getCurrentObjectName())) {
object = (T) Global.mainModule.get(getCurrentObjectName());
applyObject();
showObject();
} else

View File

@@ -2,6 +2,7 @@ package _VisualDVM.Visual.Windows;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.TextField.StyledTextField;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphForm;
import _VisualDVM.ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphUI;
import Visual_DVM_2021.Passes.All.SPF_GetGraphFunctionPositions;
@@ -63,7 +64,7 @@ public class FunctionsForm implements FunctionsWindow {
}
@Override
public void ShowCurrentFunction() {
lCurrentFunction.setText(Current.getFunction().funcName);
lCurrentFunction.setText(Global.mainModule.getFunction().funcName);
}
@Override
public void ShowNoCurrentFunction() {
@@ -74,9 +75,9 @@ public class FunctionsForm implements FunctionsWindow {
ShowExternalFilter.setSelected(SPF_GetGraphFunctionPositions.showExternalFunctions);
ShowUnreachableFilter.setSelected(SPF_GetGraphFunctionPositions.showUnreachableFunctions);
//-
sIterations.setValue(Current.getProject().fgIterations);
sResistance.setValue(Current.getProject().fgResistance);
sScreen.setValue(Current.getProject().fgScreen);
sIterations.setValue(Global.mainModule.getProject().fgIterations);
sResistance.setValue(Global.mainModule.getProject().fgResistance);
sScreen.setValue(Global.mainModule.getProject().fgScreen);
//-
cbShowByCurrentFunction.setSelected(SPF_GetGraphFunctionPositions.showByCurrentFunction);
ShowIn.setSelected(SPF_GetGraphFunctionPositions.showIn);
@@ -103,28 +104,28 @@ public class FunctionsForm implements FunctionsWindow {
Pass.passes.get(PassCode.SaveGraph).Do();
}
});
sIterations.setModel(new SpinnerNumberModel(Current.getProject().fgIterations,
sIterations.setModel(new SpinnerNumberModel(Global.mainModule.getProject().fgIterations,
100, 5000, 100
));
sResistance.setModel(new SpinnerNumberModel(Current.getProject().fgResistance,
sResistance.setModel(new SpinnerNumberModel(Global.mainModule.getProject().fgResistance,
10, 5000, 50
));
sScreen.setModel(new SpinnerNumberModel(Current.getProject().fgScreen,
sScreen.setModel(new SpinnerNumberModel(Global.mainModule.getProject().fgScreen,
0.25, 2.0, 0.05
));
sDepth.setModel(new SpinnerNumberModel(1,
0, 64, 1
));
UI_.MakeSpinnerRapid(sIterations, e -> {
Current.getProject().UpdatefgIterations((int) sIterations.getValue());
Global.mainModule.getProject().UpdatefgIterations((int) sIterations.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI_.MakeSpinnerRapid(sResistance, e -> {
Current.getProject().UpdatefgResistance((int) sResistance.getValue());
Global.mainModule.getProject().UpdatefgResistance((int) sResistance.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI_.MakeSpinnerRapid(sScreen, e -> {
Current.getProject().UpdatefgScreen((double) sScreen.getValue());
Global.mainModule.getProject().UpdatefgScreen((double) sScreen.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI_.MakeSpinnerRapid(sDepth, e -> {

View File

@@ -83,9 +83,9 @@ public class MainForm extends Form implements MainWindow {
}
private void InstallProjectPanel() {
globalTabs.insertTab("", null,
(projectForm = new ProjectForm()).content, Current.getProject().description, 0);
(projectForm = new ProjectForm()).content,Global.mainModule.getProject().description, 0);
globalTabs.setTabComponentAt(0,
new TabToolBar("Проект: " + Current.getProject().name, PassCode.CloseCurrentProject) {
new TabToolBar("Проект: " + Global.mainModule.getProject().name, PassCode.CloseCurrentProject) {
@Override
public void leftMouseAction() {
globalTabs.setSelectedIndex(0);

View File

@@ -123,7 +123,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
}
@Override
public void ShowProjectSapforLog() {
logText.setText(Current.getProject().Log);
logText.setText(Global.mainModule.getProject().Log);
logText.setCaretPosition(0);
}
@Override
@@ -154,9 +154,9 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
//filesTabs.setTabComponentAt(0,
// new TabToolBar(Current.getFile().name, PassCode_2021.CloseCurrentFile));
// projectTabs.setTitleAt(0, "Файл: " + Current.getFile().name);
fileBackground.add((Current.getFile().form = new FileForm(Current.getFile())).getContent());
fileBackground.add((Global.mainModule.getFile().form = new FileForm(Global.mainModule.getFile())).getContent());
projectTabs.setTabComponentAt(0,
new TabToolBar("Файл: " + Current.getFile().name, PassCode.CloseCurrentFile) {
new TabToolBar("Файл: " + Global.mainModule.getFile().name, PassCode.CloseCurrentFile) {
@Override
public void leftMouseAction() {
projectTabs.setSelectedIndex(0);
@@ -178,10 +178,10 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
@Override
public void GotoFile(String fileName, int line, boolean focus) {
if (focus) FocusFile();
if (Current.HasFile() && Current.getFile().name.equals(fileName))
Current.getFile().form.getEditor().gotoLine(line);
else if (Current.getProject().db.files.containsKey(fileName)) {
DBProjectFile targetFile = Current.getProject().db.files.get(fileName);
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(fileName))
Global.mainModule.getFile().form.getEditor().gotoLine(line);
else if (Global.mainModule.getProject().db.files.containsKey(fileName)) {
DBProjectFile targetFile = Global.mainModule.getProject().db.files.get(fileName);
targetFile.UpdateLastLine(line);
Pass.passes.get(PassCode.OpenCurrentFile).Do(targetFile);
}
@@ -229,17 +229,17 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
@Override
public void RefreshProjectTreeAndMessages() {
RefreshProjectFiles();
DBProjectFile badFile = Current.getProject().getFirstBadFile();
DBProjectFile badFile = Global.mainModule.getProject().getFirstBadFile();
if (badFile != null) {
Pass.passes.get(PassCode.OpenCurrentFile).Do(badFile);
UI.getMainWindow().FocusProject();
UI.getMainWindow().getProjectWindow().FocusFile();
}
//-
if (Current.HasFile()) {
Current.getFile().form.ShowMessages();
if (badFile != null && badFile.equals(Current.getFile()))
Current.getFile().form.ShowFirstError();
if (Global.mainModule.HasFile()) {
Global.mainModule.getFile().form.ShowMessages();
if (badFile != null && badFile.equals(Global.mainModule.getFile()))
Global.mainModule.getFile().form.ShowFirstError();
}
}
@Override
@@ -255,7 +255,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
@Override
public void ShowProjectView() {
UI_.Clear(projectViewPanel);
ProjectView view = Current.getProjectView();
ProjectView view = Global.mainModule.getProjectView();
menuBar.getProjectViewMenu().setToolTipText(view.getDescription());
menuBar.getProjectViewMenu().setIcon(Utils_.getIcon(view.getIcon()));
switch (view) {

View File

@@ -3,6 +3,7 @@ import Common.Current_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
import _VisualDVM.Visual.Controls.ShortLabel;
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
import _VisualDVM.Visual.UI;
@@ -69,8 +70,8 @@ public class SapforPackagesComparisonForm {
RemoveObject();
//---
TextLog log = new TextLog();
if (Current_.Check(log, Current.SapforPackage)) {
object = Current.getSapforPackage();
if (Global.mainModule.Check(log, Current.SapforPackage)) {
object = Global.mainModule.getSapforPackage();
if (object.isLoaded() || (Pass.passes.get(PassCode.DownloadSapforPackage).Do(object))) {
showObject();
}

View File

@@ -5,6 +5,7 @@ import Common.Visual.Windows.Form;
import _VisualDVM.Current;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.Trees.StyledTree;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import Visual_DVM_2021.Passes.PassCode;
import Common.Passes.Pass;
@@ -172,8 +173,8 @@ public class SearchReplaceForm extends Form {
DefaultMutableTreeNode selectedFile = (DefaultMutableTreeNode) getLastSelectedPathComponent();
if (selectedFile != null) {
Pair<String, Long> info = (Pair<String, Long>) selectedFile.getUserObject();
if (Current.getProject().db.files.containsKey(info.getKey())) {
Pass.passes.get(PassCode.OpenCurrentFile).Do(Current.getProject().db.files.get(info.getKey()));
if (Global.mainModule.getProject().db.files.containsKey(info.getKey())) {
Pass.passes.get(PassCode.OpenCurrentFile).Do(Global.mainModule.getProject().db.files.get(info.getKey()));
//--->>>
replaceOn.setSelected(false);
setMode(false);
@@ -195,7 +196,7 @@ public class SearchReplaceForm extends Form {
super.Show();
//------->>
showNoFilesMatches();
if (lastProjectPath.equals(Current.getProject().Home.getAbsolutePath()))
if (lastProjectPath.equals(Global.mainModule.getProject().Home.getAbsolutePath()))
showFilesMatches();
else
dropFilesMatches();
@@ -238,8 +239,8 @@ public class SearchReplaceForm extends Form {
public void actionPerformed(ActionEvent e) {
try {
showNoFilesMatches();
lastProjectPath = Current.getProject().Home.getAbsolutePath();
matches = Current.getProject().getMatches(
lastProjectPath = Global.mainModule.getProject().Home.getAbsolutePath();
matches = Global.mainModule.getProject().getMatches(
tfFind.getText(),
registerOn.isSelected(),
wholeWordOn.isSelected());

View File

@@ -225,13 +225,13 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
}
@Override
public void ShowCurrentCompiler() {
String title = (Current.HasCompiler() && Current.getCompiler().type.equals(CompilerType.dvm)) ?
"DVM система: " + Current.getCompiler().description : "DVM система: ?";
String title = (Global.mainModule.HasCompiler() && Global.mainModule.getCompiler().type.equals(CompilerType.dvm)) ?
"DVM система: " + Global.mainModule.getCompiler().description : "DVM система: ?";
testingTabs.setTitleAt(0, title);
}
@Override
public void ShowCurrentServerSapfor() {
testingTabs.setTitleAt(2, "SAPFOR: " + Current.getServerSapfor().version);
testingTabs.setTitleAt(2, "SAPFOR: " + Global.mainModule.getServerSapfor().version);
}
@Override
public void ShowNoServerSapfor() {
@@ -271,7 +271,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
testingTabs.setSelectedIndex(3);
}
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current_.get(Current.Credentials);
Credentials credentials = Global.mainModule.getCredentials();
if (credentials.machine_id != CommonConstants.Nan) {
if (Global.mainModule.getDb().machines.containsKey(credentials.machine_id)) {
(Global.mainModule.getDb()).machines.ShowUI(credentials.machine_id);

View File

@@ -2,6 +2,7 @@ package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Visual.Trees.TreeForm;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.Arrays.UI.DimensionsTableForm;
import _VisualDVM.ProjectData.SapforData.Arrays.UI.RulesTree;
import _VisualDVM.Visual.Interface.VariantsWindow;
@@ -28,13 +29,13 @@ public class VariantsForm implements VariantsWindow {
//--
public VariantsForm() {
LoadSplitters();
Current.getProject().parallelVariants.mountUI(variantsPanel);
Global.mainModule.getProject().parallelVariants.mountUI(variantsPanel);
//-
BDistributed.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Current.getProject().SwitchFilterDistributed();
BDistributed.setIcon(Utils_.getIcon(Current.getProject().f_distributed() ? "/icons/Pick.png" : "/icons/NotPick.png"));
Global.mainModule.getProject().SwitchFilterDistributed();
BDistributed.setIcon(Utils_.getIcon(Global.mainModule.getProject().f_distributed() ? "/icons/Pick.png" : "/icons/NotPick.png"));
ShowVariantsFilter();
ShowFilteredVariantsCount();
}
@@ -42,8 +43,8 @@ public class VariantsForm implements VariantsWindow {
bMultiplied.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Current.getProject().SwitchFilterMultiplied();
bMultiplied.setIcon(Utils_.getIcon(Current.getProject().f_multiplied() ? "/icons/Pick.png" : "/icons/NotPick.png"));
Global.mainModule.getProject().SwitchFilterMultiplied();
bMultiplied.setIcon(Utils_.getIcon(Global.mainModule.getProject().f_multiplied() ? "/icons/Pick.png" : "/icons/NotPick.png"));
ShowVariantsFilter();
ShowFilteredVariantsCount();
}
@@ -68,8 +69,8 @@ public class VariantsForm implements VariantsWindow {
}
@Override
public void ShowVariantsFilterButtons() {
BDistributed.setIcon(Utils_.getIcon(Current.getProject().f_distributed() ? "/icons/Pick.png" : "/icons/NotPick.png"));
bMultiplied.setIcon(Utils_.getIcon(Current.getProject().f_multiplied() ? "/icons/Pick.png" : "/icons/NotPick.png"));
BDistributed.setIcon(Utils_.getIcon(Global.mainModule.getProject().f_distributed() ? "/icons/Pick.png" : "/icons/NotPick.png"));
bMultiplied.setIcon(Utils_.getIcon(Global.mainModule.getProject().f_multiplied() ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
@Override
public void ShowVariantsFilter() {
@@ -81,11 +82,11 @@ public class VariantsForm implements VariantsWindow {
}
@Override
public void ShowFilteredVariantsCount() {
VisibleVariantsCount.setText(String.valueOf(Current.getProject().getFilteredVariantsCount()));
VisibleVariantsCount.setText(String.valueOf(Global.mainModule.getProject().getFilteredVariantsCount()));
}
@Override
public void ShowTotalVariantsCount() {
TotalVariantsCount.setText(String.valueOf(Current.getProject().getTotalVariantsCount()));
TotalVariantsCount.setText(String.valueOf(Global.mainModule.getProject().getTotalVariantsCount()));
}
@Override
public void ShowCheckedVariantsCount() {
@@ -93,15 +94,15 @@ public class VariantsForm implements VariantsWindow {
}
@Override
public void ShowVariants() {
Current.getProject().parallelVariants.ShowUI();
Global.mainModule.getProject().parallelVariants.ShowUI();
}
@Override
public void RefreshVariants() {
Current.getProject().parallelVariants.RefreshUI();
Global.mainModule.getProject().parallelVariants.RefreshUI();
}
@Override
public void ShowNoVariants() {
Current.getProject().parallelVariants.ClearUI();
Global.mainModule.getProject().parallelVariants.ClearUI();
}
@Override
public void ShowNoCheckedVariantsCount() {