рефакторинг хранения окон
This commit is contained in:
@@ -77,10 +77,10 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
|
||||
if (e.isControlDown()) {
|
||||
switch (e.getKeyCode()) {
|
||||
case KeyEvent.VK_F:
|
||||
UI.ShowSearchForm(false);
|
||||
Global.mainModule.getUI().ShowSearchForm(false);
|
||||
break;
|
||||
case KeyEvent.VK_H:
|
||||
UI.ShowSearchForm(true);
|
||||
Global.mainModule.getUI().ShowSearchForm(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.ProjectData.Files.UI;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -36,7 +37,7 @@ public class FilesHyperlinksPanel extends JPanel {
|
||||
String[] data = links.get(index).split(":");
|
||||
String file = data[0];
|
||||
int line = Integer.parseInt(data[1]);
|
||||
UI.getMainWindow().getProjectWindow().GotoFile(file, line, true);
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().GotoFile(file, line, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -70,14 +70,14 @@ public class FilesTree extends StyledTree {
|
||||
if (o instanceof File) {
|
||||
Global.mainModule.set(Current.SelectedDirectory, o);
|
||||
Global.mainModule.set(Current.SelectedFile, null);
|
||||
UI.getMainWindow().getProjectWindow().ShowNoSelectedFile();
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().ShowNoSelectedFile();
|
||||
} else if (o instanceof DBProjectFile) {
|
||||
Global.mainModule.set(Current.SelectedFile, o);
|
||||
File file = ((DBProjectFile) o).file;
|
||||
Global.mainModule.set(Current.SelectedDirectory, file.getParentFile());
|
||||
UI.getMainWindow().getProjectWindow().ShowSelectedFile();
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().ShowSelectedFile();
|
||||
}
|
||||
UI.getMainWindow().getProjectWindow().ShowSelectedDirectory();
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().ShowSelectedDirectory();
|
||||
}
|
||||
@Override
|
||||
public void LeftMouseAction2() {
|
||||
@@ -86,7 +86,7 @@ public class FilesTree extends StyledTree {
|
||||
if (o instanceof DBProjectFile) {
|
||||
//очень важно. иначе по открытии файла дерево остается в фокусе.
|
||||
//и не происходит прокрутки скролла к строке!!
|
||||
UI.getMainWindow().getProjectWindow().FocusFileTabs();
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().FocusFileTabs();
|
||||
Global.mainModule.getPass(PassCode.OpenCurrentFile).Do(o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ public class db_project_info extends DBObject {
|
||||
newVersions.add(version);
|
||||
//--->>
|
||||
versions.put(version.name, version);
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().AddNode(node, version.node = new DefaultMutableTreeNode(version));
|
||||
Global.mainModule.getUI().getVersionsWindow().getVersionsForm().getTree().AddNode(node, version.node = new DefaultMutableTreeNode(version));
|
||||
SaveVersionToBuild("");
|
||||
}
|
||||
public void SaveVersionToBuild(String v_name) throws Exception {
|
||||
@@ -1081,14 +1081,14 @@ public class db_project_info extends DBObject {
|
||||
public void undoLastTransformation() throws Exception {
|
||||
Global.mainModule.set(Current.Version, null);
|
||||
//---
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_version.node);
|
||||
Global.mainModule.getUI().getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_version.node);
|
||||
Utils_.forceDeleteWithCheck(last_version.Home);
|
||||
versions.remove(last_version.name);
|
||||
last_version = null;
|
||||
//---
|
||||
if (last_modification != null) {
|
||||
Utils_.forceDeleteWithCheck(last_modification.Home);
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_modification.node);
|
||||
Global.mainModule.getUI().getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_modification.node);
|
||||
versions.remove(last_modification.name);
|
||||
last_modification = null;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package _VisualDVM.ProjectData.SapforData.Arrays.UI;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Tables.DBObjectEditor;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
@@ -20,6 +21,6 @@ public class DimensionStateChanger extends DBObjectEditor<TemplateDimension> {
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
value.SwitchState();
|
||||
setText(value.state.getMaskDescription());
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowFilteredVariantsCount();
|
||||
Global.mainModule.getUI().getVersionsWindow().getVariantsWindow().ShowFilteredVariantsCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ public abstract class FileObject extends iDBObject {
|
||||
return Global.mainModule.getProject().db.files.Data.get(file);
|
||||
}
|
||||
public void Show(boolean focus) {
|
||||
UI.getMainWindow().getProjectWindow().GotoFile(file, line, focus);
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().GotoFile(file, line, focus);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class FunctionsGraphMenu extends StyledPopupMenu {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (Global.mainModule.HasSelectedFunction()) {
|
||||
Global.mainModule.set(Current.Function, Global.mainModule.getSelectionFunction());
|
||||
UI.getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
|
||||
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
|
||||
Global.mainModule.getPass(PassCode.SPF_GetGraphFunctionPositions).Do();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Variants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.PredictorStatistic.PredictorStatistics_2021;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
@@ -79,7 +80,7 @@ public class ParallelVariant extends DBObject {
|
||||
@Override
|
||||
public void Select(boolean flag) {
|
||||
super.Select(flag);
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowCheckedVariantsCount();
|
||||
Global.mainModule.getUI().getVersionsWindow().getVariantsWindow().ShowCheckedVariantsCount();
|
||||
}
|
||||
public File restoreProject() {
|
||||
project = null;
|
||||
|
||||
Reference in New Issue
Block a user