Files
VisualSapfor/src/_VisualDVM/Passes/All/SPF_GetAllDeclaratedArrays.java

68 lines
2.6 KiB
Java
Raw Normal View History

2024-10-14 12:14:01 +03:00
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
2024-10-14 15:19:13 +03:00
import _VisualDVM.Global;
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayDecl;
import _VisualDVM.ProjectData.SapforData.Arrays.ArraysJson;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
2023-09-17 22:13:42 +03:00
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
@Override
public String phase() {
return "GET_ALL_ARRAY_DECL";
}
@Override
protected void performPreparation() throws Exception {
super.performPreparation(); //удаление интеррупта.
target.declaratedArrays.clear();
for (DBProjectFile f : target.db.files.Data.values())
f.array_decls.clear();
}
@Override
protected void showPreparation() {
Global.mainModule.getUI().getMainWindow().getProjectWindow().getArraysWindow().ShowNoArrays();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.ShowNoArrays();
2023-09-17 22:13:42 +03:00
}
@Override
public void unpack(String packed) throws Exception {
ArraysJson arraysJson = Utils_.gson.fromJson(packed, ArraysJson.class);
for (ProjectArray array : arraysJson.allArrays) {
array.Init();
target.declaratedArrays.put(array.id, array);
//--
for (ArrayDecl decl : array.declPlaces) {
DBProjectFile projectFile = target.db.files.get(decl.file);
projectFile.array_decls.add(decl);
}
}
for (DBProjectFile file : target.db.files.Data.values()) {
file.ArrayGraphTitle = "Объявлений: " + file.array_decls.size();
}
target.UpdateArraysCount();
2023-09-17 22:13:42 +03:00
}
@Override
protected boolean alwaysCheck() {
return true;
}
@Override
protected boolean isAtomic() {
return false;
}
@Override
protected void FocusResult() {
Global.mainModule.getUI().getMainWindow().getProjectWindow().FocusArrays();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.FocusArrays();
2023-09-17 22:13:42 +03:00
}
@Override
protected void showDone() throws Exception {
Global.mainModule.getUI().getMainWindow().getProjectWindow().getArraysWindow().ShowArrays();
Global.mainModule.getUI().getMainWindow().getProjectWindow().getAnalysisWindow().ShowArraysCount();
Global.mainModule.getUI().getMainWindow().getProjectWindow().getAnalysisWindow().ShowRegions();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.ShowArrays();
2023-09-17 22:13:42 +03:00
super.showDone();
}
}