no message

This commit is contained in:
2024-10-14 15:19:13 +03:00
parent 8eef367bd4
commit 5e09fb44ea
634 changed files with 3751 additions and 3263 deletions

View File

@@ -1,14 +1,13 @@
package _VisualDVM.Repository.Component;
import Common.CommonConstants;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
import Common.Visual.Windows.Dialog.VFileChooser;
import Common.Utils.TextLog;
import _VisualDVM.Utils;
import Common.Passes.PassException;
import Common.Utils.Loggable;
import Common.Utils.TextLog;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.VFileChooser;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import java.io.File;
import java.nio.file.Files;
@@ -23,9 +22,9 @@ public abstract class Component extends DBObject implements Loggable {
public String code = "";
public String actual_code = "";
public boolean needs_update_minimal_version = false;
VFileChooser fileChooser = null; ///для ручной установки.
private ComponentState state;
public abstract ComponentType getComponentType();
VFileChooser fileChooser = null; ///для ручной установки.
public VFileChooser getFileChooser() {
return (fileChooser == null) ? (fileChooser = new VFileChooser("выбор файла для компонента " +
Utils_.Brackets(getComponentType().getDescription()), Utils_.getExtension(getFile())))

View File

@@ -1,6 +1,6 @@
package _VisualDVM.Repository.Component;
import Common.Visual.StatusEnum;
import Common.Visual.Fonts.VisualiserFonts;
import Common.Visual.StatusEnum;
public enum ComponentState implements StatusEnum {
Undefined,
Actual,

View File

@@ -2,8 +2,8 @@ package _VisualDVM.Repository.Component;
import Common.Visual.Fonts.VisualiserFonts;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.UI_;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Menus.VisualiserMenu;
public class ComponentsMenuBar extends DataMenuBar {
public ComponentsMenuBar() {
@@ -13,17 +13,15 @@ public class ComponentsMenuBar extends DataMenuBar {
"Восстановление предыдущей версии компонента", "/icons/Resurrect.png") {
{
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
add( Global.mainModule.getPass(PassCode.ResurrectComponent).createMenuItem());
add( Global.mainModule.getPass(PassCode.ResurrectComponentFromServer).createMenuItem());
add(Global.mainModule.getPass(PassCode.ResurrectComponent).createMenuItem());
add(Global.mainModule.getPass(PassCode.ResurrectComponentFromServer).createMenuItem());
}
}
);
addPasses(PassCode.InstallComponentFromFolder,
PassCode.UpdateSelectedComponents,
PassCode.PublishComponent,
PassCode.ShowComponentChangesLog);
Global.mainModule.getPass(PassCode.PublishComponent).setControlsVisible(false);
}
}

View File

@@ -1,7 +1,7 @@
package _VisualDVM.Repository.Component;
import _VisualDVM.Current;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.Current;
import java.util.Vector;

View File

@@ -41,7 +41,7 @@ public class Instruction extends Component {
}
@Override
public void unpackMinimalVersion(String v_string) {
//--
//--
}
@Override
public void GetVersionInfo() {

View File

@@ -1,12 +1,11 @@
package _VisualDVM.Repository.Component.PerformanceAnalyzer;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import analyzer.common.MessageJtoJ;
import _VisualDVM.Utils;
import _VisualDVM.Repository.Component.Component;
import _VisualDVM.Repository.Component.ComponentType;
import _VisualDVM.Utils;
import analyzer.common.MessageJtoJ;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -103,7 +102,7 @@ public class PerformanceAnalyzer extends Component {
return null;
});
Utils.startScript(Global.TempDirectory, Global.ComponentsDirectory, "analyzer",
"java -jar -Dprism.order=sw "+ Utils_.DQuotes(Global.performanceAnalyzer.getFile()) + " --port "+ getPort()+ " --version" );
"java -jar -Dprism.order=sw " + Utils_.DQuotes(Global.performanceAnalyzer.getFile()) + " --port " + getPort() + " --version");
//-
server_thread.join();
} catch (Exception ex) {
@@ -120,12 +119,11 @@ public class PerformanceAnalyzer extends Component {
Global.mainModule.HasProject() ? Global.mainModule.getProject().getAnalyzerDirectory().getAbsolutePath() : Global.PerformanceAnalyzerDirectory.getAbsolutePath(), "StatDirPath"));
while (true) ConvertStatistic();
});
// UI.Info(String.valueOf(getPort()));
// UI.Info(String.valueOf(getPort()));
process_thread = new Thread(() -> {
try {
Utils.startScript(Global.TempDirectory, Global.ComponentsDirectory, "analyzer",
"java -jar -Dprism.order=sw "+ Utils_.DQuotes(Global.performanceAnalyzer.getFile()) + " --port "+ getPort());
"java -jar -Dprism.order=sw " + Utils_.DQuotes(Global.performanceAnalyzer.getFile()) + " --port " + getPort());
//-
} catch (Exception ex) {
ex.printStackTrace();

View File

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

View File

@@ -1,20 +1,20 @@
package _VisualDVM.Repository.Component.Sapfor;
import Common.CommonConstants;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.Settings.SettingName;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.Files.LanguageStyle;
import _VisualDVM.Repository.Component.OSDComponent;
import _VisualDVM.Repository.Component.Visualizer_2;
import _VisualDVM.TestingSystem.Common.Test.Test;
import _VisualDVM.Passes.PassCode;
import Common.Passes.PassException;
import _VisualDVM.Utils;
import _VisualDVM.Visual.UI;
import org.apache.commons.io.FileUtils;
import java.io.File;
@@ -27,17 +27,18 @@ public abstract class Sapfor extends OSDComponent {
public static final int empty_code = -100;
public static final int canceled_code = -99;
public static final int invalid_proj_code = -2;
public static File temp_copy = null;
public Vector<String> Intrinsics = new Vector<>();
public LinkedHashMap<String, String> ModifiedFiles = new LinkedHashMap<>();
public LinkedHashMap<String, String> OldFiles = new LinkedHashMap<>();
int size;
int[] sizes;
String PID = "";
private int errorCode;
private String result;
private String output;
private String outputMessage;
private String predictorStats;
String PID = "";
//-
public static String pack(String... params) {
StringBuilder res = new StringBuilder();
@@ -45,16 +46,6 @@ public abstract class Sapfor extends OSDComponent {
res.append(param.length()).append(" ").append(param);
return res.toString();
}
public void refreshPid() {
try {
// UI.Info("Calling SPF_GetCurrentPID...");
RunAnalysis("SPF_GetCurrentPID", -1, "", "");
PID = getResult();
// UI.Info("PID = " + Utils.Brackets(PID));
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static PassCode[] getAnalysesCodes() {
return new PassCode[]{
PassCode.SPF_ParseFilesWithOrder,
@@ -131,6 +122,219 @@ public abstract class Sapfor extends OSDComponent {
PassCode.SPF_InsertImplicitNone
};
}
//----------
public static Vector<PassCode> getScenariosCodes() {
Vector<PassCode> res = new Vector<>();
res.add(PassCode.SPF_InitDeclsWithZero);//+
res.add(PassCode.SPF_ConvertStructures);//+
res.add(PassCode.SPF_ExpressionSubstitution);//+
//--
res.add(PassCode.SPF_CreateCheckpoints); //+
res.add(PassCode.SPF_CreateIntervalsTree);//+
res.add(PassCode.SPF_RemoveDvmIntervals);//+
//--
res.add(PassCode.SPF_RemoveDvmDirectives); //+
res.add(PassCode.SPF_RemoveDvmDirectivesToComments); //+
res.add(PassCode.SPF_RemoveOmpDirectives);//+
res.add(PassCode.SPF_RemoveComments);//+
res.add(PassCode.SPF_RemoveDeadCode);//+
res.add(PassCode.SPF_RenameIncludes);
res.add(PassCode.SPF_InsertIncludesPass);//+
//--
res.add(PassCode.SPF_LoopEndDoConverterPass); //+
res.add(PassCode.SPF_LoopUnion);//+
res.add(PassCode.SPF_LoopFission);//+
//--
res.add(PassCode.SPF_PrivateShrinking);//+
res.add(PassCode.SPF_PrivateExpansion);//+
res.add(PassCode.SPF_PrivateRemoving);//+
//--
res.add(PassCode.SPF_RemoveUnusedFunctions);//+
res.add(PassCode.SPF_DuplicateFunctionChains);//+
//--
res.add(PassCode.SPF_ResolveParallelRegionConflicts);//+
res.add(PassCode.SPF_ResolveCommonBlockConflicts);//+
//-
res.add(PassCode.SPF_InsertDvmhRegions);//+
res.add(PassCode.SPF_SharedMemoryParallelization);//+
res.add(PassCode.SPF_InsertImplicitNone);//+
res.add(PassCode.CreateParallelVariants); //?
return res;
}
public static boolean checkLines(Vector<String> lines) {
for (String line : lines) {
if (line.toLowerCase().contains("internal error")) {
return false;
}
if (line.toLowerCase().contains("exception")) {
return false;
}
if (line.contains("[ERROR]")) {
return false;
}
if (line.toLowerCase().contains("segmentation fault")) {
return false;
}
}
return true;
}
//--
public static boolean performScript(String name, //имя скрипта
File sapfor_drv, //путь к сапфору
File workspace, //проект
String command, //проход
String flags, //флаги
String outName,
String errName,
Vector<String> resultLines
) throws Exception {
Process process = null;
int exit_code = CommonConstants.Nan;
//---
File data_workspace = new File(workspace, Constants.data);
Utils_.CheckDirectory(data_workspace);
File outputFile = new File(data_workspace, outName);
File errorsFile = new File(data_workspace, errName);
Utils_.forceDeleteWithCheck(outputFile);
Utils_.forceDeleteWithCheck(errorsFile);
//---
File file = new File(data_workspace, name + (Utils_.isWindows() ? ".bat" : ".sh"));
FileUtils.write(file,
Utils_.DQuotes(sapfor_drv)
+ (flags.isEmpty() ? "" : (" " + flags))
+ " -noLogo"
+ " " + command +
" 1>" +
Utils_.DQuotes(outputFile.getAbsolutePath()) +
" 2>" +
Utils_.DQuotes(errorsFile.getAbsolutePath()),
Charset.defaultCharset());
if (!file.setExecutable(true))
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
//--
boolean flag = false;
do {
try {
ProcessBuilder procBuilder = new ProcessBuilder(file.getAbsolutePath());
procBuilder.directory(workspace);
process = procBuilder.start();
exit_code = process.waitFor();
flag = true;
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
Utils_.sleep(1000);
}
}
while (!flag);
process = null;
//---
Vector<String> outputLines = new Vector<>(FileUtils.readLines(outputFile));
Vector<String> errorsLines = new Vector<>(FileUtils.readLines(errorsFile));
if (resultLines != null) {
resultLines.addAll(outputLines);
}
return (exit_code == 0) &&
checkLines(outputLines) &&
checkLines(errorsLines);
}
public static boolean performScript(String name, //имя скрипта
File sapfor_drv, //путь к сапфору
File workspace, //проект
String command, //проход
String flags, //флаги
String outName,
String errName
) throws Exception {
return performScript(name, sapfor_drv, workspace, command, flags, outName, errName, null);
}
public static boolean parse(File sapfor_drv, File workspace, String flags) throws Exception {
return performScript(
"parse",
sapfor_drv,
workspace,
"-parse -spf *.f* *.F*", // "-parse -spf *.f *.for *.fdv *.f90 *.f77",
flags,
Constants.parse_out_file,
Constants.parse_err_file)
&& (new File(workspace, "dvm.proj")).exists();
}
public static boolean analysis(File sapfor_drv, File workspace, PassCode code, String flags, Vector<String> result_lines) throws Exception {
return performScript("analysis",
sapfor_drv,
workspace,
code.getTestingCommand(),
flags,
Constants.out_file,
Constants.err_file,
result_lines
);
}
public static File getTempCopy(File src) throws Exception {
if (temp_copy == null || !temp_copy.exists()) {
temp_copy = Utils.getTempFileName("SAPFOR" + (Utils_.isWindows() ? ".exe" : ""));
FileUtils.copyFile(src, temp_copy);
temp_copy.setExecutable(true);
}
return temp_copy;
}
//--
public static boolean getMinMaxDim(File sapfor_drv, File workspace, Test test) throws Exception {
File sapfor = Sapfor.getTempCopy(sapfor_drv);
String flags = "-noLogo";
if (Sapfor.parse(sapfor, workspace, flags)
) {
Vector<String> outputLines = new Vector<>();
if (Sapfor.analysis(sapfor, workspace, PassCode.SPF_GetMaxMinBlockDistribution, flags, outputLines)) {
//---
for (String line : outputLines) {
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
if (line.startsWith(prefix)) {
String s = line.substring(prefix.length());
String[] data = s.split(" ");
test.min_dim = Math.max(Integer.parseInt(data[0]), 0);
test.max_dim = Math.max(Integer.parseInt(data[1]), 0);
return true;
}
}
}
}
return false;
}
public static int readVersionFromCode(File versionFile) {
int res = CommonConstants.Nan;
if (versionFile.exists()) {
try {
List<String> data = FileUtils.readLines(versionFile);
for (String s : data) {
if (s.startsWith("#define VERSION_SPF ")) {
String[] version_data = s.split("\"");
if (version_data.length > 0) {
String version_s = version_data[1];
//-
try {
res = Integer.parseInt(version_s);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
return res;
}
public void refreshPid() {
try {
// UI.Info("Calling SPF_GetCurrentPID...");
RunAnalysis("SPF_GetCurrentPID", -1, "", "");
PID = getResult();
// UI.Info("PID = " + Utils.Brackets(PID));
} catch (Exception ex) {
ex.printStackTrace();
}
}
//<editor-fold desc="компонент">
@Override
public void GetVersionInfo() {
@@ -342,14 +546,14 @@ public abstract class Sapfor extends OSDComponent {
//</editor-fold>
public SapforAnalysis getAnalysisByPhase(String phase) {
for (PassCode analysis_code : getAnalysesCodes()) {
SapforAnalysis analysis = (SapforAnalysis) Global.mainModule.getPass(analysis_code);
SapforAnalysis analysis = (SapforAnalysis) Global.mainModule.getPass(analysis_code);
if (analysis.phase().equals(phase)) return analysis;
}
return null;
}
public void ResetAllAnalyses() {
for (PassCode code : getAnalysesCodes())
( Global.mainModule.getPass(code)).Reset();
(Global.mainModule.getPass(code)).Reset();
//------------------------------------------------------------------------------------------>>>> пакетный режим.
if (UI_.isActive()) {
Global.mainModule.getPass(PassCode.Precompilation).Reset();
@@ -366,46 +570,6 @@ public abstract class Sapfor extends OSDComponent {
public LanguageStyle getStyle() throws Exception {
return (Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
}
//----------
public static Vector<PassCode> getScenariosCodes() {
Vector<PassCode> res = new Vector<>();
res.add(PassCode.SPF_InitDeclsWithZero);//+
res.add(PassCode.SPF_ConvertStructures);//+
res.add(PassCode.SPF_ExpressionSubstitution);//+
//--
res.add(PassCode.SPF_CreateCheckpoints); //+
res.add(PassCode.SPF_CreateIntervalsTree);//+
res.add(PassCode.SPF_RemoveDvmIntervals);//+
//--
res.add(PassCode.SPF_RemoveDvmDirectives); //+
res.add(PassCode.SPF_RemoveDvmDirectivesToComments); //+
res.add(PassCode.SPF_RemoveOmpDirectives);//+
res.add(PassCode.SPF_RemoveComments);//+
res.add(PassCode.SPF_RemoveDeadCode);//+
res.add(PassCode.SPF_RenameIncludes);
res.add(PassCode.SPF_InsertIncludesPass);//+
//--
res.add(PassCode.SPF_LoopEndDoConverterPass); //+
res.add(PassCode.SPF_LoopUnion);//+
res.add(PassCode.SPF_LoopFission);//+
//--
res.add(PassCode.SPF_PrivateShrinking);//+
res.add(PassCode.SPF_PrivateExpansion);//+
res.add(PassCode.SPF_PrivateRemoving);//+
//--
res.add(PassCode.SPF_RemoveUnusedFunctions);//+
res.add(PassCode.SPF_DuplicateFunctionChains);//+
//--
res.add(PassCode.SPF_ResolveParallelRegionConflicts);//+
res.add(PassCode.SPF_ResolveCommonBlockConflicts);//+
//-
res.add(PassCode.SPF_InsertDvmhRegions);//+
res.add(PassCode.SPF_SharedMemoryParallelization);//+
res.add(PassCode.SPF_InsertImplicitNone);//+
res.add(PassCode.CreateParallelVariants); //?
return res;
}
//------------------------------------------------------------------------------------------------------------------
public String getConsoleFlags() throws Exception {
Vector<String> res = new Vector<>();
@@ -418,169 +582,4 @@ public abstract class Sapfor extends OSDComponent {
res.add("-keepSPF");
return String.join(" ", res);
}
public static boolean checkLines(Vector<String> lines) {
for (String line : lines) {
if (line.toLowerCase().contains("internal error")) {
return false;
}
if (line.toLowerCase().contains("exception")) {
return false;
}
if (line.contains("[ERROR]")) {
return false;
}
if (line.toLowerCase().contains("segmentation fault")) {
return false;
}
}
return true;
}
//--
public static boolean performScript(String name, //имя скрипта
File sapfor_drv, //путь к сапфору
File workspace, //проект
String command, //проход
String flags, //флаги
String outName,
String errName,
Vector<String> resultLines
) throws Exception {
Process process = null;
int exit_code = CommonConstants.Nan;
//---
File data_workspace = new File(workspace, Constants.data);
Utils_.CheckDirectory(data_workspace);
File outputFile = new File(data_workspace, outName);
File errorsFile = new File(data_workspace, errName);
Utils_.forceDeleteWithCheck(outputFile);
Utils_.forceDeleteWithCheck(errorsFile);
//---
File file = new File(data_workspace, name + (Utils_.isWindows() ? ".bat" : ".sh"));
FileUtils.write(file,
Utils_.DQuotes(sapfor_drv)
+ (flags.isEmpty() ? "" : (" " + flags))
+ " -noLogo"
+ " " + command +
" 1>" +
Utils_.DQuotes(outputFile.getAbsolutePath()) +
" 2>" +
Utils_.DQuotes(errorsFile.getAbsolutePath()),
Charset.defaultCharset());
if (!file.setExecutable(true))
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
//--
boolean flag = false;
do {
try {
ProcessBuilder procBuilder = new ProcessBuilder(file.getAbsolutePath());
procBuilder.directory(workspace);
process = procBuilder.start();
exit_code = process.waitFor();
flag = true;
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
Utils_.sleep(1000);
}
}
while (!flag);
process = null;
//---
Vector<String> outputLines = new Vector<>(FileUtils.readLines(outputFile));
Vector<String> errorsLines = new Vector<>(FileUtils.readLines(errorsFile));
if (resultLines != null) {
resultLines.addAll(outputLines);
}
return (exit_code == 0) &&
checkLines(outputLines) &&
checkLines(errorsLines);
}
public static boolean performScript(String name, //имя скрипта
File sapfor_drv, //путь к сапфору
File workspace, //проект
String command, //проход
String flags, //флаги
String outName,
String errName
) throws Exception {
return performScript(name, sapfor_drv, workspace, command, flags, outName, errName, null);
}
public static boolean parse(File sapfor_drv, File workspace, String flags) throws Exception {
return performScript(
"parse",
sapfor_drv,
workspace,
"-parse -spf *.f* *.F*", // "-parse -spf *.f *.for *.fdv *.f90 *.f77",
flags,
Constants.parse_out_file,
Constants.parse_err_file)
&& (new File(workspace, "dvm.proj")).exists();
}
public static boolean analysis(File sapfor_drv, File workspace, PassCode code, String flags, Vector<String> result_lines) throws Exception {
return performScript("analysis",
sapfor_drv,
workspace,
code.getTestingCommand(),
flags,
Constants.out_file,
Constants.err_file,
result_lines
);
}
public static File temp_copy = null;
public static File getTempCopy(File src) throws Exception {
if (temp_copy == null || !temp_copy.exists()) {
temp_copy = Utils.getTempFileName("SAPFOR" + (Utils_.isWindows() ? ".exe" : ""));
FileUtils.copyFile(src, temp_copy);
temp_copy.setExecutable(true);
}
return temp_copy;
}
//--
public static boolean getMinMaxDim(File sapfor_drv, File workspace, Test test) throws Exception {
File sapfor = Sapfor.getTempCopy(sapfor_drv);
String flags = "-noLogo";
if (Sapfor.parse(sapfor, workspace, flags)
) {
Vector<String> outputLines = new Vector<>();
if (Sapfor.analysis(sapfor, workspace, PassCode.SPF_GetMaxMinBlockDistribution, flags, outputLines)) {
//---
for (String line : outputLines) {
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
if (line.startsWith(prefix)) {
String s = line.substring(prefix.length());
String[] data = s.split(" ");
test.min_dim = Math.max(Integer.parseInt(data[0]), 0);
test.max_dim = Math.max(Integer.parseInt(data[1]), 0);
return true;
}
}
}
}
return false;
}
public static int readVersionFromCode(File versionFile) {
int res = CommonConstants.Nan;
if (versionFile.exists()) {
try {
List<String> data = FileUtils.readLines(versionFile);
for (String s : data) {
if (s.startsWith("#define VERSION_SPF ")) {
String[] version_data = s.split("\"");
if (version_data.length > 0) {
String version_s = version_data[1];
//-
try {
res = Integer.parseInt(version_s);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
return res;
}
}

View File

@@ -1,6 +1,6 @@
package _VisualDVM.Repository.Component.UI;
import _VisualDVM.Global;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,6 +1,6 @@
package _VisualDVM.Repository.Component.UI;
import _VisualDVM.Global;
import Common.Visual.Windows.Dialog.Dialog;
import _VisualDVM.Global;
import java.awt.*;
public class ComponentsForm extends Dialog<Object, ComponentsFields> {
@@ -26,7 +26,6 @@ public class ComponentsForm extends Dialog<Object, ComponentsFields> {
public void Init(Object... params) {
Global.Components.ShowUI();
}
@Override
public void LoadSize() {
setMinimumSize(new Dimension(650, 250));
@@ -37,8 +36,8 @@ public class ComponentsForm extends Dialog<Object, ComponentsFields> {
@Override
public void onClose() {
super.onClose();
Global.properties.ComponentsWindowWidth=getWidth();
Global.properties.ComponentsWindowHeight=getHeight();
Global.properties.ComponentsWindowWidth = getWidth();
Global.properties.ComponentsWindowHeight = getHeight();
Global.properties.Update();
}
}

View File

@@ -1,6 +1,6 @@
package _VisualDVM.Repository.Component.UI;
import _VisualDVM.Visual.Editor.BaseEditor;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Visual.Editor.BaseEditor;
import javax.swing.*;
import java.awt.*;
@@ -31,5 +31,4 @@ public class PublishFields implements DialogFields {
public Component getContent() {
return content;
}
}

View File

@@ -12,5 +12,4 @@ public class PublishForm extends Dialog<String, PublishFields> {
public void ProcessResult() {
Result = fields.cbNeedsBroadcast.isSelected() ? fields.taBroadcast.getText() : null;
}
}

View File

@@ -1,9 +1,9 @@
package _VisualDVM.Repository.Component;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import Common.Passes.PassException;
import java.io.BufferedReader;
import java.io.File;
@@ -13,11 +13,11 @@ import java.net.InetAddress;
import java.net.Socket;
import java.nio.file.Paths;
public class Visualizer_2 extends OSDComponent {
public String PID = "";
//</editor-fold>
//-
//<editor-fold desc="функционал">
int port;
public String PID = "";
Socket client = null;
PrintWriter out = null;
BufferedReader in = null;
@@ -51,12 +51,12 @@ public class Visualizer_2 extends OSDComponent {
Utils_.MainLog.PrintException(e);
}
}
public void refreshPid(){
public void refreshPid() {
try {
// UI.Info("Getting Server PID...");
// UI.Info("Getting Server PID...");
Command("get_pid: ");
PID = response;
// UI.Info("SERVER PID = "+Utils.Brackets(PID));
// UI.Info("SERVER PID = "+Utils.Brackets(PID));
} catch (Exception e) {
Utils_.MainLog.PrintException(e);
}
@@ -92,7 +92,7 @@ public class Visualizer_2 extends OSDComponent {
in = new BufferedReader(new InputStreamReader(client.getInputStream())); //то что нам приходит от сервера
out = new PrintWriter(client.getOutputStream(), true); //то что мы пишем серверу.
}
public void Interrupt(){
public void Interrupt() {
Utils.Kill(PID, false);
}
public void Shutdown() throws Exception {