no message
This commit is contained in:
473
src/_VisualDVM/Constants.java
Normal file
473
src/_VisualDVM/Constants.java
Normal file
@@ -0,0 +1,473 @@
|
||||
package _VisualDVM;
|
||||
import Common.Utils.Vector_;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
public static final int planner_version = 3;
|
||||
public static final int testingMaxKernels= 64; //вообще говоря, это параметр машины.
|
||||
//--
|
||||
public static final String ComponentsDirectoryName = "Components";
|
||||
public static final String DataDirectoryName = "Data";
|
||||
public static final String BugsDirectoryName = "Bugs";
|
||||
public static final String BackUpsDirectoryName = "BackUps";
|
||||
public static final String DataBackUpsDirectoryName = "DataBackUps";
|
||||
public static final String TempDirectoryName = "Temp";
|
||||
public static final String ProjectsDirectoryName = "Projects";
|
||||
public static final String CompilationTasksDirectoryName = "CompilationTasks";
|
||||
public static final String RunTasksDirectoryName = "RunTasks";
|
||||
public static final String StsDirectoryName = "Sts";
|
||||
public static final String RepoDirectoryName = "Repo";
|
||||
public static final String TestsDirectoryName = "Tests";
|
||||
public static final String DVMPackagesDirectoryName = "DVMPackages";
|
||||
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
|
||||
//--
|
||||
//SVN vmk-post@yandex.ru
|
||||
public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive";
|
||||
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
|
||||
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
|
||||
public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
|
||||
//--
|
||||
//-файлы-признаки
|
||||
public static final String LOADED = "LOADED";
|
||||
public static final String STARTED = "STARTED";
|
||||
public static final String ABORTED = "ABORTED";
|
||||
public static final String INTERRUPT = "INTERRUPT"; //файл признак прерывания.
|
||||
public final static String DONE = "DONE";
|
||||
public final static String TIMEOUT = "TIMEOUT";
|
||||
//-вывод задач
|
||||
public final static String parse_out_file = "parse_out.txt";
|
||||
public final static String parse_err_file = "parse_err.txt";
|
||||
public final static String out_file = "out.txt";
|
||||
public final static String err_file = "err.txt";
|
||||
public final static String script = "script.sh";
|
||||
public final static String time_file = "total_time";
|
||||
//-служебные разделы проекта.
|
||||
public static final String data = "visualiser_data";
|
||||
public static final String MailAddress = "sapfor.tracker@internet.ru";
|
||||
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
|
||||
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения.
|
||||
//--
|
||||
public static final String package_json = "package_json";
|
||||
public static final String results_json = "results_json";
|
||||
//--
|
||||
public static final Vector<PassCode_2021> startSapforCodes =
|
||||
new Vector_<>(PassCode_2021.SPF_InsertIncludesPass);
|
||||
|
||||
public static final Vector<PassCode_2021> terminalSapforCodes =
|
||||
new Vector_<>( PassCode_2021.CreateParallelVariants,
|
||||
PassCode_2021.SPF_SharedMemoryParallelization,
|
||||
PassCode_2021.SPF_InsertDvmhRegions);
|
||||
//---
|
||||
public static final int parser_group = -1;
|
||||
public static final int compiler_group = -2;
|
||||
// DBProjectFile
|
||||
public static final String no_data = "Нет данных";
|
||||
public static final String dep = ".dep";
|
||||
public static final String out = ".out";
|
||||
public static final String err = ".err";
|
||||
public static final String makefile = "Makefile";
|
||||
//db_project_info
|
||||
public static final String launch_script_name = "run";
|
||||
public static final String default_binary_name = "0";
|
||||
public static final String spf = "spf.proj";
|
||||
public static final String options = "options";
|
||||
public static final String gcov = "gcov";
|
||||
public static final String attachments = "attachments";
|
||||
public static final String statistic = "statistic";
|
||||
public static final String unknown_metric = " — ";
|
||||
public static final String old_tests_db_name = "tests2026";
|
||||
public static final String tests_db_name = "tests2027";
|
||||
public static final String dateNaN = "NaN";
|
||||
//------
|
||||
public static final String[] crushed_cases = new String[]{
|
||||
"rts err",
|
||||
"rts stack trace",
|
||||
"rts fatal err",
|
||||
"sigegv",
|
||||
"there are not enough slots available in the system to satisfy the",
|
||||
"forrtl: severe",
|
||||
"invalid pointer",
|
||||
"forrtl: error",
|
||||
"fatal error",
|
||||
"unknown error class",
|
||||
"failed",
|
||||
"killed by signal",
|
||||
"bad termination"
|
||||
};
|
||||
//-------------------------------------------------------
|
||||
public static String[] resourses_names = new String[]{
|
||||
//--
|
||||
"Process_r.h",
|
||||
"starter.cpp",
|
||||
"launcher.cpp",
|
||||
//--
|
||||
"Array.h",
|
||||
"CompilationSupervisor.h",
|
||||
"CompilationTask.h",
|
||||
"File.h",
|
||||
"Global.h",
|
||||
"planner.cpp",
|
||||
"RunSupervisor.h",
|
||||
"RunTask.h",
|
||||
"String.h",
|
||||
"Supervisor.h",
|
||||
"Task.h",
|
||||
"Text.h",
|
||||
"Utils.h",
|
||||
"version.h"
|
||||
|
||||
};
|
||||
//пробный коммит. изменение комментария.++
|
||||
//кронтаб и перезагрузка
|
||||
//https://snipp.ru/raznoe/crontab
|
||||
// /var/spool/cron/crontabs/testuser что менять
|
||||
//https://saribzhanov.ru/tehno/perezagruzka-ubuntu-po-cron/ //раз в сутки
|
||||
//testuser ALL=NOPASSWD:/sbin/reboot
|
||||
//0 2 2,15 * * reboot &>/var/log/reboot.log
|
||||
//https://unix.stackexchange.com/questions/117148/how-can-i-run-reboot-as-a-normal-user-without-needing-to-enter-a-password
|
||||
//--
|
||||
//https://losst.ru/komandy-terminala-linux
|
||||
public static String[] linux_system_commands = new String[]{
|
||||
//<editor-fold desc="все линуксовые команды. их МНОГО">
|
||||
"a2p",
|
||||
"ac",
|
||||
"addgroup",
|
||||
"adduser",
|
||||
"agrep",
|
||||
"alias",
|
||||
"apropos",
|
||||
"apt",
|
||||
"aptitude",
|
||||
"ar",
|
||||
"arch",
|
||||
"arp",
|
||||
"as",
|
||||
"aspell",
|
||||
"at",
|
||||
"awk",
|
||||
"basename",
|
||||
"bash",
|
||||
"bс",
|
||||
"bdiff",
|
||||
"bfs",
|
||||
"bg",
|
||||
"biff",
|
||||
"break",
|
||||
"bs",
|
||||
"bye",
|
||||
"cal",
|
||||
"calendar",
|
||||
"cancel",
|
||||
"cat",
|
||||
"cc",
|
||||
"cd",
|
||||
"cfdisk",
|
||||
"chdir",
|
||||
"checkeq",
|
||||
"checknr",
|
||||
"chfn",
|
||||
"chgrp",
|
||||
"chmod",
|
||||
"chown",
|
||||
"chroot",
|
||||
"chsh",
|
||||
"cksum",
|
||||
"clear",
|
||||
"cmp",
|
||||
"col",
|
||||
"comm",
|
||||
"compress",
|
||||
"continue",
|
||||
"cp",
|
||||
"cpio",
|
||||
"crontab",
|
||||
"csh",
|
||||
"csplit",
|
||||
"ctags",
|
||||
"cu",
|
||||
"curl",
|
||||
"cut",
|
||||
"date",
|
||||
"dc",
|
||||
"dd",
|
||||
"delgroup",
|
||||
"deluser",
|
||||
"depmod",
|
||||
"deroff",
|
||||
"df",
|
||||
"dhclient",
|
||||
"dig",
|
||||
"dircmp",
|
||||
"dirname",
|
||||
"dmesg",
|
||||
"dos2unix",
|
||||
"dpkg",
|
||||
"dpost",
|
||||
"du",
|
||||
"echo",
|
||||
"ed",
|
||||
"edit",
|
||||
"egrep",
|
||||
"eject",
|
||||
"elm",
|
||||
"emacs",
|
||||
"emerge",
|
||||
"enable",
|
||||
"env",
|
||||
"eqn",
|
||||
"ex",
|
||||
"exit",
|
||||
"expand",
|
||||
"expr",
|
||||
"fc",
|
||||
"fdisk",
|
||||
"fg",
|
||||
"fgrep",
|
||||
"file",
|
||||
"find",
|
||||
"findsmb",
|
||||
"finger",
|
||||
"fmt",
|
||||
"fold",
|
||||
"for",
|
||||
"foreach",
|
||||
"free",
|
||||
"fsck",
|
||||
"ftp",
|
||||
"fuser",
|
||||
"gawk",
|
||||
"getfacl",
|
||||
"gpasswd",
|
||||
"gprof",
|
||||
"grep",
|
||||
"groupadd",
|
||||
"groupdel",
|
||||
"groupmod",
|
||||
"gnuzip",
|
||||
"gview",
|
||||
"gvim",
|
||||
"gzip",
|
||||
"halt",
|
||||
"head",
|
||||
"help",
|
||||
"history",
|
||||
"host",
|
||||
"hostid",
|
||||
"hostname",
|
||||
"htop",
|
||||
"id",
|
||||
"ifconfig",
|
||||
"ifdown",
|
||||
"ifquery",
|
||||
"ifup",
|
||||
"info",
|
||||
"insmod",
|
||||
"iostat",
|
||||
"ip",
|
||||
"iwconfig",
|
||||
"jobs",
|
||||
"join",
|
||||
"kill",
|
||||
"killall",
|
||||
"ksh",
|
||||
"last",
|
||||
"ld",
|
||||
"ldd",
|
||||
"less",
|
||||
"link",
|
||||
"ln",
|
||||
"lo",
|
||||
"locate",
|
||||
"login",
|
||||
"logname",
|
||||
"logout",
|
||||
"losetup",
|
||||
"ls",
|
||||
"lsmod",
|
||||
"lsof",
|
||||
"lzcat",
|
||||
"lzma",
|
||||
"mach",
|
||||
"mailx",
|
||||
"make",
|
||||
"man",
|
||||
"merge",
|
||||
"mesg",
|
||||
"mkdir",
|
||||
"mkfs",
|
||||
"mkswap",
|
||||
"modinfo",
|
||||
"modprobe",
|
||||
"more",
|
||||
"mount",
|
||||
"mt",
|
||||
"mv",
|
||||
"mysql",
|
||||
"mysqldump",
|
||||
"nc",
|
||||
"netstat",
|
||||
"newgrp",
|
||||
"nice",
|
||||
"niscat",
|
||||
"nischmod",
|
||||
"nischown",
|
||||
"nischttl",
|
||||
"nisdefaults",
|
||||
"nistbladm",
|
||||
"nl",
|
||||
"nmap",
|
||||
"nohup",
|
||||
"nroff",
|
||||
"nslookup",
|
||||
"od",
|
||||
"on",
|
||||
"onintr",
|
||||
"pack",
|
||||
"pacman",
|
||||
"pagesize",
|
||||
"parted",
|
||||
"partprobe",
|
||||
"passwd",
|
||||
"paste",
|
||||
"pax",
|
||||
"pact",
|
||||
"perl",
|
||||
"pg",
|
||||
"pico",
|
||||
"pine",
|
||||
"pkill",
|
||||
"poweroff",
|
||||
"pr",
|
||||
"printenv",
|
||||
"printf",
|
||||
"ps",
|
||||
"pstree",
|
||||
"pvs",
|
||||
"pwd",
|
||||
"quit",
|
||||
"rcp",
|
||||
"readlink",
|
||||
"reboot",
|
||||
"red",
|
||||
"rename",
|
||||
"repeat",
|
||||
"replace",
|
||||
"rlogin",
|
||||
"rm",
|
||||
"rmdir",
|
||||
"rmmod",
|
||||
"route",
|
||||
"rpcinfo",
|
||||
"rsh",
|
||||
"rsync",
|
||||
"s2p",
|
||||
"scp",
|
||||
"screen",
|
||||
"script",
|
||||
"sdiff",
|
||||
"sed",
|
||||
"sendmail",
|
||||
"service",
|
||||
"set",
|
||||
"setfacl",
|
||||
"sfdisk",
|
||||
"sftp",
|
||||
"sh",
|
||||
"shred",
|
||||
"shutdown",
|
||||
"sleep",
|
||||
"slogin",
|
||||
"smbclient",
|
||||
"sort",
|
||||
"spell",
|
||||
"split",
|
||||
"startx",
|
||||
"ss",
|
||||
"ssh",
|
||||
"stat",
|
||||
"stop",
|
||||
"strftime",
|
||||
"strip",
|
||||
"stty",
|
||||
"su",
|
||||
"sudo",
|
||||
"swapoff",
|
||||
"swapon",
|
||||
"systemctl",
|
||||
"tabs",
|
||||
"tac",
|
||||
"tail",
|
||||
"talk",
|
||||
"tar",
|
||||
"tcopy",
|
||||
"tcpdump",
|
||||
"tcsh",
|
||||
"tee",
|
||||
"telnet",
|
||||
"test",
|
||||
"time",
|
||||
"timex",
|
||||
"todos",
|
||||
"top",
|
||||
"touch",
|
||||
"traceroute",
|
||||
"tree",
|
||||
"tty",
|
||||
"umask",
|
||||
"umount",
|
||||
"unalias",
|
||||
"uname",
|
||||
"uncompress",
|
||||
"uniq",
|
||||
"unlink",
|
||||
"unlzma",
|
||||
"unpack",
|
||||
"until",
|
||||
"unxz",
|
||||
"unzip",
|
||||
"uptime",
|
||||
"useradd",
|
||||
"userdel",
|
||||
"usermod",
|
||||
"vacation",
|
||||
"vi",
|
||||
"vim",
|
||||
"w",
|
||||
"wait",
|
||||
"wall",
|
||||
"wc",
|
||||
"wget",
|
||||
"whereis",
|
||||
"which",
|
||||
"while",
|
||||
"who",
|
||||
"whoami",
|
||||
"whois",
|
||||
"Xorg",
|
||||
"xargs",
|
||||
"xfd",
|
||||
"xhost",
|
||||
"xlsfonts",
|
||||
"xrdb",
|
||||
"xset",
|
||||
"xz",
|
||||
"xzcat",
|
||||
"yacc",
|
||||
"yes",
|
||||
"yppasswd",
|
||||
"yum",
|
||||
"zcat",
|
||||
"zipcloack",
|
||||
"zipinfo",
|
||||
"zipnote",
|
||||
"zipsplit",
|
||||
"zypper"
|
||||
//</editor-fold>
|
||||
};
|
||||
public static Vector<String> admins_mails = new Vector_<>(
|
||||
|
||||
"vmk-post@yandex.ru"
|
||||
// "79854210702@ya.ru"
|
||||
);
|
||||
}
|
||||
436
src/_VisualDVM/Current.java
Normal file
436
src/_VisualDVM/Current.java
Normal file
@@ -0,0 +1,436 @@
|
||||
package _VisualDVM;
|
||||
import Common.CurrentAnchestor;
|
||||
import GlobalData.Account.Account;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import GlobalData.Module.Module;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import GlobalData.Tasks.RunTask.RunTask;
|
||||
import GlobalData.User.User;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import ProjectData.SapforData.Functions.FuncInfo;
|
||||
import ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import Visual_DVM_2021.Passes.UI.PassForm;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
public enum Current implements CurrentAnchestor {
|
||||
//--
|
||||
DVMPackage,
|
||||
SapforPackage,
|
||||
//--
|
||||
ServerSapfor,
|
||||
SapforEtalonVersion,
|
||||
SapforVersion,
|
||||
//--
|
||||
ComponentServerBackup,
|
||||
Subscriber,
|
||||
FileGraphElement,
|
||||
InlineGraphElement,
|
||||
InlineGraphElement2,
|
||||
IncludeGraphElement,
|
||||
Component,
|
||||
Project,
|
||||
File,
|
||||
Root,
|
||||
Version,
|
||||
BugReport,
|
||||
Account,
|
||||
DBArray,
|
||||
ProjectArray,
|
||||
ParallelRegionInfo,
|
||||
ParallelVariant,
|
||||
Machine,
|
||||
User,
|
||||
Compiler,
|
||||
Makefile,
|
||||
Module,
|
||||
RunConfiguration,
|
||||
EnvironmentValue,
|
||||
CompilationTask,
|
||||
RunTask,
|
||||
ProjectNode, //узел в дереве проекта. нужен для отображения добавленных файлов
|
||||
SelectedDirectory,
|
||||
SelectedFile,
|
||||
//текущий выбранный удаленный файл
|
||||
RemoteFile,
|
||||
PassForm, //текущее окно анимации. нужно для сообщений сапфора по сокету.
|
||||
RunStsRecord,
|
||||
//только для того, чтобы закодировать таблицу.
|
||||
Array,
|
||||
ParallelRegion,
|
||||
Dimensions,
|
||||
//----------
|
||||
Warnings,
|
||||
Errors,
|
||||
Notes,
|
||||
Recommendations,
|
||||
//-
|
||||
Sapfor,
|
||||
//-
|
||||
Scenario,
|
||||
ScenarioCommand,
|
||||
//-
|
||||
DVMConfiguration,
|
||||
Group,
|
||||
//-
|
||||
DVMParameterValue,
|
||||
Test,
|
||||
Function,
|
||||
SelectedFunction,
|
||||
//-
|
||||
Credentials,
|
||||
//-
|
||||
PackageVersion,
|
||||
SapforConfiguration,
|
||||
SapforProfile,
|
||||
SapforProfileSetting,
|
||||
//--
|
||||
ProjectView,
|
||||
SubscriberWorkspace,
|
||||
DVMRunTask,
|
||||
SapforSettings,
|
||||
SapforSettingsCommand,
|
||||
DVMSettings;
|
||||
@Override
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case DVMSettings:
|
||||
return "Параметры тестирования DVM системы";
|
||||
case SapforSettings:
|
||||
return "Параметры тестирования системы SAPFOR";
|
||||
case SapforSettingsCommand:
|
||||
return "Команда SAPFOR";
|
||||
case DVMRunTask:
|
||||
return "Задача DVM тестирования";
|
||||
case SapforPackage:
|
||||
return "Пакет тестирования SAPFOR";
|
||||
case DVMPackage:
|
||||
return "Пакет тестирования DVM";
|
||||
case DVMConfiguration:
|
||||
return "Конфигурация тестирования";
|
||||
case ServerSapfor:
|
||||
return "тестовая версия SAPFOR";
|
||||
case SubscriberWorkspace:
|
||||
return "рабочее пространство пользователя";
|
||||
case SapforProfile:
|
||||
return "Профиль SAPFOR";
|
||||
case SapforProfileSetting:
|
||||
return "Настройка профиля SAPFOR";
|
||||
case SapforEtalonVersion:
|
||||
return "Версия SAPFOR(Эталон)";
|
||||
case SapforVersion:
|
||||
return "Версия SAPFOR";
|
||||
case ComponentServerBackup:
|
||||
return "Версия компонента для восстановления с сервера";
|
||||
case Subscriber:
|
||||
return "Адресат";
|
||||
case SelectedFunction:
|
||||
return "Выбранный узел графа процедур";
|
||||
case SapforConfiguration:
|
||||
return "Конфигурация тестирования SAPFOR";
|
||||
case PackageVersion:
|
||||
return "Версия пакетного режима";
|
||||
case Credentials:
|
||||
return "Учётные данные";
|
||||
case Function:
|
||||
return "Функция";
|
||||
case DVMParameterValue:
|
||||
return "Параметр DVM системы";
|
||||
case ParallelRegion:
|
||||
return "Область распараллеливания";
|
||||
case Group:
|
||||
return "Группа тестов DVM";
|
||||
case Scenario:
|
||||
return "Сценарий";
|
||||
case ScenarioCommand:
|
||||
return "Команда сценария";
|
||||
case ProjectNode:
|
||||
return "текущий узел дерева проектов"; //служебка
|
||||
case Test:
|
||||
return "Тест";
|
||||
case Sapfor:
|
||||
return "SAPFOR";
|
||||
case EnvironmentValue:
|
||||
return "Значение переменной окружения";
|
||||
case SelectedDirectory:
|
||||
return "Папка проекта";
|
||||
case SelectedFile:
|
||||
return "Файл проекта";
|
||||
case RunConfiguration:
|
||||
return "Конфигурация запуска";
|
||||
case RunTask:
|
||||
return "Задача на запуск";
|
||||
case CompilationTask:
|
||||
return "Задача на компиляцию";
|
||||
case Makefile:
|
||||
return "Мейкфайл";
|
||||
case Module:
|
||||
return "Языковой модуль мейкфайла";
|
||||
case RemoteFile:
|
||||
return "Удалённый файл";
|
||||
case Component:
|
||||
return "Компонент";
|
||||
case Project:
|
||||
return "Проект";
|
||||
case File:
|
||||
return "Файл";
|
||||
case Root:
|
||||
return "Корень дерева версий";
|
||||
case Version:
|
||||
return "Версия";
|
||||
case BugReport:
|
||||
return "Отчёт об ошибке";
|
||||
case Account:
|
||||
return "Аккаунт";
|
||||
case Machine:
|
||||
return "Машина";
|
||||
case User:
|
||||
return "Пользователь";
|
||||
case Compiler:
|
||||
return "Компилятор";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------->>
|
||||
public static boolean HasProject() {
|
||||
return CurrentAnchestor.get(Project) != null;
|
||||
}
|
||||
public static boolean HasFile() {
|
||||
return CurrentAnchestor.get(File) != null;
|
||||
}
|
||||
public static boolean HasSelectedFile() {
|
||||
return CurrentAnchestor.get(SelectedFile) != null;
|
||||
}
|
||||
public static boolean HasAccount() {
|
||||
return CurrentAnchestor.get(Account) != null;
|
||||
}
|
||||
public static boolean HasMachine() {
|
||||
return CurrentAnchestor.get(Machine) != null;
|
||||
}
|
||||
public static boolean HasUser() {
|
||||
return CurrentAnchestor.get(User) != null;
|
||||
}
|
||||
public static boolean HasCompiler() {
|
||||
return CurrentAnchestor.get(Compiler) != null;
|
||||
}
|
||||
public static boolean HasRemoteFile() {
|
||||
return CurrentAnchestor.get(RemoteFile) != null;
|
||||
}
|
||||
public static boolean HasMakefile() {
|
||||
return CurrentAnchestor.get(Makefile) != null;
|
||||
}
|
||||
public static boolean HasRunConfiguration() {
|
||||
return CurrentAnchestor.get(RunConfiguration) != null;
|
||||
}
|
||||
public static boolean HasCompilationTask() {
|
||||
return CurrentAnchestor.get(CompilationTask) != null;
|
||||
}
|
||||
public static boolean HasRunTask() {
|
||||
return CurrentAnchestor.get(RunTask) != null;
|
||||
}
|
||||
public static boolean HasPassForm() {
|
||||
return CurrentAnchestor.get(PassForm) != null;
|
||||
}
|
||||
public static boolean HasProjectView() {
|
||||
return CurrentAnchestor.get(ProjectView) != null;
|
||||
}
|
||||
public static SapforSettings getSapforSettings() {
|
||||
return (SapforSettings) CurrentAnchestor.get(SapforSettings);
|
||||
}
|
||||
public static boolean HasSapforSettings() {
|
||||
return CurrentAnchestor.get(SapforSettings) != null;
|
||||
}
|
||||
public static db_project_info getProject() {
|
||||
return (db_project_info) CurrentAnchestor.get(Project);
|
||||
}
|
||||
public static DBProjectFile getFile() {
|
||||
return (DBProjectFile) CurrentAnchestor.get(File);
|
||||
}
|
||||
public static Repository.Component.Component getComponent() {
|
||||
return (Repository.Component.Component) CurrentAnchestor.get(Component);
|
||||
}
|
||||
public static Repository.BugReport.BugReport getBugReport() {
|
||||
return (BugReport) CurrentAnchestor.get(BugReport);
|
||||
}
|
||||
public static db_project_info getRoot() {
|
||||
return (db_project_info) CurrentAnchestor.get(Root);
|
||||
}
|
||||
public static boolean HasRoot() {
|
||||
return CurrentAnchestor.get(Root) != null;
|
||||
}
|
||||
public static db_project_info getVersion() {
|
||||
return (db_project_info) CurrentAnchestor.get(Version);
|
||||
}
|
||||
public static Account getAccount() {
|
||||
return (Account) CurrentAnchestor.get(Account);
|
||||
}
|
||||
public static boolean HasSubscriber() {
|
||||
return CurrentAnchestor.get(Current.Subscriber) != null;
|
||||
}
|
||||
public static Repository.Subscribes.Subscriber getSubscriber() {
|
||||
return (Subscriber) CurrentAnchestor.get(Current.Subscriber);
|
||||
}
|
||||
public static Machine getMachine() {
|
||||
return (Machine) CurrentAnchestor.get(Current.Machine);
|
||||
}
|
||||
public static User getUser() {
|
||||
return (User) CurrentAnchestor.get(Current.User);
|
||||
}
|
||||
public static Compiler getCompiler() {
|
||||
return (Compiler) CurrentAnchestor.get(Current.Compiler);
|
||||
}
|
||||
public static CompilationTask getCompilationTask() {
|
||||
return (CompilationTask) CurrentAnchestor.get(Current.CompilationTask);
|
||||
}
|
||||
public static RunTask getRunTask() {
|
||||
return (RunTask) CurrentAnchestor.get(Current.RunTask);
|
||||
}
|
||||
public static RemoteFile getRemoteFile() {
|
||||
return (RemoteFile) CurrentAnchestor.get(Current.RemoteFile);
|
||||
}
|
||||
public static Makefile getMakefile() {
|
||||
return (Makefile) CurrentAnchestor.get(Current.Makefile);
|
||||
}
|
||||
public static Module getModule() {
|
||||
return (Module) CurrentAnchestor.get(Current.Module);
|
||||
}
|
||||
public static RunConfiguration getRunConfiguration() {
|
||||
return (RunConfiguration) CurrentAnchestor.get(Current.RunConfiguration);
|
||||
}
|
||||
public static Repository.Component.Sapfor.Sapfor getSapfor() {
|
||||
return (Repository.Component.Sapfor.Sapfor) CurrentAnchestor.get(Current.Sapfor);
|
||||
}
|
||||
public static boolean HasGroup() {
|
||||
return CurrentAnchestor.get(Current.Group) != null;
|
||||
}
|
||||
public static TestingSystem.Common.Group.Group getGroup() {
|
||||
return (TestingSystem.Common.Group.Group) CurrentAnchestor.get(Current.Group);
|
||||
}
|
||||
public static boolean HasConfiguration() {
|
||||
return CurrentAnchestor.get(Current.DVMConfiguration) != null;
|
||||
}
|
||||
public static DVMConfiguration getDVMConfiguration() {
|
||||
return (DVMConfiguration) CurrentAnchestor.get(Current.DVMConfiguration);
|
||||
}
|
||||
public static SapforConfiguration getSapforConfiguration() {
|
||||
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) CurrentAnchestor.get(Current.SapforConfiguration);
|
||||
}
|
||||
public static Test getTest() {
|
||||
return (TestingSystem.Common.Test.Test) CurrentAnchestor.get(Current.Test);
|
||||
}
|
||||
public static boolean HasTest() {
|
||||
return CurrentAnchestor.get(Current.Test) != null;
|
||||
}
|
||||
public static boolean HasVersion() {
|
||||
return CurrentAnchestor.get(Current.Version) != null;
|
||||
}
|
||||
public static RemoteFile getComponentServerBackup() {
|
||||
return (RemoteFile) CurrentAnchestor.get(Current.ComponentServerBackup);
|
||||
}
|
||||
public static boolean HasComponentServerBackup() {
|
||||
return CurrentAnchestor.get(Current.ComponentServerBackup) != null;
|
||||
}
|
||||
public static DefaultMutableTreeNode getProjectNode() {
|
||||
return (DefaultMutableTreeNode) CurrentAnchestor.get(Current.ProjectNode);
|
||||
}
|
||||
public static DefaultMutableTreeNode getProjectCurrentParentNode() {
|
||||
DefaultMutableTreeNode node = Current.getProjectNode();
|
||||
//если в дереве еще никто не выделялся, берем корень.
|
||||
if (node == null)
|
||||
return Current.getProject().filesTreeRoot;
|
||||
return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
|
||||
}
|
||||
public static File getSelectedDirectory() {
|
||||
return (File) CurrentAnchestor.get(Current.SelectedDirectory);
|
||||
}
|
||||
public static DBProjectFile getSelectedFile() {
|
||||
return (DBProjectFile) CurrentAnchestor.get(Current.SelectedFile);
|
||||
}
|
||||
public static boolean HasBugReport() {
|
||||
return CurrentAnchestor.get(Current.BugReport) != null;
|
||||
}
|
||||
public static PassForm getPassForm() {
|
||||
return (Visual_DVM_2021.Passes.UI.PassForm) CurrentAnchestor.get(Current.PassForm);
|
||||
}
|
||||
public static ParallelRegion getParallelRegion() {
|
||||
return (ParallelRegion) CurrentAnchestor.get(Current.ParallelRegion);
|
||||
}
|
||||
public static boolean HasParallelRegion() {
|
||||
return CurrentAnchestor.get(Current.ParallelRegion) != null;
|
||||
}
|
||||
public static boolean HasFunction() {
|
||||
return CurrentAnchestor.get(Current.Function) != null;
|
||||
}
|
||||
public static boolean HasSelectedFunction() {
|
||||
return CurrentAnchestor.get(Current.SelectedFunction) != null;
|
||||
}
|
||||
public static FuncInfo getFunction() {
|
||||
return (FuncInfo) CurrentAnchestor.get(Current.Function);
|
||||
}
|
||||
public static FuncInfo getSelectionFunction() {
|
||||
return (FuncInfo) CurrentAnchestor.get(Current.SelectedFunction);
|
||||
}
|
||||
public static boolean HasScenario() {
|
||||
return CurrentAnchestor.get(Current.Scenario) != null;
|
||||
}
|
||||
public static db_project_info getPackageVersion() {
|
||||
return (db_project_info) CurrentAnchestor.get(Current.PackageVersion);
|
||||
}
|
||||
public static boolean HasPackageVersion() {
|
||||
return CurrentAnchestor.get(Current.PackageVersion) != null;
|
||||
}
|
||||
public static boolean HasSapforConfiguration() {
|
||||
return CurrentAnchestor.get(Current.SapforConfiguration) != null;
|
||||
}
|
||||
public static ProjectData.ProjectView getProjectView() {
|
||||
return (ProjectData.ProjectView) CurrentAnchestor.get(ProjectView);
|
||||
}
|
||||
public static boolean HasSapforProfile() {
|
||||
return CurrentAnchestor.get(Current.SapforProfile) != null;
|
||||
}
|
||||
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
|
||||
return (GlobalData.SapforProfile.SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
|
||||
}
|
||||
public static boolean HasServerSapfor() {
|
||||
return CurrentAnchestor.get(Current.ServerSapfor) != null;
|
||||
}
|
||||
public static TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
|
||||
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) CurrentAnchestor.get(Current.ServerSapfor);
|
||||
}
|
||||
public static boolean HasSubscriberWorkspace() {
|
||||
return CurrentAnchestor.get(Current.SubscriberWorkspace) != null;
|
||||
}
|
||||
public static Repository.SubscriberWorkspace.SubscriberWorkspace getSubscriberWorkspace() {
|
||||
return (Repository.SubscriberWorkspace.SubscriberWorkspace) CurrentAnchestor.get(Current.SubscriberWorkspace);
|
||||
}
|
||||
public static boolean HasDVMPackage() {
|
||||
return CurrentAnchestor.get(Current.DVMPackage) != null;
|
||||
}
|
||||
public static TestingSystem.DVM.DVMPackage.DVMPackage getDVMPackage() {
|
||||
return (TestingSystem.DVM.DVMPackage.DVMPackage) CurrentAnchestor.get(Current.DVMPackage);
|
||||
}
|
||||
public static boolean HasSapforPackage() {
|
||||
return CurrentAnchestor.get(Current.SapforPackage) != null;
|
||||
}
|
||||
public static TestingSystem.SAPFOR.SapforPackage.SapforPackage getSapforPackage() {
|
||||
return (TestingSystem.SAPFOR.SapforPackage.SapforPackage) CurrentAnchestor.get(Current.SapforPackage);
|
||||
}
|
||||
public static boolean HasDVMRunTask() {
|
||||
return CurrentAnchestor.get(Current.DVMRunTask) != null;
|
||||
}
|
||||
public static TestingSystem.DVM.DVMTasks.DVMRunTask getDVMRunTask() {
|
||||
return (TestingSystem.DVM.DVMTasks.DVMRunTask) CurrentAnchestor.get(Current.DVMRunTask);
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,6 @@ import Common.Mode;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Loggable;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Current;
|
||||
import Common_old.GlobalProperties;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Account.Account;
|
||||
import GlobalData.Account.AccountRole;
|
||||
import GlobalData.GlobalDatabase;
|
||||
@@ -29,6 +24,7 @@ import TestingSystem.SAPFOR.PackageModeSupervisor;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import _VisualDVM.Visual.Syntax.LightSPFEditorTheme;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
||||
|
||||
|
||||
230
src/_VisualDVM/GlobalProperties.java
Normal file
230
src/_VisualDVM/GlobalProperties.java
Normal file
@@ -0,0 +1,230 @@
|
||||
package _VisualDVM;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Visual.Menus.StableMenuItem;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.file.Paths;
|
||||
public class GlobalProperties {
|
||||
@Expose
|
||||
public Common.Mode Mode = Common.Mode.Normal;
|
||||
@Expose
|
||||
public String ServerAddress = "alex-freenas.ddns.net";
|
||||
@Expose
|
||||
public String ServerUserName = "testuser";
|
||||
@Expose
|
||||
public int ServerUserSHHPort = 23;
|
||||
@Expose
|
||||
public int ComponentsServerPort = 7995;
|
||||
@Expose
|
||||
public int TestingServerPort = 7998;
|
||||
@Expose
|
||||
public int SocketTimeout = 5000;
|
||||
@Expose
|
||||
public boolean OldServer = false;
|
||||
@Expose
|
||||
public String SMTPHost = "smtp.mail.ru";
|
||||
@Expose
|
||||
public int SMTPPort = 465;
|
||||
@Expose
|
||||
public int MailSocketPort = 465;
|
||||
@Expose
|
||||
public boolean collapseCredentials = false;
|
||||
@Expose
|
||||
public boolean collapseFileGraphs = false;
|
||||
@Expose
|
||||
public boolean collapseFileMessages = false;
|
||||
@Expose
|
||||
public boolean collapseProjectTrees = false;
|
||||
@Expose
|
||||
public String BackupWorkspace = "_sapfor_x64_backups";
|
||||
@Expose
|
||||
public int BackupHour = 5;
|
||||
@Expose
|
||||
public int BackupMinute = 0;
|
||||
@Expose
|
||||
public boolean EmailAdminsOnStart = false;
|
||||
@Expose
|
||||
public boolean AutoUpdateSearch = true;
|
||||
@Expose
|
||||
public boolean ConfirmPassesStart = true;
|
||||
@Expose
|
||||
public boolean ShowPassesDone = true;
|
||||
@Expose
|
||||
public boolean FocusPassesResult = true;
|
||||
@Expose
|
||||
public String GlobalDBName = "db7.sqlite";
|
||||
@Expose
|
||||
public String ProjectDBName = "new_project_base.sqlite";
|
||||
@Expose
|
||||
public String BugReportsDBName = "bug_reports.sqlite";
|
||||
@Expose
|
||||
public String TestsDBName = "tests.sqlite";
|
||||
@Expose
|
||||
public int ComponentsWindowWidth = 650;
|
||||
@Expose
|
||||
public int ComponentsWindowHeight = 250;
|
||||
@Expose
|
||||
public String VisualiserPath = "";
|
||||
@Expose
|
||||
public String Sapfor_FPath = "";
|
||||
@Expose
|
||||
public String Visualizer_2Path = "";
|
||||
@Expose
|
||||
public String InstructionPath = "";
|
||||
@Expose
|
||||
public String PerformanceAnalyzerPath = "";
|
||||
@Expose
|
||||
public int ComponentsBackUpsCount = 10;
|
||||
@Expose
|
||||
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
|
||||
@Expose
|
||||
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
|
||||
@Expose
|
||||
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
|
||||
@Expose
|
||||
public boolean eraseTestingWorkspaces = true; //удалять ли рабочее пространство пакетов тестирования после его завершения
|
||||
//-----------------
|
||||
public String getFieldDescription(String fieldName) {
|
||||
switch (fieldName) {
|
||||
case "ShowPassesDone":
|
||||
return "Сообщать об успешном выполнении проходов";
|
||||
case "ConfirmPassesStart":
|
||||
return "Запрашивать подтверждения начала выполнения проходов";
|
||||
case "FocusPassesResult":
|
||||
return "Переходить на результирующую вкладку проходов по их завершении";
|
||||
case "collapseCredentials":
|
||||
return "Свернуть раздел машин";
|
||||
case "collapseFileGraphs":
|
||||
return "Свернуть раздел графов файла";
|
||||
case "collapseFileMessages":
|
||||
return "Свернуть раздел сообщений файла";
|
||||
case "collapseProjectTrees":
|
||||
return "Свернуть раздел деревьев проекта";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
public GlobalProperties(GlobalProperties p) {
|
||||
super();
|
||||
Mode = p.Mode;
|
||||
ServerAddress = p.ServerAddress;
|
||||
ServerUserName = p.ServerUserName;
|
||||
ServerUserSHHPort = p.ServerUserSHHPort;
|
||||
ComponentsServerPort = p.ComponentsServerPort;
|
||||
TestingServerPort = p.TestingServerPort;
|
||||
SocketTimeout = p.SocketTimeout;
|
||||
OldServer = p.OldServer;
|
||||
SMTPHost = p.SMTPHost;
|
||||
SMTPPort = p.SMTPPort;
|
||||
MailSocketPort = p.MailSocketPort;
|
||||
collapseCredentials = p.collapseCredentials;
|
||||
collapseFileGraphs = p.collapseFileGraphs;
|
||||
collapseFileMessages = p.collapseFileMessages;
|
||||
collapseProjectTrees = p.collapseProjectTrees;
|
||||
BackupWorkspace = p.BackupWorkspace;
|
||||
BackupHour = p.BackupHour;
|
||||
BackupMinute = p.BackupMinute;
|
||||
EmailAdminsOnStart = p.EmailAdminsOnStart;
|
||||
AutoUpdateSearch = p.AutoUpdateSearch;
|
||||
ConfirmPassesStart = p.ConfirmPassesStart;
|
||||
ShowPassesDone = p.ShowPassesDone;
|
||||
FocusPassesResult = p.FocusPassesResult;
|
||||
GlobalDBName = p.GlobalDBName;
|
||||
ProjectDBName = p.ProjectDBName;
|
||||
BugReportsDBName = p.BugReportsDBName;
|
||||
TestsDBName = p.TestsDBName;
|
||||
ComponentsWindowWidth = p.ComponentsWindowWidth;
|
||||
ComponentsWindowHeight = p.ComponentsWindowHeight;
|
||||
VisualiserPath = p.VisualiserPath;
|
||||
Sapfor_FPath = p.Sapfor_FPath;
|
||||
Visualizer_2Path = p.Visualizer_2Path;
|
||||
InstructionPath = p.InstructionPath;
|
||||
PerformanceAnalyzerPath = p.PerformanceAnalyzerPath;
|
||||
ComponentsBackUpsCount = p.ComponentsBackUpsCount;
|
||||
AutoCheckTesting = p.AutoCheckTesting;
|
||||
CheckTestingIntervalSeconds = p.CheckTestingIntervalSeconds;
|
||||
EmailOnTestingProgress = p.EmailOnTestingProgress;
|
||||
eraseTestingWorkspaces = p.eraseTestingWorkspaces;
|
||||
}
|
||||
//-----------------
|
||||
public void addFlagMenuItem(JMenu menu, String fieldName) {
|
||||
JMenuItem menu_item = new StableMenuItem(getFieldDescription(fieldName),
|
||||
getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png");
|
||||
//-
|
||||
menu_item.addActionListener(e -> {
|
||||
if (Pass_2021.passes.get(PassCode_2021.UpdateProperty).Do(fieldName, !getFlag(fieldName)))
|
||||
menu_item.setIcon(CommonUtils.getIcon(getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
});
|
||||
menu.add(menu_item);
|
||||
}
|
||||
public boolean getFlag(String fieldName) {
|
||||
boolean field = false;
|
||||
try {
|
||||
field = (boolean) getClass().getField(fieldName).get(this);
|
||||
//
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return field;
|
||||
}
|
||||
public void switchFlag(String fieldName) {
|
||||
boolean field = false;
|
||||
try {
|
||||
field = (boolean) getClass().getField(fieldName).get(this);
|
||||
getClass().getField(fieldName).set(this, !field);
|
||||
//
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void Update() {
|
||||
try {
|
||||
CommonUtils.jsonToFile(this, getFile());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//--
|
||||
public boolean updateField(String name, Object newValue) {
|
||||
try {
|
||||
Field field = getClass().getField(name);
|
||||
Object oldValue = field.get(this);
|
||||
//---
|
||||
if (newValue.equals(oldValue))
|
||||
return false;
|
||||
//--
|
||||
field.set(this, newValue);
|
||||
this.Update();
|
||||
return true;
|
||||
//--
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void switchAndUpdateFlag(String name) {
|
||||
try {
|
||||
Field field = getClass().getField(name);
|
||||
boolean oldValue = (boolean) field.get(this);
|
||||
boolean newValue = !oldValue;
|
||||
//---
|
||||
field.set(this, newValue);
|
||||
this.Update();
|
||||
//--
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return Paths.get(System.getProperty("user.dir"), "properties").toFile();
|
||||
}
|
||||
//--
|
||||
public GlobalProperties() {
|
||||
}
|
||||
}
|
||||
854
src/_VisualDVM/Utils.java
Normal file
854
src/_VisualDVM/Utils.java
Normal file
@@ -0,0 +1,854 @@
|
||||
package _VisualDVM;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.StringTemplate;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Visual.CommonUI;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser_;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.*;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.*;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.IntStream;
|
||||
public class Utils {
|
||||
public static boolean isLinuxSystemCommand(String text) {
|
||||
for (String command : Constants.linux_system_commands) {
|
||||
if (text.equalsIgnoreCase(command)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static String MFVar(Object o) {
|
||||
return "$(" + o.toString() + ")";
|
||||
}
|
||||
public static void CheckDirectory(File dir) {
|
||||
if (!dir.exists()) {
|
||||
try {
|
||||
FileUtils.forceMkdir(dir);
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void CheckAndCleanDirectory(File dir) {
|
||||
if (dir.exists()) {
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null)
|
||||
for (File f : files) {
|
||||
try {
|
||||
forceDeleteWithCheck(f);
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
FileUtils.forceMkdir(dir);
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static String ReadAllText(File file) {
|
||||
try {
|
||||
return new String(Files.readAllBytes(file.toPath()));
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public static void CleanDirectory(File dir) {
|
||||
if (dir.exists() && dir.isDirectory()) {
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null) {
|
||||
for (File f : files) {
|
||||
try {
|
||||
forceDeleteWithCheck(f);
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void WriteToFile(File f, String text) throws IOException {
|
||||
Files.write(
|
||||
f.toPath(),
|
||||
text.getBytes(),
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.TRUNCATE_EXISTING);
|
||||
}
|
||||
// http://java-online.ru/blog-archive.xhtml
|
||||
public static void getFilesCountR(File dir, Index res) {
|
||||
for (File f : dir.listFiles()) {
|
||||
res.Inc();
|
||||
if (f.isDirectory())
|
||||
getFilesCountR(f, res);
|
||||
}
|
||||
}
|
||||
public static int getFilesCount(File dir) {
|
||||
Index res = new Index();
|
||||
getFilesCountR(dir, res);
|
||||
return res.getValue();
|
||||
}
|
||||
public static File CreateTempResourceFile(String res_name) throws Exception {
|
||||
URL u = (Utils.class.getResource("/files/" + res_name));
|
||||
InputStream i = u.openStream();
|
||||
Path p = Paths.get(Global.TempDirectory.getAbsolutePath(), CommonUtils.getDateName(res_name));
|
||||
Files.copy(i, p, StandardCopyOption.REPLACE_EXISTING);
|
||||
return p.toFile();
|
||||
}
|
||||
public static void CreateResourceFile(String res_name, File dst) throws Exception {
|
||||
URL u = (Utils.class.getResource("/files/" + res_name));
|
||||
InputStream i = u.openStream();
|
||||
Files.copy(i, dst.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
//просто дать объект под файл с сгенерированным именем
|
||||
public static File CreateTempFile(String name, String text) throws IOException {
|
||||
File res = getTempFileName(name);
|
||||
WriteToFile(res, text);
|
||||
return res;
|
||||
}
|
||||
public static File CreateTempFile(String name, String ext, String text) throws IOException {
|
||||
File res = getTempFileName(name, ext);
|
||||
WriteToFile(res, text);
|
||||
return res;
|
||||
}
|
||||
public static File getTempFileName(String name, String ext) {
|
||||
return Paths.get(System.getProperty("user.dir"), "Temp", CommonUtils.getDateName(name) + (ext.isEmpty() ? "" : ("." + ext))).toFile();
|
||||
}
|
||||
public static File getTempFileName(String name) {
|
||||
return getTempFileName(name, "");
|
||||
}
|
||||
public static boolean isAnchestor(File child, File anchestor) {
|
||||
return child.getAbsolutePath().startsWith(anchestor.getAbsolutePath() + (CommonUtils.isWindows() ? "\\" : "/"));
|
||||
}
|
||||
//при условии что это точно его предок
|
||||
public static String getRelativeAddress(File file, File anchestor) {
|
||||
return file.getAbsolutePath().substring(anchestor.getAbsolutePath().length() + 1);
|
||||
}
|
||||
//для переименования/добавления новых файлов.
|
||||
public static boolean validateFileShortNewName(String name, TextLog Log) {
|
||||
boolean res = true;
|
||||
if (name.isEmpty()) {
|
||||
Log.Writeln_("Имя файла не может быть пустым");
|
||||
res = false;
|
||||
}
|
||||
if (CommonUtils.ContainsCyrillic(name)) {
|
||||
Log.Writeln_("Имя файла не может содержать кириллицу");
|
||||
res = false;
|
||||
}
|
||||
if (CommonUtils.ContainsForbiddenName(name)) {
|
||||
Log.Writeln_("Имя файла не может содержать запрещённых символов\n" + CommonUtils.printAllForbiddenCharacters());
|
||||
res = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//корень сюда гарантированно не попадает. значит можно запрещать двоеточие.
|
||||
//идет по всем уровням файлов
|
||||
public static boolean validateProjectFile(File file, TextLog Log) {
|
||||
String name = file.getName();
|
||||
if (CommonUtils.ContainsCyrillic(name) || CommonUtils.ContainsForbiddenName(name)) {
|
||||
Log.Writeln_(file.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//входной параметр всегда папка.
|
||||
public static void validateProjectFolder_r(File dir, TextLog Log) {
|
||||
validateProjectFile(dir, Log);
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null)
|
||||
for (File file : files) {
|
||||
if (file.isDirectory())
|
||||
validateProjectFolder_r(file, Log);
|
||||
else validateProjectFile(file, Log);
|
||||
}
|
||||
}
|
||||
public static boolean validateProjectFolder(File dir, TextLog Log) {
|
||||
TextLog files_list = new TextLog();
|
||||
String[] filesLines = files_list.text.split("\n");
|
||||
validateProjectFolder_r(dir, files_list);
|
||||
if (!files_list.isEmpty())
|
||||
Log.Writeln_("Имена " + filesLines.length + " файлов/подпапок содержат запрещённые символы " +
|
||||
CommonUtils.printAllForbiddenCharacters() +
|
||||
"или кириллицу");
|
||||
//нужно проверить корень на наличие хоть одной программы.
|
||||
return Log.isEmpty();
|
||||
}
|
||||
public static void delete_with_check(File file) throws Exception {
|
||||
int attempts = 0;
|
||||
while (attempts < 10) {
|
||||
if (file.exists()) {
|
||||
try {
|
||||
FileUtils.forceDelete(file);
|
||||
} catch (Exception ex) {
|
||||
// ex.printStackTrace();
|
||||
}
|
||||
} else return;
|
||||
if (file.exists()) {
|
||||
attempts++;
|
||||
System.out.println("файл " + CommonUtils.Brackets(file.getAbsolutePath()) + " занят");
|
||||
Thread.sleep(2000);
|
||||
} else return;
|
||||
}
|
||||
throw new PassException("Не удалось удалить файл " + CommonUtils.Brackets(file.getAbsolutePath()) + " за " + attempts + " попыток");
|
||||
}
|
||||
public static void GetVertices(float R, float r, float x0, float y0, int n, float phi) {
|
||||
boolean inner = false;
|
||||
for (int i = 0; i < 2 * n; i++) {
|
||||
float rad = inner ? r : R;
|
||||
System.out.println("x=" + (x0 + rad * Math.cos(phi + Math.PI * i / n)));
|
||||
System.out.println("y=" + (y0 + rad * Math.sin(phi + Math.PI * i / n)));
|
||||
System.out.println("--");
|
||||
inner = !inner;
|
||||
}
|
||||
}
|
||||
public static String md5Custom(String st) {
|
||||
MessageDigest messageDigest = null;
|
||||
byte[] digest = new byte[0];
|
||||
try {
|
||||
messageDigest = MessageDigest.getInstance("MD5");
|
||||
messageDigest.reset();
|
||||
messageDigest.update(st.getBytes());
|
||||
digest = messageDigest.digest();
|
||||
} catch (Exception e) {
|
||||
// тут можно обработать ошибку
|
||||
// возникает она если в передаваемый алгоритм в getInstance(,,,) не существует
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
}
|
||||
BigInteger bigInt = new BigInteger(1, digest);
|
||||
String md5Hex = bigInt.toString(16);
|
||||
while (md5Hex.length() < 32) {
|
||||
md5Hex = "0" + md5Hex;
|
||||
}
|
||||
return md5Hex;
|
||||
}
|
||||
public static void renameSubdirs_r(DefaultMutableTreeNode node, File old_anchestor, File new_anchestor) {
|
||||
if (node.getUserObject() instanceof File) {
|
||||
File old_file = (File) node.getUserObject();
|
||||
String relative_name = old_file.getAbsolutePath().substring(old_anchestor.getAbsolutePath().length() + 1);
|
||||
File new_file = Paths.get(new_anchestor.getAbsolutePath(), relative_name).toFile();
|
||||
node.setUserObject(new_file);
|
||||
for (int i = 0; i < node.getChildCount(); ++i) {
|
||||
renameSubdirs_r((DefaultMutableTreeNode) node.getChildAt(i), old_anchestor, new_anchestor);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void forceDeleteWithCheck(File file) throws Exception {
|
||||
int attempts = 0;
|
||||
while (attempts < 10) {
|
||||
if (file.exists()) {
|
||||
try {
|
||||
FileUtils.forceDelete(file);
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
} else return;
|
||||
if (file.exists()) {
|
||||
attempts++;
|
||||
CommonUtils.MainLog.Print("неудачная попытка удаления: файл " + CommonUtils.Brackets(file.getAbsolutePath()) + " занят");
|
||||
Thread.sleep(2000);
|
||||
} else return;
|
||||
}
|
||||
throw new PassException("Не удалось удалить файл " + CommonUtils.Brackets(file.getAbsolutePath()) + " за " + attempts + " попыток");
|
||||
}
|
||||
public static Socket createClientSocket(InetAddress address, int port, int timeout) throws Exception {
|
||||
Socket socket = new Socket();
|
||||
socket.setSoTimeout(timeout);
|
||||
socket.connect(new InetSocketAddress(address, port), timeout);
|
||||
return socket;
|
||||
}
|
||||
public static void CreateResourceFile(File dst) throws Exception {
|
||||
URL u = (Utils.class.getResource("/files/" + dst.getName()));
|
||||
InputStream i = u.openStream();
|
||||
Files.copy(i, dst.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
public static void getFilesByExtensions_r(File dir, Vector<File> res, String... extensions) {
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (file.isFile()) {
|
||||
String file_extension = CommonUtils.getExtension(file);
|
||||
for (String ext : extensions) {
|
||||
if (file_extension.equalsIgnoreCase(ext)) {
|
||||
res.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (file.isDirectory())
|
||||
getFilesByExtensions_r(file, res, extensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
//----->>
|
||||
public static void deleteFilesByExtensions(File dir, String... extensions) throws Exception {
|
||||
Vector<File> res = new Vector<>();
|
||||
Utils.getFilesByExtensions_r(dir, res, extensions);
|
||||
for (File src : res)
|
||||
Utils.forceDeleteWithCheck(src);
|
||||
}
|
||||
//----->>
|
||||
//--процессы-------------------------------------------------->>>>>
|
||||
//<editor-fold desc="создание скрипта">
|
||||
public static Process startScript(File scriptDirectory, File targetDirectory, String name, String scriptText, Map<String, String> envs) throws Exception {
|
||||
//->
|
||||
File scriptFile = createScript(scriptDirectory, targetDirectory, name, scriptText);
|
||||
ProcessBuilder procBuilder = new ProcessBuilder(scriptFile.getAbsolutePath());
|
||||
procBuilder.directory(scriptDirectory);
|
||||
procBuilder.redirectErrorStream(true);
|
||||
if (envs != null) {
|
||||
for (String envName : envs.keySet()) {
|
||||
procBuilder.environment().put(envName, envs.get(envName));
|
||||
}
|
||||
}
|
||||
return procBuilder.start();
|
||||
}
|
||||
public static Process startScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
||||
return startScript(scriptDirectory, targetDirectory, name, scriptText, null);
|
||||
}
|
||||
public static File createScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
||||
//->
|
||||
File scriptFile = Paths.get(scriptDirectory.getAbsolutePath(), name + (CommonUtils.isWindows() ? ".bat" : "")).toFile();
|
||||
FileUtils.write(scriptFile, "cd " + CommonUtils.DQuotes(targetDirectory.getAbsolutePath()) + "\n" + scriptText);
|
||||
if (!scriptFile.setExecutable(true)) throw new PassException("Не удалось создать исполняемый файл для скрипта");
|
||||
return scriptFile;
|
||||
}
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="чтение вывода процесса">
|
||||
public static String readLine(Process process) throws Exception {
|
||||
InputStream stdout = process.getInputStream();
|
||||
InputStreamReader isrStdout = new InputStreamReader(stdout);
|
||||
BufferedReader brStdout = new BufferedReader(isrStdout);
|
||||
String line = brStdout.readLine();
|
||||
return line;
|
||||
}
|
||||
public static Vector<String> readAllLines(Process process) throws Exception {
|
||||
Vector<String> output = new Vector<>();
|
||||
InputStream stdout = process.getInputStream();
|
||||
InputStreamReader isrStdout = new InputStreamReader(stdout);
|
||||
BufferedReader brStdout = new BufferedReader(isrStdout);
|
||||
String line;
|
||||
while ((line = brStdout.readLine()) != null) {
|
||||
output.add(line);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
public static String readAllOutput(Process process) throws Exception {
|
||||
return String.join("\n", readAllLines(process));
|
||||
}
|
||||
//</editor-fold>
|
||||
public static String extractHeaderName(String line) {
|
||||
String tline = line.trim().toLowerCase();
|
||||
if (tline.startsWith("include")) {
|
||||
String[] data = tline.split("'");
|
||||
return data.length > 1 ? data[1] : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getRelativeName(File dir, File file) {
|
||||
return
|
||||
file.getAbsolutePath().startsWith(dir.getAbsolutePath()) ?
|
||||
file.getAbsolutePath().substring(dir.getAbsolutePath().length() + 1).replace('/', '\\') :
|
||||
file.getAbsolutePath()
|
||||
;
|
||||
}
|
||||
public static boolean containsLine(Vector<String> list, String line, int max_index) {
|
||||
int last_index = -1;
|
||||
for (int i = 0; i < list.size(); ++i)
|
||||
if (list.get(i).equals(line)) last_index = i;
|
||||
return (last_index >= max_index);
|
||||
}
|
||||
public static String compareTexts(String master, String slave) {
|
||||
Vector<String> lines = new Vector<>(Arrays.asList(master.split("\n")));
|
||||
Vector<String> slavelines = new Vector<>(Arrays.asList(slave.split("\n")));
|
||||
Vector<String> t2 = new Vector<>();
|
||||
int old_j = 0;
|
||||
int j = 0;
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
if (containsLine(slavelines, lines.get(i), old_j)) {
|
||||
for (int k = old_j; k < slavelines.size(); ++k) {
|
||||
j = k;
|
||||
if (lines.get(i).equals(slavelines.get(k))) {
|
||||
j++;
|
||||
t2.add(slavelines.get(k));
|
||||
break;
|
||||
} else
|
||||
t2.add("+ " + slavelines.get(k));
|
||||
}
|
||||
old_j = j;
|
||||
} else {
|
||||
//строки гарантированно нет.
|
||||
t2.add("- " + lines.get(i));
|
||||
}
|
||||
}
|
||||
//теперь граничное условие. если первый файл кончился а второй нет, его остаток это добавление.
|
||||
for (int i = j; i < slavelines.size(); ++i)
|
||||
t2.add("+ " + slavelines.get(i));
|
||||
return String.join("\n", t2);
|
||||
}
|
||||
public static int getHalfKernels() {
|
||||
int countCores = 1;
|
||||
if (Runtime.getRuntime().availableProcessors() > 1)
|
||||
countCores = Runtime.getRuntime().availableProcessors() / 2;
|
||||
return countCores;
|
||||
}
|
||||
public static int getMaxKernels() {
|
||||
return Math.max(2, Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
public static int getMatrixProcessors(String matrix) {
|
||||
if (matrix.trim().isEmpty()) return 1;
|
||||
String[] data = matrix.split(" ");
|
||||
int res = 1;
|
||||
for (String d : data)
|
||||
res *= Integer.parseInt(d);
|
||||
return res;
|
||||
}
|
||||
public static int getCTestMaxDim(File test) {
|
||||
int fileMax = 0;
|
||||
final String prefix = "#pragma dvm array distribute";
|
||||
int n = 0;
|
||||
try {
|
||||
for (String line : FileUtils.readLines(test, Charset.defaultCharset())) {
|
||||
// #pragma dvm array distribute[block][block], не важно
|
||||
String packedLine = CommonUtils.removeCharacters(CommonUtils.removeRedundantSpaces(line).toLowerCase(), "\n", "\r", "\t");
|
||||
if (packedLine.startsWith(prefix)) {
|
||||
packedLine = packedLine.substring(prefix.length());
|
||||
boolean bracketOpen = false;
|
||||
int pragmaMax = 0;
|
||||
String distr = "";
|
||||
for (int i = packedLine.indexOf('['); i < packedLine.length(); ++i) {
|
||||
char c = packedLine.charAt(i);
|
||||
if (bracketOpen) {
|
||||
if (c == ']') {
|
||||
bracketOpen = false;
|
||||
if (distr.equals("block"))
|
||||
pragmaMax++;
|
||||
distr = "";
|
||||
} else {
|
||||
distr += c;
|
||||
}
|
||||
} else {
|
||||
if (c == '[') {
|
||||
bracketOpen = true;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fileMax = Math.max(fileMax, pragmaMax);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return fileMax;
|
||||
}
|
||||
public static int getCProjectMaxDim(db_project_info project) {
|
||||
int res = 0;
|
||||
for (DBProjectFile file : project.db.files.Data.values()) {
|
||||
if (file.isActiveProgram())
|
||||
res = Math.max(res, getCTestMaxDim(file.file));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static boolean isTimeout(long startDate, long maxtime_sec) {
|
||||
Date now = new Date();
|
||||
long delta = (now.getTime() - startDate) / 1000;
|
||||
return (delta > maxtime_sec);
|
||||
}
|
||||
//https://translated.turbopages.org/proxy_u/en-ru.ru.596e2df7-62fd38bb-6b4aad49-74722d776562/https/stackoverflow.com/questions/34658054/finding-whole-word-only-in-java-string-search
|
||||
public static long findInFile(String keyword_in, boolean registerOn, boolean wholeWord, File file) {
|
||||
if (keyword_in.isEmpty()) return 0;
|
||||
long res = 0;
|
||||
try {
|
||||
String text = FileUtils.readFileToString(file);
|
||||
String keyword = keyword_in;
|
||||
//-->>
|
||||
if (!registerOn) {
|
||||
text = text.toUpperCase();
|
||||
keyword = keyword.toUpperCase();
|
||||
}
|
||||
String regex = wholeWord ? "\\b" + keyword + "\\b" : keyword;
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(text);
|
||||
while (matcher.find()) res++;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void addEmptyLines(Vector<String> lines, int num) {
|
||||
IntStream.range(0, num).mapToObj(i -> "").forEach(lines::add);
|
||||
}
|
||||
protected static boolean isSource(File file) {
|
||||
if (file.isFile()) {
|
||||
String extension = CommonUtils.getExtension(file).toLowerCase();
|
||||
switch (extension) {
|
||||
case "f":
|
||||
case "fdv":
|
||||
case "for":
|
||||
case "f77":
|
||||
case "f90":
|
||||
// case "fh":
|
||||
case "c":
|
||||
case "cdv":
|
||||
case "cpp":
|
||||
// case "h":
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean containsSource(File folder, boolean question) {
|
||||
File visualiserData = new File(folder, Constants.data);
|
||||
if (visualiserData.exists()) {
|
||||
return true;
|
||||
} //есть папка с данными, значит его уже открывали, все хорошо.
|
||||
File[] files = folder.listFiles();
|
||||
Vector<File> sources = new Vector<>();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (isSource(file)) {
|
||||
sources.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sources.isEmpty()) {
|
||||
if (question) return CommonUI.Question("Папка " + CommonUtils.Brackets(folder.getName()) + "\n" +
|
||||
"не содержит ни одного файла, распознанного как поддерживаемый код\n" +
|
||||
"Всё равно открыть её как проект");
|
||||
else return false;
|
||||
} else return true;
|
||||
}
|
||||
public static void Kill(String PID, boolean force) {
|
||||
if (!PID.isEmpty()) {
|
||||
String killCommand =
|
||||
force ? CommonUtils.isWindows() ? "taskkill /PID " + CommonUtils.DQuotes(PID) + " /F /T" : "kill -9 " + CommonUtils.DQuotes(PID) :
|
||||
CommonUtils.isWindows() ? "taskkill /PID " + CommonUtils.DQuotes(PID) : "kill -2 " + CommonUtils.DQuotes(PID);
|
||||
System.out.println(killCommand);
|
||||
try {
|
||||
Process killer = Utils.startScript(Global.TempDirectory, Global.TempDirectory, "killer", killCommand);
|
||||
killer.waitFor();
|
||||
System.out.println(Utils.readAllOutput(killer));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static boolean isFunctionName(String name) {
|
||||
if (name.isEmpty())
|
||||
return false;
|
||||
char[] letters = name.toCharArray();
|
||||
if (!(CommonUtils.isEnglishLetter(letters[0]) || letters[0] == '_')) {
|
||||
return false;
|
||||
}
|
||||
//---
|
||||
for (int i = 1; i < letters.length; ++i) {
|
||||
if (!(CommonUtils.isEnglishLetter(letters[i]) || letters[i] == '_' || CommonUtils.isIntegerValue(String.valueOf(letters[i])))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static void keepNewFiles(File directory, int count) throws Exception {
|
||||
if (count > 0) {
|
||||
File[] old_ = directory.listFiles(pathname -> pathname.isFile());
|
||||
if (old_ != null) {
|
||||
Vector<File> old = new Vector<>();
|
||||
Collections.addAll(old, old_);
|
||||
old.sort((o1, o2) -> Long.compare(o2.lastModified(), o1.lastModified()));
|
||||
for (int i = count - 1; i < old.size(); ++i) {
|
||||
File file = old.get(i);
|
||||
FileUtils.forceDelete(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static boolean isParallelVersionName(String name) {
|
||||
char[] chars = name.toLowerCase().toCharArray();
|
||||
if ((chars.length > 1) && (chars[0] == 'p')) {
|
||||
for (int i = 1; i < chars.length; ++i) {
|
||||
if (!Character.isDigit(chars[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean isCrushedLine(String line) {
|
||||
String l_line = line.toLowerCase();
|
||||
for (String crushed : Constants.crushed_cases)
|
||||
if (l_line.contains(crushed))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
public static boolean isCrushed(List<String> output_lines, List<String> errors_lines) {
|
||||
return output_lines.stream().anyMatch(Utils::isCrushedLine) || errors_lines.stream().anyMatch(Utils::isCrushedLine);
|
||||
}
|
||||
public static Pair<TaskState, Integer> analyzeCorrectness(List<String> lines) {
|
||||
int complete = 0;
|
||||
int errors = 0;
|
||||
int total = 0;
|
||||
int starts = 0;
|
||||
int ends = 0;
|
||||
for (String s : lines) {
|
||||
String line = s.toUpperCase();
|
||||
if (line.contains("COMPLETE")) {
|
||||
complete++;
|
||||
total++;
|
||||
} else if (line.contains("ERROR")) {
|
||||
errors++;
|
||||
total++;
|
||||
} else if (line.contains("START")) {
|
||||
starts++;
|
||||
} else if (line.contains("END")) {
|
||||
ends++;
|
||||
}
|
||||
}
|
||||
TaskState state = TaskState.Finished;
|
||||
if (starts != ends) {
|
||||
state = TaskState.WrongTestFormat;
|
||||
} else if (errors > 0) {
|
||||
state = TaskState.DoneWithErrors;
|
||||
} else {
|
||||
state = TaskState.Done;
|
||||
}
|
||||
return new Pair<>(state, (int) ((((double) complete) / total) * 100));
|
||||
}
|
||||
public static Pair<TaskState, Integer> analyzePerformance(List<String> lines) {
|
||||
StringTemplate stringTemplate = new StringTemplate("Verification =", "");
|
||||
for (String line : lines) {
|
||||
String param = stringTemplate.check_and_get_param(line);
|
||||
if (param != null) {
|
||||
switch (param) {
|
||||
case "SUCCESSFUL":
|
||||
return new Pair<>(TaskState.Done, 100);
|
||||
case "UNSUCCESSFUL":
|
||||
return new Pair<>(TaskState.DoneWithErrors, 0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Pair<>(TaskState.WrongTestFormat, 0);
|
||||
}
|
||||
public static double parseCleanTime(String output) {
|
||||
double res = 0.0;
|
||||
StringTemplate template = new StringTemplate("Time in seconds =", "");
|
||||
String p = template.check_and_get_param(output);
|
||||
try {
|
||||
if (p != null) res = Double.parseDouble(p);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void RestoreSelectedDirectory(VFileChooser_ directoryChooser) {
|
||||
String last_dir_home =
|
||||
((GlobalDatabase)CommonUtils.db).settings.get(SettingName.ProjectsSearchDirectory).Value;
|
||||
if (!last_dir_home.isEmpty())
|
||||
directoryChooser.SetCurrentDirectory(last_dir_home);
|
||||
}
|
||||
public static void ClearProjectData(File project_home) throws Exception {
|
||||
Utils.deleteFilesByExtensions(project_home, "dep", "proj");
|
||||
File project_data = new File(project_home, Constants.data);
|
||||
if (project_data.exists())
|
||||
FileUtils.forceDelete(project_data);
|
||||
}
|
||||
//--
|
||||
public static boolean isVersion(File directory) throws Exception {
|
||||
return new File(directory, Constants.data).exists();
|
||||
}
|
||||
public static boolean checkFileCreation(File file) {
|
||||
for (int i = 1; i <= 10; ++i) {
|
||||
if (file.exists()) return true;
|
||||
else CommonUtils.sleep(1000);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static void createEmptyFile(String name) {
|
||||
File file = new File(name);
|
||||
try {
|
||||
FileUtils.writeStringToFile(file, "");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static Pair<Vector<String>, Vector<String>> getFortranLines(String text) {
|
||||
Vector<String> lines = new Vector<>();
|
||||
Vector<String> visible_lines = new Vector<>();
|
||||
//1.прочитать весь текст.
|
||||
char[] chars = text.toCharArray();
|
||||
//по символам получить строки.
|
||||
char c = 0; //текущий символ
|
||||
int i = 0; //индекс текущего символа.
|
||||
StringBuilder line = new StringBuilder(); //текущая строка
|
||||
StringBuilder v_line = new StringBuilder(); //текущая строка
|
||||
while (i < chars.length) {
|
||||
c = chars[i];
|
||||
//System.out.print("`"+c+"`");
|
||||
++i;
|
||||
switch (c) {
|
||||
case '\r': //возврат каретки, игнор
|
||||
break;
|
||||
case ' ':
|
||||
case '\t':
|
||||
if (((GlobalDatabase)CommonUtils.db).settings.get(SettingName.SpacesOn).toBoolean()) line.append(c);
|
||||
v_line.append(c);
|
||||
break;
|
||||
case '\n': //конец строки
|
||||
if (((GlobalDatabase)CommonUtils.db).settings.get(SettingName.FortranWrapsOn).toBoolean()) {
|
||||
//оракул. лезем в начало следующей строки
|
||||
//и анализируем первые 5 символов
|
||||
boolean hasWrap = false;
|
||||
int wi;
|
||||
//------
|
||||
//с нуля потому что и уже увеличено.
|
||||
for (int j = 0; (j < 6) && ((wi = i + j) < chars.length); ++j) {
|
||||
char s = chars[wi];
|
||||
if ((j == 0) && ((s == 'c') || (s == 'C') || (s == '!'))) {
|
||||
break;
|
||||
}
|
||||
if ((j > 0) && (j < 5) && (s == '!')) {
|
||||
break;
|
||||
}
|
||||
if ((j == 5) && (s != ' ')) {
|
||||
hasWrap = true;
|
||||
i = wi + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//-----
|
||||
if (hasWrap)
|
||||
break;
|
||||
}
|
||||
//добавление строки в результат.
|
||||
if ((line.length() > 0) || ((GlobalDatabase)CommonUtils.db).settings.get(SettingName.EmptyLinesOn).toBoolean()
|
||||
// Global.db.settings.get(SettingName.SpacesOn).toBoolean()
|
||||
) {
|
||||
lines.add(line.toString());
|
||||
visible_lines.add(v_line.toString());
|
||||
}
|
||||
//сброс
|
||||
line = new StringBuilder();
|
||||
v_line = new StringBuilder();
|
||||
break;
|
||||
default:
|
||||
line.append(c);
|
||||
v_line.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((i > 0) && (c != '\n')) {
|
||||
//строка оборвалась на EOF
|
||||
//добавление строки в результат.
|
||||
if ((line.length() > 0) ||((GlobalDatabase)CommonUtils.db).settings.get(SettingName.EmptyLinesOn).toBoolean()
|
||||
// && Global.db.settings.get(SettingName.SpacesOn).toBoolean()
|
||||
) {
|
||||
lines.add(line.toString());
|
||||
visible_lines.add(v_line.toString());
|
||||
}
|
||||
}
|
||||
return new Pair<>(lines, visible_lines);
|
||||
}
|
||||
public static boolean CompareLines(String line1_raw, String line2_raw) {
|
||||
String line1 = line1_raw;
|
||||
String line2 = line2_raw;
|
||||
if (!((GlobalDatabase)CommonUtils.db).settings.get(SettingName.RegisterOn).toBoolean()) {
|
||||
line1 = line1.toUpperCase();
|
||||
line2 = line2.toUpperCase();
|
||||
}
|
||||
if (!((GlobalDatabase)CommonUtils.db).settings.get(SettingName.SpacesOn).toBoolean()) {
|
||||
line1 = CommonUtils.removeCharacters(line1, " ", "\t");
|
||||
line2 = CommonUtils.removeCharacters(line2, " ", "\t");
|
||||
}
|
||||
return line1.equals(line2);
|
||||
}
|
||||
public static boolean Contains(Vector<String> list, String line, int max_index) {
|
||||
int last_index = -1;
|
||||
for (int i = 0; i < list.size(); ++i)
|
||||
if (CompareLines(list.get(i), line)) last_index = i;
|
||||
return (last_index >= max_index);
|
||||
}
|
||||
public static boolean compareFortranTexts(String text1, String text2) {
|
||||
Pair<Vector<String>, Vector<String>> p1 = getFortranLines(text1);
|
||||
Pair<Vector<String>, Vector<String>> p2 = getFortranLines(text2);
|
||||
Vector<String> lines1 = p1.getKey();
|
||||
Vector<String> lines2 = p2.getKey();
|
||||
if (lines1.size() != lines2.size())
|
||||
return false;
|
||||
for (int i = 0; i < lines1.size(); ++i) {
|
||||
if (!CompareLines(lines1.get(i), lines2.get(i)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//--
|
||||
private static void get_newest_file_date_r(File dir, Vector<Long> dates) {
|
||||
Vector<File> files = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File pathname) {
|
||||
return pathname.isFile();
|
||||
}
|
||||
})));
|
||||
if (!files.isEmpty()) {
|
||||
files.sort(new Comparator<File>() {
|
||||
@Override
|
||||
public int compare(File o1, File o2) {
|
||||
return Long.compare(o1.lastModified(), o2.lastModified());
|
||||
}
|
||||
}.reversed());
|
||||
dates.add(files.firstElement().lastModified());
|
||||
}
|
||||
//--
|
||||
Vector<File> subdirs = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File pathname) {
|
||||
return pathname.isDirectory();
|
||||
}
|
||||
})));
|
||||
if (!subdirs.isEmpty()) {
|
||||
for (File subdir : subdirs)
|
||||
get_newest_file_date_r(subdir, dates);
|
||||
}
|
||||
}
|
||||
public static long getNewestFileDate(File dir) {
|
||||
Vector<Long> dates = new Vector<>();
|
||||
get_newest_file_date_r(dir, dates);
|
||||
Collections.sort(dates);
|
||||
if (dates.isEmpty()) {
|
||||
dates.add(dir.lastModified());
|
||||
}
|
||||
System.out.println(new Date(dates.lastElement()));
|
||||
return dates.firstElement();
|
||||
}
|
||||
public static void addDefaultMails(Vector<String> mails) {
|
||||
if (!mails.contains(Constants.MailAddress))
|
||||
mails.add(Constants.MailAddress);
|
||||
for (String mail : Constants.admins_mails) {
|
||||
if (!mails.contains(mail))
|
||||
mails.add(mail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
234
src/_VisualDVM/Validators/DVMHelpParser.java
Normal file
234
src/_VisualDVM/Validators/DVMHelpParser.java
Normal file
@@ -0,0 +1,234 @@
|
||||
package _VisualDVM.Validators;
|
||||
import Common.Utils.CommonUtils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.CompilerEnvironment.CompilerEnvironment;
|
||||
import GlobalData.CompilerOption.CompilerOption;
|
||||
|
||||
import java.util.Arrays;
|
||||
public class DVMHelpParser {
|
||||
public static HelpParserState state;
|
||||
public static String t_line;
|
||||
public static String line;
|
||||
//-
|
||||
public static OptionState optionState;
|
||||
public static CompilerOption option;
|
||||
//-
|
||||
public static int spacesCounter;
|
||||
public static CompilerEnvironment environment;
|
||||
public static EnvironmentState environmentState;
|
||||
//-
|
||||
public static String descriptionLine = "";
|
||||
//-
|
||||
public static Compiler compiler = null;
|
||||
public static String[] banned_options = new String[]{
|
||||
"-o",
|
||||
"-c",
|
||||
"-f90",
|
||||
"-FI"
|
||||
};
|
||||
public static void ResetOption() {
|
||||
optionState = OptionState.SearchName;
|
||||
option = null;
|
||||
descriptionLine = "";
|
||||
}
|
||||
public static void TryConfirmOptionDescriptionLine() {
|
||||
if (option != null && !descriptionLine.isEmpty()) {
|
||||
option.description.add(descriptionLine.trim());
|
||||
descriptionLine = "";
|
||||
}
|
||||
}
|
||||
public static void TryConfirmOption() {
|
||||
if ((option != null) && (!compiler.options.containsKey(option.name))) {
|
||||
if (!descriptionLine.isEmpty())
|
||||
option.description.add(descriptionLine.trim());
|
||||
option.CheckParameterVariants();
|
||||
if (!Arrays.asList(banned_options).contains(option.name)) {
|
||||
compiler.options.put(option.name, option);
|
||||
}
|
||||
ResetOption();
|
||||
}
|
||||
}
|
||||
public static void ResetEnvironment() {
|
||||
environmentState = EnvironmentState.SearchName;
|
||||
spacesCounter = 0;
|
||||
environment = null;
|
||||
descriptionLine = "";
|
||||
}
|
||||
public static void TryConfirmEnvironmentDescriptionLine() {
|
||||
if (environment != null && !descriptionLine.isEmpty()) {
|
||||
environment.description.add(descriptionLine.trim());
|
||||
descriptionLine = "";
|
||||
}
|
||||
}
|
||||
public static void TryConfirmEnvironment() {
|
||||
if ((environment != null) && (!compiler.environments.containsKey(environment.name))) {
|
||||
if (!descriptionLine.isEmpty())
|
||||
environment.description.add(descriptionLine.trim());
|
||||
environment.CheckDefaults();
|
||||
compiler.environments.put(environment.name, environment);
|
||||
ResetEnvironment();
|
||||
}
|
||||
}
|
||||
public static void ReadOptions(Compiler compiler_in) {
|
||||
compiler = compiler_in;
|
||||
String[] lines = compiler.helpText.split("\n");
|
||||
state = HelpParserState.Search;
|
||||
for (String line_ : lines) {
|
||||
line = line_; //нужна для окружения. там пробелы нужно считать сразу.
|
||||
t_line = CommonUtils.removeCharacters(line_.trim(), "\r");
|
||||
switch (state) {
|
||||
case Search:
|
||||
switch (t_line) {
|
||||
case "Output and debugging options:":
|
||||
case "Convertation options:":
|
||||
case "Optimization options:":
|
||||
state = HelpParserState.OptionsChapter;
|
||||
ResetOption();
|
||||
break;
|
||||
case "Environment variables":
|
||||
state = HelpParserState.EnvironmentsChapterHeader;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EnvironmentsChapterHeader:
|
||||
state = HelpParserState.EnvironmentsChapter;
|
||||
ResetEnvironment();
|
||||
break;
|
||||
case OptionsChapter:
|
||||
if (t_line.isEmpty()) {
|
||||
TryConfirmOption();
|
||||
state = HelpParserState.Search;
|
||||
} else {
|
||||
char[] symbols = t_line.toCharArray();
|
||||
//- Новая строка.
|
||||
optionState = OptionState.SearchName;
|
||||
//-
|
||||
for (char c : symbols) {
|
||||
switch (optionState) {
|
||||
case SearchName:
|
||||
switch (c) {
|
||||
case '-':
|
||||
TryConfirmOption();
|
||||
//-
|
||||
option = new CompilerOption();
|
||||
option.name += c;
|
||||
optionState = OptionState.Name;
|
||||
break;
|
||||
default:
|
||||
descriptionLine += c;
|
||||
optionState = OptionState.Description;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Name:
|
||||
switch (c) {
|
||||
case '<':
|
||||
optionState = OptionState.Parameter;
|
||||
break;
|
||||
case ' ':
|
||||
case '=':
|
||||
case '\t':
|
||||
option.parameterSeparator += c;
|
||||
optionState = OptionState.SearchParameter;
|
||||
break;
|
||||
default:
|
||||
option.name += c;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SearchParameter:
|
||||
if (c == '<') {
|
||||
optionState = OptionState.Parameter;
|
||||
} else {
|
||||
option.parameterSeparator = "";
|
||||
optionState = OptionState.Description;
|
||||
descriptionLine += c;
|
||||
}
|
||||
break;
|
||||
case Parameter:
|
||||
if (c == '>') {
|
||||
optionState = OptionState.SearchDescription;
|
||||
} else {
|
||||
option.parameterName += c;
|
||||
}
|
||||
break;
|
||||
case SearchDescription:
|
||||
if (c != ' ') {
|
||||
descriptionLine += c;
|
||||
optionState = OptionState.Description;
|
||||
}
|
||||
break;
|
||||
case Description:
|
||||
descriptionLine += c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//-
|
||||
TryConfirmOptionDescriptionLine();
|
||||
}
|
||||
break;
|
||||
case EnvironmentsChapter:
|
||||
if (t_line.isEmpty()) {
|
||||
TryConfirmEnvironment();
|
||||
state = HelpParserState.Search;
|
||||
} else {
|
||||
char[] symbols = line.toCharArray();
|
||||
//- Новая строка.
|
||||
environmentState = EnvironmentState.SearchName;
|
||||
spacesCounter = 0;
|
||||
//-
|
||||
for (char c : symbols) {
|
||||
switch (environmentState) {
|
||||
case SearchName:
|
||||
if (c == ' ') {
|
||||
if (spacesCounter++ > 4) {
|
||||
//имя нам уже не встретится. это строка описания.
|
||||
environmentState = EnvironmentState.Description;
|
||||
}
|
||||
} else if (Character.isLetter(c)) {
|
||||
if (spacesCounter == 4) {
|
||||
TryConfirmEnvironment();
|
||||
environment = new CompilerEnvironment();
|
||||
environment.name += c;
|
||||
environmentState = EnvironmentState.Name;
|
||||
}
|
||||
} else {
|
||||
descriptionLine += c;
|
||||
environmentState = EnvironmentState.Description;
|
||||
}
|
||||
break;
|
||||
case Name:
|
||||
//в имени окружения пробелов быть не может. ждем описания.
|
||||
if (c == ' ') {
|
||||
environmentState = EnvironmentState.SearchDescription;
|
||||
} else if (Character.isLetterOrDigit(c) || c == '_') {
|
||||
//буквы цифры и подчеркивания - имя продолжается.
|
||||
environment.name += c;
|
||||
} else {
|
||||
descriptionLine += c;
|
||||
environmentState = EnvironmentState.Description;
|
||||
}
|
||||
break;
|
||||
case SearchDescription:
|
||||
if (c == ' ') {
|
||||
//игнорируем.
|
||||
} else {
|
||||
descriptionLine += c;
|
||||
environmentState = EnvironmentState.Description;
|
||||
}
|
||||
break;
|
||||
case Description:
|
||||
descriptionLine += c;
|
||||
break;
|
||||
}
|
||||
TryConfirmOptionDescriptionLine();
|
||||
}
|
||||
//-
|
||||
TryConfirmEnvironmentDescriptionLine();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------>>
|
||||
}
|
||||
8
src/_VisualDVM/Validators/EnvironmentState.java
Normal file
8
src/_VisualDVM/Validators/EnvironmentState.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.Validators;
|
||||
public enum EnvironmentState {
|
||||
SearchName,
|
||||
Name,
|
||||
//-
|
||||
SearchDescription,
|
||||
Description
|
||||
}
|
||||
10
src/_VisualDVM/Validators/HelpParserState.java
Normal file
10
src/_VisualDVM/Validators/HelpParserState.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package _VisualDVM.Validators;
|
||||
public enum HelpParserState {
|
||||
Search,
|
||||
OptionsChapter,
|
||||
//------------------
|
||||
//------------------
|
||||
EnvironmentsChapterHeader,
|
||||
EnvironmentsChapter,
|
||||
End
|
||||
}
|
||||
11
src/_VisualDVM/Validators/OptionState.java
Normal file
11
src/_VisualDVM/Validators/OptionState.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package _VisualDVM.Validators;
|
||||
public enum OptionState {
|
||||
SearchName,
|
||||
Name,
|
||||
//-
|
||||
SearchParameter,
|
||||
Parameter,
|
||||
//-
|
||||
SearchDescription,
|
||||
Description
|
||||
}
|
||||
68
src/_VisualDVM/Validators/PathValidator.java
Normal file
68
src/_VisualDVM/Validators/PathValidator.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package _VisualDVM.Validators;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.TextLog;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities;
|
||||
public class PathValidator extends Validator {
|
||||
PathValidatorState state;
|
||||
StringBuilder name;
|
||||
int spaces_count;
|
||||
public PathValidator(String string, String string_name_in, TextLog log_in) {
|
||||
super(string, string_name_in, log_in);
|
||||
}
|
||||
@Override
|
||||
protected void reset() {
|
||||
state = PathValidatorState.Start;
|
||||
name = new StringBuilder();
|
||||
spaces_count = 0;
|
||||
}
|
||||
@Override
|
||||
protected boolean continueCondition() {
|
||||
return (state == PathValidatorState.Name) || state == PathValidatorState.Start;
|
||||
}
|
||||
@Override
|
||||
protected void Body() {
|
||||
switch (state) {
|
||||
case Start:
|
||||
if (RSyntaxUtilities.isLetter(c) || RSyntaxUtilities.isDigit(c) || c == '_') {
|
||||
name.append(c);
|
||||
state = PathValidatorState.Name;
|
||||
} else state = PathValidatorState.WrongNameFormat;
|
||||
break;
|
||||
case Name:
|
||||
switch (c) {
|
||||
case '/':
|
||||
reset();
|
||||
break;
|
||||
case ' ':
|
||||
spaces_count++;
|
||||
name.append(c);
|
||||
break;
|
||||
default:
|
||||
if (CommonUtils.isForbiddenCharacter(c))
|
||||
state = PathValidatorState.Forbidden;
|
||||
else name.append(c);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void PerformFinish() {
|
||||
switch (state) {
|
||||
case WrongNameFormat:
|
||||
Log.Writeln(string_name + ": имя файла или каталога в пути имеет неверный формат");
|
||||
break;
|
||||
case Forbidden:
|
||||
Log.Writeln(string_name + ": Составляющие путь имена содержат запрещённые символы \n" + CommonUtils.printAllForbiddenCharacters());
|
||||
break;
|
||||
case Name:
|
||||
if (spaces_count > 0)
|
||||
Log.Writeln(string_name + ": Пробелы в окончании пути к файлу запрещены.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected int getStartIndex() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
8
src/_VisualDVM/Validators/PathValidatorState.java
Normal file
8
src/_VisualDVM/Validators/PathValidatorState.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.Validators;
|
||||
public enum PathValidatorState {
|
||||
Start,
|
||||
Name,
|
||||
WrongNameFormat,
|
||||
Forbidden,
|
||||
SpacesInLastName
|
||||
}
|
||||
291
src/_VisualDVM/Validators/ShellParser.java
Normal file
291
src/_VisualDVM/Validators/ShellParser.java
Normal file
@@ -0,0 +1,291 @@
|
||||
package _VisualDVM.Validators;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Vector;
|
||||
public class ShellParser {
|
||||
public static ShellParserState state;
|
||||
public static StringBuilder lineBuilder;
|
||||
public static String userName;
|
||||
public static StringBuilder invitationBuilder;
|
||||
public static char c;
|
||||
public static char[] buffer = new char[1];
|
||||
public static Vector<String> lines = new Vector<>();
|
||||
// public static boolean bracketOpened = false;
|
||||
public static boolean return_active = false;
|
||||
public static boolean isCommandSymbol() {
|
||||
int code = c;
|
||||
return code <= 31 || c == 127;
|
||||
}
|
||||
public static void ResetLine() {
|
||||
invitationBuilder = new StringBuilder();
|
||||
lineBuilder = new StringBuilder();
|
||||
// bracketOpened = false;
|
||||
state = ShellParserState.NewLine;
|
||||
return_active = false;
|
||||
}
|
||||
public static boolean isNameCharacter() {
|
||||
//латиница, цифры,подчеркивания. и -
|
||||
return String.valueOf(c).matches("[\\w\\-]*") || c == '?';
|
||||
}
|
||||
public static boolean isRBracket(){
|
||||
return c=='('||c==')';
|
||||
}
|
||||
|
||||
//false наоборот означать что конец строки ЕСТЬ.
|
||||
public static boolean checkEndLine() {
|
||||
if (return_active) {
|
||||
switch (c) {
|
||||
case '\n':
|
||||
//ложная тревога. возврат каретки ни на что не влияет.
|
||||
lines.add(lineBuilder.toString());
|
||||
ResetLine();
|
||||
return false;
|
||||
case '\r':
|
||||
return false;
|
||||
default:
|
||||
//тут был возврат. надо игнорить символ, ибо он уже прочитан.
|
||||
return_active = false;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (c) {
|
||||
case '\r':
|
||||
return_active = true;
|
||||
return false;
|
||||
case '\n':
|
||||
lines.add(lineBuilder.toString());
|
||||
ResetLine();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
public static void NewLine() {
|
||||
if (c == '[') {//приглашение со скобками.
|
||||
// bracketOpened = true;
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else {
|
||||
if (isNameCharacter()) {
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else
|
||||
//не буква и не скобка. значит в этой строке приглашения нет.
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
}
|
||||
*/
|
||||
public static void NewLine() {
|
||||
if (c=='@'){ //собака, признак приглашения.
|
||||
String test = invitationBuilder.toString();
|
||||
test = test.toLowerCase();
|
||||
state = test.endsWith(userName.toLowerCase()) ? ShellParserState.MachineName : ShellParserState.Skip;
|
||||
invitationBuilder.append(c);
|
||||
}else {
|
||||
invitationBuilder.append(c);
|
||||
}
|
||||
/*
|
||||
if (c == '[') {//приглашение со скобками.
|
||||
// bracketOpened = true;
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else {
|
||||
if (isNameCharacter()) {
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else
|
||||
//не буква и не скобка. значит в этой строке приглашения нет.
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*
|
||||
public static void UserName() {
|
||||
if (c == '@') { //проверить. а тот ли юзернейм.
|
||||
String test = invitationBuilder.toString();
|
||||
// if (bracketOpened) test = test.substring(1);
|
||||
test = test.toLowerCase();
|
||||
state = test.endsWith(userName.toLowerCase()) ? ShellParserState.MachineName : ShellParserState.Skip;
|
||||
invitationBuilder.append(c);
|
||||
} else if (isNameCharacter() || (c == '['))
|
||||
invitationBuilder.append(c);
|
||||
else
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
*/
|
||||
public static void MachineName() {
|
||||
switch (c) {
|
||||
case ' ':
|
||||
case ':':
|
||||
state = ShellParserState.Path;
|
||||
invitationBuilder.append(c);
|
||||
break;
|
||||
default:
|
||||
if (isNameCharacter())
|
||||
invitationBuilder.append(c);
|
||||
else state = ShellParserState.Skip;
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static void Path() {
|
||||
switch (c) {
|
||||
case '$':
|
||||
case '#':
|
||||
case '>':
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.Space; //приглашение завершено. осталось прочитать пробел после него
|
||||
break;
|
||||
/*
|
||||
case ']':
|
||||
if (bracketOpened) {
|
||||
invitationBuilder.append(c);
|
||||
bracketOpened = false;
|
||||
} else {
|
||||
// UI.Info("KEK");
|
||||
state = ShellParserState.Skip; //непарная скобка, все, привет
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
invitationBuilder.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static void Space() {
|
||||
if (c == ' ') {
|
||||
state = ShellParserState.End;
|
||||
invitationBuilder.append(c);
|
||||
} else {
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
}
|
||||
public static void setUserName(String userName_in) {
|
||||
userName = userName_in;
|
||||
}
|
||||
public static void printChar() {
|
||||
if (c != CommonConstants.boop) {
|
||||
int code = c;
|
||||
if ((!return_active) || (c == '\n')) {
|
||||
System.out.print(c == '\r' ? ("\\r") :
|
||||
(c == '\n' ? "\\n\n" : c));
|
||||
if (isCommandSymbol())
|
||||
System.out.print(CommonUtils.RBrackets(code));
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void ReadInvitation(InputStreamReader fromServer) {
|
||||
lines.clear();
|
||||
ResetLine();
|
||||
do {
|
||||
try {
|
||||
if (fromServer.read(buffer) >= 0) {
|
||||
c = buffer[0];
|
||||
printChar();
|
||||
// if (!isCommandSymbol()) {
|
||||
if (checkEndLine() && (!isCommandSymbol())) {
|
||||
lineBuilder.append(c);
|
||||
switch (state) {
|
||||
case NewLine:
|
||||
NewLine();
|
||||
break;
|
||||
// case UserName:
|
||||
// UserName();
|
||||
// break;
|
||||
case MachineName:
|
||||
MachineName();
|
||||
break;
|
||||
case Path:
|
||||
Path();
|
||||
break;
|
||||
case Space:
|
||||
Space();
|
||||
break;
|
||||
case Skip:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
state = ShellParserState.End;
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
state = ShellParserState.End;
|
||||
}
|
||||
} while (!state.equals(ShellParserState.End));
|
||||
}
|
||||
public static String ReadLine(InputStreamReader fromServer) {
|
||||
StringBuilder res = new StringBuilder();
|
||||
state = ShellParserState.NewLine;
|
||||
do {
|
||||
try {
|
||||
if (fromServer.read(buffer) >= 0) {
|
||||
c = buffer[0];
|
||||
printChar();
|
||||
switch (c) {
|
||||
case '\r':
|
||||
break;
|
||||
case '\n':
|
||||
state = ShellParserState.End;
|
||||
break;
|
||||
default:
|
||||
res.append(c);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
state = ShellParserState.End;
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
state = ShellParserState.End;
|
||||
}
|
||||
} while (!state.equals(ShellParserState.End));
|
||||
return res.toString();
|
||||
}
|
||||
public static void ReadCommand(String command, InputStreamReader fromServer){
|
||||
StringBuilder res = new StringBuilder();
|
||||
do {
|
||||
try {
|
||||
if (fromServer.read(buffer) >= 0) {
|
||||
c = buffer[0];
|
||||
printChar();
|
||||
switch (c) {
|
||||
case '\r':
|
||||
break;
|
||||
case '\n':
|
||||
break;
|
||||
default:
|
||||
res.append(c);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
return;
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
return;
|
||||
}
|
||||
} while (!res.toString().contains(command));
|
||||
}
|
||||
public static String getCommandResult(InputStreamReader fromServer) {
|
||||
//если последняя строка ответа - кончается на приглашение, то ничего не делаем.
|
||||
//если нет. значит ответ кончается на перевод строки. или пуст.
|
||||
// нужно прочитать еще одно приглашение.
|
||||
String last_line = "";
|
||||
String res = "";
|
||||
boolean no_extra_read = false;
|
||||
if (lines.size() > 0) {
|
||||
last_line = lines.lastElement();
|
||||
if (no_extra_read = last_line.endsWith(invitationBuilder.toString())) {
|
||||
lines.remove(lines.size() - 1);
|
||||
//больше ничего не читаем. но. обрезаем ее конец.
|
||||
last_line = last_line.substring(0, last_line.length() - invitationBuilder.length());
|
||||
lines.add(last_line);
|
||||
}
|
||||
res = String.join("\n", lines);
|
||||
}
|
||||
if (!no_extra_read) {
|
||||
ReadInvitation(fromServer);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
12
src/_VisualDVM/Validators/ShellParserState.java
Normal file
12
src/_VisualDVM/Validators/ShellParserState.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package _VisualDVM.Validators;
|
||||
public enum ShellParserState {
|
||||
//--------------------------------
|
||||
NewLine, //начало строки.
|
||||
UserName, //имя пользователя.
|
||||
MachineName, //имя машины
|
||||
Path, //путь к текущей папке - часть приглашения
|
||||
Space, //завершающий приглашение пробел.
|
||||
Skip, //гарантированно не приглашение.
|
||||
//--------------------------------
|
||||
End//выход
|
||||
}
|
||||
34
src/_VisualDVM/Validators/Validator.java
Normal file
34
src/_VisualDVM/Validators/Validator.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package _VisualDVM.Validators;
|
||||
import Common.Utils.TextLog;
|
||||
public class Validator {
|
||||
protected char c;
|
||||
protected int i;
|
||||
protected String string_name;
|
||||
protected char[] chars;
|
||||
protected TextLog Log;
|
||||
public Validator(String string, String string_name_in, TextLog log_in) {
|
||||
string_name = string_name_in;
|
||||
chars = string.toCharArray();
|
||||
Log = log_in;
|
||||
reset();
|
||||
}
|
||||
protected void reset() {
|
||||
}
|
||||
protected int getStartIndex() {
|
||||
return 0;
|
||||
}
|
||||
protected boolean continueCondition() {
|
||||
return true;
|
||||
}
|
||||
protected void Body() {
|
||||
}
|
||||
protected void PerformFinish() {
|
||||
}
|
||||
public void Validate() {
|
||||
for (i = getStartIndex(); i < chars.length && continueCondition(); ++i) {
|
||||
c = chars[i];
|
||||
Body();
|
||||
}
|
||||
PerformFinish();
|
||||
}
|
||||
}
|
||||
26
src/_VisualDVM/Visual/Controls/PassButton.java
Normal file
26
src/_VisualDVM/Visual/Controls/PassButton.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package _VisualDVM.Visual.Controls;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.awt.*;
|
||||
public class PassButton extends MenuBarButton implements PassControl {
|
||||
public PassButton(Pass_2021 pass, boolean tab) {
|
||||
setText(pass.getButtonText());
|
||||
setToolTipText(pass.getDescription());
|
||||
if (pass.getIconPath() != null) {
|
||||
if (tab) {
|
||||
setIcon(pass.getTabIcon());
|
||||
setPreferredSize(new Dimension(18,18));
|
||||
setMaximumSize(new Dimension(18,18));
|
||||
setMinimumSize(new Dimension(18,18));
|
||||
}
|
||||
else
|
||||
setIcon(pass.getIconPath());
|
||||
}
|
||||
addActionListener(pass.getControlAction());
|
||||
pass.controls.add(this);
|
||||
}
|
||||
public PassButton(Pass_2021 pass) {
|
||||
this(pass, false);
|
||||
}
|
||||
}
|
||||
8
src/_VisualDVM/Visual/Controls/PassControl.java
Normal file
8
src/_VisualDVM/Visual/Controls/PassControl.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.Visual.Controls;
|
||||
public interface PassControl {
|
||||
void setIcon(String icon_path);
|
||||
void setEnabled(boolean flag);
|
||||
void setVisible(boolean flag);
|
||||
void setToolTipText(String text);
|
||||
void setText(String text);
|
||||
}
|
||||
13
src/_VisualDVM/Visual/Interface/AnalysisWindow.java
Normal file
13
src/_VisualDVM/Visual/Interface/AnalysisWindow.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface AnalysisWindow extends FormWithSplitters, VisualizerForm{
|
||||
void ShowProjectMaxDim();
|
||||
void ShowNoProjectMaxDim();
|
||||
|
||||
void ShowMetrics();
|
||||
void ShowNoMetrics();
|
||||
void ShowRegions();
|
||||
void ShowNoRegions();
|
||||
void ShowLoopsCount();
|
||||
void ShowFunctionsCount();
|
||||
void ShowArraysCount();
|
||||
}
|
||||
5
src/_VisualDVM/Visual/Interface/ArraysWindow.java
Normal file
5
src/_VisualDVM/Visual/Interface/ArraysWindow.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface ArraysWindow extends VisualizerForm, FormWithSplitters{
|
||||
void ShowArrays();
|
||||
void ShowNoArrays();
|
||||
}
|
||||
28
src/_VisualDVM/Visual/Interface/CallbackWindow.java
Normal file
28
src/_VisualDVM/Visual/Interface/CallbackWindow.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface CallbackWindow extends VisualizerForm {
|
||||
void ShowAccount();
|
||||
void ShowBugReports();
|
||||
void ShowNoBugReports();
|
||||
void ShowSubscribers();
|
||||
void ShowNoSubscribers();
|
||||
void ShowCurrentBugReport();
|
||||
void ShowNoCurrentBugReport();
|
||||
void ShowSubscription();
|
||||
//-
|
||||
default void ShowAll() {
|
||||
ShowAccount();
|
||||
ShowSubscription();
|
||||
ShowBugReports();
|
||||
ShowSubscribers();
|
||||
}
|
||||
String getBugReportDescriptionText();
|
||||
String getBugReportDescriptionAdditionText();
|
||||
String getBugReportCommentText();
|
||||
String getBugReportCommentAdditionText();
|
||||
void ClearBugReportDescriptionAdditionText();
|
||||
void ClearBugReportCommentAdditionText();
|
||||
void FocusRecipients();
|
||||
void SwitchScreen(boolean small);
|
||||
void setUserRights();
|
||||
void setAdminRights();
|
||||
}
|
||||
6
src/_VisualDVM/Visual/Interface/CommentInterface.java
Normal file
6
src/_VisualDVM/Visual/Interface/CommentInterface.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import javax.swing.*;
|
||||
public interface CommentInterface extends VisualizerForm, FormWithSplitters {
|
||||
void setEditorScroll(JScrollPane scroll_in);
|
||||
void setAdditionScroll(JScrollPane scroll_in);
|
||||
}
|
||||
13
src/_VisualDVM/Visual/Interface/DebugWindow.java
Normal file
13
src/_VisualDVM/Visual/Interface/DebugWindow.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import javax.swing.*;
|
||||
public interface DebugWindow {
|
||||
JPanel getContent();
|
||||
void ShowAll();
|
||||
//--
|
||||
void DropRunTasksComparison();
|
||||
void DropCompilationTasksComparison();
|
||||
void ShowLastCompilationTask();
|
||||
void ShowCurrentRunTask();
|
||||
void ShowLastRunTask();
|
||||
void ShowNoCurrentRunTask();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import javax.swing.*;
|
||||
public interface DescriptionInterface extends VisualizerForm,FormWithSplitters {
|
||||
void setEditorScroll(JScrollPane scroll_in);
|
||||
void setAdditionScroll(JScrollPane scroll_in);
|
||||
}
|
||||
67
src/_VisualDVM/Visual/Interface/FileWindow.java
Normal file
67
src/_VisualDVM/Visual/Interface/FileWindow.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface FileWindow extends VisualizerForm{
|
||||
void ShowText();
|
||||
void ShowLanguage();
|
||||
void ShowType();
|
||||
void ShowStyle();
|
||||
default void ShowProperties() {
|
||||
ShowLanguage();
|
||||
ShowType();
|
||||
ShowStyle();
|
||||
}
|
||||
void ShowMessages();
|
||||
void ShowNoMessages();
|
||||
void ShowLoops();
|
||||
void ShowNoLoops();
|
||||
void ShowGCOV();
|
||||
void ShowNoGCOV();
|
||||
void ShowFunctions();
|
||||
void ShowNoFunctions();
|
||||
void ShowArrays();
|
||||
void ShowNoArrays();
|
||||
void ShowCaretInfo();
|
||||
void FocusMessagesPriority();
|
||||
void ShowFirstError();
|
||||
//-
|
||||
void ShowCompilationOutput();
|
||||
void ShowNoCompilationOutput();
|
||||
void ShowRunOutput();
|
||||
void ShowNoRunOutput();
|
||||
void ShowGCOVLog();
|
||||
void ShowNoGCOVLog();
|
||||
void FocusGCOVLog();
|
||||
SPFEditorInterface getEditor();
|
||||
default void ShowAllAnalyses() {
|
||||
ShowLoops();
|
||||
ShowFunctions();
|
||||
ShowArrays();
|
||||
ShowGCOV();
|
||||
ShowCompilationOutput();
|
||||
ShowRunOutput();
|
||||
}
|
||||
default void ShowNoAnalyses() {
|
||||
ShowNoLoops();
|
||||
ShowNoFunctions();
|
||||
ShowNoArrays();
|
||||
ShowNoGCOV();
|
||||
ShowNoCompilationOutput();
|
||||
ShowNoRunOutput();
|
||||
}
|
||||
void FocusLoops();
|
||||
void FocusFunctions();
|
||||
void FocusArrays();
|
||||
void RefreshTabsNames();
|
||||
void FocusCompilationOut();
|
||||
void FocusCompilationErrors();
|
||||
//--
|
||||
void ShowWarningsCount();
|
||||
void ShowErrorsCount();
|
||||
void ShowNotesCount();
|
||||
void ShowRecommendationsCount();
|
||||
//--
|
||||
void CollapseGraphs();
|
||||
void ExpandGraphs();
|
||||
//--
|
||||
void CollapseMessages();
|
||||
void ExpandMessages();
|
||||
}
|
||||
10
src/_VisualDVM/Visual/Interface/FormWithSplitters.java
Normal file
10
src/_VisualDVM/Visual/Interface/FormWithSplitters.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import Common.Utils.CommonUtils;
|
||||
public interface FormWithSplitters {
|
||||
default void LoadSplitters() {
|
||||
CommonUtils.db.splitters.Load(this);
|
||||
}
|
||||
default void SaveSplitters() {
|
||||
CommonUtils.db.splitters.Save(this);
|
||||
}
|
||||
}
|
||||
11
src/_VisualDVM/Visual/Interface/FunctionsWindow.java
Normal file
11
src/_VisualDVM/Visual/Interface/FunctionsWindow.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphForm;
|
||||
import javafx.util.Pair;
|
||||
public interface FunctionsWindow extends VisualizerForm, FormWithSplitters {
|
||||
void ShowFunctions();
|
||||
void ShowNoFunctions();
|
||||
void ShowCurrentFunction();
|
||||
void ShowNoCurrentFunction();
|
||||
Pair<Integer, Integer> getFunctionsGraphPanelSizes();
|
||||
FunctionsGraphForm getFunctionsGraphWindow();
|
||||
}
|
||||
83
src/_VisualDVM/Visual/Interface/ProjectWindow.java
Normal file
83
src/_VisualDVM/Visual/Interface/ProjectWindow.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import Common.Visual.Trees.TreeForm;
|
||||
import _VisualDVM.Visual.UI;
|
||||
public interface ProjectWindow {
|
||||
//-
|
||||
ArraysWindow getArraysWindow();
|
||||
FunctionsWindow getFunctionsWindow();
|
||||
AnalysisWindow getAnalysisWindow();
|
||||
//-
|
||||
void RefreshProjectFiles();
|
||||
void ShowSelectedDirectory();
|
||||
void ShowSelectedFile();
|
||||
void ShowNoSelectedFile();
|
||||
void ShowProjectSapforLog();
|
||||
void ShowIncludes();
|
||||
void ShowNoIncludes();
|
||||
void ShowFunctions();
|
||||
void ShowNoFunctions();
|
||||
void RefreshProjectTreeAndMessages();
|
||||
TreeForm getFilesTreeForm();
|
||||
//-
|
||||
void SwitchScreen(boolean small);
|
||||
void ShowProjectView();
|
||||
//-
|
||||
default void ShowAllAnalyses() {
|
||||
ShowProjectSapforLog();
|
||||
ShowIncludes();
|
||||
ShowFunctions();
|
||||
getArraysWindow().ShowArrays();
|
||||
//------------------------------>>
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowVariantsFilterButtons();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowProjectDistribution();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowVariantsFilter();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowTotalVariantsCount();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowFilteredVariantsCount();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowCheckedVariantsCount();
|
||||
//----------------------------->>
|
||||
getAnalysisWindow().ShowMetrics();
|
||||
getAnalysisWindow().ShowLoopsCount();
|
||||
getAnalysisWindow().ShowFunctionsCount();
|
||||
getAnalysisWindow().ShowArraysCount();
|
||||
getAnalysisWindow().ShowRegions();
|
||||
getAnalysisWindow().ShowProjectMaxDim();
|
||||
}
|
||||
default void ShowNoAnalyses() {
|
||||
ShowNoIncludes();
|
||||
ShowNoFunctions();
|
||||
getFunctionsWindow().ShowNoCurrentFunction();
|
||||
getArraysWindow().ShowNoArrays();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowNoProjectDistribution();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowNoVariants();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowNoVariantsFilter();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowNoTotalVariantsCount();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowNoFilteredVariantsCount();
|
||||
UI.getVersionsWindow().getVariantsWindow().ShowNoCheckedVariantsCount();
|
||||
getAnalysisWindow().ShowNoMetrics();
|
||||
getAnalysisWindow().ShowNoRegions();
|
||||
getAnalysisWindow().ShowLoopsCount();
|
||||
getAnalysisWindow().ShowFunctionsCount();
|
||||
getAnalysisWindow().ShowArraysCount();
|
||||
getAnalysisWindow().ShowNoProjectMaxDim();
|
||||
}
|
||||
//---
|
||||
void ShowFile();
|
||||
void ShowNoFile();
|
||||
//---
|
||||
void GotoFile(String fileName, int line, boolean focus);
|
||||
void FocusFile();
|
||||
void FocusFileTabs();
|
||||
//-
|
||||
void FocusDependencies();
|
||||
void FocusArrays();
|
||||
void FocusFunctions();
|
||||
void FocusAnalysis();
|
||||
void FocusHierarchy();
|
||||
void FocusPoints();
|
||||
//-
|
||||
void RefreshTabsNames();
|
||||
void FocusVersions();
|
||||
//--
|
||||
void CollapseProjectTrees();
|
||||
void ExpandProjectTrees();
|
||||
}
|
||||
16
src/_VisualDVM/Visual/Interface/SPFEditorInterface.java
Normal file
16
src/_VisualDVM/Visual/Interface/SPFEditorInterface.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface SPFEditorInterface {
|
||||
//-----------------------------------
|
||||
void ClearHighlights();
|
||||
//---------------->>
|
||||
void ClearLoopsHighLights();
|
||||
void ClearGOCVHighlights();
|
||||
//----------------->>
|
||||
void HighlightLoops();
|
||||
void HighlightGCOV();
|
||||
//------------------------------------
|
||||
void gotoLine(int num);
|
||||
int getCurrentLine();
|
||||
int getCaretPosition();
|
||||
String getText();
|
||||
}
|
||||
7
src/_VisualDVM/Visual/Interface/ScenariosWindow.java
Normal file
7
src/_VisualDVM/Visual/Interface/ScenariosWindow.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface ScenariosWindow extends FormWithSplitters, VisualizerForm{
|
||||
void ShowAll();
|
||||
void FocusSapforTasksPackages();
|
||||
void ShowCurrentSapforTasksPackage();
|
||||
void ShowNoSapforTasksPackage();
|
||||
}
|
||||
4
src/_VisualDVM/Visual/Interface/StatisticsWindow.java
Normal file
4
src/_VisualDVM/Visual/Interface/StatisticsWindow.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface StatisticsWindow extends VisualizerForm{
|
||||
void ShowAll();
|
||||
}
|
||||
37
src/_VisualDVM/Visual/Interface/TestingWindow.java
Normal file
37
src/_VisualDVM/Visual/Interface/TestingWindow.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
public interface TestingWindow extends VisualizerForm {
|
||||
void ShowAll();
|
||||
//-
|
||||
void ShowCurrentTestsPackage();
|
||||
void DropTestRunTasksComparison();
|
||||
void DropSapforComparison();
|
||||
void ShowCurrentTestRunTask();
|
||||
void ShowNoTestRunTask();
|
||||
//-
|
||||
void RefreshTabsNames();
|
||||
//-
|
||||
void FocusTestingTasks();
|
||||
void ShowCurrentSapforPackageVersionEtalon();
|
||||
void ShowCurrentSapforPackageVersion();
|
||||
void ShowNoSapforPackageVersionEtalon();
|
||||
void ShowNoSapforPackageVersion();
|
||||
void FocusSapforTesting();
|
||||
void ShowCurrentCompiler();
|
||||
void ShowCurrentServerSapfor();
|
||||
void ShowNoServerSapfor();
|
||||
void ShowCurrentDVMPackage();
|
||||
void ShowNoCurrentDVMPackage();
|
||||
//--
|
||||
void ShowDVMRunTask(DVMRunTask master);
|
||||
void ShowSapforPackage(SapforPackage master);
|
||||
//-
|
||||
void CompareDVMRunTasks(DVMRunTask master, DVMRunTask slave);
|
||||
void CompareSapforPackages(SapforPackage master, SapforPackage slave);
|
||||
//-
|
||||
void ShowDVMPackage(DVMPackage master);
|
||||
void CollapseCredentials();
|
||||
void ExpandCredentials();
|
||||
}
|
||||
6
src/_VisualDVM/Visual/Interface/TestsWindow.java
Normal file
6
src/_VisualDVM/Visual/Interface/TestsWindow.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import javax.swing.*;
|
||||
public interface TestsWindow {
|
||||
void ShowAll();
|
||||
JPanel getContent();
|
||||
}
|
||||
17
src/_VisualDVM/Visual/Interface/VariantsWindow.java
Normal file
17
src/_VisualDVM/Visual/Interface/VariantsWindow.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
public interface VariantsWindow extends VisualizerForm, FormWithSplitters {
|
||||
void ShowProjectDistribution();
|
||||
void ShowNoProjectDistribution();
|
||||
void ShowVariantsFilterButtons();
|
||||
void ShowVariantsFilter();
|
||||
void ShowNoVariantsFilter();
|
||||
void ShowTotalVariantsCount();
|
||||
void ShowFilteredVariantsCount();
|
||||
void ShowCheckedVariantsCount();
|
||||
void ShowNoCheckedVariantsCount();
|
||||
void ShowNoFilteredVariantsCount();
|
||||
void ShowNoTotalVariantsCount();
|
||||
void ShowVariants();
|
||||
void RefreshVariants();
|
||||
void ShowNoVariants();
|
||||
}
|
||||
13
src/_VisualDVM/Visual/Interface/VersionsWindow.java
Normal file
13
src/_VisualDVM/Visual/Interface/VersionsWindow.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import Common.Visual.Trees.TreeForm;
|
||||
import ProjectData.Project.db_project_info;
|
||||
public interface VersionsWindow extends VisualizerForm {
|
||||
VariantsWindow getVariantsWindow();
|
||||
void ShowProjectVariants();
|
||||
void ShowNoProjectVariants();
|
||||
void FocusDistribution();
|
||||
void BlockVariants();
|
||||
void UnblockVariants();
|
||||
void RemoveVersionFromComparison(db_project_info version);
|
||||
TreeForm getVersionsForm();
|
||||
}
|
||||
9
src/_VisualDVM/Visual/Interface/VisualizerForm.java
Normal file
9
src/_VisualDVM/Visual/Interface/VisualizerForm.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package _VisualDVM.Visual.Interface;
|
||||
import javax.swing.*;
|
||||
public interface VisualizerForm {
|
||||
//просто некая панель, на которой может быть все что угодно. монтируется на панель родителя,
|
||||
//при условии что она BorderLayout
|
||||
default JPanel getContent() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
32
src/_VisualDVM/Visual/Menus/AttachementsMenu.java
Normal file
32
src/_VisualDVM/Visual/Menus/AttachementsMenu.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import _VisualDVM.Current;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
public class AttachementsMenu extends StyledPopupMenu {
|
||||
JMenuItem mscreenshot;
|
||||
JMenuItem mExplorer;
|
||||
public AttachementsMenu() {
|
||||
add(mscreenshot = Pass_2021.passes.get(PassCode_2021.MakeScreenShot).createMenuItem());
|
||||
addSeparator();
|
||||
mExplorer = new VisualiserMenuItem("Открыть вложения в проводнике...", "/icons/Explorer.png");
|
||||
mExplorer.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Desktop.getDesktop().open(Current.getProject().getAttachmentsDirectory());
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(mExplorer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package _VisualDVM.Visual.Menus.CredentialsBar;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public class CredentialsBar extends VisualiserMenuBar {
|
||||
public MenuBarButton MachineButton;
|
||||
public MenuBarButton UserButton;
|
||||
MenuBarButton bExpand;
|
||||
public CredentialsBar(){
|
||||
this.add(bExpand = new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/ExpandDown.png");
|
||||
setToolTipText("Развернуть");
|
||||
addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021.passes.get(PassCode_2021.UpdateProperty).Do("collapseCredentials", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 0);
|
||||
add(MachineButton = new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/Machine.png");
|
||||
setFont(VisualiserFonts.TreeBold);
|
||||
setToolTipText("Текущая машина");
|
||||
}
|
||||
});
|
||||
//--
|
||||
add(UserButton = new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/User.png");
|
||||
setFont(VisualiserFonts.TreeBold);
|
||||
setToolTipText("Текущий пользователь");
|
||||
}
|
||||
});
|
||||
}
|
||||
public void ShowMachine(){
|
||||
MachineButton.setText(Current.getMachine().getURL());
|
||||
}
|
||||
public void ShowUser(){
|
||||
UserButton.setText(Current.getUser().login);
|
||||
}
|
||||
public void ShowNoMachine(){
|
||||
MachineButton.setText("?");
|
||||
}
|
||||
public void ShowNoUser(){
|
||||
UserButton.setText("?");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package _VisualDVM.Visual.Menus.FastAccessMenuBar;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.LinkedHashMap;
|
||||
public class FastAccessMenuBar extends VisualiserMenuBar {
|
||||
LinkedHashMap<PassCode_2021, JButton> passesButtons = new LinkedHashMap<>();
|
||||
public FastAccessMenuBar() {
|
||||
Refresh();
|
||||
}
|
||||
@Override
|
||||
public void setSizeLimits() {
|
||||
//если задавать PreffredSize 0, скролл НЕ РАБОТАЕТ. Магия!
|
||||
}
|
||||
public void showPass(Pass_2021 pass) {
|
||||
JButton button = null;
|
||||
if (passesButtons.containsKey(pass.code()))
|
||||
button = passesButtons.get((pass.code()));
|
||||
else {
|
||||
button = pass.createButton();
|
||||
passesButtons.put(pass.code(), button);
|
||||
}
|
||||
add(button);
|
||||
Dimension d = button.getPreferredSize();
|
||||
button.setPreferredSize(new Dimension(d.width, 30));
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
public void Refresh() {
|
||||
CommonUI.Clear(this);
|
||||
int i = 1;
|
||||
for (Pass_2021 pass : Pass_2021.FAPasses) {
|
||||
if (pass.stats.HasUsages()) {
|
||||
showPass(pass);
|
||||
++i;
|
||||
if (i > (((GlobalDatabase)CommonUtils.db).settings.get(SettingName.FastAccessPassesCount).toInt32())) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Drop(){
|
||||
CommonUI.Clear(this);
|
||||
}
|
||||
}
|
||||
84
src/_VisualDVM/Visual/Menus/FileMenuBar/FileMenuBar.java
Normal file
84
src/_VisualDVM/Visual/Menus/FileMenuBar/FileMenuBar.java
Normal file
@@ -0,0 +1,84 @@
|
||||
package _VisualDVM.Visual.Menus.FileMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class FileMenuBar extends VisualiserMenuBar {
|
||||
public JSpinner sToGo;
|
||||
JLabel LineCountLabel;
|
||||
public JLabel CurrentSymbolLabel;
|
||||
SPFEditor editor;
|
||||
FileSettingsMenu fileSettingsMenu;
|
||||
public FileMenuBar(SPFEditor editor_in) {
|
||||
editor = editor_in;
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setToolTipText("Поиск(Ctrl+F)");
|
||||
setIcon("/icons/LastOpened.png");
|
||||
addActionListener(e -> UI.ShowSearchForm());
|
||||
}
|
||||
});
|
||||
addPasses(PassCode_2021.Save);
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setToolTipText("Увеличить шрифт(Ctrl+'+')");
|
||||
setIcon("/icons/Editor/Font+.png");
|
||||
addActionListener(e -> editor.FontUp());
|
||||
}
|
||||
});
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setToolTipText("Уменьшить шрифт(Ctrl+'-')");
|
||||
setIcon("/icons/Editor/Font-.png");
|
||||
addActionListener(e -> editor.FontDown());
|
||||
}
|
||||
});
|
||||
add(new MenuBarButton() {
|
||||
boolean isOn = false;
|
||||
{
|
||||
setToolTipText("Отображать спецсимволы");
|
||||
setIcon("/icons/Editor/ShowNoSigns.png");
|
||||
addActionListener(e-> {
|
||||
isOn = !isOn;
|
||||
if (isOn) {
|
||||
setIcon("/icons/Editor/ShowAllSigns.png");
|
||||
setToolTipText("Скрыть спецсимволы");
|
||||
editor.setWhitespaceVisible(true);
|
||||
editor.setEOLMarkersVisible(true);
|
||||
} else {
|
||||
setIcon("/icons/Editor/ShowNoSigns.png");
|
||||
setToolTipText("Отображать спецсимволы");
|
||||
editor.setWhitespaceVisible(false);
|
||||
editor.setEOLMarkersVisible(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
add(new JLabel(" Строка "));
|
||||
add(sToGo = new JSpinner());
|
||||
sToGo.setPreferredSize(new Dimension(60, 25));
|
||||
sToGo.setMaximumSize(new Dimension(60, 25));
|
||||
add(new JLabel(" из "));
|
||||
add(LineCountLabel = new JLabel("?"));
|
||||
add(new JLabel(" | "));
|
||||
add(new JLabel("Позиция "));
|
||||
add(CurrentSymbolLabel = new JLabel());
|
||||
add(new JSeparator());
|
||||
addMenus(fileSettingsMenu = new FileSettingsMenu());
|
||||
//--
|
||||
// addPasses(PassCode_2021.CloseCurrentFile);
|
||||
//-
|
||||
setPreferredSize(new Dimension(0, 30));
|
||||
}
|
||||
public void ShowLinesCount() {
|
||||
LineCountLabel.setText(String.valueOf(editor.getLineCount()));
|
||||
}
|
||||
//-
|
||||
public void ShowLanguage(){fileSettingsMenu.ShowLanguage();}
|
||||
public void ShowType(){fileSettingsMenu.ShowType();}
|
||||
public void ShowStyle(){fileSettingsMenu.ShowStyle();}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package _VisualDVM.Visual.Menus.FileMenuBar;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Visual.Menus.LanguagesSubmenu;
|
||||
import _VisualDVM.Visual.Menus.StylesSubmenu;
|
||||
import _VisualDVM.Visual.Menus.TypesSubmenu;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import ProjectData.Files.FileType;
|
||||
import ProjectData.Files.LanguageStyle;
|
||||
import ProjectData.LanguageName;
|
||||
|
||||
import javax.swing.*;
|
||||
public class FileSettingsMenu extends VisualiserMenu {
|
||||
JMenu mLanguage;
|
||||
JMenu mStyle;
|
||||
JMenu mType;
|
||||
public FileSettingsMenu() {
|
||||
super("Настройки файла", "/icons/Settings.png");
|
||||
add(mLanguage = new LanguagesSubmenu() {
|
||||
@Override
|
||||
public void action(LanguageName languageName) {
|
||||
if (Current.getFile().UpdateLanguage(languageName)) {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getFile().form.ShowLanguage();
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Current.getFile().node);
|
||||
}
|
||||
}
|
||||
});
|
||||
ShowLanguage();
|
||||
//--
|
||||
add(mStyle = new StylesSubmenu() {
|
||||
@Override
|
||||
public void action(LanguageStyle languageStyle) {
|
||||
if (Current.getFile().UpdateStyle(languageStyle)) {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getFile().form.ShowStyle();
|
||||
}
|
||||
}
|
||||
});
|
||||
ShowStyle();
|
||||
//--
|
||||
add(mType = new TypesSubmenu() {
|
||||
@Override
|
||||
public void action(FileType fileType) {
|
||||
if (Current.getFile().UpdateType(fileType)) {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Current.getFile().node);
|
||||
Current.getFile().form.ShowType();
|
||||
}
|
||||
}
|
||||
});
|
||||
ShowType();
|
||||
}
|
||||
public void ShowLanguage() {
|
||||
mLanguage.setText("Язык: " + Current.getFile().languageName.getDescription());
|
||||
}
|
||||
public void ShowStyle() {
|
||||
mStyle.setText("Стиль: " + Current.getFile().style.getDescription());
|
||||
}
|
||||
public void ShowType() {
|
||||
mType.setText("Тип: " + Current.getFile().fileType.getDescription());
|
||||
}
|
||||
}
|
||||
26
src/_VisualDVM/Visual/Menus/FileStyleMenu.java
Normal file
26
src/_VisualDVM/Visual/Menus/FileStyleMenu.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import _VisualDVM.Current;
|
||||
import ProjectData.Files.LanguageStyle;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
public class FileStyleMenu extends StyledPopupMenu {
|
||||
public FileStyleMenu() {
|
||||
for (LanguageStyle s : LanguageStyle.values()) {
|
||||
JMenuItem m = new VisualiserMenuItem(s.getDescription());
|
||||
m.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (Current.getFile().UpdateStyle(s)) {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getFile().form.ShowStyle();
|
||||
}
|
||||
}
|
||||
});
|
||||
add(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
37
src/_VisualDVM/Visual/Menus/GraphMenu.java
Normal file
37
src/_VisualDVM/Visual/Menus/GraphMenu.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Visual.Trees.StyledTree;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
public class GraphMenu<T extends StyledTree> extends StyledPopupMenu {
|
||||
public T tree;
|
||||
public GraphMenu(T tree_in, String branches_name) {
|
||||
tree = tree_in;
|
||||
JMenuItem m = null;
|
||||
m = new VisualiserMenuItem("Свернуть все " + branches_name);
|
||||
m.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
tree.CollapseAll();
|
||||
}
|
||||
});
|
||||
add(m);
|
||||
m = new VisualiserMenuItem("Развернуть все " + branches_name);
|
||||
m.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
tree.ExpandAll();
|
||||
}
|
||||
});
|
||||
add(m);
|
||||
}
|
||||
public GraphMenu(T tree) {
|
||||
this(tree, tree.getBranchesName());
|
||||
}
|
||||
public void Show(MouseEvent mouseEvent) {
|
||||
show(tree, mouseEvent.getX(), mouseEvent.getY());
|
||||
}
|
||||
}
|
||||
34
src/_VisualDVM/Visual/Menus/LanguagesSubmenu.java
Normal file
34
src/_VisualDVM/Visual/Menus/LanguagesSubmenu.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import ProjectData.LanguageName;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
public abstract class LanguagesSubmenu extends VisualiserMenu {
|
||||
public LanguagesSubmenu() {
|
||||
this("Язык");
|
||||
}
|
||||
public LanguagesSubmenu(String text) {
|
||||
super(text, "/icons/Language.png", true);
|
||||
for (LanguageName languageName : LanguageName.values()) {
|
||||
if (languageName.equals(LanguageName.fortran) ||
|
||||
(languageName.equals(LanguageName.c) ||
|
||||
(languageName.equals(LanguageName.cpp)))) {
|
||||
|
||||
JMenuItem languageItem = new StableMenuItem(languageName.getDescription());
|
||||
String li = languageName.getIcon();
|
||||
if (!li.isEmpty())
|
||||
languageItem.setIcon(CommonUtils.getIcon(li));
|
||||
languageItem.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
action(languageName);
|
||||
}
|
||||
});
|
||||
add(languageItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
public abstract void action(LanguageName languageName);
|
||||
}
|
||||
344
src/_VisualDVM/Visual/Menus/MainEditorMenu.java
Normal file
344
src/_VisualDVM/Visual/Menus/MainEditorMenu.java
Normal file
@@ -0,0 +1,344 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.TextEditorMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Visual.Editor.CaretInfo;
|
||||
import _VisualDVM.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import ProjectData.SapforData.Functions.FuncCall;
|
||||
import ProjectData.SapforData.Functions.FuncInfo;
|
||||
import ProjectData.SapforData.Functions.FunctionType;
|
||||
import ProjectData.SapforData.Loops.Loop;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public class MainEditorMenu extends TextEditorMenu {
|
||||
FuncCall call = null;
|
||||
FuncInfo decl = null;
|
||||
Loop loop = null;
|
||||
DBProjectFile header = null;
|
||||
//------------------
|
||||
JMenuItem m_comment;
|
||||
JMenuItem m_uncomment;
|
||||
JMenuItem m_inline;
|
||||
JMenuItem m_add_lines_to_region;
|
||||
JMenuItem m_remove_lines_from_region;
|
||||
JMenuItem m_loop_union;
|
||||
JMenuItem m_undo;
|
||||
JMenuItem m_gotoFunction;
|
||||
JMenuItem m_gotoHeader;
|
||||
//-----------------
|
||||
public MainEditorMenu(RSyntaxTextArea editor_in) {
|
||||
super(editor_in);
|
||||
addSeparator();
|
||||
m_gotoHeader = new VisualiserMenuItem("Перейти к заголовочному файлу", "/icons/Transformations/SPF_InsertIncludesPass.png");
|
||||
m_gotoHeader.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021.passes.get(PassCode_2021.OpenCurrentFile).Do(header);
|
||||
}
|
||||
});
|
||||
add(m_gotoHeader);
|
||||
addSeparator();
|
||||
m_gotoFunction = new VisualiserMenuItem("Перейти к объявлению процедуры", "/icons/versions/currentVersion.png");
|
||||
m_gotoFunction.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
decl.Show(true);
|
||||
}
|
||||
});
|
||||
add(m_gotoFunction);
|
||||
m_inline = new VisualiserMenuItem("Подставить вызов процедуры", "/icons/Transformations/SPF_InlineProcedures.png");
|
||||
m_inline.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021.passes.get(PassCode_2021.SPF_InlineProcedure).Do(call);
|
||||
}
|
||||
});
|
||||
add(m_inline);
|
||||
addSeparator();
|
||||
m_loop_union = new VisualiserMenuItem("Объединить цикл со следующим", "/icons/Transformations/SPF_LoopUnion.png");
|
||||
m_loop_union.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021.passes.get(PassCode_2021.SPF_LoopUnionCurrent).Do();
|
||||
}
|
||||
});
|
||||
add(m_loop_union);
|
||||
m_add_lines_to_region = new VisualiserMenuItem("Добавить строки в область", "/icons/Menu/AddLines.png");
|
||||
m_add_lines_to_region.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Pass_2021.passes.get(PassCode_2021.SPF_ChangeSpfIntervals).Do(
|
||||
((RSyntaxTextArea) editor).getLineOfOffset(editor.getSelectionStart()) + 1,
|
||||
((RSyntaxTextArea) editor).getLineOfOffset(editor.getSelectionEnd()) + 1,
|
||||
1
|
||||
);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(m_add_lines_to_region);
|
||||
m_remove_lines_from_region = new VisualiserMenuItem("Удалить строки из области", "/icons/Menu/RemoveLines.png");
|
||||
m_remove_lines_from_region.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Pass_2021.passes.get(PassCode_2021.SPF_ChangeSpfIntervals).Do(
|
||||
((RSyntaxTextArea) editor).getLineOfOffset(editor.getSelectionStart()) + 1,
|
||||
((RSyntaxTextArea) editor).getLineOfOffset(editor.getSelectionEnd()) + 1,
|
||||
0
|
||||
);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(m_remove_lines_from_region);
|
||||
addSeparator();
|
||||
m_comment = new VisualiserMenuItem("Закомментировать блок", "/icons/Editor/Comment.png");
|
||||
m_comment.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String new_ = "";
|
||||
String[] data = selectedText.split("\n");
|
||||
int i = 0;
|
||||
switch (Current.getFile().languageName) {
|
||||
case fortran:
|
||||
for (String line : data) {
|
||||
if (!line.startsWith("!")) {
|
||||
new_ += "!" + line;
|
||||
} else new_ += line;
|
||||
if (i < data.length - 1) new_ += "\n";
|
||||
++i;
|
||||
}
|
||||
break;
|
||||
case c:
|
||||
case cpp:
|
||||
for (String line : data) {
|
||||
if (!line.startsWith("//")) {
|
||||
new_ += "//" + line;
|
||||
} else new_ += line;
|
||||
if (i < data.length - 1) new_ += "\n";
|
||||
++i;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
new_ = selectedText;
|
||||
break;
|
||||
}
|
||||
editor.replaceSelection(new_);
|
||||
}
|
||||
});
|
||||
add(m_comment);
|
||||
m_uncomment = new VisualiserMenuItem("Раскомментировать блок", "/icons/Editor/Uncomment.png");
|
||||
m_uncomment.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String new_ = "";
|
||||
String[] data = selectedText.split("\n");
|
||||
int i = 0;
|
||||
switch (Current.getFile().languageName) {
|
||||
case fortran:
|
||||
for (String line : data) {
|
||||
if (line.startsWith("!")) {
|
||||
new_ += line.substring(1);
|
||||
} else new_ += line;
|
||||
if (i < data.length - 1) new_ += "\n";
|
||||
++i;
|
||||
}
|
||||
break;
|
||||
case c:
|
||||
case cpp:
|
||||
for (String line : data) {
|
||||
if (line.startsWith("//")) {
|
||||
new_ += line.substring(2);
|
||||
} else new_ += line;
|
||||
if (i < data.length - 1) new_ += "\n";
|
||||
++i;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
new_ = selectedText;
|
||||
break;
|
||||
}
|
||||
//todo. возможно, изменить концепцию на выделенные строки?
|
||||
editor.replaceSelection(new_);
|
||||
}
|
||||
});
|
||||
add(m_uncomment);
|
||||
addSeparator();
|
||||
m_undo = new VisualiserMenuItem("Отменить последнюю модификацию", "/icons/Menu/Undo.png");
|
||||
m_undo.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Current.getSapfor().UpdateProjectFiles(false);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(m_undo);
|
||||
}
|
||||
private void checkFunction() {
|
||||
call = null;
|
||||
decl = null;
|
||||
//--
|
||||
m_inline.setEnabled(false);
|
||||
m_gotoFunction.setEnabled(false);
|
||||
//--
|
||||
m_inline.setToolTipText("");
|
||||
m_gotoFunction.setToolTipText("");
|
||||
//--
|
||||
if (selectedText == null) {
|
||||
m_inline.setText("Невозможно подставить вызов процедуры. Не выделено имя процедуры.");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры. Не выделено имя процедуры");
|
||||
return;
|
||||
}
|
||||
if (selectedText.contains("\n")) {
|
||||
m_inline.setText("Невозможно подставить вызов процедуры. Выделено несколько строк");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры. Выделено несколько строк.");
|
||||
return;
|
||||
}
|
||||
if (!Utils.isFunctionName(selectedText)) {
|
||||
String tip = "Имя процедуры может содержать только английские буквы, цифры и подчеркивания, и не может начинаться с цифры.";
|
||||
//-
|
||||
m_inline.setText("Невозможно подставить вызов процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Выделено некорректное имя.");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Выделено некорректное имя.");
|
||||
//-
|
||||
m_inline.setToolTipText(tip);
|
||||
m_gotoFunction.setToolTipText(tip);
|
||||
return;
|
||||
}
|
||||
if (!Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctions).isDone()) {
|
||||
m_inline.setText("Невозможно подставить вызов процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Выполните проход \"Граф процедур \".");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Выполните проход \"Граф процедур \"");
|
||||
return;
|
||||
}
|
||||
if (Current.getSapfor().isIntrinsic(selectedText)) {
|
||||
m_inline.setText("Невозможно подставить вызов процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Процедура является стандартной.");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Процедура является стандартной.");
|
||||
return;
|
||||
}
|
||||
call = Current.getFile().find_func_call(selectedText);
|
||||
if (call == null) {
|
||||
m_inline.setText("Невозможно подставить вызов процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Вызов не найден в текущей строке.");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Объявление процедуры уже находится в текущей строке.");
|
||||
return;
|
||||
}
|
||||
decl = Current.getProject().allFunctions.get(call.funcName);
|
||||
if (decl.type.equals(FunctionType.NotFound)) {
|
||||
m_inline.setText("Невозможно подставить вызов процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Объявление процедуры не найдено в проекте.");
|
||||
m_gotoFunction.setText("Невозможно перейти к объявлению процедуры " + CommonUtils.Brackets(selectedText) +
|
||||
" . Объявление процедуры не найдено в проекте.");
|
||||
return;
|
||||
}
|
||||
//---
|
||||
m_inline.setEnabled(true);
|
||||
m_gotoFunction.setEnabled(true);
|
||||
m_inline.setText("Подставить вызов процедуры " + CommonUtils.Brackets(selectedText));
|
||||
m_gotoFunction.setText("Перейти к объявлению процедуры " + CommonUtils.Brackets(selectedText));
|
||||
//--
|
||||
}
|
||||
private void checkHeader() {
|
||||
header = null;
|
||||
m_gotoHeader.setEnabled(false);
|
||||
//--
|
||||
CaretInfo caretInfo = ((SPFEditor) editor).getCaretInfo();
|
||||
if (caretInfo != null) {
|
||||
String header_ = Utils.extractHeaderName(caretInfo.current_line);
|
||||
if (header_ == null) {
|
||||
m_gotoHeader.setText("Невозможно перейти к заголовочному файлу. В текущей строке не найдено включений.");
|
||||
return;
|
||||
}
|
||||
if (!Pass_2021.passes.get(PassCode_2021.SPF_GetIncludeDependencies).isDone()) {
|
||||
m_gotoHeader.setText("Невозможно перейти к заголовочному файлу. Выполните проход \"Поиск зависимостей по включению\"");
|
||||
return;
|
||||
}
|
||||
if (!Current.getFile().relativeHeaders.containsKey(header_)) {
|
||||
m_gotoHeader.setText("Невозможно перейти к заголовочному файлу " + CommonUtils.Brackets(header_) + " . Файл не найден среди включений текущего файла.");
|
||||
return;
|
||||
}
|
||||
header = Current.getFile().relativeHeaders.get(header_);
|
||||
m_gotoHeader.setText("Переход к заголовочному файлу " + CommonUtils.Brackets(header_));
|
||||
m_gotoHeader.setEnabled(true);
|
||||
}
|
||||
}
|
||||
private void checkLoop() {
|
||||
loop = null;
|
||||
m_loop_union.setEnabled(false);
|
||||
if (!Pass_2021.passes.get(PassCode_2021.SPF_GetGraphLoops).isDone()) {
|
||||
m_loop_union.setText("Невозможно объединить цикл в текущей строке со следующим. " +
|
||||
"Выполните проход \"Граф циклов\"");
|
||||
return;
|
||||
}
|
||||
loop = Current.getFile().find_current_loop();
|
||||
if (loop == null) {
|
||||
m_loop_union.setText("Невозможно объединить цикл в текущей строке со следующим. Не найдено циклов в текущей строке.");
|
||||
return;
|
||||
}
|
||||
m_loop_union.setEnabled(true);
|
||||
m_loop_union.setText("Объединить цикл в строке " + CommonUtils.Brackets(loop.line) + " со следующим");
|
||||
}
|
||||
@Override
|
||||
public void CheckElementsVisibility() {
|
||||
super.CheckElementsVisibility();
|
||||
m_strike.setVisible(false);
|
||||
m_unstrike.setVisible(false);
|
||||
checkFunction();
|
||||
checkHeader();
|
||||
checkLoop();
|
||||
if (selectedText == null) {
|
||||
m_comment.setEnabled(false);
|
||||
m_uncomment.setEnabled(false);
|
||||
m_add_lines_to_region.setEnabled(false);
|
||||
m_remove_lines_from_region.setEnabled(false);
|
||||
m_comment.setText("Невозможно закомментировать блок. Не выделено ни одной строки.");
|
||||
m_uncomment.setText("Невозможно раскомментировать блок. Не выделено ни одной строки.");
|
||||
m_add_lines_to_region.setText("Невозможно добавить строки в область. Не выделено ни одной строки.");
|
||||
m_remove_lines_from_region.setText("Невозможно удалить строки из области. Не выделено ни одной строки.");
|
||||
} else {
|
||||
m_comment.setEnabled(true);
|
||||
m_uncomment.setEnabled(true);
|
||||
m_add_lines_to_region.setEnabled(true);
|
||||
m_remove_lines_from_region.setEnabled(true);
|
||||
m_comment.setText("Закомментировать блок");
|
||||
m_uncomment.setText("Раскомментировать блок");
|
||||
m_add_lines_to_region.setText("Добавить строки в область");
|
||||
m_remove_lines_from_region.setText("Удалить строки из области");
|
||||
}
|
||||
if (Current.getSapfor().OldFiles.isEmpty()) {
|
||||
m_undo.setEnabled(false);
|
||||
m_undo.setText("Невозможно отменить последнюю модификацию. Модификации отсутствуют.");
|
||||
} else {
|
||||
m_undo.setEnabled(true);
|
||||
m_undo.setText("Отменить последнюю модификацию.");
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/_VisualDVM/Visual/Menus/MainMenuBar/AnalysesMenu.java
Normal file
14
src/_VisualDVM/Visual/Menus/MainMenuBar/AnalysesMenu.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import Repository.Component.Sapfor.Sapfor;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class AnalysesMenu extends VisualiserMenu {
|
||||
public AnalysesMenu() {
|
||||
super("Анализаторы","/icons/Analyses.png" );
|
||||
for (PassCode_2021 code : Sapfor.getAnalysesCodes())
|
||||
add(Pass_2021.passes.get(code).createMenuItem());
|
||||
addSeparator();
|
||||
add(Pass_2021.passes.get(PassCode_2021.SPF_GetGCovInfo).createMenuItem());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class GlobalCleaningMenu extends VisualiserMenu {
|
||||
public GlobalCleaningMenu() {
|
||||
super("Очистка", "/icons/Clean.png", false);
|
||||
add(Pass_2021.passes.get(PassCode_2021.DropLastProjects).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DropFastAccess).createMenuItem());
|
||||
addSeparator();
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteDownloadedBugReports).createMenuItem());
|
||||
addSeparator();
|
||||
add(Pass_2021.passes.get(PassCode_2021.DropAnalyses).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.CleanAnalyses).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DropSavedArrays).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteDebugResults).createMenuItem());
|
||||
addSeparator();
|
||||
add(Pass_2021.passes.get(PassCode_2021.ResetCurrentProject).createMenuItem());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import GlobalData.DBLastProject.DBLastProject;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.MenuEvent;
|
||||
import javax.swing.event.MenuListener;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.io.File;
|
||||
import java.util.Vector;
|
||||
public class LastOpenedProjectsMenu extends VisualiserMenu {
|
||||
public LastOpenedProjectsMenu() {
|
||||
super("Недавние проекты", "/icons/LastOpened.png");
|
||||
addMenuListener(new MenuListener() {
|
||||
@Override
|
||||
public void menuSelected(MenuEvent e) {
|
||||
removeAll();
|
||||
Vector<DBLastProject> projects = ((GlobalDatabase)CommonUtils.db).lastProjects.getOrdered();
|
||||
int k = 1;
|
||||
for (DBLastProject p : projects) {
|
||||
if (new File(p.HomePath).exists() && p.lastOpened != 0) {
|
||||
VisualiserMenuItem i = new VisualiserMenuItem(p.HomePath);
|
||||
i.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021.passes.get(PassCode_2021.OpenCurrentProject).Do(new File(p.HomePath));
|
||||
}
|
||||
});
|
||||
add(i);
|
||||
++k;
|
||||
if (k > (((GlobalDatabase)CommonUtils.db).settings.get(SettingName.LastOpenedProjectsCount).toInt32())) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void menuDeselected(MenuEvent e) {
|
||||
}
|
||||
@Override
|
||||
public void menuCanceled(MenuEvent e) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
90
src/_VisualDVM/Visual/Menus/MainMenuBar/MainMenuBar.java
Normal file
90
src/_VisualDVM/Visual/Menus/MainMenuBar/MainMenuBar.java
Normal file
@@ -0,0 +1,90 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar;
|
||||
import Common.Visual.CommonUI;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import _VisualDVM.Visual.Menus.MainMenuBar.VisualiserSettingsMenu.VisualiserSettingsMenu;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class MainMenuBar extends VisualiserMenuBar {
|
||||
JMenu analyses;
|
||||
JMenu transformations;
|
||||
MenuBarButton components;
|
||||
public MainMenuBar() {
|
||||
addMenus(new LastOpenedProjectsMenu());
|
||||
addPasses(PassCode_2021.OpenCurrentProject, PassCode_2021.CreateEmptyProject);
|
||||
addMenus(
|
||||
analyses = new AnalysesMenu(),
|
||||
transformations = new TransformationsMenu(),
|
||||
new GlobalCleaningMenu(),
|
||||
new VisualiserSettingsMenu()
|
||||
);
|
||||
add(components = new MenuBarButton() {
|
||||
{
|
||||
setToolTipText("Компоненты");
|
||||
setIcon("/icons/ComponentsActual.png");
|
||||
addActionListener(e -> {
|
||||
if (PerformanceAnalyzer.isActive) {
|
||||
CommonUI.Info("Перед работой с компонентами закройте анализатор производительности!");
|
||||
} else {
|
||||
Pass_2021.passes.get(PassCode_2021.GetComponentsActualVersions).Do();
|
||||
Global.RefreshUpdatesStatus();
|
||||
UI.ShowComponentsWindow();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
/*
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/Comparsion.png");
|
||||
setToolTipText("Анализатор статистик");
|
||||
addActionListener(e -> {
|
||||
Global.performanceAnalyzer.Start();
|
||||
});
|
||||
}
|
||||
});
|
||||
*/
|
||||
addPasses(PassCode_2021.ShowInstruction);
|
||||
//-
|
||||
setPreferredSize(new Dimension(0, 30));
|
||||
//---
|
||||
|
||||
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/Apply.png");
|
||||
setToolTipText("Test");
|
||||
addActionListener(e -> {
|
||||
Pass_2021.passes.get(PassCode_2021.TestPass).Do();
|
||||
});
|
||||
}
|
||||
});
|
||||
ShowProject(false);
|
||||
}
|
||||
public void ShowUpdatesIcon() {
|
||||
components.setIcon(
|
||||
(Global.need_update > 0) || (Global.bad_state > 0)
|
||||
? "/icons/ComponentsNeedUpdate.gif"
|
||||
: (Global.need_publish > 0 ? "/icons/ComponentsNeedPublish_2023.gif" : "/icons/ComponentsActual.png"));
|
||||
}
|
||||
public void ShowProject(boolean flag) {
|
||||
analyses.setEnabled(flag);
|
||||
transformations.setEnabled(flag);
|
||||
Pass_2021[] cleaningPasses = new Pass_2021[]{
|
||||
Pass_2021.passes.get(PassCode_2021.DropAnalyses),
|
||||
Pass_2021.passes.get(PassCode_2021.DropSavedArrays),
|
||||
Pass_2021.passes.get(PassCode_2021.CleanAnalyses),
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteDebugResults),
|
||||
Pass_2021.passes.get(PassCode_2021.ResetCurrentProject)
|
||||
};
|
||||
for (Pass_2021 pass : cleaningPasses) {
|
||||
pass.setControlsEnabled(flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
src/_VisualDVM/Visual/Menus/MainMenuBar/MainWindow.java
Normal file
20
src/_VisualDVM/Visual/Menus/MainMenuBar/MainWindow.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar;
|
||||
import _VisualDVM.Visual.Interface.*;
|
||||
public interface MainWindow {
|
||||
void Show();
|
||||
void ShowProject();
|
||||
void ShowNoProject();
|
||||
ProjectWindow getProjectWindow();
|
||||
CallbackWindow getCallbackWindow();
|
||||
TestsWindow getTestsWindow();
|
||||
TestingWindow getTestingWindow();
|
||||
//-
|
||||
void ShowUpdatesIcon();
|
||||
void FocusProject();
|
||||
void FocusCallback();
|
||||
void FocusTests();
|
||||
void FocusTesting();
|
||||
void SwitchTestingTabs(boolean flag);
|
||||
//-
|
||||
void ShowCheckedTestsCount();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar;
|
||||
import _VisualDVM.Visual.Menus.PassesSubMenu;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import Repository.Component.Sapfor.Sapfor;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class TransformationsMenu extends VisualiserMenu {
|
||||
public TransformationsMenu() {
|
||||
super("Преобразования", "/icons/Transformations.png");
|
||||
add(new PassesSubMenu("Циклы", "/icons/Menu/Loops.png",
|
||||
Sapfor.getLoopsTransformationsCodes()));
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Приватные переменные", "/icons/Menu/Privates.png",
|
||||
Sapfor.getPrivatesTransformationsCodes()));
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Процедуры", "/icons/Menu/Functions.png",
|
||||
Sapfor.getProceduresTransformationsCodes()));
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Директивы", "/icons/Directives.png",
|
||||
Sapfor.getDVMTransformationsCodes()));
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Интервалы", "/icons/Menu/Intervals.png",
|
||||
Sapfor.getIntervalsTransformationsCodes()
|
||||
));
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Области распараллеливания", "/icons/Menu/Regions.png",
|
||||
Sapfor.getRegionsTransformationsCodes()
|
||||
));
|
||||
addSeparator();
|
||||
add(Pass_2021.passes.get(PassCode_2021.SPF_SharedMemoryParallelization).createMenuItem());
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Предобработка проекта", "/icons/Menu/Preprocessing.png",
|
||||
Sapfor.getPreparationTransformationsCodes()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar.VisualiserSettingsMenu;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.Menus.SettingsSubmenu;
|
||||
import GlobalData.Settings.SettingName;
|
||||
public class CompactnessSettingsMenu extends SettingsSubmenu {
|
||||
public CompactnessSettingsMenu(){
|
||||
super("Компактность отображения", null,
|
||||
SettingName.SmallScreen,
|
||||
SettingName.ShowFullTabsNames,
|
||||
SettingName.ShowFullArraysDeclarations,
|
||||
SettingName.FastAccessPassesCount,
|
||||
SettingName.LastOpenedProjectsCount
|
||||
);
|
||||
addSeparator();
|
||||
String [] propertiesNames = new String[]{
|
||||
// "collapseCredentials",
|
||||
"collapseProjectTrees",
|
||||
"collapseFileGraphs",
|
||||
"collapseFileMessages"
|
||||
};
|
||||
for (String name: propertiesNames){
|
||||
Global.properties.addFlagMenuItem(this, name);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package _VisualDVM.Visual.Menus.MainMenuBar.VisualiserSettingsMenu;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Visual.Menus.PropertiesSubmenu;
|
||||
import _VisualDVM.Visual.Menus.SettingsSubmenu;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import GlobalData.Settings.SettingName;
|
||||
public class VisualiserSettingsMenu extends VisualiserMenu {
|
||||
public VisualiserSettingsMenu() {
|
||||
super("Настройки визуализатора", "/icons/Settings.png");
|
||||
//-
|
||||
add(new PropertiesSubmenu("Подтверждения и уведомления", null,
|
||||
"ShowPassesDone",
|
||||
"ConfirmPassesStart",
|
||||
"FocusPassesResult"
|
||||
));
|
||||
add(new CompactnessSettingsMenu());
|
||||
if (CommonUtils.isWindows()) {
|
||||
add(new SettingsSubmenu("Компиляция на локальной машине", null,
|
||||
SettingName.LocalMakePathWindows,
|
||||
SettingName.Kernels
|
||||
));
|
||||
} else {
|
||||
add(new SettingsSubmenu("Компиляция на локальной машине", null,
|
||||
SettingName.Kernels
|
||||
));
|
||||
}
|
||||
add(new SettingsSubmenu("Синхронизация", null,
|
||||
SettingName.AutoBugReportsLoad,
|
||||
SettingName.AutoTestsLoad
|
||||
));
|
||||
add(new SettingsSubmenu("Сравнение", null,
|
||||
SettingName.ExtensionsOn,
|
||||
SettingName.RegisterOn,
|
||||
SettingName.SpacesOn,
|
||||
SettingName.EmptyLinesOn,
|
||||
SettingName.FortranWrapsOn,
|
||||
SettingName.ComparsionDiffMergeOn
|
||||
));
|
||||
add(((GlobalDatabase)CommonUtils.db).settings.get(SettingName.Workspace).getMenuItem());
|
||||
add(((GlobalDatabase)CommonUtils.db).settings.get(SettingName.BugReportsAgeLimit).getMenuItem());
|
||||
}
|
||||
}
|
||||
18
src/_VisualDVM/Visual/Menus/PassMenuItem.java
Normal file
18
src/_VisualDVM/Visual/Menus/PassMenuItem.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import _VisualDVM.Visual.Controls.PassControl;
|
||||
public class PassMenuItem extends VisualiserMenuItem implements PassControl {
|
||||
@Override
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
}
|
||||
public PassMenuItem(Pass_2021 pass) {
|
||||
setText(pass.getDescription());
|
||||
setToolTipText(pass.getDescription());
|
||||
if (pass.getIconPath() != null) setIcon(pass.getIconPath());
|
||||
addActionListener(pass.getControlAction());
|
||||
pass.controls.add(this);
|
||||
}
|
||||
}
|
||||
18
src/_VisualDVM/Visual/Menus/PassesSubMenu.java
Normal file
18
src/_VisualDVM/Visual/Menus/PassesSubMenu.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
public class PassesSubMenu extends JMenu {
|
||||
public PassesSubMenu(String title, String icon, PassCode_2021... passes) {
|
||||
super(title);
|
||||
setIcon(CommonUtils.getIcon(icon));
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
for (PassCode_2021 code : passes) {
|
||||
add(Pass_2021.passes.get(code).createMenuItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
132
src/_VisualDVM/Visual/Menus/ProjectFilesMenu.java
Normal file
132
src/_VisualDVM/Visual/Menus/ProjectFilesMenu.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Trees.StyledTree;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import ProjectData.Files.FileType;
|
||||
import ProjectData.Files.LanguageStyle;
|
||||
import ProjectData.LanguageName;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
public class ProjectFilesMenu extends GraphMenu {
|
||||
VisualiserMenuItem m_select_all;
|
||||
VisualiserMenuItem m_unselect_all;
|
||||
VisualiserMenuItem m_multiselection;
|
||||
JMenu mLanguage;
|
||||
JMenu mStyle;
|
||||
JMenu mType;
|
||||
public ProjectFilesMenu(StyledTree tree) {
|
||||
super(tree, "подпапки");
|
||||
addSeparator();
|
||||
JMenuItem m = new VisualiserMenuItem("Открыть в проводнике...", "/icons/Explorer.png");
|
||||
m.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Desktop.getDesktop().open(Current.getProject().Home);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(m);
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Добавить", "/icons/RedAdd.png",
|
||||
PassCode_2021.AddFile,
|
||||
PassCode_2021.CreateEmptyDirectory,
|
||||
PassCode_2021.ImportFiles));
|
||||
addSeparator();
|
||||
add(new PassesSubMenu("Переименовать", "/icons/Menu/Rename.png",
|
||||
PassCode_2021.RenameFile,
|
||||
PassCode_2021.RenameDirectory));
|
||||
add(new VisualiserMenuItem("Удалить текущий проект", "/icons/Delete.png") {
|
||||
{
|
||||
addActionListener(e -> {
|
||||
if (Current.HasProject()) {
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().SelectNode(Current.getProject().node);
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteVersion).Do();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
addSeparator();
|
||||
m_multiselection = new VisualiserMenuItem("Массовый режим работы с файлами");
|
||||
m_multiselection.setIcon(CommonUtils.getIcon(Global.files_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
m_multiselection.addActionListener(e -> {
|
||||
Global.files_multiselection = !Global.files_multiselection;
|
||||
m_multiselection.setIcon(CommonUtils.getIcon(Global.files_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
Current.getProject().SelectAllFiles(false);
|
||||
UI.getMainWindow().getProjectWindow().RefreshProjectFiles();
|
||||
|
||||
//-
|
||||
});
|
||||
add(m_multiselection);
|
||||
addSeparator();
|
||||
//-
|
||||
m_select_all = new StableMenuItem("Выбрать всё", "/icons/SelectAll.png");
|
||||
m_select_all.addActionListener(e -> {
|
||||
Current.getProject().SelectAllFiles(true);
|
||||
tree.updateUI();
|
||||
});
|
||||
add(m_select_all);
|
||||
m_unselect_all = new StableMenuItem("Отменить всё", "/icons/UnselectAll.png");
|
||||
m_unselect_all.addActionListener(e -> {
|
||||
Current.getProject().SelectAllFiles(false);
|
||||
tree.updateUI();
|
||||
});
|
||||
add(m_unselect_all);
|
||||
//--------------------------------------------------
|
||||
add(mLanguage = new LanguagesSubmenu(PassCode_2021.SetSelectedFilesLanguage.getDescription()) {
|
||||
@Override
|
||||
public void action(LanguageName languageName) {
|
||||
Pass_2021.passes.get(PassCode_2021.SetSelectedFilesLanguage).Do(languageName);
|
||||
}
|
||||
});
|
||||
add(mStyle = new StylesSubmenu(PassCode_2021.SetSelectedFilesStyle.getDescription()) {
|
||||
@Override
|
||||
public void action(LanguageStyle languageStyle) {
|
||||
Pass_2021.passes.get(PassCode_2021.SetSelectedFilesStyle).Do(languageStyle);
|
||||
}
|
||||
});
|
||||
add(mType = new TypesSubmenu(PassCode_2021.SetSelectedFilesType.getDescription()) {
|
||||
@Override
|
||||
public void action(FileType fileType) {
|
||||
Pass_2021.passes.get(PassCode_2021.SetSelectedFilesType).Do(fileType);
|
||||
}
|
||||
});
|
||||
//--------------------------------------------------
|
||||
add(Pass_2021.passes.get(PassCode_2021.ExcludeSelectedFiles).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.IncludeSelectedFiles).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.ExcludeFile).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.IncludeFile).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteFile).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteDirectory).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteSelectedFiles).createMenuItem());
|
||||
}
|
||||
@Override
|
||||
public void CheckElementsVisibility() {
|
||||
m_select_all.setVisible(Global.files_multiselection);
|
||||
m_unselect_all.setVisible(Global.files_multiselection);
|
||||
mLanguage.setVisible(Global.files_multiselection);
|
||||
mStyle.setVisible(Global.files_multiselection);
|
||||
mType.setVisible(Global.files_multiselection);
|
||||
//-
|
||||
Pass_2021.passes.get(PassCode_2021.ExcludeFile).setControlsVisible(!Global.files_multiselection);
|
||||
Pass_2021.passes.get(PassCode_2021.IncludeFile).setControlsVisible(!Global.files_multiselection);
|
||||
//-
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteFile).setControlsVisible(!Global.files_multiselection);
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteDirectory).setControlsVisible(!Global.files_multiselection);
|
||||
//--
|
||||
Pass_2021.passes.get(PassCode_2021.ExcludeSelectedFiles).setControlsVisible(Global.files_multiselection);
|
||||
Pass_2021.passes.get(PassCode_2021.IncludeSelectedFiles).setControlsVisible(Global.files_multiselection);
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteSelectedFiles).setControlsVisible(Global.files_multiselection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package _VisualDVM.Visual.Menus.ProjectMenuBar;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class FilesOperationsMenu extends VisualiserMenu {
|
||||
public FilesOperationsMenu() {
|
||||
super("Массовые операции над файлами","/icons/MassFiles.png" );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package _VisualDVM.Visual.Menus.ProjectMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class ProjectMenuBar extends VisualiserMenuBar {
|
||||
public ProjectViewMenu projectViewMenu;
|
||||
public ProjectMenuBar() {
|
||||
addMenus(projectViewMenu = new ProjectViewMenu());
|
||||
add(new JSeparator());
|
||||
addMenus(
|
||||
new ProjectSettingsMenu()
|
||||
);
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setToolTipText("Профили");
|
||||
setIcon("/icons/Profiles.png");
|
||||
addActionListener(e -> {
|
||||
UI.ShowProfilesWindow();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
public ProjectViewMenu getProjectViewMenu() {
|
||||
return projectViewMenu;
|
||||
}
|
||||
@Override
|
||||
public void setSizeLimits() {
|
||||
setPreferredSize(new Dimension(0, 32));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package _VisualDVM.Visual.Menus.ProjectMenuBar;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Visual.Menus.LanguagesSubmenu;
|
||||
import _VisualDVM.Visual.Menus.SettingsSubmenu;
|
||||
import _VisualDVM.Visual.Menus.StylesSubmenu;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import ProjectData.Files.LanguageStyle;
|
||||
import ProjectData.LanguageName;
|
||||
|
||||
import javax.swing.*;
|
||||
public class ProjectSettingsMenu extends VisualiserMenu {
|
||||
JMenu mLanguage;
|
||||
JMenu mStyle;
|
||||
public ProjectSettingsMenu() {
|
||||
super("Настройки проекта", "/icons/Settings.png");
|
||||
add(mLanguage = new LanguagesSubmenu() {
|
||||
@Override
|
||||
public void action(LanguageName languageName) {
|
||||
if (Current.getProject().UpdateLanguage(languageName)) {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
ShowLanguage();
|
||||
}
|
||||
}
|
||||
});
|
||||
ShowLanguage();
|
||||
//--
|
||||
add(mStyle = new StylesSubmenu() {
|
||||
@Override
|
||||
public void action(LanguageStyle languageStyle) {
|
||||
if (Current.getProject().UpdateStyle(languageStyle))
|
||||
ShowStyle();
|
||||
}
|
||||
});
|
||||
ShowStyle();
|
||||
addSeparator();
|
||||
add(new SettingsSubmenu("Анализ", null,
|
||||
SettingName.Precompilation,
|
||||
SettingName.STATIC_SHADOW_ANALYSIS,
|
||||
SettingName.KEEP_DVM_DIRECTIVES,
|
||||
SettingName.IGNORE_IO_SAPFOR,
|
||||
SettingName.MPI_PROGRAM,
|
||||
SettingName.ANALYSIS_OPTIONS
|
||||
));
|
||||
addSeparator();
|
||||
add(new SettingsSubmenu("Построение системы интервалов", null,
|
||||
SettingName.KEEP_LOOPS_CLOSE_NESTING,
|
||||
SettingName.KEEP_GCOV
|
||||
));
|
||||
addSeparator();
|
||||
add(new SettingsSubmenu("Построение версий", null,
|
||||
SettingName.FREE_FORM,
|
||||
SettingName.KEEP_SPF_DIRECTIVES,
|
||||
SettingName.KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS,
|
||||
SettingName.OUTPUT_UPPER,
|
||||
SettingName.MAX_SHADOW_WIDTH,
|
||||
SettingName.DVMConvertationOptions,
|
||||
SettingName.SaveModifications
|
||||
));
|
||||
addSeparator();
|
||||
add(((GlobalDatabase)CommonUtils.db).settings.get(SettingName.TRANSLATE_MESSAGES).getMenuItem());
|
||||
add(((GlobalDatabase)CommonUtils.db).settings.get(SettingName.DEBUG_PRINT_ON).getMenuItem());
|
||||
add(((GlobalDatabase)CommonUtils.db).settings.get(SettingName.GCOVLimit).getMenuItem());
|
||||
}
|
||||
public void ShowLanguage() {
|
||||
mLanguage.setText("Язык: " + Current.getProject().languageName.getDescription());
|
||||
}
|
||||
public void ShowStyle() {
|
||||
mStyle.setText("Стиль: " + Current.getProject().style.getDescription());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package _VisualDVM.Visual.Menus.ProjectMenuBar;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import ProjectData.ProjectView;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
public class ProjectViewMenu extends VisualiserMenu {
|
||||
LinkedHashMap<ProjectView, JMenuItem> views;
|
||||
public ProjectViewMenu() {
|
||||
super("", "");
|
||||
views = new LinkedHashMap<>();
|
||||
for (ProjectView view : ProjectView.values()) {
|
||||
JMenuItem m = new JMenuItem(view.getDescription()) {
|
||||
{
|
||||
setIcon(CommonUtils.getIcon(view.getIcon()));
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
addActionListener(e -> {
|
||||
CurrentAnchestor.set(Current.ProjectView, view);
|
||||
UI.getMainWindow().getProjectWindow().ShowProjectView();
|
||||
});
|
||||
}
|
||||
};
|
||||
add(m);
|
||||
views.put(view, m);
|
||||
}
|
||||
}
|
||||
public void SelectView(ProjectView view){
|
||||
views.get(view).doClick();
|
||||
}
|
||||
}
|
||||
18
src/_VisualDVM/Visual/Menus/PropertiesSubmenu.java
Normal file
18
src/_VisualDVM/Visual/Menus/PropertiesSubmenu.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
public class PropertiesSubmenu extends JMenu {
|
||||
public PropertiesSubmenu(String title, String icon, String... settings) {
|
||||
super(title);
|
||||
if (icon != null)
|
||||
setIcon(CommonUtils.getIcon(icon));
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
for (String name : settings) {
|
||||
Global.properties.addFlagMenuItem(this, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
86
src/_VisualDVM/Visual/Menus/SelectionTreeMenu.java
Normal file
86
src/_VisualDVM/Visual/Menus/SelectionTreeMenu.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Visual.Selectable;
|
||||
import Common.Visual.Trees.DataTree;
|
||||
import Common.Visual.Trees.SelectableTree;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
|
||||
VisualiserMenuItem m_select_for_current;
|
||||
VisualiserMenuItem m_unselect_for_current;
|
||||
VisualiserMenuItem m_select_all;
|
||||
VisualiserMenuItem m_unselect_all;
|
||||
public SelectionTreeMenu(SelectableTree tree_in) {
|
||||
super(tree_in, "");
|
||||
addSeparator();
|
||||
//-
|
||||
m_select_all = new StableMenuItem("Выбрать всё", "/icons/SelectAll.png");
|
||||
m_select_all.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
SelectAll(true);
|
||||
tree.updateUI();
|
||||
}
|
||||
});
|
||||
add(m_select_all);
|
||||
m_unselect_all = new StableMenuItem("Отменить всё", "/icons/UnselectAll.png");
|
||||
m_unselect_all.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
SelectAll(false);
|
||||
tree.updateUI();
|
||||
}
|
||||
});
|
||||
add(m_unselect_all);
|
||||
addSeparator();
|
||||
m_select_for_current = new VisualiserMenuItem("");
|
||||
m_select_for_current.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Object o = CurrentAnchestor.get(tree.getCurrent());
|
||||
if (o instanceof Selectable) {
|
||||
((Selectable) o).SelectAllChildren(true);
|
||||
}
|
||||
tree.updateUI();
|
||||
}
|
||||
});
|
||||
add(m_select_for_current);
|
||||
//--------
|
||||
m_unselect_for_current = new VisualiserMenuItem("");
|
||||
m_unselect_for_current.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Object o = CurrentAnchestor.get(tree.getCurrent());
|
||||
if (o instanceof Selectable) {
|
||||
((Selectable) o).SelectAllChildren(false);
|
||||
}
|
||||
tree.updateUI();
|
||||
}
|
||||
});
|
||||
//-------
|
||||
add(m_unselect_for_current);
|
||||
}
|
||||
public abstract Class getTargetClass(); //для кого позволяется выбирать всех потомков.
|
||||
public abstract void SelectAll(boolean select);
|
||||
@Override
|
||||
public void CheckElementsVisibility() {
|
||||
Object current = CurrentAnchestor.get(tree.getCurrent());
|
||||
if ((current != null) && (current.getClass().equals(getTargetClass()))) {
|
||||
String name = ((Selectable) current).getSelectionText();
|
||||
m_select_for_current.setText("Выбрать всё для " +
|
||||
CommonUtils.Brackets(name));
|
||||
m_unselect_for_current.setText("Отменить выбор всех для " +
|
||||
CommonUtils.Brackets(name));
|
||||
//-
|
||||
m_select_for_current.setVisible(true);
|
||||
m_unselect_for_current.setVisible(true);
|
||||
} else {
|
||||
m_select_for_current.setVisible(false);
|
||||
m_unselect_for_current.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
src/_VisualDVM/Visual/Menus/SettingsSubmenu.java
Normal file
19
src/_VisualDVM/Visual/Menus/SettingsSubmenu.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import GlobalData.Settings.SettingName;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SettingsSubmenu extends JMenu {
|
||||
public SettingsSubmenu(String title, String icon, SettingName... settings) {
|
||||
super(title);
|
||||
if (icon != null)
|
||||
setIcon(CommonUtils.getIcon(icon));
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
for (SettingName c : settings) {
|
||||
add(((GlobalDatabase)CommonUtils.db).settings.get(c).getMenuItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/_VisualDVM/Visual/Menus/StableMenuItem.java
Normal file
41
src/_VisualDVM/Visual/Menus/StableMenuItem.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicMenuItemUI;
|
||||
//неичезающий меню итем. нужен для настроек
|
||||
//https://translated.turbopages.org/proxy_u/en-ru.ru.64537f6c-6460c460-8e74a1ab-74722d776562/https/tips4java.wordpress.com/2010/09/12/keeping-menus-open/
|
||||
class StableItemUI extends BasicMenuItemUI {
|
||||
public static ComponentUI createUI(JComponent c) {
|
||||
return new StableItemUI();
|
||||
}
|
||||
@Override
|
||||
protected void doClick(MenuSelectionManager msm) {
|
||||
menuItem.doClick(0);
|
||||
if (CommonUI.last_menu_path != null)
|
||||
MenuSelectionManager.defaultManager().setSelectedPath(CommonUI.last_menu_path);
|
||||
}
|
||||
}
|
||||
public class StableMenuItem extends VisualiserMenuItem {
|
||||
{
|
||||
getModel().addChangeListener(e -> {
|
||||
if (getModel().isArmed() && isShowing())
|
||||
CommonUI.last_menu_path = MenuSelectionManager.defaultManager().getSelectedPath();
|
||||
});
|
||||
}
|
||||
public StableMenuItem(String text) {
|
||||
super(text);
|
||||
setUI(new StableItemUI());
|
||||
}
|
||||
public StableMenuItem(String text, String icon_path) {
|
||||
super(text);
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
setUI(new StableItemUI());
|
||||
}
|
||||
public StableMenuItem() {
|
||||
setUI(new StableItemUI());
|
||||
}
|
||||
}
|
||||
17
src/_VisualDVM/Visual/Menus/StablePassMenuItem.java
Normal file
17
src/_VisualDVM/Visual/Menus/StablePassMenuItem.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import _VisualDVM.Visual.Controls.PassControl;
|
||||
public class StablePassMenuItem extends StableMenuItem implements PassControl {
|
||||
@Override
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
}
|
||||
public StablePassMenuItem(Pass_2021 pass) {
|
||||
setText(pass.getDescription());
|
||||
setToolTipText(pass.getDescription());
|
||||
if (pass.getIconPath() != null) setIcon(pass.getIconPath());
|
||||
addActionListener(pass.getControlAction());
|
||||
pass.controls.add(this);
|
||||
}
|
||||
}
|
||||
25
src/_VisualDVM/Visual/Menus/StylesSubmenu.java
Normal file
25
src/_VisualDVM/Visual/Menus/StylesSubmenu.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import ProjectData.Files.LanguageStyle;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
public abstract class StylesSubmenu extends VisualiserMenu {
|
||||
public StylesSubmenu() {
|
||||
this("Стиль");
|
||||
}
|
||||
public StylesSubmenu(String text) {
|
||||
super(text, "/icons/Style.png", true);
|
||||
for (LanguageStyle languageStyle : LanguageStyle.values()) {
|
||||
JMenuItem m = new StableMenuItem(languageStyle.getDescription());
|
||||
m.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
action(languageStyle);
|
||||
}
|
||||
});
|
||||
add(m);
|
||||
}
|
||||
}
|
||||
public abstract void action(LanguageStyle languageStyle);
|
||||
}
|
||||
30
src/_VisualDVM/Visual/Menus/TestsCompilationFilterMenu.java
Normal file
30
src/_VisualDVM/Visual/Menus/TestsCompilationFilterMenu.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionListener;
|
||||
public class TestsCompilationFilterMenu extends StyledPopupMenu {
|
||||
public void CreateStateItem(TaskState state, ActionListener listener){
|
||||
JMenuItem m = new VisualiserMenuItem(state.getDescription());
|
||||
m.addActionListener(listener);
|
||||
add(m);
|
||||
}
|
||||
public TestsCompilationFilterMenu(){
|
||||
for (TaskState taskState: TaskState.values()){
|
||||
switch (taskState){
|
||||
case Queued:
|
||||
case FailedToQueue:
|
||||
case NoSuchTask:
|
||||
case AbortingByUser:
|
||||
break;
|
||||
case Waiting:
|
||||
CreateStateItem(taskState, e -> {
|
||||
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
26
src/_VisualDVM/Visual/Menus/TypesSubmenu.java
Normal file
26
src/_VisualDVM/Visual/Menus/TypesSubmenu.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import ProjectData.Files.FileType;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
public abstract class TypesSubmenu extends VisualiserMenu {
|
||||
public TypesSubmenu() {
|
||||
this("Тип");
|
||||
}
|
||||
public TypesSubmenu(String text) {
|
||||
super(text, "/icons/type.png", true);
|
||||
for (FileType fileType : FileType.values()) {
|
||||
if (fileType != FileType.forbidden) {
|
||||
JMenuItem m = new StableMenuItem(fileType.getDescription());
|
||||
m.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
action(fileType);
|
||||
}
|
||||
});
|
||||
add(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
public abstract void action(FileType fileType);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package _VisualDVM.Visual.Menus.VariantsMenuBar;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class VariantsMenuBar extends DataMenuBar {
|
||||
public VariantsMenuBar() {
|
||||
super("варианты");
|
||||
addPasses(PassCode_2021.ShowAllParallelVariants, PassCode_2021.ShowParallelVariantsCoverage,
|
||||
PassCode_2021.PredictParallelVariants, PassCode_2021.CreateParallelVariants);
|
||||
}
|
||||
}
|
||||
53
src/_VisualDVM/Visual/Menus/VersionsMenu.java
Normal file
53
src/_VisualDVM/Visual/Menus/VersionsMenu.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Trees.DataTree;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class VersionsMenu extends GraphMenu<DataTree> {
|
||||
VisualiserMenuItem m_select_all;
|
||||
VisualiserMenuItem m_unselect_all;
|
||||
VisualiserMenuItem m_multiselection;
|
||||
public VersionsMenu(DataTree tree) {
|
||||
super(tree, "подверсии");
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteSubversions).createMenuItem());
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteLonelyM).createMenuItem());
|
||||
addSeparator();
|
||||
m_multiselection = new VisualiserMenuItem("Массовый режим работы с версиями");
|
||||
m_multiselection.setIcon(CommonUtils.getIcon(Global.versions_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
m_multiselection.addActionListener(e -> {
|
||||
Global.versions_multiselection = !Global.versions_multiselection;
|
||||
m_multiselection.setIcon(CommonUtils.getIcon(Global.versions_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
Current.getRoot().SelectAllVersions(false);
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().updateUI();
|
||||
});
|
||||
add(m_multiselection);
|
||||
addSeparator();
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteVersion).createMenuItem());
|
||||
//-
|
||||
m_select_all = new StableMenuItem("Выбрать всё, кроме резервных копий","/icons/SelectAll.png");
|
||||
m_select_all.addActionListener(e -> {
|
||||
Current.getRoot().SelectAllVersions(true);
|
||||
tree.updateUI();
|
||||
});
|
||||
add(m_select_all);
|
||||
m_unselect_all = new StableMenuItem("Отменить всё","/icons/UnselectAll.png");
|
||||
m_unselect_all.addActionListener(e -> {
|
||||
Current.getRoot().SelectAllVersions(false);
|
||||
tree.updateUI();
|
||||
});
|
||||
add(m_unselect_all);
|
||||
add(Pass_2021.passes.get(PassCode_2021.DeleteSelectedVersions).createMenuItem());
|
||||
}
|
||||
@Override
|
||||
public void CheckElementsVisibility() {
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteSelectedVersions).setControlsVisible(!Global.versions_multiselection);
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteSelectedVersions).setControlsVisible(Global.versions_multiselection);
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteVersion).setControlsVisible(!Global.versions_multiselection);
|
||||
m_select_all.setVisible(Global.versions_multiselection);
|
||||
m_unselect_all.setVisible(Global.versions_multiselection);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.Visual.Menus.VersionsMenuBar;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class VersionsMenuBar extends VisualiserMenuBar {
|
||||
public VersionsMenuBar(){
|
||||
addPasses(PassCode_2021.CreateTestsGroupFromSelectedVersions);
|
||||
}
|
||||
}
|
||||
27
src/_VisualDVM/Visual/Menus/VisualiserMenu.java
Normal file
27
src/_VisualDVM/Visual/Menus/VisualiserMenu.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class VisualiserMenu extends JMenu {
|
||||
public VisualiserMenu(String text, String iconPath, boolean textVisible) {
|
||||
setMinimumSize(new Dimension(38, 30)); //иначе сужаются вертикально.
|
||||
setToolTipText(text);
|
||||
if (textVisible)
|
||||
setText(text);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
if (!iconPath.isEmpty())
|
||||
setIcon(CommonUtils.getIcon(iconPath));
|
||||
}
|
||||
public VisualiserMenu(String text, String iconPath) {
|
||||
this(text, iconPath, false);
|
||||
}
|
||||
public void addPasses(PassCode_2021... codes) {
|
||||
for (PassCode_2021 code : codes)
|
||||
add(Pass_2021.passes.get(code).createMenuItem());
|
||||
}
|
||||
}
|
||||
49
src/_VisualDVM/Visual/Menus/VisualiserMenuBar.java
Normal file
49
src/_VisualDVM/Visual/Menus/VisualiserMenuBar.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package _VisualDVM.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
//https://java-online.ru/swing-menu.xhtml
|
||||
public class VisualiserMenuBar extends JToolBar {
|
||||
public VisualiserMenuBar() {
|
||||
setFloatable(false);
|
||||
setSizeLimits();
|
||||
}
|
||||
public void addPasses(PassCode_2021... codes) {
|
||||
//- кнопки. связать их с проходами. (!)
|
||||
for (PassCode_2021 code : codes)
|
||||
add(Pass_2021.passes.get(code).createButton());
|
||||
}
|
||||
public JMenuBar addMenus(JMenu... menus) {
|
||||
JMenuBar bar = new JMenuBar() {
|
||||
{
|
||||
for (JMenu menu : menus)
|
||||
add(menu);
|
||||
}
|
||||
};
|
||||
add(bar);
|
||||
return bar;
|
||||
}
|
||||
public JLabel addLabel(String text_in) {
|
||||
return addLabel(text_in, null);
|
||||
}
|
||||
public JLabel addLabel(String text_in, String icon_path_in) {
|
||||
JLabel res = new JLabel(text_in) {
|
||||
{
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
if (icon_path_in != null) {
|
||||
setIcon(CommonUtils.getIcon(icon_path_in));
|
||||
}
|
||||
}
|
||||
};
|
||||
add(res);
|
||||
return res;
|
||||
}
|
||||
public void setSizeLimits() {
|
||||
setPreferredSize(new Dimension(0, 30));
|
||||
}
|
||||
}
|
||||
305
src/_VisualDVM/Visual/UI.java
Normal file
305
src/_VisualDVM/Visual/UI.java
Normal file
@@ -0,0 +1,305 @@
|
||||
package _VisualDVM.Visual;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Visual.Menus.CredentialsBar.CredentialsBar;
|
||||
import _VisualDVM.Visual.Menus.FastAccessMenuBar.FastAccessMenuBar;
|
||||
import _VisualDVM.Visual.Menus.FileMenuBar.FileMenuBar;
|
||||
import _VisualDVM.Visual.Menus.MainMenuBar.MainMenuBar;
|
||||
import _VisualDVM.Visual.Menus.MainMenuBar.MainWindow;
|
||||
import _VisualDVM.Visual.Menus.VariantsMenuBar.VariantsMenuBar;
|
||||
import _VisualDVM.Visual.Menus.VersionsMenuBar.VersionsMenuBar;
|
||||
import Common.Visual.Tables.*;
|
||||
import Common.Visual.Trees.GraphTreeCellRenderer;
|
||||
import Common.Visual.Trees.SelectionTreeCellRenderer;
|
||||
import _VisualDVM.Visual.Windows.SearchReplaceForm;
|
||||
import GlobalData.Compiler.CompilersDBTable;
|
||||
import GlobalData.Compiler.CompilersMenuBar;
|
||||
import GlobalData.CompilerEnvironment.UI.CompilerEnvironmentValueEditor;
|
||||
import GlobalData.CompilerEnvironment.UI.CompilerEnvironmentValueRenderer;
|
||||
import GlobalData.CompilerOption.UI.CompilerOptionParameterNameRenderer;
|
||||
import GlobalData.CompilerOption.UI.CompilerOptionParameterValueEditor;
|
||||
import GlobalData.CompilerOption.UI.CompilerOptionParameterValueRenderer;
|
||||
import GlobalData.DVMParameter.DVMParameterDBTable;
|
||||
import GlobalData.DVMParameter.DVMParametersMenuBar;
|
||||
import GlobalData.EnvironmentValue.EnvironmentValuesDBTable;
|
||||
import GlobalData.EnvironmentValue.EnvironmentValuesMenuBar;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import GlobalData.Machine.MachinesDBTable;
|
||||
import GlobalData.Machine.MachinesMenuBar;
|
||||
import GlobalData.Makefile.MakefilesDBTable;
|
||||
import GlobalData.Makefile.MakefilesMenuBar;
|
||||
import GlobalData.Module.ModulesDBTable;
|
||||
import GlobalData.Module.ModulesMenuBar;
|
||||
import GlobalData.RemoteFile.UI.RemoteFileChooser;
|
||||
import GlobalData.RemoteFile.UI.RemoteFileRenderer;
|
||||
import GlobalData.RunConfiguration.RunConfigurationsDBTable;
|
||||
import GlobalData.RunConfiguration.RunConfigurationsMenuBar;
|
||||
import GlobalData.SapforProfile.SapforProfilesDBTable;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import GlobalData.Tasks.CompilationTask.CompilationTasksDBTable;
|
||||
import GlobalData.Tasks.RunTask.RunTasksDBTable;
|
||||
import GlobalData.User.UsersDBTable;
|
||||
import GlobalData.User.UsersMenuBar;
|
||||
import ProjectData.DBArray.ArraysDBTable;
|
||||
import ProjectData.Files.UI.FilesTreeCellRenderer;
|
||||
import ProjectData.Project.UI.VersionsTreeCellRenderer;
|
||||
import ProjectData.SapforData.Arrays.ArraysSet;
|
||||
import ProjectData.SapforData.Arrays.UI.DimensionRenderer;
|
||||
import ProjectData.SapforData.Arrays.UI.DimensionStateChanger;
|
||||
import ProjectData.SapforData.Arrays.UI.RulesTreeCellRenderer;
|
||||
import ProjectData.SapforData.Regions.RegionsSet;
|
||||
import ProjectData.SapforData.Variants.UI.VariantRankRenderer;
|
||||
import ProjectData.SapforData.Variants.VariantsSet;
|
||||
import Repository.BugReport.BugReportsDBTable;
|
||||
import Repository.BugReport.BugReportsMenuBar;
|
||||
import Repository.Component.UI.ComponentsForm;
|
||||
import Repository.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||
import Repository.SubscriberWorkspace.SubscriberWorkspacesMenuBar;
|
||||
import Repository.Subscribes.SubscribersMenuBar;
|
||||
import Repository.Subscribes.SubsribersDBTable;
|
||||
import TestingSystem.Common.Group.GroupsDBTable;
|
||||
import TestingSystem.Common.Group.GroupsMenuBar;
|
||||
import TestingSystem.Common.Test.TestDBTable;
|
||||
import TestingSystem.Common.Test.TestsMenuBar;
|
||||
import TestingSystem.Common.TestingBar;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfigurationDBTable;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfigurationsMenuBar;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackageDBTable;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackagesBar;
|
||||
import TestingSystem.DVM.DVMSettings.DVMSettingsDBTable;
|
||||
import TestingSystem.DVM.DVMSettings.UI.DVMSettingsBar;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTasksBar;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTasksSet;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationDBTable;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationsMenuBar;
|
||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
|
||||
import TestingSystem.SAPFOR.SapforSettings.SapforSettingsBar;
|
||||
import TestingSystem.SAPFOR.SapforSettings.SapforSettingsDBTable;
|
||||
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommandsBar;
|
||||
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommandsDBTable;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforPackagesBar;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforVersionsTreeCellRenderer;
|
||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsBar;
|
||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import _VisualDVM.Visual.Interface.DebugWindow;
|
||||
import _VisualDVM.Visual.Interface.VersionsWindow;
|
||||
import Visual_DVM_2021.UI.Main.DebugForm;
|
||||
import Visual_DVM_2021.UI.Main.MainForm;
|
||||
import Visual_DVM_2021.UI.Main.ProfilesForm;
|
||||
import Visual_DVM_2021.UI.Main.VersionsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
import javax.swing.text.DefaultHighlighter;
|
||||
import javax.swing.text.Highlighter;
|
||||
import javax.swing.tree.TreeCellRenderer;
|
||||
import java.awt.*;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import static Common.Visual.Tables.TableEditors.*;
|
||||
import static Common.Visual.Tables.TableRenderers.*;
|
||||
import static Common.Visual.Trees.TreeRenderers.*;
|
||||
public class UI {
|
||||
public static MainMenuBar mainMenuBar = null;
|
||||
public static TestingBar testingBar = null;
|
||||
public static CredentialsBar credentialsBar = null;
|
||||
public static FileMenuBar fileMenuBar = null;
|
||||
public static VersionsMenuBar versionsMenuBar = null;
|
||||
public static FastAccessMenuBar fastAccessMenuBar = null;
|
||||
//ФОРМЫ
|
||||
static MainWindow mainWindow = null;
|
||||
static ComponentsForm componentsWindow = null;
|
||||
static SearchReplaceForm searchReplaceWindow = null;
|
||||
static ProfilesForm profilesWindow = null;
|
||||
static VersionsWindow versionsWindow = null;
|
||||
static DebugWindow debugWindow = null;
|
||||
static RemoteFileChooser remoteFileChooser = null;
|
||||
//------------
|
||||
public static final Highlighter.HighlightPainter GoodLoopPainter = new DefaultHighlighter.DefaultHighlightPainter(new Color(152, 251, 152, 90));
|
||||
public static final Highlighter.HighlightPainter BadLoopPainter = new DefaultHighlighter.DefaultHighlightPainter(new Color(240, 128, 128, 90));
|
||||
public static LinkedHashMap<Common.Visual.Tables.TableRenderers, TableCellRenderer> TableRenderers = new LinkedHashMap<>();
|
||||
public static LinkedHashMap<Common.Visual.Tables.TableEditors, TableCellEditor> TableEditors = new LinkedHashMap<>();
|
||||
public static LinkedHashMap<Common.Visual.Trees.TreeRenderers, TreeCellRenderer> TreeRenderers = new LinkedHashMap<>();
|
||||
public static boolean HasMainWindow() {
|
||||
return mainWindow != null;
|
||||
}
|
||||
public static void CreateMenus() {
|
||||
mainMenuBar = new MainMenuBar();
|
||||
testingBar = new TestingBar();
|
||||
credentialsBar = new CredentialsBar();
|
||||
versionsMenuBar = new VersionsMenuBar();
|
||||
fastAccessMenuBar = new FastAccessMenuBar();
|
||||
//---------------------------------------------------->>
|
||||
CommonUI.menuBars.put(BugReportsDBTable.class, new BugReportsMenuBar());
|
||||
CommonUI.menuBars.put(SubscriberWorkspaceDBTable.class, new SubscriberWorkspacesMenuBar());
|
||||
//---------------------------------------------------->>
|
||||
CommonUI.menuBars.put(GroupsDBTable.class, new GroupsMenuBar());
|
||||
CommonUI.menuBars.put(TestDBTable.class, new TestsMenuBar());
|
||||
CommonUI.menuBars.put(DVMConfigurationDBTable.class, new DVMConfigurationsMenuBar());
|
||||
CommonUI.menuBars.put(DVMPackageDBTable.class, new DVMPackagesBar());
|
||||
CommonUI.menuBars.put(SapforPackageDBTable.class, new SapforPackagesBar());
|
||||
CommonUI.menuBars.put(DVMRunTasksSet.class, new DVMRunTasksBar());
|
||||
//--->>>
|
||||
CommonUI.menuBars.put(MachinesDBTable.class, new MachinesMenuBar());
|
||||
CommonUI.menuBars.put(UsersDBTable.class, new UsersMenuBar());
|
||||
CommonUI.menuBars.put(CompilersDBTable.class, new CompilersMenuBar());
|
||||
CommonUI.menuBars.put(MakefilesDBTable.class, new MakefilesMenuBar());
|
||||
CommonUI.menuBars.put(ModulesDBTable.class, new ModulesMenuBar());
|
||||
CommonUI.menuBars.put(RunConfigurationsDBTable.class, new RunConfigurationsMenuBar());
|
||||
CommonUI.menuBars.put(EnvironmentValuesDBTable.class, new EnvironmentValuesMenuBar());
|
||||
CommonUI.menuBars.put(DVMParameterDBTable.class, new DVMParametersMenuBar());
|
||||
CommonUI.menuBars.put(CompilationTasksDBTable.class, new DataMenuBar("задачи на компиляцию"));
|
||||
CommonUI.menuBars.put(RunTasksDBTable.class, new DataMenuBar("задачи на запуск"));
|
||||
//---->>
|
||||
CommonUI.menuBars.put(SapforConfigurationDBTable.class, new SapforConfigurationsMenuBar());
|
||||
//---->>
|
||||
CommonUI.menuBars.put(RegionsSet.class, new DataMenuBar("области распараллеливания"));
|
||||
CommonUI.menuBars.put(ArraysSet.class, new DataMenuBar("массивы"));
|
||||
CommonUI.menuBars.put(ArraysDBTable.class, new DataMenuBar("сохранённые состояния") {
|
||||
@Override
|
||||
public void createSelectionButtons(DataSet dataSet) {
|
||||
//не нужны.
|
||||
}
|
||||
});
|
||||
CommonUI.menuBars.put(VariantsSet.class, new VariantsMenuBar());
|
||||
CommonUI.menuBars.put(SubsribersDBTable.class, new SubscribersMenuBar());
|
||||
CommonUI.menuBars.put(SapforProfilesDBTable.class, new DataMenuBar("профили", PassCode_2021.SaveProfile, PassCode_2021.EditProfile, PassCode_2021.ApplyProfile, PassCode_2021.DeleteProfile));
|
||||
CommonUI.menuBars.put(ServerSapforsDBTable.class, new ServerSapforsBar());
|
||||
CommonUI.menuBars.put(SapforSettingsDBTable.class, new SapforSettingsBar());
|
||||
CommonUI.menuBars.put(SapforSettingsCommandsDBTable.class, new SapforSettingsCommandsBar());
|
||||
CommonUI.menuBars.put(DVMSettingsDBTable.class, new DVMSettingsBar());
|
||||
//---->>
|
||||
}
|
||||
public static void CreateWindows() {
|
||||
searchReplaceWindow = new SearchReplaceForm();
|
||||
remoteFileChooser = new RemoteFileChooser();
|
||||
profilesWindow = new ProfilesForm();
|
||||
mainWindow = new MainForm();
|
||||
//---------------------------------------
|
||||
mainWindow.Show();
|
||||
}
|
||||
//-
|
||||
public static void CreateAll() {
|
||||
//<editor-fold desc="Локализация компонентов окна JFileChooser">
|
||||
UIManager.put("FileChooser.openButtonText", "Открыть");
|
||||
UIManager.put("FileChooser.cancelButtonText", "Отмена");
|
||||
UIManager.put("FileChooser.lookInLabelText", "Смотреть в");
|
||||
UIManager.put("FileChooser.fileNameLabelText", "Имя файла");
|
||||
UIManager.put("FileChooser.filesOfTypeLabelText", "Тип файла");
|
||||
UIManager.put("FileChooser.saveButtonText", "Сохранить");
|
||||
UIManager.put("FileChooser.saveButtonToolTipText", "Сохранить");
|
||||
UIManager.put("FileChooser.openButtonToolTipText", "Открыть");
|
||||
UIManager.put("FileChooser.cancelButtonText", "Отмена");
|
||||
UIManager.put("FileChooser.cancelButtonToolTipText", "Отмена");
|
||||
UIManager.put("FileChooser.lookInLabelText", "Папка");
|
||||
UIManager.put("FileChooser.saveInLabelText", "Папка");
|
||||
UIManager.put("FileChooser.fileNameLabelText", "Имя файла");
|
||||
UIManager.put("FileChooser.filesOfTypeLabelText", "Тип файлов");
|
||||
UIManager.put("FileChooser.upFolderToolTipText", "На один уровень вверх");
|
||||
UIManager.put("FileChooser.newFolderToolTipText", "Создание новой папки");
|
||||
UIManager.put("FileChooser.listViewButtonToolTipText", "Список");
|
||||
UIManager.put("FileChooser.detailsViewButtonToolTipText", "Таблица");
|
||||
UIManager.put("FileChooser.fileNameHeaderText", "Имя");
|
||||
UIManager.put("FileChooser.fileSizeHeaderText", "Размер");
|
||||
UIManager.put("FileChooser.fileTypeHeaderText", "Тип");
|
||||
UIManager.put("FileChooser.fileDateHeaderText", "Изменен");
|
||||
UIManager.put("FileChooser.fileAttrHeaderText", "Атрибуты");
|
||||
UIManager.put("FileChooser.acceptAllFileFilterText", "Все файлы");
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Локализация компонентов окна подтверждения">
|
||||
UIManager.put("OptionPane.yesButtonText", "Да");
|
||||
UIManager.put("OptionPane.noButtonText", "Нет");
|
||||
UIManager.put("OptionPane.cancelButtonText", "Отмена");
|
||||
UIManager.put("OptionPane.okButtonText", "Готово");
|
||||
//</editor-fold>
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Объекты отрисовки и редактирования деревьев и таблиц">
|
||||
TableRenderers.put(RendererDate, new DateRenderer_());
|
||||
TableRenderers.put(RendererProgress, new ProgressBarRenderer());
|
||||
TableRenderers.put(RendererSelect, new DBObjectSelectionRenderer());
|
||||
TableRenderers.put(RendererDimension, new DimensionRenderer());
|
||||
TableRenderers.put(RendererMultiline, new MultilineRenderer());
|
||||
TableRenderers.put(RendererHyperlinks, new HyperlinksRenderer());
|
||||
TableRenderers.put(RendererTopLeft, new TopLeftRenderer());
|
||||
TableRenderers.put(RendererMaskedInt, new MaskedIntegerValueRenderer());
|
||||
TableRenderers.put(RendererVariantRank, new VariantRankRenderer());
|
||||
TableRenderers.put(RendererHiddenList, new HiddenListRenderer());
|
||||
TableRenderers.put(RendererWrapText, new WrapTextRenderer());
|
||||
TableRenderers.put(RendererCompilerOptionParameterValue, new CompilerOptionParameterValueRenderer());
|
||||
TableRenderers.put(RendererCompilerOptionParameterName, new CompilerOptionParameterNameRenderer());
|
||||
TableRenderers.put(RendererCompilerEnvironmentValue, new CompilerEnvironmentValueRenderer());
|
||||
TableRenderers.put(RendererStatusEnum, new StatusEnumRenderer());
|
||||
TableRenderers.put(RendererAutoConfiguration, new ConfigurationAutoRenderer());
|
||||
//---------------------------------------------
|
||||
TreeRenderers.put(RendererGraph, new GraphTreeCellRenderer());
|
||||
TreeRenderers.put(RendererRemoteFile, new RemoteFileRenderer());
|
||||
TreeRenderers.put(RendererFile, new FilesTreeCellRenderer());
|
||||
TreeRenderers.put(RendererVersion, new VersionsTreeCellRenderer());
|
||||
TreeRenderers.put(RendererSapforVersion, new SapforVersionsTreeCellRenderer());
|
||||
TreeRenderers.put(RendererRule, new RulesTreeCellRenderer());
|
||||
TreeRenderers.put(RendererSelection, new SelectionTreeCellRenderer());
|
||||
//----------------------------------------------
|
||||
TableEditors.put(EditorSelect, new DBObjectSelector());
|
||||
TableEditors.put(EditorHyperlinks, new VectorEditor());
|
||||
TableEditors.put(EditorDimension, new DimensionStateChanger());
|
||||
TableEditors.put(EditorCompilerOptionParameterValue, new CompilerOptionParameterValueEditor());
|
||||
TableEditors.put(EditorCompilerEnvironmentValue, new CompilerEnvironmentValueEditor());
|
||||
TableEditors.put(EditorAutoConfiguration, new ConfigurationAutoSwitcher());
|
||||
//</editor-fold>
|
||||
}
|
||||
public static void CreateComponentsForm() {
|
||||
componentsWindow = new ComponentsForm();
|
||||
}
|
||||
//-----
|
||||
public static void ShowTabsNames(JTabbedPane tabs) {
|
||||
ShowTabsNames(tabs, 0);
|
||||
}
|
||||
public static void ShowTabsNames(JTabbedPane tabs, int startIndex) {
|
||||
boolean flag = ((GlobalDatabase) CommonUtils.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
|
||||
for (int i = startIndex; i < tabs.getTabCount(); ++i)
|
||||
tabs.setTitleAt(i, flag ? tabs.getToolTipTextAt(i) : "");
|
||||
}
|
||||
public static void CreateVersionsWindow() {
|
||||
versionsWindow = new VersionsForm(Current.getRoot());
|
||||
}
|
||||
//-
|
||||
public static void ShowSearchForm(boolean replace) {
|
||||
searchReplaceWindow.setMode(replace);
|
||||
searchReplaceWindow.ShowMode();
|
||||
ShowSearchForm();
|
||||
}
|
||||
public static void HideSearchForm() {
|
||||
if (searchReplaceWindow.isVisible())
|
||||
searchReplaceWindow.setVisible(false);
|
||||
}
|
||||
public static void ShowSearchForm() {
|
||||
if (searchReplaceWindow.isVisible())
|
||||
searchReplaceWindow.Refresh();
|
||||
else
|
||||
searchReplaceWindow.Show();
|
||||
}
|
||||
public static void ShowComponentsWindow() {
|
||||
componentsWindow.ShowDialog("");
|
||||
}
|
||||
public static void ShowProfilesWindow() {
|
||||
profilesWindow.ShowDialog("");
|
||||
}
|
||||
//----
|
||||
public static MainWindow getMainWindow(){return mainWindow;}
|
||||
public static VersionsWindow getVersionsWindow(){return versionsWindow;}
|
||||
public static ComponentsForm getComponentsWindow(){return componentsWindow;}
|
||||
public static SearchReplaceForm getSearchReplaceWindow(){return searchReplaceWindow;}
|
||||
public static ProfilesForm getProfilesWindow(){return profilesWindow;}
|
||||
public static RemoteFileChooser getRemoteFileChooser(){return remoteFileChooser;}
|
||||
//возможно перекинуть на тестирование. потом.
|
||||
public static DebugWindow getDebugWindow() {
|
||||
if (debugWindow == null)
|
||||
debugWindow = new DebugForm();
|
||||
return debugWindow;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser_;
|
||||
import Common_old.Constants;
|
||||
import _VisualDVM.Constants;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
||||
@@ -2,10 +2,10 @@ package _VisualDVM.Visual.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Windows.Form;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Trees.StyledTree;
|
||||
import Common_old.UI.UI;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import javafx.util.Pair;
|
||||
|
||||
Reference in New Issue
Block a user