no message
This commit is contained in:
@@ -36,29 +36,20 @@ public class SapforTasksPackageTree extends DataTree {
|
||||
public void selectSamePath_r(TreePath example, int index, DefaultMutableTreeNode node, Vector<DefaultMutableTreeNode> res) {
|
||||
if (index < example.getPathCount()) {
|
||||
DefaultMutableTreeNode exampleNode = (DefaultMutableTreeNode) example.getPathComponent(index);
|
||||
// System.out.println("index = "+index);
|
||||
// System.out.println("example node="+exampleNode.toString());
|
||||
// System.out.println("node-"+node.toString());
|
||||
// System.out.println("");
|
||||
if (exampleNode.toString().equals(node.toString())) {
|
||||
res.add(node);
|
||||
// System.out.println("+");
|
||||
for (int i = 0; i < node.getChildCount(); ++i)
|
||||
selectSamePath_r(example, index+1, (DefaultMutableTreeNode) node.getChildAt(i), res);
|
||||
selectSamePath_r(example, index + 1, (DefaultMutableTreeNode) node.getChildAt(i), res);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void selectSamePath(TreePath path_in) {
|
||||
// int i = path_in.getPath().length;
|
||||
// path_in.getPathComponent(i).toString();
|
||||
// System.out.println("e = " + path_in);
|
||||
Vector<DefaultMutableTreeNode> pathNodes = new Vector<>();
|
||||
selectSamePath_r(path_in, 0, root, pathNodes);
|
||||
// System.out.println("+");
|
||||
TreePath path = new TreePath(pathNodes.toArray());
|
||||
// System.out.println(path);
|
||||
setSelectionPath(path);
|
||||
// System.out.println("++");
|
||||
if (!pathNodes.isEmpty()) {
|
||||
TreePath path = new TreePath(pathNodes.toArray());
|
||||
setSelectionPath(path);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void SelectionAction(TreePath e) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package Visual_DVM_2021.UI.Main;
|
||||
import Common.Current;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Label.ShortLabel;
|
||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
||||
import Common.UI.UI;
|
||||
@@ -13,6 +12,7 @@ import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SapforPackagesComparisonForm {
|
||||
public boolean comparisonMode = false;
|
||||
//-->>
|
||||
private JPanel content;
|
||||
public JPanel getContent() {
|
||||
@@ -34,7 +34,7 @@ public class SapforPackagesComparisonForm {
|
||||
protected SapforTasksPackage object = null;
|
||||
//-->>
|
||||
// protected DataSet<String, SapforTaskResult> packageTasks;
|
||||
protected DataSetControlForm Body;
|
||||
protected SapforTasksPackageTree Body;
|
||||
public JScrollPane treeScroll = null;
|
||||
//--->>
|
||||
public boolean isMaster() {
|
||||
@@ -48,15 +48,39 @@ public class SapforPackagesComparisonForm {
|
||||
protected void RemoveObject() {
|
||||
object = null;
|
||||
showNoObject();
|
||||
//--
|
||||
if (comparisonMode) {
|
||||
comparisonMode = false;
|
||||
if (isMaster()) {
|
||||
slave.comparisonMode = false;
|
||||
slave.object = null;
|
||||
slave.showNoObject();
|
||||
} else {
|
||||
master.comparisonMode = false;
|
||||
master.object = null;
|
||||
master.showNoObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ApplyObject() {
|
||||
//---
|
||||
RemoveObject();
|
||||
//---
|
||||
TextLog log = new TextLog();
|
||||
if (Current.Check(log, Current.SapforTasksPackage)) {
|
||||
object = Current.getSapforTasksPackage();
|
||||
if (object.isLoaded() || (Pass_2021.passes.get(PassCode_2021.DownloadSapforTasksPackage).Do(object)))
|
||||
if (object.isLoaded() || (Pass_2021.passes.get(PassCode_2021.DownloadSapforTasksPackage).Do(object))) {
|
||||
showObject();
|
||||
else UI.Info("Пакет не закружен");
|
||||
/*
|
||||
if (isMaster()) {
|
||||
System.out.println("master");
|
||||
SynchronizeTrees();
|
||||
} else if (master.object != null){
|
||||
System.out.println("slave");
|
||||
master.SynchronizeTrees();
|
||||
}
|
||||
*/
|
||||
} else UI.Info("Пакет не закружен");
|
||||
} else
|
||||
UI.Info(log.toString());
|
||||
}
|
||||
@@ -75,22 +99,20 @@ public class SapforPackagesComparisonForm {
|
||||
//---
|
||||
public void showCommonTree() {
|
||||
//---
|
||||
treePanel.add(new JScrollPane(
|
||||
new SapforTasksPackageTree(object.results.root,
|
||||
treePanel.add(treeScroll = new JScrollPane(
|
||||
Body = new SapforTasksPackageTree(object.results.root,
|
||||
isMaster() ? Current.SapforEtalonVersion : Current.SapforVersion
|
||||
)));
|
||||
treePanel.repaint();
|
||||
treePanel.revalidate();
|
||||
}
|
||||
public SapforTasksPackageTree showComparisonTree() {
|
||||
SapforTasksPackageTree res = null;
|
||||
public void showComparisonTree() {
|
||||
treePanel.add(treeScroll = new JScrollPane(
|
||||
res =new SapforTasksPackageTree(object.results.comparison_root,
|
||||
Body = new SapforTasksPackageTree(object.results.comparison_root,
|
||||
isMaster() ? Current.SapforEtalonVersion : Current.SapforVersion
|
||||
)));
|
||||
treePanel.repaint();
|
||||
treePanel.revalidate();
|
||||
return res;
|
||||
}
|
||||
//---
|
||||
public void showNoTree() {
|
||||
@@ -191,6 +213,8 @@ public class SapforPackagesComparisonForm {
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
comparisonMode = false;
|
||||
slave.comparisonMode = false;
|
||||
//--
|
||||
treeScroll = null;
|
||||
slave.treeScroll = null;
|
||||
@@ -238,39 +262,24 @@ public class SapforPackagesComparisonForm {
|
||||
slave.showCommonTree();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
comparisonMode = true;
|
||||
slave.comparisonMode = true;
|
||||
//--
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
showComparisonTree().setSlaveTree(slave.showComparisonTree());
|
||||
slave.treeScroll.getVerticalScrollBar().setModel(treeScroll.getVerticalScrollBar().getModel());
|
||||
showComparisonTree();
|
||||
slave.showComparisonTree();
|
||||
SynchronizeTrees();
|
||||
}
|
||||
};
|
||||
pass.Do();
|
||||
}
|
||||
public void DoShowPass(boolean startCondition) {
|
||||
Pass_2021 pass = new Pass_2021() {
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Отображение";
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean needsConfirmations() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return startCondition;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Show();
|
||||
}
|
||||
};
|
||||
pass.Do();
|
||||
public void SynchronizeTrees() {
|
||||
if (slave.Body!=null) {
|
||||
Body.setSlaveTree(slave.Body);
|
||||
slave.treeScroll.getVerticalScrollBar().setModel(treeScroll.getVerticalScrollBar().getModel());
|
||||
}
|
||||
}
|
||||
//предполагаем что оба объекта есть и мы можем получить с них текст.
|
||||
//1. если режим сравнения. синхронизация выбора строк в деревьях.
|
||||
//2. открытие выбранной версии как текущего проекта. (создание копии с распаковкой сообщений)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user