отображение машины и ползователя на вкладке тестирования.
This commit is contained in:
10
src/Common/UI/Menus_2023/DVMPackagesBar/DVMPackagesBar.java
Normal file
10
src/Common/UI/Menus_2023/DVMPackagesBar/DVMPackagesBar.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package Common.UI.Menus_2023.DVMPackagesBar;
|
||||
import Common.UI.Menus_2023.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DVMPackagesBar extends DataMenuBar {
|
||||
public DVMPackagesBar() {
|
||||
super("пакеты задач DVM", PassCode_2021.AddDVMPackage
|
||||
// PassCode_2021.ExportTasksPackageToExcel,PassCode_2021.AbortTaskPackage, PassCode_2021.DeleteTasksPackage
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,5 @@ public interface MainWindow {
|
||||
//-
|
||||
void ShowCredentials();
|
||||
void ShowCheckedTestsCount();
|
||||
void FocusCredentials();
|
||||
}
|
||||
|
||||
@@ -29,4 +29,7 @@ public class MenuBarButton extends JButton {
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(Utils.getIcon(icon_path));
|
||||
}
|
||||
public void setFont(VisualiserFonts font_in){
|
||||
setFont(Current.getTheme().Fonts.get(font_in));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,22 +7,49 @@ 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 javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class TestingBar extends VisualiserMenuBar {
|
||||
public MenuBarButton MachineButton;
|
||||
public MenuBarButton UserButton;
|
||||
|
||||
// public JLabel MachineLabel;
|
||||
// public JLabel UserLabel;
|
||||
public JLabel KernelsLabel;
|
||||
|
||||
public JButton autorefreshButton;
|
||||
JSpinner sCheckTime;
|
||||
JSpinner sKernels;
|
||||
public TestingBar() {
|
||||
addPasses(PassCode_2021.SynchronizeTestsTasks);
|
||||
// addPasses(PassCode_2021.SynchronizeTestsTasks);
|
||||
//--
|
||||
add(new JLabel(" ядер ") {
|
||||
// AddLabel("машина: ", "/icons/Machine.png");
|
||||
add(MachineButton = new MenuBarButton() {
|
||||
{
|
||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setIcon("/icons/Machine.png");
|
||||
setFont(VisualiserFonts.TreePlain);
|
||||
setToolTipText("Машина тестирования");
|
||||
addActionListener(e -> {
|
||||
UI.getMainWindow().FocusCredentials();
|
||||
});
|
||||
}
|
||||
});
|
||||
//--
|
||||
add(UserButton = new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/User.png");
|
||||
setFont(VisualiserFonts.TreePlain);
|
||||
setToolTipText("Учетная запись машины тестирования");
|
||||
addActionListener(e -> {
|
||||
UI.getMainWindow().FocusCredentials();
|
||||
});
|
||||
}
|
||||
});
|
||||
//-
|
||||
KernelsLabel = addLabel("", "/icons/Kernels.png");
|
||||
KernelsLabel.setHorizontalTextPosition(JLabel.LEFT);
|
||||
KernelsLabel.setToolTipText("количество ядер, задействованное при тестировании");
|
||||
add(sKernels = new JSpinner());
|
||||
sKernels.setPreferredSize(new Dimension(60, 26));
|
||||
sKernels.setMaximumSize(new Dimension(60, 26));
|
||||
@@ -33,6 +60,9 @@ public class TestingBar extends VisualiserMenuBar {
|
||||
UI.MakeSpinnerRapid(sKernels, e -> {
|
||||
Global.properties.updateField("TestingKernels", sKernels.getValue());
|
||||
});
|
||||
|
||||
|
||||
addLabel(" ");
|
||||
//--
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
@@ -48,6 +78,7 @@ public class TestingBar extends VisualiserMenuBar {
|
||||
setIcon(Utils.getIcon(Global.properties.EmailOnTestingProgress ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
|
||||
//--
|
||||
add(autorefreshButton = new MenuBarButton() {
|
||||
{
|
||||
@@ -88,4 +119,16 @@ public class TestingBar extends VisualiserMenuBar {
|
||||
public void ShowAutoCheckTesting() {
|
||||
autorefreshButton.setIcon(Utils.getIcon(Global.properties.AutoCheckTesting ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
}
|
||||
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("?");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
package Common.UI.Menus_2023;
|
||||
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;
|
||||
|
||||
@@ -25,6 +28,21 @@ public class VisualiserMenuBar extends JToolBar {
|
||||
add(bar);
|
||||
return bar;
|
||||
}
|
||||
public JLabel addLabel(String text_in) {
|
||||
return addLabel(text_in, null);
|
||||
}
|
||||
public JLabel addLabel(String text_in, String icon_path_in) {
|
||||
JLabel res = new JLabel(text_in) {
|
||||
{
|
||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
if (icon_path_in != null) {
|
||||
setIcon(Utils.getIcon(icon_path_in));
|
||||
}
|
||||
}
|
||||
};
|
||||
add(res);
|
||||
return res;
|
||||
}
|
||||
public void setSizeLimits() {
|
||||
setPreferredSize(new Dimension(0, 30));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Global;
|
||||
import Common.UI.Menus_2023.BugReportsMenuBar.BugReportsMenuBar;
|
||||
import Common.UI.Menus_2023.CompilersMenuBar.CompilersMenuBar;
|
||||
import Common.UI.Menus_2023.ConfigurationsMenuBar.ConfigurationsMenuBar;
|
||||
import Common.UI.Menus_2023.DVMPackagesBar.DVMPackagesBar;
|
||||
import Common.UI.Menus_2023.DVMParametersMenuBar.DVMParametersMenuBar;
|
||||
import Common.UI.Menus_2023.DataMenuBar;
|
||||
import Common.UI.Menus_2023.EnvironmentValuesMenuBar.EnvironmentValuesMenuBar;
|
||||
@@ -59,6 +60,7 @@ import GlobalData.User.UsersDBTable;
|
||||
import ProjectData.DBArray.ArraysDBTable;
|
||||
import ProjectData.Files.UI.FilesTreeCellRenderer;
|
||||
import Repository.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackageDBTable;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforVersionsTreeCellRenderer;
|
||||
import ProjectData.Project.UI.VersionsTreeCellRenderer;
|
||||
import ProjectData.SapforData.Arrays.ArraysSet;
|
||||
@@ -220,7 +222,8 @@ public class UI {
|
||||
menuBars.put(GroupsDBTable.class, new GroupsMenuBar());
|
||||
menuBars.put(TestDBTable.class, new TestsMenuBar());
|
||||
menuBars.put(ConfigurationDBTable.class, new ConfigurationsMenuBar());
|
||||
menuBars.put(TasksPackageDBTable.class, new TasksPackagesMenuBar());
|
||||
menuBars.put(DVMPackageDBTable.class, new DVMPackagesBar());
|
||||
// menuBars.put(TasksPackageDBTable.class, new TasksPackagesMenuBar());
|
||||
menuBars.put(TestRunTasksDBTable.class, new TestRunTasksMenuBar());
|
||||
//--->>>
|
||||
menuBars.put(MachinesDBTable.class, new MachinesMenuBar());
|
||||
|
||||
Reference in New Issue
Block a user