From a39b8c3a13975c93094b23af5b84ddb9a3db69b7 Mon Sep 17 00:00:00 2001 From: 02090095 Date: Wed, 20 Mar 2024 19:12:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D0=B6=D1=83?= =?UTF-8?q?=D1=82=D0=BE=D1=87=D0=BD=D1=8B=D0=B9.=20=D1=81=D0=B2=D0=BE?= =?UTF-8?q?=D1=80=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B2=D1=8C=D0=B5=D0=B2=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0=20=D0=BF=D0=BE=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=D0=BE=D0=B9=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA?= =?UTF-8?q?=D0=B5.=20=D0=B4=D1=83=D0=BC=D0=B0=D1=8E=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B6=D0=B8=D1=82=D1=8C=20=D1=81=D0=B2=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B2=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BF=D0=B0=D0=BA=D1=82=D0=BD=D0=BE=D1=81=D1=82=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 4 +++ properties | 5 ++-- src/Common/GlobalProperties.java | 2 ++ .../Menus_2023/MainMenuBar/MainMenuBar.java | 10 +++++++ .../UI/Interface/ProjectWindow.java | 4 +++ src/Visual_DVM_2021/UI/Main/ProjectForm.form | 11 +++----- src/Visual_DVM_2021/UI/Main/ProjectForm.java | 27 ++++++++++++++++++- 7 files changed, 52 insertions(+), 11 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 14660d53..333d59b8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,6 +7,10 @@ + + + + diff --git a/properties b/properties index 52e6db2d..5a3eb592 100644 --- a/properties +++ b/properties @@ -35,6 +35,7 @@ "CheckTestingIntervalSeconds": 10, "EmailOnTestingProgress": false, "collapseCredentials": false, - "collapseFileGraphs": false, - "collapseFileMessages": false + "collapseFileGraphs": true, + "collapseFileMessages": true, + "collapseProjectTrees": true } \ No newline at end of file diff --git a/src/Common/GlobalProperties.java b/src/Common/GlobalProperties.java index 964802f6..6a3ef5bd 100644 --- a/src/Common/GlobalProperties.java +++ b/src/Common/GlobalProperties.java @@ -100,6 +100,8 @@ public class GlobalProperties extends Properties { public boolean collapseFileGraphs = false; @Expose public boolean collapseFileMessages = false; + @Expose + public boolean collapseProjectTrees = false; //- @Override public File getFile() { diff --git a/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java b/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java index 2be3e1c7..53a59746 100644 --- a/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java +++ b/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java @@ -1,6 +1,8 @@ package Common.UI.Menus_2023.MainMenuBar; import Common.Current; import Common.Global; +import Common.UI.Menus_2023.ECButtonPosition; +import Common.UI.Menus_2023.ExpandCollapseButton; import Common.UI.Menus_2023.MenuBarButton; import Common.UI.Menus_2023.VisualiserMenuBar; import Common.UI.UI; @@ -14,6 +16,7 @@ public class MainMenuBar extends VisualiserMenuBar { JMenu analyses; JMenu transformations; MenuBarButton components; + public ExpandCollapseButton RightECButton; public MainMenuBar() { addMenus(new LastOpenedProjectsMenu()); addPasses(PassCode_2021.OpenCurrentProject, PassCode_2021.CreateEmptyProject); @@ -65,6 +68,13 @@ public class MainMenuBar extends VisualiserMenuBar { } }); */ + add(RightECButton = new ExpandCollapseButton("область деревьев проекта", ECButtonPosition.Up) { + { + addActionListener(e -> { + UI.getMainWindow().getProjectWindow().SwitchProjectTrees(); + }); + } + }); //--- ShowProject(false); } diff --git a/src/Visual_DVM_2021/UI/Interface/ProjectWindow.java b/src/Visual_DVM_2021/UI/Interface/ProjectWindow.java index 6e354d1b..98ba3ac3 100644 --- a/src/Visual_DVM_2021/UI/Interface/ProjectWindow.java +++ b/src/Visual_DVM_2021/UI/Interface/ProjectWindow.java @@ -77,4 +77,8 @@ public interface ProjectWindow { //- void RefreshTabsNames(); void FocusVersions(); + //-- + void CollapseProjectTrees(); + void ExpandProjectTrees(); + void SwitchProjectTrees(); } diff --git a/src/Visual_DVM_2021/UI/Main/ProjectForm.form b/src/Visual_DVM_2021/UI/Main/ProjectForm.form index 3a3ac979..caca7a64 100644 --- a/src/Visual_DVM_2021/UI/Main/ProjectForm.form +++ b/src/Visual_DVM_2021/UI/Main/ProjectForm.form @@ -26,8 +26,7 @@ - - + @@ -41,11 +40,7 @@ - - - - - + @@ -65,7 +60,7 @@ - + diff --git a/src/Visual_DVM_2021/UI/Main/ProjectForm.java b/src/Visual_DVM_2021/UI/Main/ProjectForm.java index 1c6a4384..9b6ae120 100644 --- a/src/Visual_DVM_2021/UI/Main/ProjectForm.java +++ b/src/Visual_DVM_2021/UI/Main/ProjectForm.java @@ -43,6 +43,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow { private JPanel analysisFormPanel; private final JScrollPane FastAccessScroll; private JPanel projectViewPanel; + private JPanel projectTreesBackground; private JPanel projectBackground; ProjectMenuBar menuBar; //- @@ -61,7 +62,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow { public ProjectForm() { LoadSplitters(); //- - projectBackground.add(menuBar = new ProjectMenuBar(), BorderLayout.NORTH); + projectTreesBackground.add(menuBar = new ProjectMenuBar(), BorderLayout.NORTH); arraysFormPanel.add((arraysForm = new ArraysForm()).getContent()); functionsFormPanel.add((functionsForm = new FunctionsForm()).getContent()); analysisFormPanel.add((analysisForm = new AnalysisForm()).getContent()); @@ -288,4 +289,28 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow { public void FocusVersions() { projectTabs.setSelectedIndex(5); } + //-- + @Override + public void CollapseProjectTrees() { + UI.Clear(projectBackground); + projectBackground.add(fileBackground); + projectBackground.updateUI(); + } + @Override + public void ExpandProjectTrees() { + SC3.setLeftComponent(fileBackground); + projectBackground.add(SC3); + projectBackground.updateUI(); + } + @Override + public void SwitchProjectTrees() { + if (Global.properties.collapseProjectTrees) + ExpandProjectTrees(); + else + CollapseProjectTrees(); + //--------------- + Global.properties.collapseProjectTrees =!Global.properties.collapseProjectTrees; + Global.properties.Update(); + UI.mainMenuBar.RightECButton.Switch(Global.properties.collapseProjectTrees); + } } \ No newline at end of file