From 63c1f352967abfcf9fcf25f64555cc5dd9c88c84 Mon Sep 17 00:00:00 2001
From: Ludovic Apvrille <ludovic.apvrille@telecom-paris.fr>
Date: Thu, 23 Sep 2021 17:32:55 +0200
Subject: [PATCH] Adding sysmlv2 view

---
 src/main/java/ui/GTURTLEModeling.java |  6 +++---
 src/main/java/ui/MainGUI.java         | 10 +++++++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java
index 24f50aad5e..772ca912b2 100644
--- a/src/main/java/ui/GTURTLEModeling.java
+++ b/src/main/java/ui/GTURTLEModeling.java
@@ -1988,14 +1988,14 @@ public class GTURTLEModeling {
 
     }
 
-    public boolean toSysMLV2() {
+    public String toSysMLV2() {
         if (avatarspec != null) {
             AVATAR2SysMLV2 toS = new AVATAR2SysMLV2(avatarspec);
             StringBuffer sb = toS.generateSysMLV2Spec(true, true);
             System.out.println("SysMLV2:\n" + sb.toString());
-            return true;
+            return sb.toString();
         }
-        return false;
+        return null;
     }
 
     public boolean generateProVerifFromAVATAR(String _path, int _stateReachability, boolean _typed, boolean allowPrivateChannelDuplication, String loopLimit) {
diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java
index 33233d2035..4e4ac2d80c 100644
--- a/src/main/java/ui/MainGUI.java
+++ b/src/main/java/ui/MainGUI.java
@@ -3423,7 +3423,15 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
 
     public void toSysMLV2() {
         checkModelingSyntax(true);
-        gtm.toSysMLV2();
+        String data = gtm.toSysMLV2();
+        if (data != null) {
+            TraceManager.addDev("New Frame SysML");
+            JFrameBasicText fbt = new JFrameBasicText("SysML V2 - " + getCurrentTDiagramPanel().getName(), data);
+            fbt.setSize(800, 800);
+            fbt.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            fbt.setVisible(true);
+            TraceManager.addDev("Frame shown");
+        }
     }
 
     public void makeLotosFile() {
-- 
GitLab