сворачивание машин v++

This commit is contained in:
2024-03-15 12:32:49 +03:00
parent 431d23f427
commit 1b91cff318
15 changed files with 159 additions and 28 deletions

View File

@@ -94,6 +94,8 @@ public class GlobalProperties extends Properties {
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
@Expose
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
@Expose
public boolean collapseCredentials=false;
//-
@Override
public File getFile() {

View File

@@ -0,0 +1,66 @@
package Common.UI.Menus_2023.CredentialsBar;
import Common.Current;
import Common.UI.Menus_2023.MenuBarButton;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.Themes.VisualiserFonts;
import Common.UI.UI;
import javax.swing.*;
public class CredentialsBar extends VisualiserMenuBar {
public MenuBarButton MachineButton;
public MenuBarButton UserButton;
public MenuBarButton ExpandButton;
public CredentialsBar(){
add(MachineButton = new MenuBarButton() {
{
setIcon("/icons/Machine.png");
setFont(VisualiserFonts.TreeBold);
setToolTipText("Текущая машина");
/*
addActionListener(e -> {
UI.getMainWindow().FocusCredentials();
});
*/
}
});
//--
add(UserButton = new MenuBarButton() {
{
setIcon("/icons/User.png");
setFont(VisualiserFonts.TreeBold);
setToolTipText("Текущий пользователь");
/*
addActionListener(e -> {
UI.getMainWindow().FocusCredentials();
});
*/
}
});
add(new JSeparator());
//--
add(ExpandButton = new MenuBarButton() {
{
setIcon("/icons/ExpandDown.png");
setFont(VisualiserFonts.TreeBold);
setToolTipText("Развернуть");
addActionListener(e -> {
UI.getMainWindow().getTestingWindow().SwitchCredentials(true);
});
}
});
}
public void ShowMachine(){
MachineButton.setText(Current.getMachine().getURL());
}
public void ShowUser(){
UserButton.setText(Current.getUser().login);
}
public void ShowNoMachine(){
MachineButton.setText("?");
}
public void ShowNoUser(){
UserButton.setText("?");
}
}

View File

@@ -52,17 +52,18 @@ public class MainMenuBar extends VisualiserMenuBar {
//-
setPreferredSize(new Dimension(0, 30));
//---
/*
/*
add(new MenuBarButton() {
{
setIcon("/icons/Apply.png");
setToolTipText("Test");
addActionListener(e -> {
Pass_2021.passes.get(PassCode_2021.TestPass).Do();
// Pass_2021.passes.get(PassCode_2021.TestPass).Do();
UI.getMainWindow().getTestingWindow().SwitchCredentials(false);
});
}
});
*/
*/
//---
ShowProject(false);
}

View File

@@ -2,6 +2,7 @@ package Common.UI;
import Common.Current;
import Common.Database.DataSet;
import Common.Global;
import Common.UI.Menus_2023.CredentialsBar.CredentialsBar;
import Repository.BugReport.BugReportsMenuBar;
import GlobalData.Compiler.CompilersMenuBar;
import TestingSystem.DVM.Configuration.ConfigurationsMenuBar;
@@ -106,6 +107,7 @@ public class UI {
public static MenuElement[] last_menu_path;
public static MainMenuBar mainMenuBar = null;
public static TestingBar testingBar = null;
public static CredentialsBar credentialsBar = null;
public static VersionsMenuBar versionsMenuBar = null;
public static FastAccessMenuBar fastAccessMenuBar = null;
//------------
@@ -209,6 +211,7 @@ public class UI {
public static void CreateMenus() {
mainMenuBar = new MainMenuBar();
testingBar = new TestingBar();
credentialsBar = new CredentialsBar();
versionsMenuBar = new VersionsMenuBar();
fastAccessMenuBar = new FastAccessMenuBar();
//---------------------------------------------------->>

View File

@@ -1,7 +1,13 @@
package GlobalData.Compiler;
import Common.UI.Menus_2023.DataMenuBar;
import Common.UI.Menus_2023.MenuBarButton;
import Common.UI.Themes.VisualiserFonts;
import Common.UI.UI;
import Visual_DVM_2021.Passes.PassCode_2021;
import javax.swing.*;
public class CompilersMenuBar extends DataMenuBar {
public MenuBarButton CollapseButton;
public CompilersMenuBar() {
super("компиляторы",
PassCode_2021.AddCompiler,
@@ -9,5 +15,16 @@ public class CompilersMenuBar extends DataMenuBar {
PassCode_2021.DeleteCompiler,
PassCode_2021.ShowCompilerVersion,
PassCode_2021.ShowCompilerHelp);
add(new JSeparator());
add(CollapseButton = new MenuBarButton() {
{
setIcon("/icons/CollapseUp.png");
setFont(VisualiserFonts.TreeBold);
setToolTipText("ернуть");
addActionListener(e -> {
UI.getMainWindow().getTestingWindow().SwitchCredentials(false);
});
}
});
}
}

View File

@@ -84,19 +84,18 @@ public class MachinesDBTable extends iDBTable<Machine> {
public void ShowCurrentObject() throws Exception {
super.ShowCurrentObject();
UI.getMainWindow().getTestingWindow().ShowCurrentCompiler();
//UI.testingBar.ShowMachine();
UI.credentialsBar.ShowMachine();
}
@Override
public void ShowNoCurrentObject() throws Exception {
super.ShowNoCurrentObject();
UI.getMainWindow().getTestingWindow().ShowCurrentCompiler();
//UI.testingBar.ShowNoMachine();
UI.credentialsBar.ShowNoMachine();
}
@Override
protected void AdditionalInitColumns() {
columns.get(0).setVisible(false);
}
};
}
@Override

View File

@@ -77,13 +77,13 @@ public class UsersDBTable extends iDBTable<User> {
public void ShowCurrentObject() throws Exception {
super.ShowCurrentObject();
// UI.getMainWindow().ShowCurrentCompiler();
// UI.testingBar.ShowUser();
UI.credentialsBar.ShowUser();
}
@Override
public void ShowNoCurrentObject() throws Exception {
super.ShowNoCurrentObject();
// UI.getMainWindow().ShowCurrentCompiler();
// UI.testingBar.ShowNoUser();
UI.credentialsBar.ShowNoUser();
}
};

View File

@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override
public void GetVersionInfo() {
version = 1077;
version = 1079;
String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime());

View File

@@ -32,4 +32,7 @@ public interface TestingWindow extends VisualizerForm {
void CompareSapforPackages(SapforPackage master, SapforPackage slave);
//-
void ShowDVMPackage(DVMPackage master);
void CollapseCredentials();
void ExpandCredentials();
void SwitchCredentials(boolean flag);
}

View File

@@ -38,7 +38,7 @@
</properties>
<border type="none"/>
<children>
<grid id="f073a" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="f073a" binding="credentialsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>

View File

@@ -1,9 +1,11 @@
package Visual_DVM_2021.UI.Main;
import Common.Constants;
import Common.Current;
import Common.Global;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import GlobalData.Compiler.CompilerType;
import GlobalData.Credentials.Credentials;
import TestingSystem.Common.TestingServer;
import TestingSystem.DVM.DVMPackage.DVMPackage;
import TestingSystem.DVM.DVMTasks.DVMRunTask;
@@ -55,6 +57,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
private JPanel compilersPanel;
private JPanel machinesPanel;
private JPanel usersPanel;
private JPanel credentialsPanel;
private JPanel testsRunTasksBackground;
private JCheckBox filterFinished;
private JButton bTest;
@@ -81,6 +84,9 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
);
//--->>>
RefreshTabsNames();
if (Global.properties.collapseCredentials) {
CollapseCredentials();
}
//-
SC50.setLeftComponent(dvmTestingRunMaster.getContent());
SC50.setRightComponent(dvmTestingRunSlave.getContent());
@@ -115,6 +121,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
Global.testingServer.db.sapforConfigurations.ShowUI();
Global.testingServer.db.dvmRunTasks.ShowUI();
//---
RestoreLastCredentials();
//---
if (Global.properties.AutoCheckTesting)
TestingServer.TimerOn();
}
@@ -213,7 +221,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
dvmTestingRunMaster.ApplyObject(master);
dvmTestingRunSlave.ApplyObject(slave);
dvmTestingRunMaster.DoComparePass(true);
// testingTabs.setSelectedIndex(1);
// testingTabs.setSelectedIndex(1);
}
@Override
public void CompareSapforPackages(SapforPackage master, SapforPackage slave) {
@@ -222,10 +230,38 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
sapforPackageTreeMaster.DoComparePass();
testingTabs.setSelectedIndex(3);
}
@Override
public void CollapseCredentials() {
UI.Clear(credentialsPanel);
credentialsPanel.add(UI.credentialsBar);
SC71.setDividerLocation(30);
SC71.setDividerSize(0);
//SC71.setEnabled(false);
credentialsPanel.revalidate();
credentialsPanel.repaint();
}
@Override
public void ExpandCredentials() {
UI.Clear(credentialsPanel);
credentialsPanel.add(SC18);
SC71.setDividerLocation(200);
//SC71.setEnabled(true);
SC71.setDividerSize(3);
credentialsPanel.revalidate();
credentialsPanel.repaint();
}
@Override
public void SwitchCredentials(boolean flag) {
if (flag) {
ExpandCredentials();
} else {
CollapseCredentials();
}
Global.properties.collapseCredentials = !flag;
Global.properties.Update();
}
/*
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current.get(Current.Credentials);
if (credentials.machine_id != Constants.Nan) {
if (Global.db.machines.containsKey(credentials.machine_id)) {
@@ -267,5 +303,4 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
}
}
}
*/
}

BIN
src/icons/CollapseUp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/icons/ExpandDown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB