diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java index 0a5c97175ec40cdc96a416ee8a3108205b07c29e..71f72d5338d724934970d1cfdf95b5d60d621278 100755 --- a/src/main/java/ui/GTURTLEModeling.java +++ b/src/main/java/ui/GTURTLEModeling.java @@ -38,6 +38,7 @@ package ui; +import ui.tree.*; import avatartranslator.*; import avatartranslator.toproverif.AVATAR2ProVerif; import avatartranslator.totpn.AVATAR2TPN; @@ -139,6 +140,7 @@ import java.awt.*; import java.io.*; import java.util.*; import java.util.List; +import javax.swing.tree.*; // AVATAR // AVATAR @@ -3604,6 +3606,18 @@ public class GTURTLEModeling { // TREE MANAGEMENT + public void expandToErrors() { + if (mcvdt != null) { + SyntaxAnalysisErrorTree saet = mcvdt.getSyntaxAnalysisErrorTree(); + if (saet != null) { + Object []obj = new Object[2]; + obj[0] = mcvdt; + obj[1] = saet; + mgui.dtree.expandPath(new TreePath(obj)); + } + } + } + public String toString() { return mgui.getTitle(); } @@ -3624,7 +3638,6 @@ public class GTURTLEModeling { } else { return st; } - } public int getIndexOfChild(Object child) { diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java index 2223bb5b09f4ee2e5e45e2323bda4efc48d0831b..33d33d08dede314bf99c6167f216dd3759b21ce5 100644 --- a/src/main/java/ui/MainGUI.java +++ b/src/main/java/ui/MainGUI.java @@ -1050,6 +1050,13 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe } return list; } + + public void expandToErrors() { + if (gtm != null) { + gtm.expandToErrors(); + } + } + public Vector<String> getTMLTasks(){ TURTLEPanel tp; Vector<String> list = new Vector<String>(); diff --git a/src/main/java/ui/tree/JDiagramTree.java b/src/main/java/ui/tree/JDiagramTree.java index 89c57f657305e1d52e43902d360390202cfa789c..51b81852fde86de02e081f9ed9069194d68a14b4 100755 --- a/src/main/java/ui/tree/JDiagramTree.java +++ b/src/main/java/ui/tree/JDiagramTree.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,7 +31,7 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ @@ -67,11 +67,11 @@ import java.util.Set; /** - * Class JDiagramTree - * Dialog for managing attributes - * Creation: 14/12/2003 - * @version 1.0 14/12/2003 - * @author Ludovic APVRILLE + * Class JDiagramTree + * Dialog for managing attributes + * Creation: 14/12/2003 + * @version 1.0 14/12/2003 + * @author Ludovic APVRILLE */ public class JDiagramTree extends javax.swing.JTree implements ActionListener, MouseListener, TreeExpansionListener, TreeSelectionListener, Runnable { private boolean toUpdate = false; @@ -193,14 +193,14 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M jmiShow.addActionListener(this); jmiMinimize = new JMenuItem("Minimize"); jmiMinimize.addActionListener(this); - jmiRefusalGraph = new JMenuItem("Make Test Sequences"); + jmiRefusalGraph = new JMenuItem("Make Test Sequences"); jmiRefusalGraph.addActionListener(this); jmiRemove = new JMenuItem("Remove from tree"); jmiRemove.addActionListener(this); popupTree.add(jmiAnalyze); popupTree.add(jmiShow); popupTree.add(jmiMinimize); - popupTree.add(jmiRefusalGraph); + popupTree.add(jmiRefusalGraph); popupTree.addSeparator(); popupTree.add(jmiRemove); } @@ -298,6 +298,10 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M } + public void expandPath(TreePath tp) { + expandPath(tp); + } + public void treeCollapsed(TreeExpansionEvent treeExpansionEvent) { m_expandedTreePaths.remove(treeExpansionEvent.getPath()); } @@ -380,7 +384,7 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M if (selectedRG != null) { if (ae.getSource() == jmiAnalyze) { mgui.showAUTFromRG(selectedRG.name, selectedRG); - + } else if (ae.getSource() == jmiShow) { if (selectedRG.graph != null) { selectedRG.graph.display(); @@ -401,7 +405,7 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M if (selectedRG != null) { mgui.makeRefusalGraph(selectedRG); } - } + } } @@ -410,12 +414,12 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M //TraceManager.addDev("Adding graph from file"); String [] graph = mgui.loadAUTGraph(); - if (graph != null) { - RG rg = new RG(graph[0]); - rg.fileName = graph[0]; - rg.data = graph[1]; - mgui.addRG(rg); - } + if (graph != null) { + RG rg = new RG(graph[0]); + rg.fileName = graph[0]; + rg.data = graph[1]; + mgui.addRG(rg); + } } } diff --git a/src/main/java/ui/tree/SyntaxAnalysisTree.java b/src/main/java/ui/tree/SyntaxAnalysisTree.java index 57af10515714064f9e2b72cfc6e9c8c681f98238..c517c9f8b66db17a65149a6b0fe2574d59dbeb7c 100755 --- a/src/main/java/ui/tree/SyntaxAnalysisTree.java +++ b/src/main/java/ui/tree/SyntaxAnalysisTree.java @@ -68,6 +68,16 @@ public class SyntaxAnalysisTree implements GenericTree { public String toString() { return name; } + + public SyntaxAnalysisErrorTree getSyntaxAnalysisErrorTree() { + return errort; + } + + public SyntaxAnalysisWarningTree getSyntaxAnalysisWarningTree() { + return warningt; + } + + public int getChildCount() { return 2;