diff --git a/src/translator/ActivityDiagram.java b/src/translator/ActivityDiagram.java index 761de66585909cd7da070aeec23b2fd6fc1c7533..572f6855bb23cca1b83e9259f2b8fe56bd69b92b 100755 --- a/src/translator/ActivityDiagram.java +++ b/src/translator/ActivityDiagram.java @@ -344,7 +344,7 @@ public class ActivityDiagram extends Vector{ return new StringBuffer(s + "\n"); } - public void RemoveAllNonReferencedElts() { + public void removeAllNonReferencedElts() { ADComponent adc; while((adc = hasNonReferencedElts()) != null) { remove(adc); diff --git a/src/translator/TURTLEModeling.java b/src/translator/TURTLEModeling.java index f23d68c4331163526dd19a3fa9f7d911524b7b8d..6f533234b28fbbf0f257a006a203228d7b0ca11a 100755 --- a/src/translator/TURTLEModeling.java +++ b/src/translator/TURTLEModeling.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille * * ludovic.apvrille AT enst.fr * @@ -1726,7 +1726,7 @@ public class TURTLEModeling { //modified = false; // for debug -> to be removed i++; } - ad.RemoveAllNonReferencedElts(); + ad.removeAllNonReferencedElts(); } public boolean unrollComponents(ActivityDiagram ad, boolean debug) { @@ -1891,7 +1891,7 @@ public class TURTLEModeling { /*System.out.println("print"); ad.print();*/ // Remove all non referenced elements - ad.RemoveAllNonReferencedElts(); + ad.removeAllNonReferencedElts(); /*System.out.println("Last print:"); ad.print();*/ @@ -2244,7 +2244,7 @@ public class TURTLEModeling { //modified = false; // for debug -> to be removed i++; } - ad.RemoveAllNonReferencedElts(); + ad.removeAllNonReferencedElts(); } public boolean analyseChoiceStop(ActivityDiagram ad) { diff --git a/src/ui/DesignPanelTranslator.java b/src/ui/DesignPanelTranslator.java index 63eb10a2b7b26240297727b8bb5d74fed76dfa13..f2c352f5f9d0c66d7f1e83c9bbca67dfedce7d3b 100755 --- a/src/ui/DesignPanelTranslator.java +++ b/src/ui/DesignPanelTranslator.java @@ -60,7 +60,7 @@ import ui.osad.*; public class DesignPanelTranslator { protected TURTLEDesignPanelInterface dp; - protected Vector checkingErrors; + protected Vector checkingErrors, warnings; protected CorrespondanceTGElement listE; // usual list protected CorrespondanceTGElement listB; // list for particular element -> first element of group of blocks @@ -71,6 +71,7 @@ public class DesignPanelTranslator { public void reinit() { checkingErrors = new Vector(); + warnings = new Vector(); listE = new CorrespondanceTGElement(); listB = new CorrespondanceTGElement(); } @@ -80,7 +81,7 @@ public class DesignPanelTranslator { } public Vector getWarnings() { - return null; + return warnings; } public CorrespondanceTGElement getCorrespondanceTGElement() { @@ -116,6 +117,13 @@ public class DesignPanelTranslator { checkingErrors.addElement(ce); } + private void addWarning(CheckingError ce) { + if (warnings == null) { + warnings = new Vector(); + } + warnings.addElement(ce); + } + public void addTClasses(TURTLEDesignPanelInterface dp, Vector tclasses, String preName, TURTLEModeling tm) { TDiagramPanel tdp; @@ -367,10 +375,6 @@ public class DesignPanelTranslator { while(iterator.hasNext()) { tgc = (TGComponent)(iterator.next()); - /*if (tgc.getCheckableAccessibility()) { - - }*/ - if (tgc instanceof TADActionState) { tadas = (TADActionState)tgc; s = ((TADActionState)tgc).getAction(); @@ -900,6 +904,20 @@ public class DesignPanelTranslator { } // Increasing count of this panel tdp.count ++; + + // Remove all elements not reachable from start state + int sizeb = ad.size(); + + ad.removeAllNonReferencedElts(); + int sizea = ad.size(); + if (sizeb > sizea) { + CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, "Non reachable elements have been removed in " + t.getName()); + ce.setTClass(t); + ce.setTGComponent(null); + ce.setTDiagramPanel(tdp); + addWarning(ce); + //System.out.println("Non reachable elements have been removed in " + t.getName()); + } } public void addRelations(TURTLEDesignPanelInterface dp, String prename, TURTLEModeling tm) { diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java index 1530638cb6ec439e394cbeadd7f4ba3bc7c47fda..6c3c83657fff78d1da3a01c6ada92cc0cf51074a 100755 --- a/src/ui/GTURTLEModeling.java +++ b/src/ui/GTURTLEModeling.java @@ -1476,7 +1476,7 @@ public class GTURTLEModeling { public boolean checkTURTLEModeling(Vector tclasses, DesignPanel dp, boolean overideSyntaxChecking) { // Builds a TURTLE modeling from diagrams - warnings = new Vector(); + //warnings = new Vector(); //checkingErrors = null; mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO); //tm = new TURTLEModeling(); @@ -1489,6 +1489,7 @@ public class GTURTLEModeling { listE = dpt.getCorrespondanceTGElement(); checkingErrors = dpt.getErrors(); + warnings = dpt.getWarnings(); if ((checkingErrors != null) && (checkingErrors.size() >0)){ return false; } @@ -1499,7 +1500,7 @@ public class GTURTLEModeling { TURTLEModelChecker tmc = new TURTLEModelChecker(tm); checkingErrors = tmc.syntaxAnalysisChecking(); - warnings = tmc.getWarnings(); + warnings.addAll(tmc.getWarnings()); if ((checkingErrors != null) && (checkingErrors.size() > 0)){ return false; diff --git a/src/ui/procsd/JDialogAttributeProCSD.java b/src/ui/procsd/JDialogAttributeProCSD.java index 9e2b8bafeb570efa63c351e10887692817317630..515022544b329dd6eb7cdb277e413a67a48a0883 100644 --- a/src/ui/procsd/JDialogAttributeProCSD.java +++ b/src/ui/procsd/JDialogAttributeProCSD.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille * * ludovic.apvrille AT enst.fr * diff --git a/src/ui/procsd/ProactiveCSDPanel.java b/src/ui/procsd/ProactiveCSDPanel.java index da1cf204d888d220b58dd1796a51627a4cacd6cc..9ce6640991efa5c56b4bc0863a6a59e3903d668e 100755 --- a/src/ui/procsd/ProactiveCSDPanel.java +++ b/src/ui/procsd/ProactiveCSDPanel.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille * * ludovic.apvrille AT enst.fr * diff --git a/src/ui/tmldd/TMLArchiBUSNode.java b/src/ui/tmldd/TMLArchiBUSNode.java index fc99c7fc17125f9061d6a114b664df0b09e1927a..c7ad64cc767c3fc28b5a1174420caacc8e73af11 100755 --- a/src/ui/tmldd/TMLArchiBUSNode.java +++ b/src/ui/tmldd/TMLArchiBUSNode.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille ludovic.apvrille AT enst.fr diff --git a/src/ui/tmldd/TMLArchiBridgeNode.java b/src/ui/tmldd/TMLArchiBridgeNode.java index fcb17183efd0562abe54c21bd441541c568e1267..237ed69ab5d7d00f93e8add7f4ae22dc9f00bfee 100755 --- a/src/ui/tmldd/TMLArchiBridgeNode.java +++ b/src/ui/tmldd/TMLArchiBridgeNode.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille ludovic.apvrille AT enst.fr diff --git a/src/ui/tmldd/TMLArchiCommunicationNode.java b/src/ui/tmldd/TMLArchiCommunicationNode.java index f47bffb19f88b33dde6ff7861ab69f6fb1756030..3217956d405369650b27b93e5737397993348ec8 100755 --- a/src/ui/tmldd/TMLArchiCommunicationNode.java +++ b/src/ui/tmldd/TMLArchiCommunicationNode.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille ludovic.apvrille AT enst.fr diff --git a/src/ui/tmldd/TMLArchiHWANode.java b/src/ui/tmldd/TMLArchiHWANode.java index c150ebdd8cb1fe5db3700eb15cb8b691da6a769e..add92e8d30e24e5bd188dec6ad295b7537bb3287 100755 --- a/src/ui/tmldd/TMLArchiHWANode.java +++ b/src/ui/tmldd/TMLArchiHWANode.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille ludovic.apvrille AT enst.fr diff --git a/src/ui/tmldd/TMLArchiNode.java b/src/ui/tmldd/TMLArchiNode.java index bc7021097e9f887ac5d7337cde84ef26863bb480..a6ae26a641daf353bf9579040bd4115d50cc1b97 100755 --- a/src/ui/tmldd/TMLArchiNode.java +++ b/src/ui/tmldd/TMLArchiNode.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille ludovic.apvrille AT enst.fr