отображение машины и ползователя на вкладке тестирования.
This commit is contained 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("?");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user