упорядочил папки с кодом.

This commit is contained in:
2023-11-19 01:53:56 +03:00
parent 4883b4af51
commit 44c6daffa3
596 changed files with 2140 additions and 1569 deletions

View File

@@ -1,8 +1,8 @@
package Common.UI.Menus;
import Common.Current;
import Common.Global;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -9,8 +9,8 @@ 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 Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import javax.swing.*;

View File

@@ -2,8 +2,8 @@ package Common.UI.Menus;
import Common.Current;
import Common.UI.Themes.VisualiserFonts;
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
public class PassesSubMenu extends JMenu {

View File

@@ -11,8 +11,8 @@ import Common.Utils.Utils;
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 Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -5,8 +5,8 @@ import Common.UI.Menus_2023.StableMenuItem;
import Common.UI.Trees.DataTree;
import Common.UI.UI;
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
public class VersionsMenu extends GraphMenu<DataTree> {
VisualiserMenuItem m_select_all;
VisualiserMenuItem m_unselect_all;

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.BugReportsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class BugReportsMenuBar extends DataMenuBar {
public BugReportsMenuBar() {
super("отчёты об ошибках",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.CompilersMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class CompilersMenuBar extends DataMenuBar {
public CompilersMenuBar() {
super("компиляторы",

View File

@@ -3,8 +3,8 @@ import Common.Current;
import Common.UI.Menus_2023.DataMenuBar;
import Common.UI.Menus_2023.VisualiserMenu;
import Common.UI.Themes.VisualiserFonts;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
public class ComponentsMenuBar extends DataMenuBar {
public ComponentsMenuBar() {
super("компоненты");

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.ConfigurationsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class ConfigurationsMenuBar extends DataMenuBar {
public ConfigurationsMenuBar() {
super("конфигурации");

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.DVMParametersMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class DVMParametersMenuBar extends DataMenuBar {
public DVMParametersMenuBar() {
super("параметры",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023;
import Common.Database.DataSet;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.EnvironmentValuesMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class EnvironmentValuesMenuBar extends DataMenuBar {
public EnvironmentValuesMenuBar() {
super("переменные окружения", PassCode_2021.AddEnvironmentValue,

View File

@@ -3,8 +3,8 @@ import Common.Global;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI;
import GlobalData.Settings.SettingName;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -3,7 +3,7 @@ import Common.UI.Menus_2023.MenuBarButton;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI;
import ProjectData.Files.UI.Editor.SPFEditor;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -3,8 +3,8 @@ import Common.Global;
import Common.UI.Menus_2023.DataMenuBar;
import Common.UI.Menus_2023.MenuBarButton;
import Common.Utils.Utils;
import TestingSystem.Common.Group.GroupsDBTable;
import Visual_DVM_2021.Passes.PassCode_2021;
import Repository.TestingSystem.Common.Group.GroupsDBTable;
import Common.Passes.PassCode_2021;
import javax.swing.*;
public class GroupsMenuBar extends DataMenuBar {

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.MachinesMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class MachinesMenuBar extends DataMenuBar {
public MachinesMenuBar() {
super("машины",

View File

@@ -1,8 +1,8 @@
package Common.UI.Menus_2023.MainMenuBar;
import Common.UI.Menus_2023.VisualiserMenu;
import Repository.Component.Sapfor.Sapfor;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Repository.ComponentsServer.Component.Sapfor.Sapfor;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
public class AnalysesMenu extends VisualiserMenu {
public AnalysesMenu() {
super("Анализаторы","/icons/Analyses.png" );

View File

@@ -1,7 +1,7 @@
package Common.UI.Menus_2023.MainMenuBar;
import Common.UI.Menus_2023.VisualiserMenu;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
public class GlobalCleaningMenu extends VisualiserMenu {
public GlobalCleaningMenu() {
super("Очистка", "/icons/Clean.png", false);

View File

@@ -4,8 +4,8 @@ import Common.UI.Menus.VisualiserMenuItem;
import Common.UI.Menus_2023.VisualiserMenu;
import GlobalData.DBLastProject.DBLastProject;
import GlobalData.Settings.SettingName;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
import javax.swing.event.MenuEvent;

View File

@@ -3,9 +3,9 @@ import Common.Global;
import Common.UI.Menus_2023.MenuBarButton;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI;
import Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Repository.ComponentsServer.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,5 +1,5 @@
package Common.UI.Menus_2023.MainMenuBar;
import Visual_DVM_2021.UI.Interface.*;
import Common.UI.Windows.Interface.*;
public interface MainWindow {
void Show();
void ShowProject();

View File

@@ -1,9 +1,9 @@
package Common.UI.Menus_2023.MainMenuBar;
import Common.UI.Menus.PassesSubMenu;
import Common.UI.Menus_2023.VisualiserMenu;
import Repository.Component.Sapfor.Sapfor;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Repository.ComponentsServer.Component.Sapfor.Sapfor;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
public class TransformationsMenu extends VisualiserMenu {
public TransformationsMenu() {
super("Преобразования", "/icons/Transformations.png");

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.MakefilesMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class MakefilesMenuBar extends DataMenuBar {
public MakefilesMenuBar() {
super("мейкфайлы",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.ModulesMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class ModulesMenuBar extends DataMenuBar {
public ModulesMenuBar() {
super("языковые модули", PassCode_2021.EditModule);

View File

@@ -1,5 +1,5 @@
package Common.UI.Menus_2023;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.Pass_2021;
import java.awt.*;
public class PassButton extends MenuBarButton implements PassControl {

View File

@@ -1,7 +1,7 @@
package Common.UI.Menus_2023;
import Common.UI.Menus.VisualiserMenuItem;
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.Pass_2021;
public class PassMenuItem extends VisualiserMenuItem implements PassControl {
@Override
public void setIcon(String icon_path) {

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.RunConfigurationsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
import javax.swing.*;
public class RunConfigurationsMenuBar extends DataMenuBar {

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.SapforConfigurationCommandsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class SapforConfigurationCommandsMenuBar extends DataMenuBar {
public SapforConfigurationCommandsMenuBar() {
super("команды",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.SapforConfigurationsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class SapforConfigurationsMenuBar extends DataMenuBar {
public SapforConfigurationsMenuBar() {
super("конфигурации", PassCode_2021.StartSapforTests,

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.SapforTasksPackagesBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class SapforTasksPackagesBar extends DataMenuBar {
public SapforTasksPackagesBar() {
super("пакеты задач",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.ServerSapforsBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class ServerSapforsBar extends DataMenuBar {
public ServerSapforsBar() {
super("версии SAPFOR", PassCode_2021.InstallServerSapfor, PassCode_2021.DeleteServerSapfor);

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023;
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.Pass_2021;
public class StablePassMenuItem extends StableMenuItem implements PassControl {
@Override
public void setIcon(String icon_path) {

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.SubscribersMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class SubscribersMenuBar extends DataMenuBar {
public SubscribersMenuBar() {
super("Адресаты",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.TasksPackagesMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class TasksPackagesMenuBar extends DataMenuBar {
public TasksPackagesMenuBar() {
super("пакеты задач", PassCode_2021.AbortSelectedPackages);

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.TestRunTasksMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
import javax.swing.*;
public class TestRunTasksMenuBar extends DataMenuBar {

View File

@@ -6,8 +6,8 @@ import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.Themes.VisualiserFonts;
import Common.UI.UI;
import Common.Utils.Utils;
import TestingSystem.Common.TestingServer;
import Visual_DVM_2021.Passes.PassCode_2021;
import Repository.TestingSystem.Common.TestingServer;
import Common.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.TestsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class TestsMenuBar extends DataMenuBar {
public TestsMenuBar() {
super("тесты",

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.UsersMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class UsersMenuBar extends DataMenuBar {
public UsersMenuBar() {
super("пользователи", PassCode_2021.AddUser,

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.VariantsMenuBar;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class VariantsMenuBar extends DataMenuBar {
public VariantsMenuBar() {
super("варианты");

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023.VersionsMenuBar;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Common.Passes.PassCode_2021;
public class VersionsMenuBar extends VisualiserMenuBar {
public VersionsMenuBar(){
addPasses(PassCode_2021.CreateTestsGroupFromSelectedVersions);

View File

@@ -1,6 +1,6 @@
package Common.UI.Menus_2023;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import javax.swing.*;
import java.awt.*;

View File

@@ -57,7 +57,7 @@ import GlobalData.Tasks.RunTask.RunTasksDBTable;
import GlobalData.User.UsersDBTable;
import ProjectData.DBArray.ArraysDBTable;
import ProjectData.Files.UI.FilesTreeCellRenderer;
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforVersionsTreeCellRenderer;
import Repository.TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforVersionsTreeCellRenderer;
import ProjectData.Project.UI.VersionsTreeCellRenderer;
import ProjectData.SapforData.Arrays.ArraysSet;
import ProjectData.SapforData.Arrays.UI.DimensionRenderer;
@@ -66,23 +66,23 @@ 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.Component.UI.ComponentsForm;
import Repository.Subscribes.SubsribersDBTable;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationDBTable;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
import TestingSystem.SAPFOR.SapforTask.SapforTasksDBTable;
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackagesDBTable;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
import TestingSystem.DVM.Configuration.UI.ConfigurationDBTable;
import TestingSystem.Common.Group.GroupsDBTable;
import TestingSystem.DVM.Tasks.TestRunTasksDBTable;
import TestingSystem.DVM.TasksPackage.TasksPackageDBTable;
import TestingSystem.Common.Test.TestDBTable;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.UI.Interface.DebugWindow;
import Visual_DVM_2021.UI.Interface.VersionsWindow;
import Visual_DVM_2021.UI.Main.*;
import Repository.ComponentsServer.Component.BugReport.BugReportsDBTable;
import Repository.ComponentsServer.Component.UI.ComponentsForm;
import Repository.ComponentsServer.Subscribes.SubsribersDBTable;
import Repository.TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationDBTable;
import Repository.TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
import Repository.TestingSystem.SAPFOR.SapforTask.SapforTasksDBTable;
import Repository.TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackagesDBTable;
import Repository.TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
import Repository.TestingSystem.DVM.Configuration.UI.ConfigurationDBTable;
import Repository.TestingSystem.Common.Group.GroupsDBTable;
import Repository.TestingSystem.DVM.Tasks.TestRunTasksDBTable;
import Repository.TestingSystem.DVM.TasksPackage.TasksPackageDBTable;
import Repository.TestingSystem.Common.Test.TestDBTable;
import Common.Passes.PassCode_2021;
import Common.UI.Windows.Interface.DebugWindow;
import Common.UI.Windows.Interface.VersionsWindow;
import Common.UI.Windows.Main.*;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;

View File

@@ -0,0 +1,13 @@
package Common.UI.Windows.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();
}

View File

@@ -0,0 +1,5 @@
package Common.UI.Windows.Interface;
public interface ArraysWindow extends VisualizerForm, FormWithSplitters{
void ShowArrays();
void ShowNoArrays();
}

View File

@@ -0,0 +1,28 @@
package Common.UI.Windows.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();
}

View File

@@ -0,0 +1,6 @@
package Common.UI.Windows.Interface;
import javax.swing.*;
public interface CommentInterface extends VisualizerForm, FormWithSplitters {
void setEditorScroll(JScrollPane scroll_in);
void setAdditionScroll(JScrollPane scroll_in);
}

View File

@@ -0,0 +1,7 @@
package Common.UI.Windows.Interface;
import javax.swing.*;
public interface CredentialsWindow {
JPanel getContent();
void ShowAll();
void RestoreLastCredentials();
}

View File

@@ -0,0 +1,13 @@
package Common.UI.Windows.Interface;
import javax.swing.*;
public interface DebugWindow {
JPanel getContent();
void ShowAll();
//--
void DropRunTasksComparison();
void DropCompilationTasksComparison();
void ShowLastCompilationTask();
void ShowCurrentRunTask();
void ShowLastRunTask();
void ShowNoCurrentRunTask();
}

View File

@@ -0,0 +1,6 @@
package Common.UI.Windows.Interface;
import javax.swing.*;
public interface DescriptionInterface extends VisualizerForm,FormWithSplitters {
void setEditorScroll(JScrollPane scroll_in);
void setAdditionScroll(JScrollPane scroll_in);
}

View File

@@ -0,0 +1,60 @@
package Common.UI.Windows.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 ShowWarningsCount();
void ShowErrorsCount();
void ShowNotesCount();
void ShowRecommendationsCount();
}

View File

@@ -0,0 +1,7 @@
package Common.UI.Windows.Interface;
public interface FilterWindow extends VisualizerForm {
void ShowMatchesCount(int count);
default void ShowNoMatches() {
ShowMatchesCount(0);
}
}

View File

@@ -0,0 +1,10 @@
package Common.UI.Windows.Interface;
import Common.Global;
public interface FormWithSplitters {
default void LoadSplitters() {
Global.db.splitters.Load(this);
}
default void SaveSplitters() {
Global.db.splitters.Save(this);
}
}

View File

@@ -0,0 +1,11 @@
package Common.UI.Windows.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();
}

View File

@@ -0,0 +1,48 @@
package Common.UI.Windows.Interface;
import Common.Current;
import Common.UI.DebugPrintLevel;
import Common.UI.UI;
import Common.Utils.Utils;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.file.Paths;
import java.util.Date;
public interface Loggable {
String getLogHomePath();
String getLogName();
default File getLogFile() {
return Paths.get(getLogHomePath(), (getLogName() + "_log.txt")).toFile();
}
default void ClearLog() {
try {
Utils.forceDeleteWithCheck(getLogFile());
} catch (Exception ignored) {
}
}
default void Print(String message) {
try {
FileWriter Log = new FileWriter(getLogFile(), true);
String datedMessage = Utils.Brackets(new Date()) + " " + message;
Log.write(datedMessage + "\n");
Log.close();
} catch (Exception ignored) {
}
}
default void Print(DebugPrintLevel level, String message) {
if (level.isEnabled())
Print(Utils.Brackets(level.getDescription()) + " " + message);
}
default void PrintException(Exception ex) {
StringWriter out = new StringWriter();
PrintWriter writer = new PrintWriter(out);
ex.printStackTrace(writer);
writer.flush();
Print(out.toString());
if (Current.hasUI())
UI.Error("Возникло исключение. Подробности в файле журнала\n" +
Utils.Brackets(getLogFile().getAbsolutePath()));
}
}

View File

@@ -0,0 +1,80 @@
package Common.UI.Windows.Interface;
import Common.UI.Trees.TreeForm;
import Common.UI.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();
}

View File

@@ -0,0 +1,16 @@
package Common.UI.Windows.Interface;
public interface SPFEditorInterface {
//-----------------------------------
void ClearHighlights();
//---------------->>
void ClearLoopsHighLights();
void ClearGOCVHighlights();
//----------------->>
void HighlightLoops();
void HighlightGCOV();
//------------------------------------
void gotoLine(int num);
int getCurrentLine();
int getCaretPosition();
String getText();
}

View File

@@ -0,0 +1,7 @@
package Common.UI.Windows.Interface;
public interface ScenariosWindow extends FormWithSplitters, VisualizerForm{
void ShowAll();
void FocusSapforTasksPackages();
void ShowCurrentSapforTasksPackage();
void ShowNoSapforTasksPackage();
}

View File

@@ -0,0 +1,4 @@
package Common.UI.Windows.Interface;
public interface StatisticsWindow extends VisualizerForm{
void ShowAll();
}

View File

@@ -0,0 +1,22 @@
package Common.UI.Windows.Interface;
public interface TestingWindow extends VisualizerForm {
void ShowAll();
//-
void ShowCurrentTestsPackage();
void DropTestRunTasksComparison();
void DropSapforComparison();
void ShowCurrentTestRunTask();
void ShowNoTestRunTask();
//-
void RefreshTabsNames();
void FocusTestingSystem();
void RemountTestTable();
//-
void FocusTestingTasks();
void ShowCurrentSapforPackageVersionEtalon();
void ShowCurrentSapforPackageVersion();
void ShowNoSapforPackageVersionEtalon();
void ShowNoSapforPackageVersion();
void FocusSapforTesting();
}

View File

@@ -0,0 +1,6 @@
package Common.UI.Windows.Interface;
import javax.swing.*;
public interface TestsWindow {
void ShowAll();
JPanel getContent();
}

View File

@@ -0,0 +1,17 @@
package Common.UI.Windows.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();
}

View File

@@ -0,0 +1,13 @@
package Common.UI.Windows.Interface;
import Common.UI.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();
}

View File

@@ -0,0 +1,9 @@
package Common.UI.Windows.Interface;
import javax.swing.*;
public interface VisualizerForm {
//просто некая панель, на которой может быть все что угодно. монтируется на панель родителя,
//при условии что она BorderLayout
default JPanel getContent() {
return null;
}
}

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.AnalysisForm">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="744" height="530"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="da14d" binding="SCX">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<dividerLocation value="250"/>
<dividerSize value="0"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="5d21" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="250"/>
<minimumSize width="-1" height="250"/>
<preferredSize width="-1" height="250"/>
</properties>
<border type="none"/>
<children>
<component id="15930" class="javax.swing.JLabel" binding="l_lines">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/Lines.png"/>
<text value="Label"/>
</properties>
</component>
<component id="63feb" class="javax.swing.JLabel" binding="l_loops">
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Loop.png"/>
<text value="Label"/>
</properties>
</component>
<component id="aa1a6" class="javax.swing.JLabel" binding="l_arrays">
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Arrays.png"/>
<text value=" Label"/>
</properties>
</component>
<component id="a2d2e" class="javax.swing.JLabel" binding="l_functions">
<constraints>
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Function.png"/>
<text value="Label"/>
</properties>
</component>
<component id="6500d" class="javax.swing.JLabel" binding="l_spf_dirs">
<constraints>
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Menu/Privates.png"/>
<text value="Label"/>
</properties>
</component>
<component id="375fa" class="javax.swing.JLabel" binding="l_dvm_dirs">
<constraints>
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Menu/Dvm.png"/>
<text value="Label"/>
</properties>
</component>
<component id="acfc" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="1" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="18" style="1"/>
<text value="Данные по проекту"/>
</properties>
</component>
<component id="c6963" class="javax.swing.JLabel" binding="l_maxdim">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/Dimensions.png"/>
<text value="Наибольшая размерность DVM-шаблона:"/>
</properties>
</component>
</children>
</grid>
<grid id="aa66b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="b285f" binding="regionsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,65 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.UI.Windows.Interface.AnalysisWindow;
import javax.swing.*;
public class AnalysisForm implements AnalysisWindow {
private JSplitPane SCX;
private JPanel content;
private JLabel l_lines;
private JLabel l_loops;
private JLabel l_arrays;
private JLabel l_functions;
private JLabel l_spf_dirs;
private JLabel l_dvm_dirs;
private JLabel l_maxdim;
private JPanel regionsPanel;
public AnalysisForm() {
LoadSplitters();
Current.getProject().parallelRegions.mountUI(regionsPanel);
}
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowProjectMaxDim() {
l_maxdim.setText("Наибольшая размерность DVM-шаблона: " + Current.getProject().maxdim);
}
@Override
public void ShowNoProjectMaxDim() {
l_maxdim.setText("Наибольшая размерность DVM-шаблона: ?");
}
@Override
public void ShowMetrics() {
l_lines.setText("Общее количество строк кода: " + Current.getProject().LinesCount());
l_spf_dirs.setText("Всего объявлено SPF директив: " + Current.getProject().SPFCount());
l_dvm_dirs.setText("Всего объявлено DVM директив: " + Current.getProject().DVMCount());
}
@Override
public void ShowNoMetrics() {
l_lines.setText("Общее количество строк кода: ?");
l_spf_dirs.setText("Всего объявлено SPF директив: ?");
l_dvm_dirs.setText("Всего объявлено DVM директив: ?");
}
@Override
public void ShowRegions() {
Current.getProject().parallelRegions.ShowUI();
}
@Override
public void ShowNoRegions() {
Current.getProject().parallelRegions.ClearUI();
}
@Override
public void ShowLoopsCount() {
l_loops.setText("Общее количество циклов: " + Current.getProject().LoopsCount());
}
@Override
public void ShowFunctionsCount() {
l_functions.setText("Всего объявлено процедур: " + Current.getProject().FunctionsCount());
}
@Override
public void ShowArraysCount() {
l_arrays.setText(" Всего объявлено массивов: " + Current.getProject().ArraysCount());
}
}

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.ArraysForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="723" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="7e722">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="821d4" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="имя "/>
<toolTipText value="по имени"/>
</properties>
</component>
<component id="9113a" class="javax.swing.JTextField" binding="filterName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
<text value=""/>
</properties>
</component>
<component id="6c0cc" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="обл. описания "/>
<toolTipText value="по области описания"/>
</properties>
</component>
<component id="8e8ac" class="javax.swing.JTextField" binding="filterLocationName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="d8df6" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value=" : "/>
</properties>
</component>
<component id="5c030" class="javax.swing.JTextField" binding="filterLocation" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="d0c01" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="файл "/>
<toolTipText value="по файлу объявления"/>
</properties>
</component>
<component id="7e2df" class="javax.swing.JTextField" binding="filterFile" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="f7cde" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<foreground color="-16777216"/>
<text value="обл. распараллеливания"/>
<toolTipText value="по области распаралеливания"/>
</properties>
</component>
<component id="5ddd8" class="javax.swing.JTextField" binding="filterRegion" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
</children>
</toolbar>
<grid id="611ac" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<splitpane id="f86e7" binding="SC8">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="29e5b" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="2a8de" binding="arraysPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="6e1c1" binding="savedArraysBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="150"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="1ca4e" binding="savedArraysPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,134 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.UI.TextField.StyledTextField;
import ProjectData.SapforData.Arrays.ProjectArray;
import Common.UI.Windows.Interface.ArraysWindow;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
public class ArraysForm implements ArraysWindow {
private JPanel content;
private JPanel arraysPanel;
private JPanel savedArraysPanel;
public JSplitPane SC8;
private JTextField filterName;
private JLabel arraysMatchesLabel;
private JTextField filterLocationName;
private JTextField filterLocation;
private JTextField filterFile;
private JTextField filterRegion;
private JPanel savedArraysBackground;
public ArraysForm(){
LoadSplitters();
Current.getProject().declaratedArrays.mountUI(arraysPanel);
Current.getProject().db.savedArrays.mountUI(savedArraysPanel);
//--
filterName.setText(ProjectArray.filterName);
filterName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterName = filterName.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterName = filterName.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterLocation.setText(ProjectArray.filterLocation);
filterLocation.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterLocation = filterLocation.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterLocation = filterLocation.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterLocationName.setText(ProjectArray.filterLocationName);
filterLocationName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterLocationName = filterLocationName.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterLocationName = filterLocationName.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterFile.setText(ProjectArray.filterFile);
filterFile.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterFile = filterFile.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterFile = filterFile.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterRegion.setText(ProjectArray.filterRegion);
filterRegion.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterRegion = filterRegion.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterRegion = filterRegion.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
}); }
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowArrays() {
Current.getProject().declaratedArrays.ShowUI();
Current.getProject().db.savedArrays.ShowUI();
}
@Override
public void ShowNoArrays() {
Current.getProject().declaratedArrays.ClearUI();
Current.getProject().db.savedArrays.ClearUI();
}
private void createUIComponents() {
// TODO: place custom component creation code here
filterName = new StyledTextField();
filterLocationName = new StyledTextField();
filterLocation = new StyledTextField();
filterFile = new StyledTextField();
filterRegion = new StyledTextField();
}
}

View File

@@ -0,0 +1,431 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.CallbackForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1360" height="574"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<toolbar id="b57af" binding="accountTools">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<maximumSize width="396" height="30"/>
<minimumSize width="396" height="30"/>
<preferredSize width="396" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="7f6d2" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value=" имя пользователя: "/>
</properties>
</component>
<component id="65fb1" class="javax.swing.JLabel" binding="lAccountName">
<constraints/>
<properties>
<font name="Times New Roman" size="18" style="0"/>
<foreground color="-16777216"/>
<text value="Label"/>
</properties>
</component>
<component id="20df1" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" "/>
</properties>
</component>
<component id="13b74" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="адрес: "/>
</properties>
</component>
<component id="9bf2f" class="javax.swing.JLabel" binding="lAccountMail">
<constraints/>
<properties>
<font name="Times New Roman" size="18" style="0"/>
<foreground color="-16777216"/>
<text value="Label"/>
</properties>
</component>
<component id="dc662" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" "/>
</properties>
</component>
<component id="20d68" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="роль: "/>
</properties>
</component>
<component id="db256" class="javax.swing.JLabel" binding="lAccountRole">
<constraints/>
<properties>
<font name="Times New Roman" size="18" style="0"/>
<foreground color="-16777216"/>
<text value="Label"/>
</properties>
</component>
<component id="ac02f" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" "/>
</properties>
</component>
</children>
</toolbar>
<grid id="3838e" binding="accountPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<splitpane id="11d1a" binding="SC10">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="4c636" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="-1" height="200"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6b542" binding="SCX">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="30"/>
<dividerSize value="0"/>
<enabled value="true"/>
<oneTouchExpandable value="false"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="a8d9e" binding="filterFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<toolbar id="41213">
<constraints border-constraint="Center"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="c248" class="javax.swing.JCheckBox" binding="BugReportsMyOnlyFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="65" height="30"/>
<minimumSize width="65" height="30"/>
<preferredSize width="65" height="30"/>
<selectedIcon value="icons/Pick.png"/>
<text value="свои"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="f2af4" class="javax.swing.JCheckBox" binding="BugReportsOpenedOnly">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="100" height="30"/>
<minimumSize width="100" height="30"/>
<preferredSize width="100" height="30"/>
<selectedIcon value="icons/Pick.png"/>
<text value="открытые"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="94f20" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="bug_"/>
</properties>
</component>
<component id="a9e5" class="javax.swing.JTextField" binding="BugReportsKeyFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="b937b" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="автор"/>
</properties>
</component>
<component id="4587b" class="javax.swing.JTextField" binding="BugReportsSenderNameFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="f7f29" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="описание"/>
</properties>
</component>
<component id="26dad" class="javax.swing.JTextField" binding="BugReportsDescriptionFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="f9296" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="проект"/>
</properties>
</component>
<component id="4c6c3" class="javax.swing.JTextField" binding="BugReportsVersionFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="fd9e5" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="исполн."/>
</properties>
</component>
<component id="de2e4" class="javax.swing.JTextField" binding="BugReportsExecutorFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="d5478" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="коммент."/>
</properties>
</component>
<component id="344dc" class="javax.swing.JTextField" binding="BugReportsCommentFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
</children>
</toolbar>
</children>
</grid>
<grid id="2de34" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="24" height="75"/>
</properties>
<border type="none"/>
<children>
<grid id="5155b" binding="bugReportsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="b15c4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="-1" height="200"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="b318" binding="currentBugReportTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="9469" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Описание и комментарий"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="17145" binding="SC6">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="8ef9b" binding="descriptionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="3efc9" binding="commentPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="a54d" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Настройки"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="93e2c" binding="settingsTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children/>
</toolbar>
<scrollpane id="7db0c" binding="bugSettingsScroll" custom-create="true">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</scrollpane>
</children>
</grid>
<grid id="df141" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Адресаты и исполнитель"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="acf24" binding="subscribersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,581 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.Global;
import Common.UI.Editor.BaseEditor;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import Repository.ComponentsServer.Component.BugReport.BugReport;
import Repository.ComponentsServer.Component.BugReport.BugReportInterface;
import Repository.ComponentsServer.Component.BugReport.BugReportState;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.CallbackWindow;
import Common.UI.Windows.Interface.CommentInterface;
import Common.UI.Windows.Interface.DescriptionInterface;
import Common.UI.Windows.Interface.FormWithSplitters;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
public class CallbackForm implements FormWithSplitters, CallbackWindow {
private final JScrollPane bugCommentScroll;
private final JScrollPane bugReportCommentAdditionScroll;
private final BaseEditor BugReportComment;
private final BaseEditor BugReportCommentAddition;
//-------------------------------------------
private final JScrollPane bugDescriptionScroll;
private final JScrollPane bugReportDescriptionAdditionScroll;
private final BaseEditor BugReportDescription;
private final BaseEditor BugReportDescriptionAddition;
private JPanel content;
public JSplitPane SC10;
public DescriptionInterface descriptionInterface;
public CommentInterface commentInterface;
DocumentListener descriptionAdditionListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().descriptionAdditionDraft =
BugReportDescriptionAddition.getText();
}
};
DocumentListener commentAdditionListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().commentAdditionDraft = BugReportCommentAddition.getText();
}
};
DocumentListener descriptionListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().description =
BugReportDescription.getText();
Global.componentsServer.db.bugReports.RefreshUI();
}
};
DocumentListener commentListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().comment = BugReportComment.getText();
}
};
//-
private JToolBar accountTools;
private JLabel lAccountName;
private JLabel lAccountMail;
private JLabel lAccountRole;
private JPanel accountPanel;
private JPanel bugReportsPanel;
private JPanel filterFormPanel;
private JPanel subscribersPanel;
private JTabbedPane currentBugReportTabs;
private JScrollPane bugSettingsScroll;
private JCheckBox BugReportsMyOnlyFilter;
private JCheckBox BugReportsOpenedOnly;
private JToolBar bugsTools;
private JToolBar settingsTools;
private JToolBar descriptionTools;
private JToolBar commentTools;
private JToolBar descriptionAdditionTools;
private JToolBar commentAdditionTools;
private JPanel descriptionPanel;
private JPanel commentPanel;
private JSplitPane SCX;
public JSplitPane SC6;
private JTextField BugReportsKeyFilter;
private JTextField BugReportsSenderNameFilter;
private JTextField BugReportsDescriptionFilter;
private JTextField BugReportsVersionFilter;
private JTextField BugReportsExecutorFilter;
private JTextField BugReportsCommentFilter;
private Viewer BugReportSettings;
public void LockMyOnly() {
if (!BugReportsMyOnlyFilter.isSelected()) {
BugReportsMyOnlyFilter.doClick();
}
BugReportsMyOnlyFilter.setEnabled(false);
}
public void UnlockMyOnly() {
BugReportsMyOnlyFilter.setEnabled(true);
if (BugReportsMyOnlyFilter.isSelected()) {
BugReportsMyOnlyFilter.doClick();
}
}
public CallbackForm() {
LoadSplitters();
//---------------------------------
//чтобы не было индусятины, лучше создать контролы здесь
BugReportDescription = new BaseEditor();
BugReportDescription.setLineWrap(true);
bugDescriptionScroll = new JScrollPane(BugReportDescription);
//----------------------------------------------
BugReportDescriptionAddition = new BaseEditor();
BugReportDescriptionAddition.setLineWrap(true);
bugReportDescriptionAdditionScroll = new JScrollPane(BugReportDescriptionAddition);
BugReportDescription.setWrapStyleWord(true);
BugReportDescriptionAddition.setWrapStyleWord(true);
//---------------------------------------------
//-
BugReportComment = new BaseEditor();
BugReportComment.setLineWrap(true);
bugCommentScroll = new JScrollPane(BugReportComment);
//-
BugReportCommentAddition = new BaseEditor();
BugReportCommentAddition.setLineWrap(true);
bugReportCommentAdditionScroll = new JScrollPane(BugReportCommentAddition);
BugReportComment.setWrapStyleWord(true);
BugReportCommentAddition.setWrapStyleWord(true);
//----------------------------------------------
//тут развилка на то вкладки или поля.
SwitchScreen(Global.db.settings.get(SettingName.SmallScreen).toBoolean());
//-
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
Global.componentsServer.db.subscribers.mountUI(subscribersPanel);
settingsTools.add(Pass_2021.passes.get(PassCode_2021.ApplyBugReportSettings).createButton());
//-
if (!Pass_2021.passes.get(PassCode_2021.CheckAccount).isDone()) {
accountTools.add(Pass_2021.passes.get(PassCode_2021.CheckAccount).createButton());
}
//--
BugReportsKeyFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterKey = BugReportsKeyFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterKey = BugReportsKeyFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsSenderNameFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterSenderName = BugReportsSenderNameFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterSenderName = BugReportsSenderNameFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsDescriptionFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterDescription = BugReportsDescriptionFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterDescription = BugReportsDescriptionFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//------->>>
BugReportsCommentFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterComment = BugReportsCommentFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterComment = BugReportsCommentFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsExecutorFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterExecutor = BugReportsExecutorFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterExecutor = BugReportsExecutorFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsVersionFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterVersion = BugReportsVersionFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterVersion = BugReportsVersionFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//--------
BugReportsMyOnlyFilter.addActionListener(e -> {
BugReportInterface.filterMyOnly = BugReportsMyOnlyFilter.isSelected();
ShowBugReports();
});
BugReportsOpenedOnly.addActionListener(e -> {
BugReportInterface.filterOpenedOnly = BugReportsOpenedOnly.isSelected();
ShowBugReports();
});
}
//-------------------------------------------
DescriptionTabs descriptionTabs = new DescriptionTabs();
DescriptionFields descriptionFields = new DescriptionFields();
CommentTabs commentTabs = new CommentTabs();
CommentFields commentFields = new CommentFields();
@Override
public void SwitchScreen(boolean small) {
UI.Clear(descriptionPanel);
//------------------------------------------------------------------
descriptionInterface = small ? descriptionTabs : descriptionFields;
descriptionInterface.setEditorScroll(bugDescriptionScroll);
descriptionInterface.setAdditionScroll(bugReportDescriptionAdditionScroll);
descriptionPanel.add(descriptionInterface.getContent());
//----------
descriptionPanel.revalidate();
descriptionPanel.repaint();
//---------
UI.Clear(commentPanel);
//------------------------------------------------------------------
commentInterface = small ? commentTabs : commentFields;
commentInterface.setEditorScroll(bugCommentScroll);
commentInterface.setAdditionScroll(bugReportCommentAdditionScroll);
commentPanel.add(commentInterface.getContent());
//----------
commentPanel.revalidate();
commentPanel.repaint();
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
descriptionInterface.SaveSplitters();
commentInterface.SaveSplitters();
}
@Override
public String getBugReportDescriptionText() {
return BugReportDescription.getText();
}
@Override
public String getBugReportDescriptionAdditionText() {
return BugReportDescriptionAddition.getText();
}
@Override
public String getBugReportCommentText() {
return BugReportComment.getText();
}
@Override
public String getBugReportCommentAdditionText() {
return BugReportCommentAddition.getText();
}
@Override
public void ClearBugReportDescriptionAdditionText() {
BugReportDescriptionAddition.setText("");
}
@Override
public void ClearBugReportCommentAdditionText() {
BugReportCommentAddition.setText("");
}
@Override
public void FocusRecipients() {
currentBugReportTabs.setSelectedIndex(2);
}
public void SwitchListeners(boolean on) {
//System.out.println("switching listeners " + on);
if (on) {
BugReportDescriptionAddition.getDocument().addDocumentListener(descriptionAdditionListener);
BugReportCommentAddition.getDocument().addDocumentListener(commentAdditionListener);
BugReportDescription.getDocument().addDocumentListener(descriptionListener);
BugReportComment.getDocument().addDocumentListener(commentListener);
} else {
BugReportDescriptionAddition.getDocument().removeDocumentListener(descriptionAdditionListener);
BugReportCommentAddition.getDocument().removeDocumentListener(commentAdditionListener);
BugReportDescription.getDocument().removeDocumentListener(descriptionListener);
BugReportComment.getDocument().removeDocumentListener(commentListener);
}
}
private void createUIComponents() {
BugReportSettings = new Viewer();
bugSettingsScroll = new JScrollPane(BugReportSettings);
//--
BugReportsKeyFilter = new StyledTextField();
BugReportsSenderNameFilter = new StyledTextField();
BugReportsDescriptionFilter = new StyledTextField();
BugReportsCommentFilter = new StyledTextField();
BugReportsExecutorFilter = new StyledTextField();
BugReportsVersionFilter = new StyledTextField();
settingsTools = new VisualiserMenuBar();
}
public void EnableBugreports() {
UI.Clear(accountPanel);
accountPanel.add(SC10);
UI.getMainWindow().ShowTestingTab();
}
@Override
public void setUserRights() {
LockMyOnly();
Pass_2021.passes.get(PassCode_2021.AddSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.EditSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DeleteSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DownloadAllBugReportsArchives).setControlsVisible(false);
}
private void setDeveloperRights() {
UnlockMyOnly();
Pass_2021.passes.get(PassCode_2021.AddSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.EditSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DeleteSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DownloadAllBugReportsArchives).setControlsVisible(true);
}
@Override
public void setAdminRights() {
UnlockMyOnly();
Pass_2021.passes.get(PassCode_2021.AddSubscriber).setControlsVisible(true);
Pass_2021.passes.get(PassCode_2021.EditSubscriber).setControlsVisible(true);
Pass_2021.passes.get(PassCode_2021.DeleteSubscriber).setControlsVisible(true);
Pass_2021.passes.get(PassCode_2021.DownloadAllBugReportsArchives).setControlsVisible(true);
}
@Override
public void ShowAccount() {
lAccountName.setText(Utils.Brackets(Current.getAccount().name));
lAccountMail.setText(Utils.Brackets(Current.getAccount().email));
lAccountRole.setText(Utils.Brackets(Current.getAccount().role.getDescription()));
switch (Current.getAccount().role) {
case Undefined:
UI.Clear(accountPanel);
accountPanel.add(new CallbackWelcomeForm().content);
UI.getMainWindow().HideTestingTab();
break;
case User:
//видит только свои баги.
EnableBugreports();
setUserRights();
break;
case Developer:
EnableBugreports();
setDeveloperRights();
break;
case Admin:
EnableBugreports();
setAdminRights();
break;
default:
EnableBugreports();
break;
}
}
@Override
public void ShowBugReports() {
Global.componentsServer.db.bugReports.ShowUI();
}
@Override
public void ShowNoBugReports() {
Global.componentsServer.db.bugReports.ClearUI();
}
@Override
public void ShowSubscribers() {
Global.componentsServer.db.subscribers.ShowUI();
}
@Override
public void ShowNoSubscribers() {
Global.componentsServer.db.subscribers.ClearUI();
}
private void ShowDraft() {
Pass_2021.setPassesControlsVisible(true,
PassCode_2021.PublishBugReport,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.DeleteBugReport
);
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.AppendBugReportComment,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.OpenBugReportTestProject,
PassCode_2021.UpdateBugReportProgress
);
}
private void ShowUserExecutor() {
Pass_2021.setPassesControlsVisible(true,
PassCode_2021.AppendBugReportComment,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.OpenBugReportTestProject
);
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.PublishBugReport,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.DeleteBugReport
);
}
private void ShowSender() {
Pass_2021.setPassesControlsVisible(true,
PassCode_2021.AppendBugReportComment,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.OpenBugReportTestProject,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.DeleteBugReport
);
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.PublishBugReport
);
}
private void ShowUser() {
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.PublishBugReport,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.DeleteBugReport,
PassCode_2021.AppendBugReportComment,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.OpenBugReportTestProject
);
}
@Override
public void ShowCurrentBugReport() {
SwitchListeners(false);
// currentBugReportTabs.setSelectedIndex(0);
BugReport target = Current.getBugReport();
BugReportInterface.CheckSubscribers(target);
Global.componentsServer.db.subscribers.ShowUI();
//-
BugReportDescription.setText(target.description);
BugReportDescription.ShowBegin();
BugReportDescriptionAddition.setText(target.descriptionAdditionDraft);
//-
BugReportComment.setText(target.comment);
BugReportComment.ShowBegin();
BugReportCommentAddition.setText(target.commentAdditionDraft);
BugReportSettings.setText(
String.join("\n",
("Версия SAPFOR: " + target.sapfor_version),
("Версия визуализатора: " + target.visualiser_version),
target.sapfor_settings
)
);
Pass_2021.setPassesControlsVisible(true, PassCode_2021.ApplyBugReportSettings);
//
if (target.state.equals(BugReportState.draft)) {
ShowDraft();
} else {
switch (Current.getAccount().role) {
case User:
if (Current.getAccount().email.equalsIgnoreCase(target.sender_address)) {
ShowSender(); //отправитель.может делать с багом все.
} else {
if (Current.getAccount().email.equalsIgnoreCase(target.executor_address)) {
ShowUserExecutor(); //исполнитель. может менять прогресс и дополнять комментарий.
} else ShowUser(); //недоступно ничего. и баг ему невидим. но на всякий случай.
}
break;
case Developer:
case Admin:
//разработчик может все то же что и админ. они равны по правам владельцу любого бага.
ShowSender();
break;
}
}
SwitchListeners(true);
}
@Override
public void ShowNoCurrentBugReport() {
SwitchListeners(false);
Global.componentsServer.db.subscribers.ShowUI();
//-
BugReportDescription.setText("");
BugReportComment.setText("");
BugReportDescriptionAddition.setText("");
BugReportCommentAddition.setText("");
BugReportSettings.setText("");
//-
Pass_2021.setPassesControlsVisible(false, PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportComment,
PassCode_2021.ApplyBugReportSettings,
PassCode_2021.PublishBugReport,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.OpenBugReportTestProject,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.DeleteBugReport
);
}
@Override
public void ShowSubscription() {
}
@Override
public JPanel getContent() {
return content;
}
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.CallbackWelcomeForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="893" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e8af5" class="javax.swing.JTextArea" binding="WelcomeText">
<constraints border-constraint="Center"/>
<properties>
<editable value="false"/>
<enabled value="true"/>
<font name="Times New Roman" size="25" style="1"/>
<text value="&#10;&#10;&#10;&#10;&#10; &#9;Чтобы получить доступ к обратной связи, пройдите регистрацию"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -0,0 +1,6 @@
package Common.UI.Windows.Main;
import javax.swing.*;
public class CallbackWelcomeForm {
public JPanel content;
private JTextArea WelcomeText;
}

View File

@@ -0,0 +1,23 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.UI.Windows.Dialog.Text.ComboTextDialog;
import Common.Utils.Utils;
import java.util.Vector;
public class CombineFilesDialog extends ComboTextDialog {
public CombineFilesDialog() {
fields.setEditable(true);
}
@Override
public void validateFields() {
super.validateFields();
if (Log.isEmpty()) {
String fileName = (String) fields.getSelectedItem();
// тут 2 случая. если имя файла совпадает с 1 из существующих, то все хорошо.
//если нет. тогда проверяем отсуствие слешей и полная валидация имени одиночного файла.
Vector<String> files_order = Current.getProject().files_order;
if (!files_order.contains(fileName))
Utils.validateFileShortNewName(fileName, Log);
}
}
}

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.CommentFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="21cc1" binding="SC26">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="f6bb7" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="ae65d" binding="commentTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="ad5e0" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Комментарий"/>
</properties>
</component>
</children>
</toolbar>
<grid id="49216" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="217fe" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="5f4e8" binding="commentAdditionTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="8669c" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Дополнение комментария"/>
</properties>
</component>
</children>
</toolbar>
<grid id="e4591" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,37 @@
package Common.UI.Windows.Main;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.CommentInterface;
import javax.swing.*;
public class CommentFields implements CommentInterface {
public JSplitPane SC26;
private JPanel content;
private JToolBar commentTools;
private JToolBar commentAdditionTools;
private JPanel editorPanel;
private JPanel additionPanel;
public CommentFields() {
LoadSplitters();
commentTools.add(Pass_2021.passes.get(PassCode_2021.SaveBugReportComment).createButton());
commentAdditionTools.add(Pass_2021.passes.get(PassCode_2021.AppendBugReportComment).createButton());
}
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
commentTools = new VisualiserMenuBar();
commentAdditionTools = new VisualiserMenuBar();
}
}

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.CommentTabs">
<grid id="27dc6" binding="comment" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="84c83" binding="tabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="bd63f" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Описание"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="8f344" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Дополнение описания"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,38 @@
package Common.UI.Windows.Main;
import Common.Passes.PassCode_2021;
import Common.UI.Windows.Interface.CommentInterface;
import javax.swing.*;
public class CommentTabs implements CommentInterface {
private JPanel comment;
private JTabbedPane tabs;
private JPanel editorPanel;
private JPanel additionPanel;
public CommentTabs() {
tabs.setTabComponentAt(0, new TabToolBar("Комментарий", PassCode_2021.SaveBugReportComment) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(0);
}
});
tabs.setTabComponentAt(1, new TabToolBar("Дополнение", PassCode_2021.AppendBugReportComment) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(1);
}
});
}
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return comment;
}
}

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.ComparisonForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="63a72" binding="tools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<maximumSize width="32929" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="5992c" class="javax.swing.JLabel" binding="lObjectName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="1"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
<component id="d59fd" class="javax.swing.JButton" binding="bApplyObject">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Apply.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Назначить объект для сравнения"/>
</properties>
</component>
<component id="dd7b1" class="javax.swing.JButton" binding="bClose">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Close.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Открепить объект"/>
</properties>
</component>
<component id="7a4ca" class="javax.swing.JSeparator">
<constraints/>
<properties/>
</component>
<component id="75549" class="javax.swing.JButton" binding="bPrevious">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Prev.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к предыдущему различию "/>
</properties>
</component>
<component id="f8e56" class="javax.swing.JButton" binding="bNext">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Next.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к следующему различию"/>
</properties>
</component>
<component id="42c3c" class="javax.swing.JButton" binding="bCompare">
<constraints/>
<properties>
<icon value="icons/Menu/Undo.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Сравнить объекты"/>
</properties>
</component>
</children>
</toolbar>
<grid id="8b423" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,440 @@
package Common.UI.Windows.Main;
import Common.Constants;
import Common.Current;
import Common.Database.DBObject;
import Common.Global;
import Common.UI.Editor.BaseEditor;
import Common.UI.Label.ShortLabel;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI;
import Common.Utils.TextLog;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import Common.Passes.Pass_2021;
import javafx.util.Pair;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaHighlighter;
import org.fife.ui.rtextarea.RTextScrollPane;
import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.Vector;
public abstract class ComparisonForm<T> {
public Class<T> t; //класс объектов.
//-->>
private JPanel content;
public JPanel getContent() {
return content;
}
protected JToolBar tools;
private JPanel editorPanel;
protected JLabel lObjectName;
protected JButton bApplyObject;
private JButton bPrevious;
private JButton bNext;
private JButton bCompare;
protected JButton bClose;
//-->>
ComparisonForm<T> this_ = null; //?
ComparisonForm<T> slave = null;
ComparisonForm<T> master = null;
//-->>
protected T object = null;
//-->>
protected BaseEditor Body;
private RTextScrollPane Scroll;
//-->>
public Vector<String> lines = new Vector<>(); //строки с учетом/неучетом пробелов. для сравнения
public Vector<String> visible_lines = new Vector<>(); //строки с нетронутыми пробелами. для отображения
//подсветка.
public LinkedHashMap<Integer, Pair<Integer, Boolean>> colors = new LinkedHashMap<>();
public RSyntaxTextAreaHighlighter slave_highlighter = null; //погонщик рабов
//-----
private boolean events_on = false;//относится только к мастеру, отвечает за скроллы.
private int current_diff_line = -1;
//--->>
public boolean isMaster() {
return slave != null;
}
public boolean isSlave() {
return master != null;
}
//--->>
//неперегружаемые методы
protected void RemoveObject() {
object = null;
removeObject();
showNoObject();
ClearText();
/*
if (isMaster())
slave.ClearText();
else if (isSlave())
master.ClearText();
*/
}
public void ApplyObject() {
RemoveObject();
TextLog log = new TextLog();
if (Current.Check(log, getCurrentObjectName())) {
object = (T) Current.get(getCurrentObjectName());
applyObject();
showObject();
} else
UI.Info(log.toString());
}
private void ShowCurrentDiff() {
Body.gotoLine_(colors.get(current_diff_line).getKey());
}
public static boolean CompareLines(String line1_raw, String line2_raw) {
String line1 = line1_raw;
String line2 = line2_raw;
if (!Global.db.settings.get(SettingName.RegisterOn).toBoolean()) {
line1 = line1.toUpperCase();
line2 = line2.toUpperCase();
}
if (!Global.db.settings.get(SettingName.SpacesOn).toBoolean()) {
line1 = Utils.remove(line1, " ", "\t");
line2 = Utils.remove(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);
}
private void getLines() {
lines.clear();
visible_lines.clear();
//1.прочитать весь текст.
char[] chars = getText().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 (Global.db.settings.get(SettingName.SpacesOn).toBoolean()) line.append(c);
v_line.append(c);
break;
case '\n': //конец строки
if (fortranWrapsOn()) {
//оракул. лезем в начало следующей строки
//и анализируем первые 5 символов
boolean hasWrap = false;
int wi;
//------
//System.out.println("checking wrap...");
//с нуля потому что и уже увеличено.
for (int j = 0; (j < 6) && ((wi = i + j) < chars.length); ++j) {
char s = chars[wi];
// System.out.print(s);
if ((j == 0) && ((s == 'c') || (s == 'C') || (s == '!'))) {
// System.out.println("next line is FL comment");
break;
}
if ((j > 0) && (j < 5) && (s == '!')) {
// System.out.println("next line is comment");
break;
}
if ((j == 5) && (s != ' ')) {
hasWrap = true;
i = wi + 1;
// System.out.println("next line is WRAP");
break;
}
}
// System.out.println();
//-----
if (hasWrap)
break;
}
// System.out.println();
//добавление строки в результат.
if ((line.length() > 0) || Global.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) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean() && Global.db.settings.get(SettingName.SpacesOn).toBoolean()) {
lines.add(line.toString());
visible_lines.add(v_line.toString());
}
}
}
protected void ClearText() {
events_on = false;
Body.setText("объект не назначен");
}
//предполагаем что оба объекта есть и мы можем получить с них текст.
protected void Compare() throws Exception {
events_on = false;
current_diff_line = Constants.Nan;
colors.clear();
//-----------------------------------------------------------------------------------------------
Body.setText("");
slave.Body.setText("");
int d = 0;
getLines();
slave.getLines();
//--------------------------------------------------------------------
Vector<String> t1 = new Vector<>();
Vector<String> t2 = new Vector<>();
//------
int old_j = 0;
int j = 0;
for (int i = 0; i < lines.size(); ++i) {
if (Contains(slave.lines, lines.get(i), old_j)) {
for (int k = old_j; k < slave.lines.size(); ++k) {
j = k;
if (CompareLines(lines.get(i), slave.lines.get(k))) {
j++;
t1.add(visible_lines.get(i));
t2.add(slave.visible_lines.get(k));
break;
} else {
t1.add("+");
t2.add("+ " + slave.visible_lines.get(k));
colors.put(d, new Pair(t2.size() - 1, true));
++d;
}
}
old_j = j;
} else {
//строки гарантированно нет.
t1.add("- " + visible_lines.get(i));
t2.add("- " + visible_lines.get(i));
colors.put(d, new Pair(t2.size() - 1, false));
++d;
}
}
//теперь граничное условие. если первый файл кончился а второй нет, его остаток это добавление.
for (int i = j; i < slave.lines.size(); ++i) {
t1.add("+");
t2.add("+ " + slave.visible_lines.get(i));
colors.put(d, new Pair(t2.size() - 1, true));
++d;
}
///----------------
Body.setText(String.join("\n", t1));
slave.Body.setText(String.join("\n", t2));
Body.setCaretPosition(0);
slave.Body.setCaretPosition(0);
//теперь покрас.
for (Integer diff_num : colors.keySet()) {
slave_highlighter.addHighlight(
slave.Body.getLineStartOffset(colors.get(diff_num).getKey()),
slave.Body.getLineEndOffset(colors.get(diff_num).getKey()),
colors.get(diff_num).getValue() ? UI.GoodLoopPainter : UI.BadLoopPainter
);
}
if (colors.size() > 0) current_diff_line = 0;
events_on = true;
}
public void Show() throws Exception {
events_on = false;
current_diff_line = Constants.Nan;
colors.clear();
//----------------------------------------------------------------------------------------------
Body.setText("");
slave.Body.setText("");
int d = 0;
getLines();
slave.getLines();
//--------------------------------------------------------------------
Vector<String> t1 = new Vector<>();
Vector<String> t2 = new Vector<>();
//------
t1.addAll(visible_lines);
t2.addAll(slave.visible_lines);
//просто выясняем кто из них длиннее, и короткий дополняем пустыми строками.]
int delta = Math.abs(t1.size() - t2.size());
if (lines.size() > slave.lines.size()) {
Utils.addEmptyLines(t2, delta);
} else if (lines.size() < slave.lines.size()) {
Utils.addEmptyLines(t1, delta);
}
///----------------
Body.setText(String.join("\n", t1));
slave.Body.setText(String.join("\n", t2));
Body.setCaretPosition(0);
slave.Body.setCaretPosition(0);
events_on = true;
}
//Перегружаемые методы.
//--->>
protected abstract Current getCurrentObjectName();
protected void showNoObject() {
lObjectName.setText("?");
lObjectName.setToolTipText("Объект не назначен.");
}
protected void showObject() {
if (object instanceof DBObject) {
DBObject dbObject = (DBObject) object;
lObjectName.setText(dbObject.toString());
lObjectName.setToolTipText(dbObject.toString());
}
}
protected void removeObject() {
}
protected void applyObject() {
}
protected abstract String getText();
protected boolean fortranWrapsOn() {
return false;
}
//--->>
// protected Object ownScrollModel = null;
//---<<
public ComparisonForm(Class<T> t_in, ComparisonForm<T> slave_in) {
//-
Body = new BaseEditor();
Scroll = new RTextScrollPane(Body);
editorPanel.add(Scroll);
// ownScrollModel = Scroll.getVerticalScrollBar().getModel();
//-
t = t_in;
this_ = this;
slave = slave_in;
bPrevious.setVisible(isMaster());
bNext.setVisible(isMaster());
Scroll.setLineNumbersEnabled(true);
bApplyObject.addActionListener(e -> {
ApplyObject();
});
//--->>>
Body.setWhitespaceVisible(true);
Body.setEditable(false);
if (isMaster()) {
//<editor-fold desc="синхронизация скроллов">
slave.Scroll.getVerticalScrollBar().setModel(Scroll.getVerticalScrollBar().getModel());
slave_highlighter = (RSyntaxTextAreaHighlighter) slave.Body.getHighlighter();
//бяк быть не должно при условии что строк одинаковое количество. а это должно выполняться.
Body.addCaretListener(e -> {
if (events_on && isReady() && slave.isReady()) {
try {
int master_lineNum = Body.getCaretLineNumber();
slave.Body.setCaretPosition(slave.Body.getLineStartOffset(master_lineNum));
} catch (Exception ex) {
Global.Log.PrintException(ex);
}
}
});
//</editor-fold>
slave.master = this;
bPrevious.addActionListener(e -> {
if (current_diff_line != Constants.Nan) {
if (current_diff_line > 0)
current_diff_line--;
else
current_diff_line = colors.size() - 1;
ShowCurrentDiff();
}
});
bNext.addActionListener(e -> {
if (current_diff_line != Constants.Nan) {
if (current_diff_line < colors.size() - 1)
current_diff_line++;
else
current_diff_line = 0;
ShowCurrentDiff();
}
});
bCompare.addActionListener(e -> {
DoComparePass(isReady() && slave.isReady());
});
} else {
//рабу сравнивать не положено.
bCompare.setVisible(false);
}
//--->>>
bClose.addActionListener(e -> {
onClose();
});
}
//-->>
private void createUIComponents() {
// TODO: place custom component creation code here
lObjectName = new ShortLabel(40);
tools = new VisualiserMenuBar();
}
//для сравнения по кнопке.
public boolean isReady() {
return object != null;
}
public void onClose() {
RemoveObject();
}
public void DoComparePass(boolean startCondition) {
Pass_2021 pass = new Pass_2021() {
@Override
public String getDescription() {
return "Сравнение";
}
@Override
protected boolean needsAnimation() {
return true;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
return startCondition;
}
@Override
protected void body() throws Exception {
Compare();
}
};
pass.Do();
}
public void DoShowPass(boolean startCondition) {
Pass_2021 pass = new Pass_2021() {
@Override
public String getDescription() {
return "Отображение";
}
@Override
protected boolean needsAnimation() {
return false;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
return startCondition;
}
@Override
protected void body() throws Exception {
Show();
}
};
pass.Do();
}
}

View File

@@ -0,0 +1,31 @@
package Common.UI.Windows.Main;
import Common.Current;
import GlobalData.Tasks.CompilationTask.CompilationTask;
public class CompilationTasksComparisonForm extends TasksComparisonForm<CompilationTask> {
public CompilationTasksComparisonForm(ComparisonForm<CompilationTask> slave_in) {
super(CompilationTask.class, slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.CompilationTask;
}
@Override
protected String getTextByTab() {
switch (status) {
case CompilationOutput:
return object.getOutput();
case CompilationErrors:
return object.getErrors();
default:
return "";
}
}
@Override
protected TasksComparisonState[] getForbiddenStates() {
return new TasksComparisonState[]{
TasksComparisonState.RunOutput,
TasksComparisonState.RunErrors,
TasksComparisonState.Sts
};
}
}

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.CredentialsForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="903" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="57b4" binding="SC18">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="400"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="c68de" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="450" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="b988" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="250" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="91c8b" binding="compilersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
<grid id="5cfd" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="450" height="100"/>
</properties>
<border type="none"/>
<children>
<splitpane id="4bf28" binding="SC19">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="197"/>
<dividerSize value="3"/>
<maximumSize width="-1" height="-1"/>
<minimumSize width="300" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="31e6f" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="0"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="c7226" binding="machinesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="cdfc5" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="250" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="5f744" binding="usersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,74 @@
package Common.UI.Windows.Main;
import Common.Constants;
import Common.Current;
import Common.Global;
import GlobalData.Credentials.Credentials;
import Common.UI.Windows.Interface.CredentialsWindow;
import Common.UI.Windows.Interface.FormWithSplitters;
import javax.swing.*;
public class CredentialsForm implements CredentialsWindow, FormWithSplitters {
public JSplitPane SC18;
public JSplitPane SC19;
private JPanel machinesPanel;
private JPanel usersPanel;
private JPanel compilersPanel;
private JPanel content;
public CredentialsForm(){
LoadSplitters();
Global.db.machines.mountUI(machinesPanel);
Global.db.users.mountUI(usersPanel);
Global.db.compilers.mountUI(compilersPanel);
}
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowAll() {
Global.db.machines.ShowUI();
RestoreLastCredentials();
}
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current.get(Current.Credentials);
if (credentials.machine_id != Constants.Nan) {
if (Global.db.machines.containsKey(credentials.machine_id)) {
Global.db.machines.ShowUI(credentials.machine_id);
if (Global.db.users.containsKey(credentials.user_id)) {
Global.db.users.ShowUI(credentials.user_id);
} else {
credentials.user_id = Constants.Nan;
Global.db.UpdateCredentials();
}
if (Global.db.compilers.containsKey(credentials.compiler_id)) {
Global.db.compilers.ShowUI(credentials.compiler_id);
} else {
credentials.compiler_id = Constants.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.makefiles.containsKey(credentials.makefile_id)) {
Global.db.makefiles.ShowUI(credentials.makefile_id);
} else {
credentials.makefile_id = Constants.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.runConfigurations.containsKey(credentials.runconfiguration_id)) {
Global.db.runConfigurations.ShowUI(credentials.runconfiguration_id);
} else {
credentials.runconfiguration_id = Constants.Nan;
Global.db.UpdateCredentials();
}
} else {
credentials.machine_id = Constants.Nan;
credentials.user_id = Constants.Nan;
credentials.compiler_id = Constants.Nan;
credentials.remotesapfor_id = Constants.Nan;
credentials.makefile_id = Constants.Nan;
credentials.runconfiguration_id = Constants.Nan;
Global.db.UpdateCredentials();
}
}
}
}

View File

@@ -0,0 +1,393 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.DebugForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="853" height="600"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="d4095" binding="debugTabs">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<grid id="5bc0d" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Компиляция">
<tooltip value="Компиляция"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="66319" binding="SC51">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="26730" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="41f85" binding="SC40">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="197"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="e9fb3" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="b9fa8" binding="compilationTasksPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="150"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="d0a9d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="c4387" binding="SC41">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="9f685" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="200" height="200"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="3d69e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="200" height="200"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="b9033" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="600" height="200"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6ed81" binding="SC20">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="548"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="daa4a" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="300" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="65ac6" binding="makefilesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="709a" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="300" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="361cf" binding="modulesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="1c08a" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Запуск">
<tooltip value="Запуск"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="44d2e" binding="SC52">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="150"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="dfa38" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="78844" binding="SC42">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="94509" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="0" height="200"/>
</properties>
<border type="none"/>
<children>
<splitpane id="c578" binding="SC43">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="10b43" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="150" height="100"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="1c6f2" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="150" height="100"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="fadcf" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="e03b4" binding="runTasksPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="c389f" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="7d248" binding="SC21">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="450"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="c844d" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="350" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="7070" binding="runConfigurationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="0"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="2473c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="500" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6e137" binding="SC35">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="200" height="-1"/>
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="250"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="f354" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="250" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="238e" binding="environmentsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="9f17d" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="250" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="ce7e2" binding="dvmParametersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,105 @@
package Common.UI.Windows.Main;
import Common.Global;
import Common.UI.Windows.Interface.DebugWindow;
import Common.UI.Windows.Interface.FormWithSplitters;
import javax.swing.*;
public class DebugForm implements DebugWindow, FormWithSplitters {
private JPanel content;
public JSplitPane SC51;
public JSplitPane SC40;
public JTabbedPane debugTabs;
public JSplitPane SC41;
public JSplitPane SC20;
public JSplitPane SC52;
public JSplitPane SC42;
public JSplitPane SC43;
public JSplitPane SC21;
public JSplitPane SC35;
private JPanel compilationTasksPanel;
private JPanel makefilesPanel;
private JPanel modulesPanel;
private JPanel runTasksPanel;
private JPanel runConfigurationsPanel;
private JPanel environmentsPanel;
private JPanel dvmParametersPanel;
//--
//-
public RunTasksComparisonForm singleRunTaskMaster; // одиночные запуски
public RunTasksComparisonForm singleRunTaskSlave;
//
public CompilationTasksComparisonForm singleCompilationTaskMaster; // одиночная компиляция
public CompilationTasksComparisonForm singleCompilationTaskSlave;
//--
//--
@Override
public JPanel getContent() {
return content;
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
try {
Global.db.SaveCredentials();
} catch (Exception ex) {
Global.Log.PrintException(ex);
}
}
@Override
public void DropRunTasksComparison() {
singleRunTaskMaster.RemoveObject();
singleRunTaskSlave.RemoveObject();
}
@Override
public void DropCompilationTasksComparison() {
singleCompilationTaskMaster.RemoveObject();
singleCompilationTaskSlave.RemoveObject();
}
@Override
public void ShowLastCompilationTask() {
singleCompilationTaskMaster.ApplyObject();
}
@Override
public void ShowLastRunTask() {
singleRunTaskMaster.ApplyObject();
}
@Override
public void ShowCurrentRunTask() {
// if (singleRunTaskMaster.isActive()) singleRunTaskMaster.ShowTask();
// else singleRunTaskSlave.ShowTask();
}
@Override
public void ShowNoCurrentRunTask() {
// if (singleRunTaskMaster.isActive()) singleRunTaskMaster.Clear();
// else singleRunTaskSlave.Clear();
}
//-
@Override
public void ShowAll() {
Global.db.makefiles.ShowUI();
Global.db.runConfigurations.ShowUI();
Global.db.compilationTasks.ShowUI(); //их видимость зависит от текущего проекта.
Global.db.runTasks.ShowUI();
}
public DebugForm(){
LoadSplitters();
//--
Global.db.makefiles.mountUI(makefilesPanel);
Global.db.modules.mountUI(modulesPanel);
Global.db.runConfigurations.mountUI(runConfigurationsPanel);
Global.db.environmentValues.mountUI(environmentsPanel);
Global.db.dvmParameters.mountUI(dvmParametersPanel);
//-
Global.db.compilationTasks.mountUI(compilationTasksPanel);
Global.db.runTasks.mountUI(runTasksPanel);
//--
singleCompilationTaskMaster = new CompilationTasksComparisonForm(singleCompilationTaskSlave = new CompilationTasksComparisonForm(null));
singleRunTaskMaster = new RunTasksComparisonForm(singleRunTaskSlave = new RunTasksComparisonForm(null));
//--
//-
SC41.setLeftComponent(singleCompilationTaskMaster.getContent());
SC41.setRightComponent(singleCompilationTaskSlave.getContent());
SC43.setLeftComponent(singleRunTaskMaster.getContent());
SC43.setRightComponent(singleRunTaskSlave.getContent());
}
}

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.DescriptionFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="5c980" binding="SC25">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="e0641" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="db173" binding="descriptionTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="45f1e" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Описание"/>
</properties>
</component>
</children>
</toolbar>
<grid id="c78b" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="893bb" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="c3176" binding="descriptionAdditionTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="7d653" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Дополнение описания"/>
</properties>
</component>
</children>
</toolbar>
<grid id="e6c00" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,38 @@
package Common.UI.Windows.Main;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.DescriptionInterface;
import javax.swing.*;
public class DescriptionFields implements DescriptionInterface {
public JSplitPane SC25;
private JPanel content;
private JToolBar descriptionTools;
private JToolBar descriptionAdditionTools;
private JPanel editorPanel;
private JPanel additionPanel;
public DescriptionFields() {
LoadSplitters();
descriptionAdditionTools.add(Pass_2021.passes.get(PassCode_2021.AppendBugReportDescription).createButton());
descriptionTools.add(Pass_2021.passes.get(PassCode_2021.SaveBugReportDescription).createButton());
}
//---------
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
descriptionTools = new VisualiserMenuBar();
descriptionAdditionTools = new VisualiserMenuBar();
}
}

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.DescriptionTabs">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="c1d95" binding="tabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="8093b" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Описание"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="2f41a" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Дополнение описания"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,37 @@
package Common.UI.Windows.Main;
import Common.Passes.PassCode_2021;
import Common.UI.Windows.Interface.DescriptionInterface;
import javax.swing.*;
public class DescriptionTabs implements DescriptionInterface {
private JPanel content;
private JTabbedPane tabs;
private JPanel editorPanel;
private JPanel additionPanel;
public DescriptionTabs() {
tabs.setTabComponentAt(0, new TabToolBar("Описание", PassCode_2021.SaveBugReportDescription) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(0);
}
});
tabs.setTabComponentAt(1, new TabToolBar("Дополнение", PassCode_2021.AppendBugReportDescription) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(1);
}
});
}
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return content;
}
}

View File

@@ -0,0 +1,311 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.FileForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1046" height="655"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="c0fc1" binding="SC1">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="350"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="9272e" binding="messagesBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="200" height="100"/>
<preferredSize width="200" height="100"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="2e27d" binding="messagesTabs">
<constraints border-constraint="Center"/>
<properties>
<tabLayoutPolicy value="1"/>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="97642" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Примечания" icon="icons/Notes.png">
<tooltip value="Примечания"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="c43ed" binding="notesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="8ff87" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Предупреждения" icon="icons/Warnings.png">
<tooltip value="Предупреждения"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="3ea79" binding="warningsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="e3e70" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Ошибки" icon="icons/Errors.png">
<tooltip value="Ошибки"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="894a8" binding="errorsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="59a3a" binding="recommendationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Рекомендации" icon="icons/Recomendations.png">
<tooltip value="Рекомендации"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value="Рекоммендации"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="35438" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Компиляция" icon="icons/CompilationOutput.png">
<tooltip value="Компиляция"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="e0364" binding="compilation_out_panel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="907aa" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Запуск" icon="icons/RunOutput.png">
<tooltip value="Запуск"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="6231d" binding="run_out_panel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="b52a6" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="GCOV" icon="icons/GCOV.PNG">
<tooltip value="GCOV"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="cf888" binding="gcov_log_panel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
<grid id="a0d95" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="9b595" binding="SC12">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="145"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="30351" binding="graphsBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="150" height="150"/>
<preferredSize width="150" height="150"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="dfe2a" binding="graphsTabs">
<constraints border-constraint="Center"/>
<properties>
<tabLayoutPolicy value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="cd053" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Loop.png">
<tooltip value="Циклы"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="f6da5" binding="loopsGraphPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="bbf0" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Function.png">
<tooltip value="Процедуры"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="f80d0" binding="functionsGraphPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="44976" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Arrays.png">
<tooltip value="Массивы"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="1d5e4" binding="arraysGraphPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
<grid id="8202e" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,358 @@
package Common.UI.Windows.Main;
import Common.Constants;
import Common.Global;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.FileMenuBar.FileMenuBar;
import Common.UI.Trees.TreeForm;
import Common.UI.UI;
import GlobalData.Settings.SettingName;
import ProjectData.Files.DBProjectFile;
import ProjectData.Files.UI.Editor.SPFEditor;
import ProjectData.LanguageName;
import ProjectData.Messages.Errors.MessageError;
import ProjectData.Messages.Notes.MessageNote;
import ProjectData.Messages.Warnings.MessageWarning;
import ProjectData.SapforData.Arrays.UI.FileArraysTree;
import ProjectData.SapforData.Functions.UI.FileFunctionsTree;
import ProjectData.SapforData.Loops.UI.FileLoopsTree;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.FileWindow;
import Common.UI.Windows.Interface.FormWithSplitters;
import Common.UI.Windows.Interface.SPFEditorInterface;
import com.sun.org.glassfish.gmbal.Description;
import org.fife.ui.rtextarea.RTextScrollPane;
import javax.swing.*;
import java.awt.*;
public class FileForm implements FileWindow, FormWithSplitters {
//контролы в столбцах
//https://stackoverflow.com/questions/7137786/how-can-i-put-a-control-in-the-jtableheader-of-a-jtable
//todo _ временно
public static int current_file_line = Constants.Nan;
private final Viewer compilationOutput;
private final Viewer runOutput;
private final Viewer gcovLog;
private final DBProjectFile file;
//-
public JSplitPane SC1;
public JSplitPane SC12;
//-
private JPanel content;
@Description("IGNORE")
protected boolean events_on = true;
private JButton bClose;
private JToolBar Tools;
private JPanel editorPanel;
private JTabbedPane messagesTabs;
private JPanel notesPanel;
private JPanel warningsPanel;
private JPanel errorsPanel;
private JTabbedPane graphsTabs;
private JPanel loopsGraphPanel;
private JPanel functionsGraphPanel;
private JPanel arraysGraphPanel;
private JPanel gcov_log_panel;
private JPanel compilation_out_panel;
private JPanel run_out_panel;
//---------------->
private JPanel recommendationsPanel;
private JPanel graphsBackground;
private JPanel messagesBackground;
//--------------->
//-
private TreeForm loopsForm; //рудиментарно. следует сделать интерфейс такой же как у таблиц
private TreeForm functionsForm;
private TreeForm arraysForm;
//-
private SPFEditor Body = null; //времянка? не очень красиво.
FileMenuBar menuBar = null;
//-
public FileForm(DBProjectFile file_in) {
LoadSplitters();
//--
MessageWarning.filterValue = "";
MessageError.filterValue = "";
MessageNote.filterValue="";
//-
file = file_in;
file.father.db.notes.mountUI(notesPanel);
file.father.db.warnings.mountUI(warningsPanel);
file.father.db.errors.mountUI(errorsPanel);
file.father.db.recommendations.mountUI(recommendationsPanel);
//---------------------------------------------------------------------------
compilation_out_panel.add(new JScrollPane(compilationOutput = new Viewer()));
run_out_panel.add(new JScrollPane(runOutput = new Viewer()));
gcov_log_panel.add(new JScrollPane(gcovLog = new Viewer()));
//----------------------------------------------------------------------------
ShowText();
ShowMessages();
ShowGCOVLog();
ShowAllAnalyses();
Body.addCaretListener(ce -> ShowCaretInfo());
editorPanel.add(menuBar = new FileMenuBar(Body), BorderLayout.NORTH);
ShowCaretInfo();
Body.requestFocus();
RefreshTabsNames();
menuBar.sToGo.addChangeListener(e -> Body.gotoLine((Integer) menuBar.sToGo.getValue()));
ShowProperties();
Pass_2021.passes.get(PassCode_2021.Save).setControlsEnabled(false);
}
@Override
public void ShowLanguage() {
Body.switching_language = true;
if (file.languageName.equals(LanguageName.fortran)) {
switch (file.style) {
case fixed:
case extended:
case none:
Body.setSyntaxEditingStyle("text/FortranSPF");
break;
case free:
Body.setSyntaxEditingStyle("text/FreeFortranSPF");
break;
}
} else
Body.setSyntaxEditingStyle(file.languageName.getStyleKey());
Body.setCodeFoldingEnabled(true);
Body.switching_language = false;
menuBar.ShowLanguage();
}
@Override
public void ShowType() {
menuBar.ShowType();
}
@Override
public void ShowStyle() {
Body.switching_language = true;
int m = file.style.getMargin();
Body.setMarginLineEnabled(true);
Body.setMarginLinePosition(m);
if (m <= 0)
Body.setMarginLineEnabled(false);
if (file.languageName.equals(LanguageName.fortran)) {
switch (file.style) {
case fixed:
case extended:
case none:
Body.setSyntaxEditingStyle("text/FortranSPF");
break;
case free:
Body.setSyntaxEditingStyle("text/FreeFortranSPF");
break;
}
}
Body.switching_language = false;
menuBar.ShowStyle();
}
@Override
public SPFEditorInterface getEditor() {
return Body;
}
@Override
public void FocusLoops() {
graphsTabs.setSelectedIndex(0);
}
@Override
public void FocusFunctions() {
graphsTabs.setSelectedIndex(1);
}
@Override
public void FocusArrays() {
graphsTabs.setSelectedIndex(2);
}
//----
@Override
public void ShowWarningsCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(1, (flag ? "Предупреждения: " : "") + file.father.db.warnings.getVisibleKeys().size());
}
@Override
public void ShowErrorsCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(2, (flag ? "Ошибки: " : "") + file.father.db.errors.getVisibleKeys().size());
}
@Override
public void ShowNotesCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(0, (flag ? "Примечания: " : "") + file.father.db.notes.getVisibleKeys().size());
}
@Override
public void ShowRecommendationsCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(3, (flag ? "Рекомендации: " : "") + file.father.db.recommendations.getVisibleKeys().size());
}
//---
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(graphsTabs);
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
//--
ShowNotesCount();
ShowWarningsCount();
ShowErrorsCount();
ShowRecommendationsCount();
//--
messagesTabs.setTitleAt(4, (flag ? "Компиляция" : ""));
messagesTabs.setTitleAt(5, (flag ? "Запуск" : ""));
messagesTabs.setTitleAt(6, (flag ? "Журнал GCOV" : ""));
}
@Override
public void FocusCompilationOut() {
messagesTabs.setSelectedIndex(4);
}
@Override
public void ShowText() {
UI.Clear(editorPanel);
editorPanel.add(new RTextScrollPane(Body = new SPFEditor(file)));
UI.getSearchReplaceForm().setEditor(Body);
if (UI.getSearchReplaceForm().isVisible())
UI.getSearchReplaceForm().requestFocus();
}
@Override
public void ShowMessages() {
file.father.db.notes.ShowUI();
file.father.db.warnings.ShowUI();
file.father.db.errors.ShowUI();
file.father.db.recommendations.ShowUI();
ShowNotesCount();
ShowWarningsCount();
ShowErrorsCount();
ShowRecommendationsCount();
//-
FocusMessagesPriority();
}
@Override
public void ShowNoMessages() {
boolean full_tiles = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
file.father.db.notes.ClearUI();
file.father.db.warnings.ClearUI();
file.father.db.errors.ClearUI();
file.father.db.recommendations.ClearUI();
messagesTabs.setTitleAt(0, (full_tiles ? "Примечания: " : "") + "-");
messagesTabs.setTitleAt(1, (full_tiles ? "Предупреждения: " : "") + "-");
messagesTabs.setTitleAt(2, (full_tiles ? "Ошибки: " : "") + "-");
messagesTabs.setTitleAt(3, (full_tiles ? "Рекомендации: " : "") + "-");
}
@Override
public void ShowLoops() {
loopsForm.Show();
Body.HighlightLoops();
}
@Override
public void ShowNoLoops() {
loopsForm.Clear();
Body.ClearLoopsHighLights();
}
@Override
public void ShowGCOVLog() {
gcovLog.setText(file.GCOVLog);
}
@Override
public void ShowGCOV() {
Body.HighlightGCOV();
}
@Override
public void ShowNoGCOVLog() {
gcovLog.setText("");
}
@Override
public void FocusGCOVLog() {
messagesTabs.setSelectedIndex(6);
}
@Override
public void ShowNoGCOV() {
Body.ClearGOCVHighlights();
}
@Override
public void ShowFunctions() {
functionsForm.Show();
}
@Override
public void ShowNoFunctions() {
functionsForm.Clear();
}
@Override
public void ShowArrays() {
arraysForm.Show();
}
@Override
public void ShowNoArrays() {
arraysForm.Clear();
}
public void EventsOn() {
events_on = true;
}
public void EventsOff() {
events_on = false;
}
@Override
public void ShowCaretInfo() {
int new_current_line = Body.getCurrentLine();
boolean line_changed = (new_current_line != current_file_line);
current_file_line = new_current_line;
menuBar.sToGo.setModel(new SpinnerNumberModel(current_file_line,
1, Body.getLineCount(), 1
));
//-
menuBar.ShowLinesCount();
menuBar.CurrentSymbolLabel.setText(String.valueOf(Body.getCurrentSymbol()));
//если выделяем строку из графа, то тоже надо отключиьт события.
//чтобы по ней не начался поиск.
if (events_on && line_changed) {
// System.out.println("Search in graphs by line...");
if (loopsForm.getTree() != null)
loopsForm.getTree().SelectNodeByCriteria(current_file_line);
if (functionsForm.getTree() != null)
functionsForm.getTree().SelectNodeByCriteria(current_file_line);
if (arraysForm.getTree() != null)
arraysForm.getTree().SelectNodeByCriteria(current_file_line);
// System.out.println("DONE");
}
}
@Override
public void FocusMessagesPriority() {
switch (file.state) {
case HasErrors:
messagesTabs.setSelectedIndex(2);
break;
case HasWarnings:
messagesTabs.setSelectedIndex(1);
break;
default:
messagesTabs.setSelectedIndex(0);
break;
}
}
@Override
public void ShowFirstError() {
if (file.father.db.errors.ui_.control.getRowCount() > 0)
file.father.db.errors.ui_.control.SelectRow(0);
}
@Override
public void ShowCompilationOutput() {
compilationOutput.setText(file.father.compilation_output);
}
@Override
public void ShowNoCompilationOutput() {
compilationOutput.setText("");
}
@Override
public void ShowRunOutput() {
runOutput.setText(file.father.run_output);
}
@Override
public void ShowNoRunOutput() {
runOutput.setText("");
}
private void createUIComponents() {
// TODO: place custom component creation code here
loopsGraphPanel = (loopsForm = new TreeForm(FileLoopsTree.class)).getContent();
functionsGraphPanel = (functionsForm = new TreeForm(FileFunctionsTree.class)).getContent();
arraysGraphPanel = (arraysForm = new TreeForm(FileArraysTree.class)).getContent();
}
@Override
public JPanel getContent() {
return content;
}
}

View File

@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.FunctionsForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1142" height="539"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="c0a67" binding="tools">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="c7ef9" class="javax.swing.JButton" binding="bZoomIn">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Editor/Font+.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Приблизить граф"/>
</properties>
</component>
<component id="169ae" class="javax.swing.JButton" binding="bZoomOut">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Editor/Font-.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Отдалить граф"/>
</properties>
</component>
<component id="752bf" class="javax.swing.JButton" binding="bSaveGraphAsImage">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/ScreenShot.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Сохранить граф как изображение"/>
</properties>
</component>
<component id="6e55b" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<foreground color="-16777216"/>
<text value=" итераций "/>
</properties>
</component>
<component id="f28ef" class="javax.swing.JSpinner" binding="sIterations">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
<component id="9c7af" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<foreground color="-16777216"/>
<text value=" связность "/>
</properties>
</component>
<component id="db983" class="javax.swing.JSpinner" binding="sResistance">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
<component id="ce20c" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<foreground color="-16777216"/>
<text value=" шкала экрана "/>
</properties>
</component>
<component id="7c318" class="javax.swing.JSpinner" binding="sScreen">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
</children>
</toolbar>
<grid id="77a07" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<toolbar id="af12" binding="filtersBar">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<font name="Times New Roman" size="10"/>
<preferredSize width="0" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="14db3" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="0"/>
<foreground color="-16777216"/>
<text value="по имени: "/>
</properties>
</component>
<component id="882a1" class="javax.swing.JTextField" binding="filterName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<maximumSize width="150" height="30"/>
<minimumSize width="150" height="30"/>
<preferredSize width="150" height="30"/>
</properties>
</component>
<component id="8ac16" class="javax.swing.JCheckBox" binding="ShowStandardFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="115" height="30"/>
<minimumSize width="115" height="30"/>
<preferredSize width="115" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="стандартные"/>
<toolTipText value="Отображать стандартные процедуры"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="1334f" class="javax.swing.JCheckBox" binding="ShowExternalFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="85" height="30"/>
<minimumSize width="85" height="30"/>
<preferredSize width="85" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="внешние"/>
<toolTipText value="Отображать внешние процедуры"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="b366c" class="javax.swing.JCheckBox" binding="ShowUnreachableFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="124" height="30"/>
<minimumSize width="124" height="30"/>
<preferredSize width="124" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="недостижимые"/>
<toolTipText value="Отображать недостижимые процедуры"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="6b691" class="javax.swing.JCheckBox" binding="cbShowByCurrentFunction">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="154" height="30"/>
<minimumSize width="154" height="30"/>
<preferredSize width="154" height="30"/>
<selected value="false"/>
<selectedIcon value="icons/Pick.png"/>
<text value="смежные c текущей: "/>
<toolTipText value="будут отображены только процедуры смежные с текущей"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="abdcb" class="javax.swing.JLabel" binding="lCurrentFunction">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
<component id="61dd9" class="javax.swing.JLabel" binding="depthLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<foreground color="-16777216"/>
<text value=" глубина "/>
<toolTipText value="глубина вызовов"/>
</properties>
</component>
<component id="30af9" class="javax.swing.JSpinner" binding="sDepth">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
<component id="e180e" class="javax.swing.JCheckBox" binding="ShowIn">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="91" height="30"/>
<minimumSize width="91" height="30"/>
<preferredSize width="91" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="входящие"/>
<toolTipText value="Отображать входящие в текущую процедуру вызовы"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="fa7b2" class="javax.swing.JCheckBox" binding="ShowOut">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="97" height="30"/>
<minimumSize width="97" height="30"/>
<preferredSize width="97" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="исходящие"/>
<toolTipText value="Отображать исходящие из текущей процедуры вызовы"/>
<verticalTextPosition value="0"/>
</properties>
</component>
</children>
</toolbar>
<grid id="9d9dc" binding="functionsGraphPanel" custom-create="true" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<background color="-4144960"/>
<font/>
<foreground color="-10197916"/>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,195 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphForm;
import ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphUI;
import Common.Passes.All.SPF_GetGraphFunctionPositions;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.FunctionsWindow;
import javafx.util.Pair;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class FunctionsForm implements FunctionsWindow {
private JPanel content;
private JButton bFitToScreen;
private JButton bZoomIn;
private JButton bZoomOut;
private JButton bSaveGraphAsImage;
private JSpinner sIterations;
private JSpinner sResistance;
private JSpinner sScreen;
private JToolBar tools;
private JTextField filterName;
private JCheckBox ShowStandardFilter;
private JCheckBox ShowExternalFilter;
private JCheckBox ShowUnreachableFilter;
private JSpinner sDepth;
private JCheckBox ShowIn;
private JCheckBox ShowOut;
private JPanel functionsGraphPanel;
private JCheckBox cbShowByCurrentFunction;
private JLabel lCurrentFunction;
private JToolBar filtersBar;
private JLabel depthLabel;
private JButton bSaveCoordinates;
private JToolBar currentFunctionTools;
private FunctionsGraphForm functionsGraphForm;
@Override
public JPanel getContent() {
return content;
}
@Override
public Pair<Integer, Integer> getFunctionsGraphPanelSizes() {
return new Pair<>(functionsGraphPanel.getWidth(), functionsGraphPanel.getHeight());
}
@Override
public FunctionsGraphForm getFunctionsGraphWindow() {
return functionsGraphForm;
}
@Override
public void ShowFunctions() {
functionsGraphForm.Show();
}
@Override
public void ShowNoFunctions() {
functionsGraphForm.Clear();
}
@Override
public void ShowCurrentFunction() {
lCurrentFunction.setText(Current.getFunction().funcName);
}
@Override
public void ShowNoCurrentFunction() {
lCurrentFunction.setText("?");
}
public void ShowFunctionGraphSettings() {
ShowStandardFilter.setSelected(SPF_GetGraphFunctionPositions.showStandardFunctions);
ShowExternalFilter.setSelected(SPF_GetGraphFunctionPositions.showExternalFunctions);
ShowUnreachableFilter.setSelected(SPF_GetGraphFunctionPositions.showUnreachableFunctions);
//-
sIterations.setValue(Current.getProject().fgIterations);
sResistance.setValue(Current.getProject().fgResistance);
sScreen.setValue(Current.getProject().fgScreen);
//-
cbShowByCurrentFunction.setSelected(SPF_GetGraphFunctionPositions.showByCurrentFunction);
ShowIn.setSelected(SPF_GetGraphFunctionPositions.showIn);
ShowOut.setSelected(SPF_GetGraphFunctionPositions.showOut);
sDepth.setValue(SPF_GetGraphFunctionPositions.depth);
}
public FunctionsForm() {
LoadSplitters();
bZoomIn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
functionsGraphForm.control.zoomIn();
}
});
bZoomOut.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
functionsGraphForm.control.zoomOut();
}
});
bSaveGraphAsImage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Pass_2021.passes.get(PassCode_2021.SaveGraph).Do();
}
});
sIterations.setModel(new SpinnerNumberModel(Current.getProject().fgIterations,
100, 5000, 100
));
sResistance.setModel(new SpinnerNumberModel(Current.getProject().fgResistance,
10, 5000, 50
));
sScreen.setModel(new SpinnerNumberModel(Current.getProject().fgScreen,
0.25, 2.0, 0.05
));
sDepth.setModel(new SpinnerNumberModel(1,
0, 64, 1
));
UI.MakeSpinnerRapid(sIterations, e -> {
Current.getProject().UpdatefgIterations((int) sIterations.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI.MakeSpinnerRapid(sResistance, e -> {
Current.getProject().UpdatefgResistance((int) sResistance.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI.MakeSpinnerRapid(sScreen, e -> {
Current.getProject().UpdatefgScreen((double) sScreen.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI.MakeSpinnerRapid(sDepth, e -> {
SPF_GetGraphFunctionPositions.depth = (int) sDepth.getValue();
FunctionsGraphUI.ffTimer.restart();
});
//----фильтрация функций
//<editor-fold desc="Фильтрация функций">
FunctionsGraphUI.ffTimer.setRepeats(false);
filterName.setText(SPF_GetGraphFunctionPositions.filterName);
filterName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
SPF_GetGraphFunctionPositions.filterName = filterName.getText();
FunctionsGraphUI.ffTimer.restart();
}
@Override
public void removeUpdate(DocumentEvent e) {
SPF_GetGraphFunctionPositions.filterName = filterName.getText();
FunctionsGraphUI.ffTimer.restart();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
ShowFunctionGraphSettings();
//-
ShowStandardFilter.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showStandardFunctions = ShowStandardFilter.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowExternalFilter.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showExternalFunctions = ShowExternalFilter.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowUnreachableFilter.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showUnreachableFunctions = ShowUnreachableFilter.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
cbShowByCurrentFunction.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showByCurrentFunction = cbShowByCurrentFunction.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowIn.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showIn = ShowIn.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowOut.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showOut = ShowOut.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
//---------------------------------------------------------
filtersBar.add(Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).createButton(), 0);
filtersBar.add(Pass_2021.passes.get(PassCode_2021.ApplyCurrentFunction).createButton(), 6);
filtersBar.setPreferredSize(new Dimension(0,30));
}
private void createUIComponents() {
// TODO: place custom component creation code here
functionsGraphPanel = (functionsGraphForm = new FunctionsGraphForm()).getContent();
filterName = new StyledTextField();
}
}

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.MainForm">
<grid id="27dc6" binding="Content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1105" height="424"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="cea1" binding="mainPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="7434f" binding="globalTabs">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</tabbedpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,282 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.Global;
import Common.UI.Menus_2023.MainMenuBar.MainWindow;
import Common.UI.UI;
import Common.UI.Windows.Form;
import Common.UI.Windows.FormType;
import Common.Utils.Utils;
import Repository.TestingSystem.Common.Group.Group;
import Repository.TestingSystem.Common.Test.Test;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.*;
import javax.swing.*;
import java.awt.*;
import java.util.Vector;
public class MainForm extends Form implements MainWindow {
private final WelcomeForm welcomeForm = new WelcomeForm(); //заглушка когда проекта нет.
int global_index = 0;
//-----------------
private ProjectForm projectForm;
private CallbackForm callbackForm;
private CredentialsForm credentialsForm;
private TestsForm testsForm;
//---
private TestingForm testingForm;
//-----------------
private JPanel Content;
private JTabbedPane globalTabs;
private JPanel mainPanel;
@Override
protected JPanel getMainPanel() {
return Content;
}
@Override
protected FormType getFormType() {
return FormType.Main;
}
@Override
public String getIconName() {
return "Sapfor.png";
}
@Override
public String getWTitleText() {
return "Visual Sapfor 3.0";
}
@Override
public String getUTitleText() {
return "Visual Sapfor 3.0";
}
@Override
public void AfterClose() {
Pass_2021.passes.get(PassCode_2021.CloseCurrentProject).Do();
if (UI.getVersionsWindow() != null)
((VersionsForm) UI.getVersionsWindow()).SaveSplitters();
SaveCallbackPanel();
SaveCredentialsPanel();
SaveTestsPanel();
SaveTestingPanel();
//--
if (UI.debugWindow!=null)
((FormWithSplitters) UI.debugWindow).SaveSplitters();
//--
Global.FinishApplication();
}
public MainForm() {
mainPanel.add(UI.mainMenuBar, BorderLayout.NORTH);
InstallWelcomePanel();
InstallCallbackPanel();
InstallCredentialsPanel();
InstallTestsPanel();
InstallTestingPanel();
ShowUpdatesIcon();
//----------------------
}
private void InstallWelcomePanel() {
globalTabs.insertTab("Начало работы",
null,
welcomeForm.content,
"Для начала работы откройте проект с помощью верхней панели инструментов, или перетащите его сюда", 0
);
}
private void InstallProjectPanel() {
globalTabs.insertTab("", null,
(projectForm = new ProjectForm()).content, Current.getProject().description, 0);
globalTabs.setTabComponentAt(0,
new TabToolBar("Проект: " + Current.getProject().name, PassCode_2021.CloseCurrentProject) {
@Override
public void leftMouseAction() {
globalTabs.setSelectedIndex(0);
}
});
}
private void RemoveProjectPanel() {
globalTabs.removeTabAt(0);
if (projectForm != null) {
projectForm.SaveSplitters();
projectForm = null;
}
}
private void InstallCallbackPanel() {
globalTabs.insertTab("Обратная связь",
Utils.getIcon("/icons/Bug.png"),
(callbackForm = new CallbackForm()).getContent(),
"Журнал ошибок и связь с разработчиками", 1);
}
private void SaveCallbackPanel() {
if (callbackForm != null) {
callbackForm.SaveSplitters();
callbackForm = null;
}
}
private void InstallCredentialsPanel() {
globalTabs.insertTab("Машины",
Utils.getIcon("/icons/Machine.png"),
(credentialsForm = new CredentialsForm()).getContent(),
"Машины, пользователи, компиляторы", 2);
}
private void SaveCredentialsPanel() {
if (credentialsForm != null) {
credentialsForm.SaveSplitters();
credentialsForm = null;
}
}
private void InstallTestsPanel() {
globalTabs.insertTab("Тесты",
Utils.getIcon("/icons/Library.PNG"),
(testsForm = new TestsForm()).getContent(),
"Библиотека тестов на сервере", 3);
}
private void SaveTestsPanel() {
if (testsForm != null) {
testsForm.SaveSplitters();
testsForm = null;
}
}
private void InstallTestingPanel() {
testingForm = new TestingForm();
ShowTestingTab();
}
@Override
public void ShowTestingTab() {
if (globalTabs.getTabCount() < 5)
globalTabs.insertTab("Тестирование",
Utils.getIcon("/icons/Session.png"),
testingForm.getContent(),
"Система тестирования", 4);
}
@Override
public void HideTestingTab() {
if (globalTabs.getTabCount() == 5)
globalTabs.removeTabAt(4);
}
@Override
public void ShowCredentials() {
/*
String res = "";
if (Current.HasMachine()) {
res += "@" + Current.getMachine().getURL();
if (Current.HasUser()) {
res = Current.getUser().login + res;
} else res = "?" + res;
/*
if (Current.HasCompiler() && Current.getCompiler().type.equals(CompilerType.dvm)) {
testingTabs.setTitleAt(3, "DVM система: " + Current.getCompiler().description);
} else {
testingTabs.setTitleAt(3, "DVM система: ?");
}
*/
/*д
} else {
res += "?@?";
}
globalTabs.setTitleAt(2, res);
*/
}
@Override
public void ShowCheckedTestsCount() {
int res = 0;
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
Vector<Test> selected_tests = new Vector<>();
Vector<Test> group_tests = new Vector<>();
for (Test test : Global.testingServer.db.tests.Data.values()) {
if (test.group_id==group.id) {
if (test.isSelected())
selected_tests.add(test);
else
group_tests.add(test);
}
}
//-
if (selected_tests.isEmpty())
res += group_tests.size();
else
res += selected_tests.size();
}
//--
globalTabs.setTitleAt(3, "Тесты: " + res);
}
private void SaveTestingPanel() {
if (testingForm != null) {
testingForm.SaveSplitters();
testingForm = null;
}
}
private void saveGlobalTab() {
global_index = globalTabs.getSelectedIndex();
}
private void restoreGlobalTab() {
globalTabs.setSelectedIndex(global_index);
}
@Override
public ProjectWindow getProjectWindow() {
return projectForm;
}
@Override
public CallbackWindow getCallbackWindow() {
return callbackForm;
}
@Override
public CredentialsWindow getCredentialsWindow() {
return credentialsForm;
}
@Override
public TestsWindow getTestsWindow() {
return testsForm;
}
@Override
public void ShowUpdatesIcon() {
UI.mainMenuBar.ShowUpdatesIcon();
}
@Override
public void FocusProject() {
globalTabs.setSelectedIndex(0);
}
@Override
public void FocusCallback() {
globalTabs.setSelectedIndex(1);
}
@Override
public void FocusTesting() {
globalTabs.setSelectedIndex(4);
}
@Override
public TestingWindow getTestingWindow() {
return testingForm;
}
@Override
public void Show() {
//приходится идти на это только ПОСЛЕ создания главного окна.
// иначе ссылка на главное окно в методах пустая.
getCallbackWindow().ShowAll();
getCredentialsWindow().ShowAll();
getTestsWindow().ShowAll();
if (getTestingWindow() != null)
getTestingWindow().ShowAll();
UI.windowsStack.push(this);
System.out.println("New Front Window");
super.Show();
}
@Override
public void ShowProject() {
//-
saveGlobalTab();
RemoveProjectPanel();
InstallProjectPanel();
restoreGlobalTab();
UI.getDebugWindow().DropCompilationTasksComparison();
UI.mainMenuBar.ShowProject(true);
}
@Override
public void ShowNoProject() {
//-
saveGlobalTab();
RemoveProjectPanel();
InstallWelcomePanel();
restoreGlobalTab();
UI.mainMenuBar.ShowProject(false);
}
}

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.ProfilesFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="67149" binding="SC61">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="84c7b" binding="profilesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="-1" height="120"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="d663" binding="settingsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="-1" height="120"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,21 @@
package Common.UI.Windows.Main;
import Common.Global;
import Common.UI.Windows.Dialog.DialogFields;
import Common.UI.Windows.Interface.FormWithSplitters;
import javax.swing.*;
import java.awt.*;
public class ProfilesFields implements DialogFields, FormWithSplitters {
private JPanel content;
public JSplitPane SC61;
private JPanel profilesPanel;
private JPanel settingsPanel;
@Override
public Component getContent() {
return content;
}
public ProfilesFields(){
Global.db.sapforProfiles.mountUI(profilesPanel);
Global.db.sapforProfilesSettings.mountUI(settingsPanel);
}
}

View File

@@ -0,0 +1,71 @@
package Common.UI.Windows.Main;
import Common.Global;
import Common.UI.Windows.Dialog.Dialog;
import Common.UI.Windows.FormType;
import GlobalData.FormsParams.DBForm;
public class ProfilesForm extends Dialog<Object, ProfilesFields> {
private DBForm info = null;
public ProfilesForm() {
super(ProfilesFields.class);
}
@Override
public boolean NeedsScroll() {
return false;
}
@Override
public void CreateButtons() {
}
@Override
public void Init(Object... params) {
if (Global.db.sapforProfiles.size() > 0) {
for (Object key : Global.db.sapforProfiles.Data.keySet()) {
Global.db.sapforProfiles.ShowUI(key);
return;
}
} else {
Global.db.sapforProfiles.ShowUI();
}
}
@Override
public int getDefaultWidth() {
return 400;
}
@Override
public int getDefaultHeight() {
return 300;
}
@Override
public void CreateContent() {
super.CreateContent();
fields.LoadSplitters();
try {
LoadWindowParameters();
} catch (Exception ex) {
ex.printStackTrace();
}
}
@Override
public void onClose() {
fields.SaveSplitters();
try {
SaveWindowParameters();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void LoadWindowParameters() throws Exception {
if (Global.db.forms.Data.containsKey(FormType.Profiles)) {
info = Global.db.forms.Data.get(FormType.Profiles);
info.Apply(this);
return;
}
setSize(getDefaultWidth(), getDefaultHeight());
}
public void SaveWindowParameters() throws Exception {
if (info != null) {
info.Init(this);
Global.db.Update(info);
} else
Global.db.Insert(new DBForm(FormType.Profiles, this));
}
}

View File

@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.ProjectForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1330" height="468"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="bf9cd" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="11ba1" binding="projectTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<tabLayoutPolicy value="1"/>
<tabPlacement value="1"/>
</properties>
<border type="none"/>
<children>
<grid id="7bb8d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Файл: -" icon="icons/Generate.png">
<tooltip value="Код"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="68abc" binding="SC3">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="650"/>
<dividerSize value="3"/>
<orientation value="1"/>
</properties>
<border type="none"/>
<children>
<grid id="b29f8" binding="filePanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="550" height="250"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="45a5e" binding="projectBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="250" height="250"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="12cee" binding="projectViewPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="0"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="c4ea6" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Arrays.png">
<tooltip value="Массивы"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="143c4" binding="arraysFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="a4700" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Function.png">
<tooltip value="Процедуры"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="a93f7" binding="functionsFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="3cb4d" binding="analysisFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="" icon="icons/Metrics.png">
<tooltip value="Анализ"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="59473" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Log.png">
<tooltip value="Журнал"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<scrollpane id="43580" binding="logScroll" custom-create="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</scrollpane>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,291 @@
package Common.UI.Windows.Main;
import Common.Current;
import Common.Global;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.ProjectMenuBar.ProjectMenuBar;
import Common.UI.Trees.TreeForm;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.Files.DBProjectFile;
import ProjectData.Files.UI.FilesTree;
import ProjectData.ProjectView;
import ProjectData.SapforData.Functions.UI.InlineTree;
import ProjectData.SapforData.Functions.UI.InlineTree2;
import ProjectData.SapforData.Includes.UI.IncludesTree;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import Common.UI.Windows.Interface.*;
import javax.swing.*;
import java.awt.*;
public class ProjectForm implements FormWithSplitters, ProjectWindow {
private final ArraysWindow arraysForm;
private final FunctionsWindow functionsForm;
private final AnalysisWindow analysisForm;
public JSplitPane SC3;
//</editor-fold>
public JPanel content;
public TreeForm includesForm;
private JTabbedPane projectTabs;
private TreeForm filesForm;
private Viewer projectDescription = null;
private JScrollPane logScroll;
private JPanel inlinePanel2;
private JPanel inlinePanel;
private TreeForm inlineForm;
private TreeForm inlineForm2;
private Viewer logText;
private JPanel includesPanel;
private JPanel filePanel;
private JPanel arraysFormPanel;
private JPanel functionsFormPanel;
private JPanel analysisFormPanel;
private final JScrollPane FastAccessScroll;
private JPanel projectViewPanel;
private JPanel projectBackground;
ProjectMenuBar menuBar;
//-
@Override
public ArraysWindow getArraysWindow() {
return arraysForm;
}
@Override
public FunctionsWindow getFunctionsWindow() {
return functionsForm;
}
@Override
public AnalysisWindow getAnalysisWindow() {
return analysisForm;
}
public ProjectForm() {
LoadSplitters();
//-
projectBackground.add(menuBar = new ProjectMenuBar(), BorderLayout.NORTH);
arraysFormPanel.add((arraysForm = new ArraysForm()).getContent());
functionsFormPanel.add((functionsForm = new FunctionsForm()).getContent());
analysisFormPanel.add((analysisForm = new AnalysisForm()).getContent());
//-
FastAccessScroll = new JScrollPane(UI.fastAccessMenuBar) {
{
getHorizontalScrollBar().setPreferredSize(new Dimension(0, 10));
setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
setPreferredSize(new Dimension(-1, 45));
}
};
content.add(FastAccessScroll, BorderLayout.NORTH);
//-
filesForm.Show();
InstallVersionsPanel();
InstallDebugPanel();
UI.getDebugWindow().ShowAll();
ShowAllAnalyses();
ShowProjectView();
SwitchScreen(Global.db.settings.get(SettingName.SmallScreen).toBoolean());
RefreshTabsNames();
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
arraysForm.SaveSplitters();
analysisForm.SaveSplitters();
functionsForm.SaveSplitters();
}
private void createUIComponents() {
// TODO: place custom component creation code here
filesForm = new TreeForm(FilesTree.class);
projectDescription = new Viewer();
logText = new Viewer();
logScroll = new JScrollPane(logText);
includesForm = new TreeForm(IncludesTree.class);
inlineForm = new TreeForm(InlineTree.class);
inlineForm2 = new TreeForm(InlineTree2.class);
}
@Override
public void RefreshProjectFiles() {
filesForm.Refresh();
}
@Override
public void ShowSelectedDirectory() {
System.out.println(Current.getSelectedDirectory().getAbsolutePath());
}
@Override
public void ShowSelectedFile() {
System.out.println(Current.getSelectedFile().file.getAbsolutePath());
}
@Override
public void ShowNoSelectedFile() {
System.out.println("?");
}
@Override
public void ShowProjectSapforLog() {
logText.setText(Current.getProject().Log);
logText.setCaretPosition(0);
}
@Override
public void ShowFunctions() {
functionsForm.ShowFunctions();
inlineForm.Show();
inlineForm2.Show();
}
@Override
public void ShowNoFunctions() {
functionsForm.ShowNoFunctions();
inlineForm.Clear();
inlineForm2.Clear();
}
@Override
public void ShowNoIncludes() {
includesForm.Clear();
}
@Override
public void ShowIncludes() {
includesForm.Show();
}
@Override
public void ShowFile() {
//пока текущий файл только один.
//filesTabs.insertTab(null, null, (Current.getFile().form = new FileForm(Current.getFile())).content,
// "текущий файл проекта", 0);
//filesTabs.setTabComponentAt(0,
// new TabToolBar(Current.getFile().name, PassCode_2021.CloseCurrentFile));
// projectTabs.setTitleAt(0, "Файл: " + Current.getFile().name);
filePanel.add((Current.getFile().form = new FileForm(Current.getFile())).getContent());
projectTabs.setTabComponentAt(0,
new TabToolBar("Файл: " + Current.getFile().name, PassCode_2021.CloseCurrentFile) {
@Override
public void leftMouseAction() {
projectTabs.setSelectedIndex(0);
}
});
}
@Override
public void ShowNoFile() {
// projectTabs.setTitleAt(0, "Файл: -");
projectTabs.setTabComponentAt(0, new TabToolBar("Файл: -"){
@Override
public void leftMouseAction() {
projectTabs.setSelectedIndex(0);
}
});
UI.Clear(filePanel);
//filesTabs.removeAll();
}
@Override
public void GotoFile(String fileName, int line, boolean focus) {
if (focus) FocusFile();
if (Current.HasFile() && Current.getFile().name.equals(fileName))
Current.getFile().form.getEditor().gotoLine(line);
else if (Current.getProject().db.files.containsKey(fileName)) {
DBProjectFile targetFile = Current.getProject().db.files.get(fileName);
targetFile.UpdateLastLine(line);
Pass_2021.passes.get(PassCode_2021.OpenCurrentFile).Do(targetFile);
}
}
@Override
public void FocusFile() {
projectTabs.setSelectedIndex(0);
}
@Override
public void FocusFileTabs() {
projectTabs.requestFocus();
}
@Override
public void FocusDependencies() {
FocusFile();
menuBar.projectViewMenu.SelectView(ProjectView.Includes);
}
@Override
public void FocusArrays() {
projectTabs.setSelectedIndex(1);
}
@Override
public void FocusFunctions() {
projectTabs.setSelectedIndex(2);
menuBar.projectViewMenu.SelectView(ProjectView.FunctionsHierarchy);
}
@Override
public void FocusAnalysis() {
projectTabs.setSelectedIndex(3);
}
@Override
public void FocusHierarchy() {
FocusFile();
menuBar.projectViewMenu.SelectView(ProjectView.FunctionsHierarchy);
}
@Override
public void FocusPoints() {
FocusFile();
menuBar.projectViewMenu.SelectView(ProjectView.FunctionsCallsPoints);
}
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(projectTabs, 1);
}
@Override
public void RefreshProjectTreeAndMessages() {
RefreshProjectFiles();
DBProjectFile badFile = Current.getProject().getFirstBadFile();
if (badFile != null) {
Pass_2021.passes.get(PassCode_2021.OpenCurrentFile).Do(badFile);
UI.getMainWindow().FocusProject();
UI.getMainWindow().getProjectWindow().FocusFile();
}
//-
if (Current.HasFile()) {
Current.getFile().form.ShowMessages();
if (badFile != null && badFile.equals(Current.getFile()))
Current.getFile().form.ShowFirstError();
}
}
@Override
public TreeForm getFilesTreeForm() {
return filesForm;
}
@Override
public void SwitchScreen(boolean small) {
FastAccessScroll.setVisible(!small);
content.repaint();
content.revalidate();
}
@Override
public void ShowProjectView() {
UI.Clear(projectViewPanel);
ProjectView view = Current.getProjectView();
menuBar.getProjectViewMenu().setToolTipText(view.getDescription());
menuBar.getProjectViewMenu().setIcon(Utils.getIcon(view.getIcon()));
switch (view) {
case Files:
projectViewPanel.add(filesForm.getContent());
break;
case Includes:
projectViewPanel.add(includesForm.getContent());
break;
case FunctionsHierarchy:
projectViewPanel.add(inlineForm2.getContent());
break;
case FunctionsCallsPoints:
projectViewPanel.add(inlineForm.getContent());
break;
}
projectViewPanel.revalidate();
}
//-
private void InstallVersionsPanel() {
projectTabs.insertTab("",
Utils.getIcon("/icons/VersionsTree.png"),
UI.getVersionsWindow().getContent(),
"Версии", 5);
}
private void InstallDebugPanel(){
projectTabs.insertTab("",
Utils.getIcon("/icons/Command.png"),
UI.getDebugWindow().getContent(),
"Компиляция и запуск", 6);
}
@Override
public void FocusVersions() {
projectTabs.setSelectedIndex(5);
}
}

View File

@@ -0,0 +1,36 @@
package Common.UI.Windows.Main;
import Common.Current;
import GlobalData.Tasks.RunTask.RunTask;
public class RunTasksComparisonForm extends TasksComparisonForm<RunTask> {
public RunTasksComparisonForm(ComparisonForm<RunTask> slave_in) {
super(RunTask.class, slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.RunTask;
}
@Override
protected TasksComparisonState getFirstState() {
return TasksComparisonState.RunOutput;
}
@Override
protected TasksComparisonState[] getForbiddenStates() {
return new TasksComparisonState[]{
TasksComparisonState.CompilationOutput,
TasksComparisonState.CompilationErrors
};
}
@Override
protected String getTextByTab() {
switch (status) {
case RunOutput:
return object.getOutput();
case RunErrors:
return object.getErrors();
case Sts:
return object.getLocalStsText();
default:
return "";
}
}
}

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Common.UI.Windows.Main.SapforPackagesComparisonForm">
<grid id="27dc6" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="90950" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<toolbar id="9400d" binding="tools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<maximumSize width="32929" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="9e365" class="javax.swing.JLabel" binding="lObjectName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="1"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
<component id="d1041" class="javax.swing.JButton" binding="bApplyObject">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Apply.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Назначить объект для сравнения"/>
</properties>
</component>
<component id="c8651" class="javax.swing.JButton" binding="bClose">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Close.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Открепить объект"/>
</properties>
</component>
<component id="37251" class="javax.swing.JSeparator">
<constraints/>
<properties/>
</component>
<component id="335a7" class="javax.swing.JButton" binding="bPrevious">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Prev.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к предыдущему различию "/>
</properties>
</component>
<component id="1f666" class="javax.swing.JButton" binding="bNext">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Next.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к следующему различию"/>
</properties>
</component>
<component id="155b4" class="javax.swing.JButton" binding="bCompare">
<constraints/>
<properties>
<icon value="icons/Menu/Undo.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Сравнить объекты"/>
</properties>
</component>
</children>
</toolbar>
<grid id="69fc0" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<grid id="24e20" binding="treePanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

Some files were not shown because too many files have changed in this diff Show More