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

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

@@ -72,7 +72,7 @@ public class PerformanceAnalyzer extends Component {
}
public void ConvertStatistic() throws Exception {
message_in = (MessageJtoJ) in.readObject();
String message = Current.getSapfor().readStatForAnalyzer(message_in.getMessage());
String message = Global.mainModule.getSapfor().readStatForAnalyzer(message_in.getMessage());
message_out = new MessageJtoJ(message, message_in.getCommand());
out.writeObject(message_out);
}
@@ -117,7 +117,7 @@ public class PerformanceAnalyzer extends Component {
try {
StartServer(() -> {
SendMessageOut(new MessageJtoJ(
Current.HasProject() ? Current.getProject().getAnalyzerDirectory().getAbsolutePath() : Global.PerformanceAnalyzerDirectory.getAbsolutePath(), "StatDirPath"));
Global.mainModule.HasProject() ? Global.mainModule.getProject().getAnalyzerDirectory().getAbsolutePath() : Global.PerformanceAnalyzerDirectory.getAbsolutePath(), "StatDirPath"));
while (true) ConvertStatistic();
});
// UI.Info(String.valueOf(getPort()));

View File

@@ -1,6 +1,7 @@
package _VisualDVM.Repository.Component.Sapfor;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -28,8 +29,8 @@ public class MessagesServer {
InputStreamReader(client.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
if (Current.HasPassForm())
Current.getPassForm().Result.ShowSapforMessage(line);
if (Global.mainModule.HasPassForm())
Global.mainModule.getPassForm().Result.ShowSapforMessage(line);
}
} catch (Exception ex) {
// UI.Print(DebugPrintLevel.MessagesServer, "соединение сброшено!");

View File

@@ -311,18 +311,18 @@ public abstract class Sapfor extends OSDComponent {
//todo рефакторить. отвязать от текущего проекта.
public void UpdateProjectFiles(boolean mode) throws Exception {
ResetAllAnalyses();
Current.getProject().dropLastModification();
Global.mainModule.getProject().dropLastModification();
DBProjectFile cuf = null;
if (Current.HasFile()) {
cuf = Current.getFile();
if (Global.mainModule.HasFile()) {
cuf = Global.mainModule.getFile();
Pass.passes.get(PassCode.CloseCurrentFile).Do();
}
if (mode) //модификация
{
OldFiles.clear();
for (String name : ModifiedFiles.keySet()) {
if (Current.getProject().db.files.Data.containsKey(name)) {
File file = Current.getProject().db.files.Data.get(name).file;
if (Global.mainModule.getProject().db.files.Data.containsKey(name)) {
File file = Global.mainModule.getProject().db.files.Data.get(name).file;
OldFiles.put(name, Utils.ReadAllText(file));
Utils.WriteToFile(file, ModifiedFiles.get(name));
}
@@ -332,7 +332,7 @@ public abstract class Sapfor extends OSDComponent {
{
if (OldFiles.size() > 0) {
for (String name : OldFiles.keySet()) {
File file = Current.getProject().db.files.Data.get(name).file;
File file = Global.mainModule.getProject().db.files.Data.get(name).file;
Utils.WriteToFile(file, OldFiles.get(name));
}
OldFiles.clear();