рефакторинг дерева версий пакета. добавил категорию по совпадениям.
This commit is contained in:
16
.idea/workspace.xml
generated
16
.idea/workspace.xml
generated
@@ -7,11 +7,21 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/TestVersionSummary.java" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/MatchesSummary.java" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/src/icons/versions/TestVersion.png" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/PackageSummary.java" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/SapforPackageTreeNode.java" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/VersionSummary.java" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/icons/versions/Match.png" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/icons/versions/NotMatch.png" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforVersion_json.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/MatchState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/MatchState.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTask.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackageInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackageInterface.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackageInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackageInterface.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/ConfigurationSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/ConfigurationSummary.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/GroupSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/GroupSummary.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/SapforVersionsTreeCellRenderer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/SapforVersionsTreeCellRenderer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/StateSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/UI/StateSummary.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package SapforTestingSystem.Json;
|
package SapforTestingSystem.Json;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
|
import SapforTestingSystem.SapforTask.MatchState;
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
import SapforTestingSystem.SapforTask.SapforTask;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
@@ -13,29 +14,6 @@ public class SapforTasksResults_json {
|
|||||||
public long EndDate = 0;
|
public long EndDate = 0;
|
||||||
@Expose
|
@Expose
|
||||||
public List<SapforTask> tasks = new Vector<>();
|
public List<SapforTask> tasks = new Vector<>();
|
||||||
public LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> sortTasksByConfigurationsAndGroups() {
|
|
||||||
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = new LinkedHashMap<>();
|
|
||||||
//--
|
|
||||||
for (SapforTask task : tasks) {
|
|
||||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
|
||||||
if (tasksByConfigurations.containsKey(task.sapfor_configuration_id)) {
|
|
||||||
groups_tasks = tasksByConfigurations.get(task.sapfor_configuration_id);
|
|
||||||
} else {
|
|
||||||
groups_tasks = new LinkedHashMap<>();
|
|
||||||
tasksByConfigurations.put(task.sapfor_configuration_id, groups_tasks);
|
|
||||||
}
|
|
||||||
Vector<SapforTask> tasks = null;
|
|
||||||
if (groups_tasks.containsKey(task.group_description)) {
|
|
||||||
tasks = groups_tasks.get(task.group_description);
|
|
||||||
} else {
|
|
||||||
tasks = new Vector<>();
|
|
||||||
groups_tasks.put(task.group_description, tasks);
|
|
||||||
}
|
|
||||||
tasks.add(task);
|
|
||||||
}
|
|
||||||
return tasksByConfigurations;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
public LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> sortTasksByStatesConfigurationsAndGroups() {
|
public LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> sortTasksByStatesConfigurationsAndGroups() {
|
||||||
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> res = new LinkedHashMap<>();
|
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> res = new LinkedHashMap<>();
|
||||||
//рассортировать задачи по конфигурациям.
|
//рассортировать задачи по конфигурациям.
|
||||||
@@ -65,4 +43,41 @@ public class SapforTasksResults_json {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
//---
|
||||||
|
public LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>>> sortTasksForTree() {
|
||||||
|
LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>>> res = new LinkedHashMap<>();
|
||||||
|
for (MatchState matchState : MatchState.values()) {
|
||||||
|
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> state_tasks = new LinkedHashMap<>();
|
||||||
|
res.put(matchState, state_tasks);
|
||||||
|
//--
|
||||||
|
for (TaskState state : TaskState.values()) {
|
||||||
|
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> configuration_tasks = new LinkedHashMap<>();
|
||||||
|
state_tasks.put(state, configuration_tasks);
|
||||||
|
//--
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
if (task.match.equals(matchState) && task.state.equals(state)) {
|
||||||
|
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
||||||
|
if (configuration_tasks.containsKey(task.sapfor_configuration_id)) {
|
||||||
|
groups_tasks = configuration_tasks.get(task.sapfor_configuration_id);
|
||||||
|
} else {
|
||||||
|
groups_tasks = new LinkedHashMap<>();
|
||||||
|
configuration_tasks.put(task.sapfor_configuration_id, groups_tasks);
|
||||||
|
}
|
||||||
|
Vector<SapforTask> tasks = null;
|
||||||
|
if (groups_tasks.containsKey(task.group_description)) {
|
||||||
|
tasks = groups_tasks.get(task.group_description);
|
||||||
|
} else {
|
||||||
|
tasks = new Vector<>();
|
||||||
|
groups_tasks.put(task.group_description, tasks);
|
||||||
|
}
|
||||||
|
tasks.add(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
//рассортировать задачи по конфигурациям.
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ public enum MatchState implements StatusEnum {
|
|||||||
case Unknown:
|
case Unknown:
|
||||||
return "неизвестно";
|
return "неизвестно";
|
||||||
case Match:
|
case Match:
|
||||||
return "да";
|
return "совпадений";
|
||||||
case NotMatch:
|
case NotMatch:
|
||||||
return "нет";
|
return "различий";
|
||||||
default:
|
default:
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Common.Database.DBObject;
|
|||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
import SapforTestingSystem.Json.SapforVersion_json;
|
import SapforTestingSystem.Json.SapforVersion_json;
|
||||||
|
import SapforTestingSystem.SapforTasksPackage.UI.VersionSummary;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
@@ -49,6 +50,9 @@ public class SapforTask extends DBObject {
|
|||||||
@Description("IGNORE")
|
@Description("IGNORE")
|
||||||
@Expose
|
@Expose
|
||||||
public Vector<SapforVersion_json> variants = new Vector<>();
|
public Vector<SapforVersion_json> variants = new Vector<>();
|
||||||
|
//----------
|
||||||
|
@Description("IGNORE")
|
||||||
|
public MatchState match = MatchState.Match;
|
||||||
//-----------
|
//-----------
|
||||||
public SapforTask() {
|
public SapforTask() {
|
||||||
}
|
}
|
||||||
@@ -61,7 +65,7 @@ public class SapforTask extends DBObject {
|
|||||||
for (SapforVersion_json version_json : versions) {
|
for (SapforVersion_json version_json : versions) {
|
||||||
version_json.init(configurationRoot);
|
version_json.init(configurationRoot);
|
||||||
//-
|
//-
|
||||||
child = new DefaultMutableTreeNode(version_json);
|
child = new VersionSummary(version_json);
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
root = child;
|
root = child;
|
||||||
parent = child;
|
parent = child;
|
||||||
@@ -72,10 +76,9 @@ public class SapforTask extends DBObject {
|
|||||||
//-
|
//-
|
||||||
}
|
}
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
|
|
||||||
for (SapforVersion_json version_json : variants) {
|
for (SapforVersion_json version_json : variants) {
|
||||||
version_json.init(configurationRoot);
|
version_json.init(configurationRoot);
|
||||||
parent.add(new DefaultMutableTreeNode(version_json));
|
parent.add(new VersionSummary(version_json));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import Common.Global;
|
|||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
import SapforTestingSystem.Json.SapforTasksResults_json;
|
import SapforTestingSystem.Json.SapforTasksResults_json;
|
||||||
|
import SapforTestingSystem.SapforTask.MatchState;
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
import SapforTestingSystem.SapforTask.SapforTask;
|
||||||
import SapforTestingSystem.SapforTasksPackage.UI.ConfigurationSummary;
|
import SapforTestingSystem.SapforTasksPackage.UI.*;
|
||||||
import SapforTestingSystem.SapforTasksPackage.UI.GroupSummary;
|
|
||||||
import SapforTestingSystem.SapforTasksPackage.UI.StateSummary;
|
|
||||||
|
|
||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -38,50 +37,62 @@ public class SapforTasksPackageInterface {
|
|||||||
public static boolean isLoaded(SapforTasksPackage package_in) {
|
public static boolean isLoaded(SapforTasksPackage package_in) {
|
||||||
return getLoadedSign(package_in).exists();
|
return getLoadedSign(package_in).exists();
|
||||||
}
|
}
|
||||||
public static DefaultMutableTreeNode buildTree(SapforTasksPackage package_in) {
|
|
||||||
SapforTasksResults_json results_json = getLocalResults(package_in);
|
|
||||||
//-- флаги группы
|
|
||||||
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> sortedTasks = results_json.sortTasksByStatesConfigurationsAndGroups();
|
|
||||||
//--
|
//--
|
||||||
DefaultMutableTreeNode root = new DefaultMutableTreeNode(package_in.id);
|
public static DefaultMutableTreeNode buildTree(SapforTasksPackage package_in) {
|
||||||
for (TaskState state : sortedTasks.keySet()) {
|
PackageSummary root = new PackageSummary();
|
||||||
|
SapforTasksResults_json results_json = getLocalResults(package_in);
|
||||||
|
LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>>> sortedTasks =
|
||||||
|
results_json.sortTasksForTree();
|
||||||
|
//--
|
||||||
|
for (MatchState match_state : sortedTasks.keySet()) {
|
||||||
|
//--
|
||||||
|
MatchesSummary matchesSummary = new MatchesSummary(match_state);
|
||||||
|
//---
|
||||||
|
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> task_states = sortedTasks.get(match_state);
|
||||||
|
//---
|
||||||
|
for (TaskState state : task_states.keySet()) {
|
||||||
//--
|
//--
|
||||||
StateSummary stateSummary = new StateSummary(state);
|
StateSummary stateSummary = new StateSummary(state);
|
||||||
//--
|
//--
|
||||||
DefaultMutableTreeNode stateNode = new DefaultMutableTreeNode(stateSummary);
|
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = task_states.get(state);
|
||||||
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = sortedTasks.get(state);
|
|
||||||
for (String configuration_id : tasksByConfigurations.keySet()) {
|
for (String configuration_id : tasksByConfigurations.keySet()) {
|
||||||
//--
|
//--
|
||||||
ConfigurationSummary configurationSummary = new ConfigurationSummary();
|
DefaultMutableTreeNode configurationNode = null;
|
||||||
DefaultMutableTreeNode configurationNode = new DefaultMutableTreeNode(configurationSummary);
|
|
||||||
//--
|
//--
|
||||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = tasksByConfigurations.get(configuration_id);
|
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = tasksByConfigurations.get(configuration_id);
|
||||||
for (String group : groups_tasks.keySet()) {
|
for (String group : groups_tasks.keySet()) {
|
||||||
//--
|
//--
|
||||||
GroupSummary groupSummary = new GroupSummary(group);
|
GroupSummary groupSummary = new GroupSummary(group);
|
||||||
DefaultMutableTreeNode groupNode = new DefaultMutableTreeNode(groupSummary);
|
|
||||||
//--
|
//--
|
||||||
for (SapforTask task : groups_tasks.get(group)) {
|
for (SapforTask task : groups_tasks.get(group)) {
|
||||||
//--
|
//--
|
||||||
stateSummary.count++;
|
stateSummary.count++;
|
||||||
|
matchesSummary.count++;
|
||||||
|
root.count++;
|
||||||
//--
|
//--
|
||||||
if (configurationSummary.text.isEmpty())
|
if (configurationNode == null) {
|
||||||
configurationSummary.init(configuration_id, task);
|
configurationNode = new ConfigurationSummary(configuration_id, task);
|
||||||
|
}
|
||||||
//--
|
//--
|
||||||
groupNode.add(task.getVersionsTree(new File(getLocalWorkspace(package_in), configuration_id)));
|
groupSummary.add(task.getVersionsTree(new File(getLocalWorkspace(package_in), configuration_id)));
|
||||||
|
|
||||||
}
|
}
|
||||||
configurationNode.add(groupNode);
|
if (configurationNode != null)
|
||||||
|
configurationNode.add(groupSummary);
|
||||||
}
|
}
|
||||||
stateNode.add(configurationNode);
|
stateSummary.add(configurationNode);
|
||||||
}
|
}
|
||||||
if (stateSummary.count > 0) {
|
if (stateSummary.count > 0) {
|
||||||
stateSummary.refreshText();
|
matchesSummary.add(stateSummary);
|
||||||
root.add(stateNode);
|
}
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
if (matchesSummary.count > 0) {
|
||||||
|
root.add(matchesSummary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
public static DefaultMutableTreeNode getTree(SapforTasksPackage package_in) {
|
public static DefaultMutableTreeNode getTree(SapforTasksPackage package_in) {
|
||||||
if (package_in.root == null)
|
if (package_in.root == null)
|
||||||
package_in.root = buildTree(package_in);
|
package_in.root = buildTree(package_in);
|
||||||
|
|||||||
@@ -5,24 +5,21 @@ import Visual_DVM_2021.Passes.PassCode_2021;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class ConfigurationSummary extends TreeSummary {
|
public class ConfigurationSummary extends SapforPackageTreeNode {
|
||||||
public String configuration_id = "";
|
public String configuration_id = "";
|
||||||
public String flags = "";
|
public String flags = "";
|
||||||
public Vector<String> codes_descriptions = new Vector<>();
|
public Vector<String> codes_descriptions = new Vector<>();
|
||||||
public ConfigurationSummary() {
|
public ConfigurationSummary(String configuration_id_in, SapforTask task) {
|
||||||
}
|
|
||||||
public void init(String configuration_id_in, SapforTask task) {
|
|
||||||
configuration_id = configuration_id_in;
|
configuration_id = configuration_id_in;
|
||||||
flags = task.flags;
|
flags = task.flags;
|
||||||
Vector<String> codes_s = new Vector<>(Arrays.asList(task.codes.split(" ")));
|
Vector<String> codes_s = new Vector<>(Arrays.asList(task.codes.split(" ")));
|
||||||
for (int i = 1; i < codes_s.size(); ++i) {
|
for (int i = 1; i < codes_s.size(); ++i) {
|
||||||
codes_descriptions.add(Utils.Brackets(PassCode_2021.valueOf(codes_s.get(i)).getDescription()));
|
codes_descriptions.add(Utils.Brackets(PassCode_2021.valueOf(codes_s.get(i)).getDescription()));
|
||||||
}
|
}
|
||||||
refreshText();
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void refreshText() {
|
public String toString() {
|
||||||
text = flags + " " + String.join("→", codes_descriptions);
|
return flags + " " + String.join("→", codes_descriptions);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getImageKey() {
|
public String getImageKey() {
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package SapforTestingSystem.SapforTasksPackage.UI;
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
public class GroupSummary extends TreeSummary {
|
public class GroupSummary extends SapforPackageTreeNode {
|
||||||
@Override
|
public String group_name = "";
|
||||||
public void refreshText() {
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
public String getImageKey() {
|
public String getImageKey() {
|
||||||
return "Group";
|
return "Group";
|
||||||
}
|
}
|
||||||
public GroupSummary(String group_name) {
|
public GroupSummary(String group_name_in) {
|
||||||
text = group_name;
|
group_name = group_name_in;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return group_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
|
import SapforTestingSystem.SapforTask.MatchState;
|
||||||
|
public class MatchesSummary extends SapforPackageTreeNode {
|
||||||
|
public MatchState state;
|
||||||
|
public int count = 0;
|
||||||
|
public MatchesSummary(MatchState state_in) {
|
||||||
|
state = state_in;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return state.getDescription() + " : " + count;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getImageKey() {
|
||||||
|
switch (state) {
|
||||||
|
case Match:
|
||||||
|
return "Match";
|
||||||
|
case NotMatch:
|
||||||
|
return "NotMatch";
|
||||||
|
default:
|
||||||
|
return "TestVersion";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
|
public class PackageSummary extends SapforPackageTreeNode {
|
||||||
|
public int count = 0;
|
||||||
|
@Override
|
||||||
|
public String getImageKey() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public PackageSummary() {
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "всего задач : " + count;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
|
import java.util.Objects;
|
||||||
|
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
||||||
|
public ImageIcon getIcon() {
|
||||||
|
return (getImageKey() != null) ?
|
||||||
|
new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")))
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
public abstract String getImageKey();
|
||||||
|
}
|
||||||
@@ -1,31 +1,18 @@
|
|||||||
package SapforTestingSystem.SapforTasksPackage.UI;
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
import Common.UI.Trees.StyledTreeCellRenderer;
|
import Common.UI.Trees.StyledTreeCellRenderer;
|
||||||
import SapforTestingSystem.Json.SapforVersion_json;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
|
||||||
import java.util.Objects;
|
|
||||||
public class SapforVersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
public class SapforVersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
||||||
public java.awt.Component getTreeCellRendererComponent(
|
public java.awt.Component getTreeCellRendererComponent(
|
||||||
JTree tree, Object value,
|
JTree tree, Object value,
|
||||||
boolean selected, boolean expanded,
|
boolean selected, boolean expanded,
|
||||||
boolean leaf, int row, boolean hasFocus) {
|
boolean leaf, int row, boolean hasFocus) {
|
||||||
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
|
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
|
||||||
Object o = ((DefaultMutableTreeNode) value).getUserObject();
|
if (value instanceof SapforPackageTreeNode) {
|
||||||
if (o instanceof TreeSummary) {
|
SapforPackageTreeNode node = (SapforPackageTreeNode) value;
|
||||||
TreeSummary summary = (TreeSummary) o;
|
|
||||||
setForeground(tree.getForeground());
|
setForeground(tree.getForeground());
|
||||||
setFont(getFont().deriveFont((float) 14.0));
|
setFont(getFont().deriveFont((float) 14.0));
|
||||||
setIcon(summary.getIcon());
|
setIcon(node.getIcon());
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (o instanceof SapforVersion_json){
|
|
||||||
SapforVersion_json version_json = (SapforVersion_json) o;
|
|
||||||
setForeground(tree.getForeground());
|
|
||||||
setFont(getFont().deriveFont((float) 14.0));
|
|
||||||
setIcon(new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/TestVersion.png"))));
|
|
||||||
setText(version_json.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
package SapforTestingSystem.SapforTasksPackage.UI;
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
public class StateSummary extends TreeSummary {
|
public class StateSummary extends SapforPackageTreeNode {
|
||||||
public TaskState state;
|
public TaskState state;
|
||||||
public int count = 0;
|
public int count = 0;
|
||||||
public StateSummary(TaskState state_in) {
|
public StateSummary(TaskState state_in) {
|
||||||
state = state_in;
|
state = state_in;
|
||||||
refreshText();
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void refreshText() {
|
public String toString() {
|
||||||
text = state.getDescription() + " : " + count;
|
return state.getDescription() + " : " + count;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getImageKey() {
|
public String getImageKey() {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||||
|
import SapforTestingSystem.Json.SapforVersion_json;
|
||||||
|
public class VersionSummary extends SapforPackageTreeNode{
|
||||||
|
public String version_name = "";
|
||||||
|
public String version_description = "";
|
||||||
|
public VersionSummary(SapforVersion_json version_json) {
|
||||||
|
version_name = version_json.Home.getName();
|
||||||
|
version_description = version_json.description;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getImageKey() {
|
||||||
|
return "TestVersion";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return version_name+ " : " +version_description;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
src/icons/versions/Match.png
Normal file
BIN
src/icons/versions/Match.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 980 B |
BIN
src/icons/versions/NotMatch.png
Normal file
BIN
src/icons/versions/NotMatch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 808 B |
Reference in New Issue
Block a user