no message

This commit is contained in:
2023-10-10 23:33:23 +03:00
parent ca969faacd
commit 7a1d5211ae
7 changed files with 124 additions and 107 deletions

View File

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

View File

@@ -8,10 +8,7 @@ import Common.UI.Windows.FormType;
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.CallbackWindow;
import Visual_DVM_2021.UI.Interface.CredentialsWindow;
import Visual_DVM_2021.UI.Interface.ProjectWindow;
import Visual_DVM_2021.UI.Interface.TestingWindow;
import Visual_DVM_2021.UI.Interface.*;
import javax.swing.*;
import java.awt.*;
@@ -22,21 +19,14 @@ public class MainForm extends Form implements MainWindow {
private ProjectForm projectForm;
private CallbackForm callbackForm;
private CredentialsForm credentialsForm;
private TestsForm testsForm;
//---
private TestingForm testingForm;
//-----------------
private JPanel Content;
private JTabbedPane globalTabs;
private JPanel mainPanel;
public MainForm() {
mainPanel.add(UI.mainMenuBar, BorderLayout.NORTH);
InstallWelcomePanel();
InstallCredentialsPanel();
InstallCallbackPanel();
InstallTestingPanel();
ShowUpdatesIcon();
//----------------------
}
@Override
protected JPanel getMainPanel() {
return Content;
@@ -64,9 +54,20 @@ public class MainForm extends Form implements MainWindow {
((VersionsForm) UI.getVersionsWindow()).SaveSplitters();
SaveCallbackPanel();
SaveCredentialsPanel();
SaveTestsPanel();
SaveTestingPanel();
Global.FinishApplication();
}
public MainForm() {
mainPanel.add(UI.mainMenuBar, BorderLayout.NORTH);
InstallWelcomePanel();
InstallCallbackPanel();
InstallCredentialsPanel();
InstallTestsPanel();
InstallTestingPanel();
ShowUpdatesIcon();
//----------------------
}
private void InstallWelcomePanel() {
globalTabs.insertTab("Начало работы",
null,
@@ -105,10 +106,10 @@ public class MainForm extends Form implements MainWindow {
}
}
private void InstallCredentialsPanel() {
globalTabs.insertTab("Учётные данные",
globalTabs.insertTab("Машины",
Utils.getIcon("/icons/Machine.png"),
(credentialsForm = new CredentialsForm()).getContent(),
"Машины, пользователи, компиляторы", 1);
"Машины, пользователи, компиляторы", 2);
}
private void SaveCredentialsPanel() {
if (credentialsForm != null) {
@@ -116,25 +117,38 @@ public class MainForm extends Form implements MainWindow {
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() < 4)
if (globalTabs.getTabCount() < 5)
globalTabs.insertTab("Тестирование",
Utils.getIcon("/icons/Session.png"),
testingForm.getContent(),
"Система тестирования", 3);
"Система тестирования", 4);
}
@Override
public void HideTestingTab() {
if (globalTabs.getTabCount() == 4)
globalTabs.removeTabAt(3);
if (globalTabs.getTabCount() == 5)
globalTabs.removeTabAt(4);
}
@Override
public void ShowCredentials() {
/*
String res = "";
if (Current.HasMachine()) {
res += "@" + Current.getMachine().getURL();
@@ -148,10 +162,12 @@ public class MainForm extends Form implements MainWindow {
testingTabs.setTitleAt(3, "DVM система: ?");
}
*/
/*д
} else {
res += "?@?";
}
globalTabs.setTitleAt(2, res);
*/
}
private void SaveTestingPanel() {
if (testingForm != null) {
@@ -178,6 +194,10 @@ public class MainForm extends Form implements MainWindow {
return credentialsForm;
}
@Override
public TestsWindow getTestsWindow() {
return testsForm;
}
@Override
public void ShowUpdatesIcon() {
UI.mainMenuBar.ShowUpdatesIcon();
}
@@ -203,6 +223,7 @@ public class MainForm extends Form implements MainWindow {
// иначе ссылка на главное окно в методах пустая.
getCallbackWindow().ShowAll();
getCredentialsWindow().ShowAll();
getTestsWindow().ShowAll();
if (getTestingWindow() != null)
getTestingWindow().ShowAll();
UI.windowsStack.push(this);

View File

@@ -415,61 +415,6 @@
</tabbedpane>
</children>
</grid>
<grid id="79bb4" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Тесты (0)" icon="icons/Library.PNG">
<tooltip value="Тесты"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="66a49" binding="SC45">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="700"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="e708e" binding="groupsBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="400" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="acd67" binding="groupsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="56f09" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="250" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="f518d" binding="testsPanel" 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="e6dae" binding="dvmTestingPanel" 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>

View File

@@ -25,7 +25,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
public JSplitPane SC41;
public JSplitPane SC42;
public JSplitPane SC43;
public JSplitPane SC45;
public JSplitPane SC50;
public JSplitPane SC51;
public JSplitPane SC52;
@@ -76,7 +75,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
private JPanel sapforConfigurationCommandsPanel;
private JLabel sapforTasksPackagesLabel;
private JLabel sapforTasksLabel;
private JPanel groupsBackground;
private JPanel sapforScenariosPanel;
private JPanel serverSapforsPanel;
private JPanel sapforTasksPackagesPanel;
@@ -130,17 +128,12 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
ShowNoProject();
//-
Global.testingServer.db.configurations.mountUI(configurationsPanel);
Global.testingServer.db.groups.mountUI(groupsPanel);
Global.testingServer.db.tests.mountUI(testsPanel);
Global.testingServer.account_db.packages.mountUI(packagesPanel);
Global.testingServer.account_db.testRunTasks.mountUI(testsRunTasksPanel);
//--
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
Global.testingServer.db.serverSapfors.mountUI(serverSapforsPanel);
// Global.testingServer.db.sapforTasksPackages.mountUI(sapforScenariosPanel);
// Global.testingServer.db.sapforTasksPackages.mountUI(sapforPackagesPanel);
//Global.db.sapforTasks.mountUI(sapforTasksPanel);
Global.testingServer.account_db.sapforTasksPackages.mountUI(sapforTasksPackagesPanel);
// Global.testingServer.account_db.sapforTasks.mountUI(sapforTasksPanel);
//--------------------------------------------------------------------->>>>
@@ -169,7 +162,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
@Override
public void ShowAll() {
Global.testingServer.db.configurations.ShowUI();
Global.testingServer.db.groups.ShowUI();
Global.testingServer.db.serverSapfors.ShowUI();
Global.testingServer.db.sapforConfigurations.ShowUI();
//----
@@ -206,7 +198,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
}
@Override
public void ShowProject() {
testingTabs.setEnabledAt(1, true);
testingTabs.setEnabledAt(0, true);
//-
ShowSession();
//-
@@ -218,9 +210,9 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
Global.db.compilationTasks.ClearUI();
Global.db.runTasks.ClearUI();
//-
if (testingTabs.getSelectedIndex() == 1)
testingTabs.setSelectedIndex(0);
testingTabs.setEnabledAt(1, false);
if (testingTabs.getSelectedIndex() == 0)
testingTabs.setSelectedIndex(1);
testingTabs.setEnabledAt(0, false);
}
@Override
public void SaveSplitters() {

View File

@@ -1,13 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Visual_DVM_2021.UI.Main.TestsForm">
<grid id="27dc6" row-count="1" column-count="1" layout-manager="BorderLayout">
<margin top="0" left="0" bottom="0" right="0"/>
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
<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"/>
<xy x="20" y="20" width="653" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
<children>
<grid id="35527" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<splitpane id="c3576" binding="SC45">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="700"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="f7d57" binding="groupsBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="400" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="94f2" binding="groupsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="2cfd" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="250" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="c642d" binding="testsPanel" 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

@@ -1,8 +1,26 @@
package Visual_DVM_2021.UI.Main;
import Common.Global;
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
import Visual_DVM_2021.UI.Interface.TestsWindow;
public class TestsForm implements TestsWindow {
import javax.swing.*;
public class TestsForm implements TestsWindow, FormWithSplitters {
private JPanel content;
public JSplitPane SC45;
private JPanel groupsBackground;
private JPanel groupsPanel;
private JPanel testsPanel;
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowAll() {
Global.testingServer.db.groups.ShowUI();
}
public TestsForm(){
LoadSplitters();
Global.testingServer.db.groups.mountUI(groupsPanel);
Global.testingServer.db.tests.mountUI(testsPanel);
}
}