no message
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class AddSapforPackageMenu extends VisualiserMenu {
|
||||
public AddSapforPackageMenu() {
|
||||
super("", "/icons/RedAdd.png");
|
||||
// addPasses(PassCode_2021.AddSapforPackage,PassCode_2021.CloneSapforPackage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
public class PackageComparisonSummary extends SapforPackageTreeNode {
|
||||
public int count = 0;
|
||||
public int mismatches_count = 0;
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "Package";
|
||||
}
|
||||
public PackageComparisonSummary() {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "всего задач : " + count + ", различий : " + mismatches_count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
public class PackageSummary extends SapforPackageTreeNode {
|
||||
public int count = 0;
|
||||
public int errors_count=0;
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "Package";
|
||||
}
|
||||
public PackageSummary() {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "всего задач : " + count+", с ошибками : "+errors_count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Utils.CommonUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
||||
public ImageIcon getIcon() {
|
||||
ImageIcon res = new ImageIcon((getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||
if (res==null) {
|
||||
CommonUtils.MainLog.Print("/icons/versions/" + getImageKey() + ".png=NULL");
|
||||
// res= new ImageIcon((getClass().getResource("/icons/versions/Version.png")));
|
||||
}
|
||||
return (getImageKey() != null) ? res : null;
|
||||
}
|
||||
public abstract String getImageKey();
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SapforPackagesBar extends DataMenuBar {
|
||||
public SapforPackagesBar() {
|
||||
super("пакеты задач SAPFOR");
|
||||
addPasses(PassCode_2021.SynchronizeTests);
|
||||
addSeparator();
|
||||
addPasses(PassCode_2021.AbortSapforPackage);
|
||||
addSeparator();
|
||||
addPasses(PassCode_2021.CompareSapforPackages);
|
||||
addSeparator();
|
||||
addPasses(PassCode_2021.DeleteSapforPackage);
|
||||
add(new JSeparator());
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setText("Свои");
|
||||
setToolTipText("Отображать только пакеты тестов авторства пользователя");
|
||||
Mark();
|
||||
addActionListener(e -> {
|
||||
SapforPackageDBTable.filterMyOnly = !SapforPackageDBTable.filterMyOnly;
|
||||
Mark();
|
||||
Global.testingServer.db.sapforPackages.ShowUI();
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(CommonUtils.getIcon(SapforPackageDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setText("Активные");
|
||||
setToolTipText("Отображать только активные пакеты тестов");
|
||||
Mark();
|
||||
addActionListener(e -> {
|
||||
SapforPackageDBTable.filterActive = !SapforPackageDBTable.filterActive;
|
||||
Mark();
|
||||
Global.testingServer.db.sapforPackages.ShowUI();
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(CommonUtils.getIcon(SapforPackageDBTable.filterActive ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.ComparisonState;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
public class SapforTaskNode extends SapforPackageTreeNode {
|
||||
public SapforTaskNode(SapforTask task_in) {
|
||||
setUserObject(task_in);
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
SapforTask task = (SapforTask) getUserObject();
|
||||
//обычный режим
|
||||
if (task.comparisonState == ComparisonState.Unknown) {
|
||||
return task.state.toString();
|
||||
}
|
||||
//режим сравнения.
|
||||
else {
|
||||
return task.comparisonState.toString()+task.state.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Trees.DataTree;
|
||||
import Common.Visual.Trees.TreeRenderers;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
import java.util.Vector;
|
||||
public class SapforTasksPackageTree extends DataTree {
|
||||
Current current;
|
||||
SapforTasksPackageTree slave_tree = null;
|
||||
public void setSlaveTree(SapforTasksPackageTree slave_tree_in) {
|
||||
slave_tree = slave_tree_in;
|
||||
}
|
||||
public SapforTasksPackageTree(DefaultMutableTreeNode root_in, Current current_in) {
|
||||
super(root_in);
|
||||
current = current_in;
|
||||
}
|
||||
@Override
|
||||
protected int getStartLine() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public TreeRenderers getRenderer() {
|
||||
return TreeRenderers.RendererSapforVersion;
|
||||
}
|
||||
@Override
|
||||
public Current getCurrent() {
|
||||
return current;
|
||||
}
|
||||
public void selectSamePath_r(TreePath example, int index, DefaultMutableTreeNode node, Vector<DefaultMutableTreeNode> res) {
|
||||
if (index < example.getPathCount()) {
|
||||
DefaultMutableTreeNode exampleNode = (DefaultMutableTreeNode) example.getPathComponent(index);
|
||||
if (exampleNode.toString().equals(node.toString())) {
|
||||
res.add(node);
|
||||
for (int i = 0; i < node.getChildCount(); ++i)
|
||||
selectSamePath_r(example, index + 1, (DefaultMutableTreeNode) node.getChildAt(i), res);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void selectSamePath(TreePath path_in) {
|
||||
Vector<DefaultMutableTreeNode> pathNodes = new Vector<>();
|
||||
selectSamePath_r(path_in, 0, root, pathNodes);
|
||||
if (!pathNodes.isEmpty()) {
|
||||
TreePath path = new TreePath(pathNodes.toArray());
|
||||
setSelectionPath(path);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void SelectionAction(TreePath e) {
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getLastPathComponent();
|
||||
Object o = node.getUserObject();
|
||||
//---
|
||||
if (slave_tree != null) {
|
||||
slave_tree.selectSamePath(e);
|
||||
}
|
||||
//---
|
||||
if (o instanceof SapforVersion_json) {
|
||||
SapforVersion_json version = (SapforVersion_json) o;
|
||||
CurrentAnchestor.set(current, version);
|
||||
if (current.equals(Current.SapforEtalonVersion))
|
||||
UI.getMainWindow().getTestingWindow().ShowCurrentSapforPackageVersionEtalon();
|
||||
else
|
||||
UI.getMainWindow().getTestingWindow().ShowCurrentSapforPackageVersion();
|
||||
//--
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Visual.Trees.StyledTreeCellRenderer;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SapforVersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
public java.awt.Component getTreeCellRendererComponent(
|
||||
JTree tree, Object value,
|
||||
boolean selected, boolean expanded,
|
||||
boolean leaf, int row, boolean hasFocus) {
|
||||
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
|
||||
if (value instanceof SapforPackageTreeNode) {
|
||||
SapforPackageTreeNode node = (SapforPackageTreeNode) value;
|
||||
setForeground(tree.getForeground());
|
||||
setFont(getFont().deriveFont((float) 14.0));
|
||||
if (node.getIcon() != null)
|
||||
setIcon(node.getIcon());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import javax.swing.*;
|
||||
import java.util.Objects;
|
||||
public abstract class TreeSummary {
|
||||
public String text = "";
|
||||
public abstract void refreshText();
|
||||
@Override
|
||||
public String toString() {
|
||||
return text;
|
||||
}
|
||||
public ImageIcon getIcon() {
|
||||
return new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||
}
|
||||
public abstract String getImageKey();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.SapforVersionState;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.VersionComparisonState;
|
||||
public class VersionNode extends SapforPackageTreeNode {
|
||||
public VersionNode(SapforVersion_json version_json) {
|
||||
setUserObject(version_json);
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
SapforVersion_json version = (SapforVersion_json) getUserObject();
|
||||
String res = "";
|
||||
if (version.comparisonState.equals(VersionComparisonState.Unknown)||version.state.equals(SapforVersionState.Empty)){
|
||||
res = version.state.toString();
|
||||
}else {
|
||||
res = version.comparisonState.toString()+version.state.toString();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user