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

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

@@ -2,6 +2,7 @@ package _VisualDVM.ProjectData.Files;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.ProjectData.GCOV.GCOV_info;
import _VisualDVM.ProjectData.LanguageName;
@@ -356,7 +357,7 @@ public class DBProjectFile extends ProjectFile {
for (FuncInfo fi : function_decls.values()) {
for (FuncCall fc : fi.calls) {
if ((fc.line == form.getEditor().getCurrentLine()) &&
!Current.getSapfor().isIntrinsic(fc.funcName)
!Global.mainModule.getSapfor().isIntrinsic(fc.funcName)
) {
return fc;
}
@@ -416,7 +417,7 @@ public class DBProjectFile extends ProjectFile {
break;
}
languageName = parent.languageName;
if (sapforStyle) style = Current.getSapfor().getStyle();
if (sapforStyle) style = Global.mainModule.getSapfor().getStyle();
else style = parent.style;
}
public void importSourceCodeSettings(DBProjectFile parent, boolean sapforStyle) throws Exception {
@@ -430,7 +431,7 @@ public class DBProjectFile extends ProjectFile {
break;
}
languageName = parent.languageName;
if (sapforStyle) style = Current.getSapfor().getStyle();
if (sapforStyle) style =Global.mainModule.getSapfor().getStyle();
else style = parent.style;
}
//------------------

View File

@@ -65,7 +65,7 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
if (!switching_language) {
file.NeedsSave = true;
if (Global.enable_text_changed && file.state != FileState.Excluded) {
Current.getSapfor().ResetAllAnalyses();
Global.mainModule.getSapfor().ResetAllAnalyses();
//текст изменился, значит M ка более не актуальна.
file.father.dropLastModification();
}

View File

@@ -3,6 +3,7 @@ import Common.Current_;
import _VisualDVM.Current;
import Common.Visual.Trees.DataTree;
import Common.Visual.Trees.TreeRenderers;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.FileObject;
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
@@ -22,11 +23,11 @@ public class FileGraphTree extends DataTree {
}
@Override
public void ShowCurrentObject() throws Exception {
Current.getFile().form.EventsOff();
Object o = Current_.get(getCurrent());
Current.getFile().form.getEditor().gotoLine((o instanceof FileObjectWithMessages) ? (((FileObjectWithMessages) o).line) : 1);
Current.getFile().form.ShowMessages();
Current.getFile().form.EventsOn();
Global.mainModule.getFile().form.EventsOff();
Object o = Global.mainModule.get(getCurrent());
Global.mainModule.getFile().form.getEditor().gotoLine((o instanceof FileObjectWithMessages) ? (((FileObjectWithMessages) o).line) : 1);
Global.mainModule.getFile().form.ShowMessages();
Global.mainModule.getFile().form.EventsOn();
}
@Override
protected boolean findNode(Object userObject, Object criteria) {

View File

@@ -19,7 +19,7 @@ import java.awt.event.KeyEvent;
import java.io.File;
public class FilesTree extends StyledTree {
public FilesTree() {
super(Current.getProject().filesTreeRoot);
super(Global.mainModule.getProject().filesTreeRoot);
this.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
@@ -48,10 +48,10 @@ public class FilesTree extends StyledTree {
new FileDrop(System.out, this, files -> {
Pass.passes.get(PassCode.ImportFiles).Do(files);
});
Current_.set(Current.File, null);
Global.mainModule.set(Current.File, null);
}
private static void forkFD(PassCode file_pass, PassCode folder_pass) {
DefaultMutableTreeNode node = Current.getProjectNode();
DefaultMutableTreeNode node = Global.mainModule.getProjectNode();
if (node != null)
Pass.passes.get((node.getUserObject() instanceof DBProjectFile) ?
file_pass : folder_pass).Do();
@@ -67,24 +67,24 @@ public class FilesTree extends StyledTree {
@Override
public void SelectionAction(TreePath e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getLastPathComponent();
Current_.set(Current.ProjectNode, node);
Global.mainModule.set(Current.ProjectNode, node);
Object o = node.getUserObject();
if (o instanceof File) {
Current_.set(Current.SelectedDirectory, o);
Current_.set(Current.SelectedFile, null);
Global.mainModule.set(Current.SelectedDirectory, o);
Global.mainModule.set(Current.SelectedFile, null);
UI.getMainWindow().getProjectWindow().ShowNoSelectedFile();
} else if (o instanceof DBProjectFile) {
Current_.set(Current.SelectedFile, o);
Global.mainModule.set(Current.SelectedFile, o);
File file = ((DBProjectFile) o).file;
Current_.set(Current.SelectedDirectory, file.getParentFile());
Global.mainModule.set(Current.SelectedDirectory, file.getParentFile());
UI.getMainWindow().getProjectWindow().ShowSelectedFile();
}
UI.getMainWindow().getProjectWindow().ShowSelectedDirectory();
}
@Override
public void LeftMouseAction2() {
if (Current.getProjectNode() != null) {
Object o = Current.getProjectNode().getUserObject();
if (Global.mainModule.getProjectNode() != null) {
Object o = Global.mainModule.getProjectNode().getUserObject();
if (o instanceof DBProjectFile) {
//очень важно. иначе по открытии файла дерево остается в фокусе.
//и не происходит прокрутки скролла к строке!!
@@ -95,8 +95,8 @@ public class FilesTree extends StyledTree {
}
@Override
public void LeftMouseAction1() {
if (Global.files_multiselection && Current.getSelectedFile() != null) {
Current.getSelectedFile().SwitchSelection();
if (Global.files_multiselection && Global.mainModule.getSelectedFile() != null) {
Global.mainModule.getSelectedFile().SwitchSelection();
updateUI();
}
}

View File

@@ -449,8 +449,8 @@ public class Message extends FileObject {
}
@Override
public boolean isVisible() {
if (Current.HasFile() && Current.getFile().name.equals(file)) {
Object o = Current_.get(Current.FileGraphElement);
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(file)) {
Object o =Global.mainModule.get(Current.FileGraphElement);
return !(o instanceof FileObjectWithMessages) || ((FileObjectWithMessages) o).HasMessage(this);
} else return false;
}

View File

@@ -5,6 +5,7 @@ import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.ColumnFilter;
import Common.Visual.Tables.TableRenderers;
import _VisualDVM.Global;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -23,7 +24,7 @@ public class MessagesDBTable<M extends Message> extends iDBTable<M> {
@Override
public void ShowCurrentObject() throws Exception {
super.ShowCurrentObject();
Current.getFile().form.getEditor().gotoLine(getCurrent().line);
Global.mainModule.getFile().form.getEditor().gotoLine(getCurrent().line);
}
@Override
protected void AdditionalInitColumns() {

View File

@@ -15,7 +15,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class VersionsTree extends DataTree {
public VersionsTree() {
super(Current.getRoot().node);
super(Global.mainModule.getRoot().node);
SelectCurrentProject();
this.addKeyListener(new KeyAdapter() {
@Override
@@ -25,8 +25,8 @@ public class VersionsTree extends DataTree {
Pass.passes.get(PassCode.DeleteVersion).Do();
break;
case KeyEvent.VK_ENTER:
if (Current.HasVersion())
Pass.passes.get(PassCode.OpenCurrentProject).Do(Current.getVersion());
if (Global.mainModule.HasVersion())
Pass.passes.get(PassCode.OpenCurrentProject).Do(Global.mainModule.getVersion());
break;
}
}
@@ -41,7 +41,7 @@ public class VersionsTree extends DataTree {
return Current.Version;
}
public void SelectCurrentProject() {
setSelectionPath(new TreePath(Current.getProject().node.getPath()));
setSelectionPath(new TreePath(Global.mainModule.getProject().node.getPath()));
}
@Override
protected GraphMenu createMenu() {
@@ -51,7 +51,7 @@ public class VersionsTree extends DataTree {
public void LeftMouseAction1() {
if (Global.versions_multiselection) {
// только если есть режим выбора версий.
Object element = Current_.get(getCurrent());
Object element = Global.mainModule.get(getCurrent());
if ((element instanceof Selectable)) {
((Selectable) element).SwitchSelection();
updateUI();
@@ -60,7 +60,7 @@ public class VersionsTree extends DataTree {
}
@Override
public void LeftMouseAction2() {
Pass.passes.get(PassCode.OpenCurrentProject).Do(Current.getVersion());
Pass.passes.get(PassCode.OpenCurrentProject).Do(Global.mainModule.getVersion());
}
@Override
protected int getStartLine() {

View File

@@ -24,9 +24,9 @@ public class VersionsTreeCellRenderer extends StyledTreeCellRenderer {
setIcon(((Selectable) o).GetSelectionIcon());
} else {
URL imageUrl = null;
boolean current = Current.HasProject() && version.Home.equals(Current.getProject().Home);
boolean current = Global.mainModule.HasProject() && version.Home.equals(Global.mainModule.getProject().Home);
String type_image_key = "";
if (version.Home.equals(Current.getRoot().Home))
if (version.Home.equals(Global.mainModule.getRoot().Home))
type_image_key = "Root";
else if (version.IsMCopy())
type_image_key = "M";

View File

@@ -435,8 +435,8 @@ public class db_project_info extends DBObject {
db.ResetAI(MessageWarning.class);
db.ResetAI(MessageRecommendation.class);
//-
Current_.set(Current.Function, null);
Current_.set(Current.SelectedFunction, null);
Global.mainModule.set(Current.Function, null);
Global.mainModule.set(Current.SelectedFunction, null);
}
public void CleanVersions() throws Exception {
node.removeAllChildren();
@@ -660,7 +660,7 @@ public class db_project_info extends DBObject {
}
public Vector<DBProjectFile> getFilesForComparsion() {
Vector<DBProjectFile> res = new Vector<>();
if (Current.HasProject() && this.Home.equals(Current.getProject().Home)) {
if (Global.mainModule.HasProject() && this.Home.equals(Global.mainModule.getProject().Home)) {
//
res = db.files.Data.values().stream().filter(file -> !file.state.equals(FileState.Excluded)).collect(Collectors.toCollection(Vector::new));
} else {
@@ -1069,7 +1069,7 @@ public class db_project_info extends DBObject {
target.Close();
}
public void undoLastTransformation() throws Exception {
Current_.set(Current.Version, null);
Global.mainModule.set(Current.Version, null);
//---
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_version.node);
Utils.forceDeleteWithCheck(last_version.Home);
@@ -1498,8 +1498,8 @@ public class db_project_info extends DBObject {
}
public String getLocalName() {
//требует отображения рута. без него работать не будет.
if (Current.HasRoot())
return Home.getAbsolutePath().substring(Current.getRoot().Home.getParentFile().getAbsolutePath().length() + 1);
if (Global.mainModule.HasRoot())
return Home.getAbsolutePath().substring(Global.mainModule.getRoot().Home.getParentFile().getAbsolutePath().length() + 1);
else return Home.getName();
}
public void SelectAllFiles(boolean b) {

View File

@@ -79,6 +79,6 @@ public class ArraysSet extends DataSet<Long, ProjectArray> {
}
@Override
public void CheckAll(boolean flag) {
Pass.passes.get(PassCode.MassSelectArrays).Do(flag,new Vector(Current.getProject().declaratedArrays.Data.values()));
Pass.passes.get(PassCode.MassSelectArrays).Do(flag,new Vector(Global.mainModule.getProject().declaratedArrays.Data.values()));
}
}

View File

@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import Common.Utils.Index;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.DBArray.DBArray;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.Dimension;
@@ -104,7 +105,7 @@ public class ProjectArray extends DBObject {
int idxPl = 3;
for (int i = 0; i < numDeclPlaces; ++i, idxPl += 2) {
String declFile = Utils_.toW(localSplited[idxPl]);
DBProjectFile file = Current.getProject().db.files.Data.get(declFile);
DBProjectFile file = Global.mainModule.getProject().db.files.Data.get(declFile);
int declLine = Integer.parseInt(localSplited[idxPl + 1]);
//declPlaces.add(new Pair<>(declFile, declLine));
ArrayDecl decl = new ArrayDecl(shortName, location, file, declLine);
@@ -219,8 +220,8 @@ public class ProjectArray extends DBObject {
}
public void CreateDimensions() {
for (BigInteger regID : regIDs) {
ParallelRegion region = Current.getProject().parallelRegions.get(regID);
for (int i = 0; i < Current.getProject().maxdim; ++i) {
ParallelRegion region = Global.mainModule.getProject().parallelRegions.get(regID);
for (int i = 0; i < Global.mainModule.getProject().maxdim; ++i) {
dimensions.add(new TemplateDimension(
i, this, region
));
@@ -254,9 +255,9 @@ public class ProjectArray extends DBObject {
if (!mask(banned_dimensions, binary)) {
if (filter) {
boolean valid = true;
if (Current.getProject().f_distributed())
if (Global.mainModule.getProject().f_distributed())
valid = CheckFilterMask(i, true, binary);
if (valid && Current.getProject().f_multiplied())
if (valid && Global.mainModule.getProject().f_multiplied())
valid = CheckFilterMask(i, false, binary);
if (valid)
varIDs.add(i);
@@ -275,9 +276,9 @@ public class ProjectArray extends DBObject {
if (!mask(banned_dimensions, binary)) {
if (filter) {
boolean valid = true;
if (Current.getProject().f_distributed())
if (Global.mainModule.getProject().f_distributed())
valid = CheckFilterMask(i, true, binary);
if (valid && Current.getProject().f_multiplied())
if (valid && Global.mainModule.getProject().f_multiplied())
valid = CheckFilterMask(i, false, binary);
return valid;
} else return true;
@@ -344,12 +345,12 @@ public class ProjectArray extends DBObject {
return CheckFilterMask(varID, distributed, "");
}
public void SaveUserState() throws Exception {
if (Current.getProject().db.savedArrays.Data.containsKey(UniqKey)) {
DBArray sa = Current.getProject().db.savedArrays.Data.get(UniqKey);
if (Global.mainModule.getProject().db.savedArrays.Data.containsKey(UniqKey)) {
DBArray sa = Global.mainModule.getProject().db.savedArrays.Data.get(UniqKey);
sa.State = State;
Current.getProject().db.Update(sa);
Global.mainModule.getProject().db.Update(sa);
} else
Current.getProject().db.Insert(new DBArray(this));
Global.mainModule.getProject().db.Insert(new DBArray(this));
}
//-----------------------------------------------------------------------
@Override

View File

@@ -1,23 +1,24 @@
package _VisualDVM.ProjectData.SapforData.Arrays.Templates;
import _VisualDVM.Current;
import _VisualDVM.Global;
public enum TemplateDimensionState {
multiplied, //0
distributed; //1
public String getMaskDescription() {
switch (this) {
case distributed:
if (Current.getProject().f_distributed()) {
if (Global.mainModule.getProject().f_distributed()) {
return "BLOCK";
} else {
if (Current.getProject().f_multiplied())
if (Global.mainModule.getProject().f_multiplied())
return " X ";
else return "BLOCK";
}
case multiplied:
if (Current.getProject().f_multiplied()) {
if (Global.mainModule.getProject().f_multiplied()) {
return " * ";
} else {
if (Current.getProject().f_distributed())
if (Global.mainModule.getProject().f_distributed())
return " X ";
else return " * ";
}

View File

@@ -4,6 +4,7 @@ import _VisualDVM.Current;
import Common.Visual.ControlForm;
import Common.Visual.Tables.Grid.GridAnchestor;
import Common.Visual.Tables.StyledTable;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
@@ -32,10 +33,10 @@ public class DimensionsTableForm extends ControlForm<StyledTable> {
public void CreateControl() {
Vector<String> columns = new Vector<>();
columns.add("шаблон");
for (int i = 0; i < Current.getProject().maxdim; ++i)
for (int i = 0; i < Global.mainModule.getProject().maxdim; ++i)
columns.add(ProjectArray.alignNames[i]);
Vector<Object> dimensions = new Vector<>();
Current.getProject().templates.forEach(t -> dimensions.add(t.CreateTemplateCells()));
Global.mainModule.getProject().templates.forEach(t -> dimensions.add(t.CreateTemplateCells()));
control = new StyledTable(new GridAnchestor(columns, dimensions) {
@Override
public Object getValueAt(int rowIndex, int columnIndex) {

View File

@@ -1,9 +1,10 @@
package _VisualDVM.ProjectData.SapforData.Arrays.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.UI.FileGraphTree;
public class FileArraysTree extends FileGraphTree {
public FileArraysTree() {
super(Current.getFile().getArraysTree());
super(Global.mainModule.getFile().getArraysTree());
}
@Override
public String getBranchesName() {

View File

@@ -1,6 +1,7 @@
package _VisualDVM.ProjectData.SapforData.Arrays.UI;
import Common.Current_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.GraphMenu;
import Common.Visual.Trees.StyledTree;
import Common.Visual.Trees.TreeRenderers;
@@ -12,11 +13,11 @@ import javax.swing.tree.TreePath;
import static Common.Visual.Trees.TreeRenderers.RendererRule;
public class RulesTree extends StyledTree {
public RulesTree() {
super(Current.getProject().align_rules_root);
super(Global.mainModule.getProject().align_rules_root);
setRootVisible(false);
expandRow(0);
ExpandAll();
Current_.set(Current.ParallelRegion, null);
Global.mainModule.set(Current.ParallelRegion, null);
}
@Override
protected GraphMenu createMenu() {
@@ -39,6 +40,6 @@ public class RulesTree extends StyledTree {
region = (ParallelRegion) o;
}
}
Current_.set(Current.ParallelRegion, region);
Global.mainModule.set(Current.ParallelRegion, region);
}
}

View File

@@ -2,6 +2,7 @@ package _VisualDVM.ProjectData.SapforData;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.iDBObject;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import com.sun.org.glassfish.gmbal.Description;
@@ -21,7 +22,7 @@ public abstract class FileObject extends iDBObject {
return "файл " + Utils_.Brackets(file) + " строка: " + line;
}
public DBProjectFile getFather() {
return Current.getProject().db.files.Data.get(file);
return Global.mainModule.getProject().db.files.Data.get(file);
}
public void Show(boolean focus) {
UI.getMainWindow().getProjectWindow().GotoFile(file, line, focus);

View File

@@ -1,9 +1,10 @@
package _VisualDVM.ProjectData.SapforData.Functions.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.UI.FileGraphTree;
public class FileFunctionsTree extends FileGraphTree {
public FileFunctionsTree() {
super(Current.getFile().getFunctionsTree());
super(Global.mainModule.getFile().getFunctionsTree());
}
@Override
public String getBranchesName() {

View File

@@ -2,6 +2,7 @@ package _VisualDVM.ProjectData.SapforData.Functions.UI.Graph;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.ControlForm;
import _VisualDVM.Global;
import com.mxgraph.swing.mxGraphComponent;
import java.awt.*;
@@ -11,7 +12,7 @@ public class FunctionsGraphForm extends ControlForm<mxGraphComponent> {
}
@Override
public void CreateControl() {
control = Current.getProject().DrawFunctionsGraph();
control = Global.mainModule.getProject().DrawFunctionsGraph();
}
@Override
public void Show() {

View File

@@ -4,6 +4,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Visual.Menus.VisualiserMenuItem;
import Common.Visual.Menus.StyledPopupMenu;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import Visual_DVM_2021.Passes.All.SPF_GetGraphFunctionPositions;
import Visual_DVM_2021.Passes.PassCode;
@@ -19,8 +20,8 @@ public class FunctionsGraphMenu extends StyledPopupMenu {
changeCurrent.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (Current.HasSelectedFunction()) {
Current_.set(Current.Function, Current.getSelectionFunction());
if (Global.mainModule.HasSelectedFunction()) {
Global.mainModule.set(Current.Function, Global.mainModule.getSelectionFunction());
UI.getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
Pass.passes.get(PassCode.SPF_GetGraphFunctionPositions).Do();
@@ -32,8 +33,8 @@ public class FunctionsGraphMenu extends StyledPopupMenu {
}
@Override
public void CheckElementsVisibility() {
if (Current.HasSelectedFunction()) {
changeCurrent.setText("Назначить процедуру " + Utils_.DQuotes(Current.getSelectionFunction().funcName) + " текущей.");
if (Global.mainModule.HasSelectedFunction()) {
changeCurrent.setText("Назначить процедуру " + Utils_.DQuotes(Global.mainModule.getSelectionFunction().funcName) + " текущей.");
changeCurrent.setEnabled(true);
} else {
changeCurrent.setText("Невозможно назначить текущую процедуру: узел графа не выбран");

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.ProjectData.SapforData.Functions.FuncCoordinates;
import _VisualDVM.ProjectData.SapforData.Functions.FuncInfo;
import _VisualDVM.ProjectData.SapforData.Functions.FunctionType;
@@ -138,10 +139,10 @@ public class FunctionsGraphUI extends mxGraph {
// UI.Info("++");
LinkedHashMap<String, Object> mxVertexes = new LinkedHashMap<>();
for (String name : graph.vertexCoordinates.keySet()) {
funcInfo = Current.getProject().allFunctions.get(name);
funcInfo = Global.mainModule.getProject().allFunctions.get(name);
String vertexType = funcInfo.type.toString();
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
FuncInfo current_fi = (FuncInfo) Current_.get(Current.Function);
FuncInfo current_fi = (FuncInfo) Global.mainModule.get(Current.Function);
if ((current_fi != null) && (funcInfo.funcName.equals(current_fi.funcName))) {
vertexType = "current";
}
@@ -200,18 +201,18 @@ public class FunctionsGraphUI extends mxGraph {
// UI.Info(cell.getGeometry().getPoint().toString());
Point point = cell.getGeometry().getPoint();
try {
if (Current.getProject().db.funcCoordinates.containsKey(funcName)) {
coords = Current.getProject().db.funcCoordinates.get(funcName);
if (Global.mainModule.getProject().db.funcCoordinates.containsKey(funcName)) {
coords = Global.mainModule.getProject().db.funcCoordinates.get(funcName);
coords.name = funcName;
coords.X = point.getX();
coords.Y = point.getY();
Current.getProject().db.Update(coords);
Global.mainModule.getProject().db.Update(coords);
} else {
coords = new FuncCoordinates();
coords.name = funcName;
coords.X = point.getX();
coords.Y = point.getY();
Current.getProject().db.Insert(coords);
Global.mainModule.getProject().db.Insert(coords);
}
} catch (Exception ignored) {
}
@@ -231,10 +232,10 @@ public class FunctionsGraphUI extends mxGraph {
mxCell mx_cell = (mxCell) cell;
if (mx_cell.isVertex()) {
String func_name = (String) mx_cell.getValue();
FuncInfo fi = Current.getProject().allFunctions.get(func_name);
FuncInfo fi = Global.mainModule.getProject().allFunctions.get(func_name);
switch (e.getClickCount()) {
case 1:
Current_.set(Current.SelectedFunction, fi);
Global.mainModule.set(Current.SelectedFunction, fi);
break;
case 2:
switch (fi.type) {

View File

@@ -1,5 +1,6 @@
package _VisualDVM.ProjectData.SapforData.Functions.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.SelectionTreeMenu;
import Common.Visual.Trees.SelectableTree;
import _VisualDVM.ProjectData.SapforData.Functions.FuncInfo;
@@ -13,7 +14,7 @@ public class InlineMenu extends SelectionTreeMenu {
}
@Override
public void SelectAll(boolean select) {
for (FuncInfo fi : Current.getProject().allFunctions.values())
for (FuncInfo fi : Global.mainModule.getProject().allFunctions.values())
fi.SelectAllChildren(select);
}
}

View File

@@ -1,13 +1,14 @@
package _VisualDVM.ProjectData.SapforData.Functions.UI;
import Common.Current_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.GraphMenu;
import Common.Visual.Trees.SelectableTree;
import Common.Visual.Trees.TreeRenderers;
import _VisualDVM.ProjectData.SapforData.FileObject;
public class InlineTree extends SelectableTree {
public InlineTree() {
super(Current.getProject().inline_root);
super(Global.mainModule.getProject().inline_root);
}
@Override
public TreeRenderers getRenderer() {
@@ -19,7 +20,7 @@ public class InlineTree extends SelectableTree {
}
@Override
public void ShowCurrentObject() {
Object o = Current_.get(getCurrent());
Object o = Global.mainModule.get(getCurrent());
if (o instanceof FileObject) {
((FileObject) o).Show(false);
}

View File

@@ -1,13 +1,14 @@
package _VisualDVM.ProjectData.SapforData.Functions.UI;
import Common.Current_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.GraphMenu;
import Common.Visual.Trees.SelectableTree;
import Common.Visual.Trees.TreeRenderers;
import _VisualDVM.ProjectData.SapforData.FileObject;
public class InlineTree2 extends SelectableTree {
public InlineTree2() {
super(Current.getProject().inline_root2);
super(Global.mainModule.getProject().inline_root2);
}
@Override
public TreeRenderers getRenderer() {
@@ -23,7 +24,7 @@ public class InlineTree2 extends SelectableTree {
}
@Override
public void ShowCurrentObject() {
Object o = Current_.get(getCurrent());
Object o = Global.mainModule.get(getCurrent());
if (o instanceof FileObject) {
((FileObject) o).Show(false);
}

View File

@@ -1,5 +1,6 @@
package _VisualDVM.ProjectData.SapforData.Includes.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.SelectionTreeMenu;
import Common.Visual.Trees.SelectableTree;
import _VisualDVM.ProjectData.SapforData.Includes.FileInfo;
@@ -13,7 +14,7 @@ public class IncludesMenu extends SelectionTreeMenu {
}
@Override
public void SelectAll(boolean select) {
for (FileInfo fi : Current.getProject().addictedFiles.values())
for (FileInfo fi : Global.mainModule.getProject().addictedFiles.values())
fi.SelectAllChildren(select);
}
}

View File

@@ -1,11 +1,12 @@
package _VisualDVM.ProjectData.SapforData.Includes.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Visual.Menus.GraphMenu;
import Common.Visual.Trees.SelectableTree;
import Common.Visual.Trees.TreeRenderers;
public class IncludesTree extends SelectableTree {
public IncludesTree() {
super(Current.getProject().includes_root);
super(Global.mainModule.getProject().includes_root);
}
@Override
public Current getCurrent() {

View File

@@ -1,9 +1,10 @@
package _VisualDVM.ProjectData.SapforData.Loops.UI;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.UI.FileGraphTree;
public class FileLoopsTree extends FileGraphTree {
public FileLoopsTree() {
super(Current.getFile().getLoopsTree());
super(Global.mainModule.getFile().getLoopsTree());
}
@Override
public String getBranchesName() {

View File

@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import Common.Utils.Index;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.AlignRule;
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.DataDirective;
@@ -63,7 +64,7 @@ public class ParallelRegion extends DBObject {
//-------------------------------------------------------
if (new_array.isTemplFlag == 1) {
maxdim = Math.max(maxdim, new_array.dimSize);
Current.getProject().templates.add(new_array);
Global.mainModule.getProject().templates.add(new_array);
new_array.regIDs.add(regionId);
} else if (new_array.isLoopArrayFlag != 1) arrays_count++;
}
@@ -82,7 +83,7 @@ public class ParallelRegion extends DBObject {
for (String FKey : lines.keySet()) {
for (Pair<Integer, Integer> L : lines.get(FKey)) {
lines_count += (L.getValue() - L.getKey());
DBProjectFile f = Current.getProject().db.files.Data.get(FKey);
DBProjectFile f = Global.mainModule.getProject().db.files.Data.get(FKey);
loops_count += f.FragmentLoopCount(L.getKey(), L.getValue());
fc_count += f.FragmentFunctionCallsCount(L.getKey(), L.getValue());
fd_count += f.FragmentFunctionDeclsCount(L.getKey(), L.getValue());
@@ -111,7 +112,7 @@ public class ParallelRegion extends DBObject {
loops_count = 0;
for (String FKey : lines.keySet()) {
for (Pair<Integer, Integer> L : lines.get(FKey)) {
DBProjectFile f = Current.getProject().db.files.Data.get(FKey);
DBProjectFile f = Global.mainModule.getProject().db.files.Data.get(FKey);
loops_count += f.FragmentLoopCount(L.getKey(), L.getValue());
}
}
@@ -121,7 +122,7 @@ public class ParallelRegion extends DBObject {
fc_count = 0;
for (String FKey : lines.keySet()) {
for (Pair<Integer, Integer> L : lines.get(FKey)) {
DBProjectFile f = Current.getProject().db.files.Data.get(FKey);
DBProjectFile f = Global.mainModule.getProject().db.files.Data.get(FKey);
fc_count += f.FragmentFunctionCallsCount(L.getKey(), L.getValue());
fd_count += f.FragmentFunctionDeclsCount(L.getKey(), L.getValue());
}
@@ -131,7 +132,7 @@ public class ParallelRegion extends DBObject {
arrays_count=0;
for (String FKey : lines.keySet()) {
for (Pair<Integer, Integer> L : lines.get(FKey)) {
DBProjectFile f = Current.getProject().db.files.Data.get(FKey);
DBProjectFile f = Global.mainModule.getProject().db.files.Data.get(FKey);
arrays_count += f.FragmentArraysCount(L.getKey(), L.getValue());
}
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.ProjectData.SapforData.Regions.UI;
import _VisualDVM.Current;
import Common.Visual.Tables.StyledCellLabel;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
import javafx.util.Pair;
@@ -40,15 +41,15 @@ public class ArrayAlignmentBar extends JToolBar {
add(label);
ChangeListener changeListener = e -> {
//инфа о связях. из списка всех объявленных массивов.
ProjectArray d_array = Current.getProject().declaratedArrays.get(array.id);
ProjectArray d_array = Global.mainModule.getProject().declaratedArrays.get(array.id);
//опять же, берем инфу из объявлений!
for (ProjectArray d_link : d_array.links.values()) {
//это массивы из объявлений. прежде чем их трогать проверим а есть ли они в текущей области.
// по адресам принадлежность смотреть нельзя.
// на момент поиска массивов у них их еще нет. а вот ид совпадают.
if (Current.getParallelRegion().ArrayBelongsToRegion(d_link.id)) {
if (Global.mainModule.getParallelRegion().ArrayBelongsToRegion(d_link.id)) {
//инфа о массиве уже из области. имеющая адрес и бар.
ProjectArray r_link = Current.getParallelRegion().getArrayById(d_link.id);
ProjectArray r_link = Global.mainModule.getParallelRegion().getArrayById(d_link.id);
Pair<JSpinner, JSpinner> pair = r_link.bar.dimensions.get(dim);
pair.getKey().setValue(K.getValue());
pair.getValue().setValue(B.getValue());