From e92af10c204280618027d0936c5e5ff4b7cfaa0a Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Tue, 23 Feb 2016 13:48:56 +0000 Subject: [PATCH] Adding satisfay link to TTool --- src/ui/IconManager.java | 8 +- src/ui/MainGUI.java | 538 +++++++++--------- src/ui/TGComponentManager.java | 11 + src/ui/TGUIAction.java | 27 +- .../AvatarRDConnectingPointDerive.java | 22 +- .../AvatarRDConnectingPointSatisfy.java | 73 +++ src/ui/avatarrd/AvatarRDElementReference.java | 316 ++++++++++ src/ui/avatarrd/AvatarRDRequirement.java | 16 +- src/ui/avatarrd/AvatarRDSatisfyConnector.java | 95 ++++ src/ui/avatarrd/AvatarRDToolBar.java | 191 ++++--- src/ui/images/avatarrdref.gif | Bin 0 -> 99 bytes src/ui/images/reqsatisfy.gif | Bin 0 -> 112 bytes 12 files changed, 911 insertions(+), 386 deletions(-) create mode 100755 src/ui/avatarrd/AvatarRDConnectingPointSatisfy.java create mode 100644 src/ui/avatarrd/AvatarRDElementReference.java create mode 100755 src/ui/avatarrd/AvatarRDSatisfyConnector.java create mode 100644 src/ui/images/avatarrdref.gif create mode 100755 src/ui/images/reqsatisfy.gif diff --git a/src/ui/IconManager.java b/src/ui/IconManager.java index a9e78dcbae..cd6814a671 100755 --- a/src/ui/IconManager.java +++ b/src/ui/IconManager.java @@ -110,7 +110,7 @@ public class IconManager { public static ImageIcon imgic900, imgic902, imgic904, imgic906, imgic908, imgic910, imgic912, imgic914, imgic916, imgic918; public static ImageIcon imgic920, imgic922, imgic924, imgic926, imgic928, imgic930; // Requirement diagrams - public static ImageIcon imgic1000, imgic1002, imgic1004,imgic1006,imgic1008, imgic1010, imgic1012, imgic1014, imgic1016; + public static ImageIcon imgic1000, imgic1002, imgic1004,imgic1006,imgic1008, imgic1010, imgic1012, imgic1014, imgic1016, imgic1018; public static ImageIcon imgic1050, imgic1052, imgic1054,imgic1056, imgic1058, imgic1060; // Attack Tree Diagrams @@ -146,7 +146,7 @@ public class IconManager { public static ImageIcon imgic5030, imgic5032, imgic5034, imgic5036, imgic5038; public static ImageIcon imgic5040, imgic5042, imgic5044, imgic5046, imgic5048; public static ImageIcon imgic5050, imgic5052, imgic5054, imgic5056, imgic5058; - public static ImageIcon imgic5060, imgic5062, imgic5064, imgic5066; + public static ImageIcon imgic5060, imgic5062, imgic5064, imgic5066, imgic5068; public static ImageIcon imgic5100, imgic5102, imgic5104, imgic5106, imgic5108; public static ImageIcon imgic5110, imgic5112, imgic5113,imgic5114; @@ -442,6 +442,7 @@ public class IconManager { private static String icon1012 = "images/reqcomp.gif"; private static String icon1014 = "images/ebrddobs.gif"; private static String icon1016 = "images/reqref.gif"; + private static String icon1018 = "images/reqsatisfy.gif"; @@ -554,6 +555,7 @@ public class IconManager { private static String icon5062 = "images/avatarmadeltref.gif"; private static String icon5064 = "images/avatarmadversioning.gif"; private static String icon5066 = "images/avatarmadimpact.gif"; + private static String icon5068 = "images/avatarrdref.gif"; private static String icon5100 = "images/avatarhead16.gif"; private static String icon5102 = "images/avatarhead32.gif"; @@ -840,6 +842,7 @@ public class IconManager { imgic1012 = getIcon(icon1012); imgic1014 = getIcon(icon1014); imgic1016 = getIcon(icon1016); + imgic1018 = getIcon(icon1018); imgic1050 = getIcon(icon1050); imgic1052 = getIcon(icon1052); @@ -945,6 +948,7 @@ public class IconManager { imgic5062 = getIcon(icon5062); imgic5064 = getIcon(icon5064); imgic5066 = getIcon(icon5066); + imgic5068 = getIcon(icon5068); imgic5100 = getIcon(icon5100); imgic5102 = getIcon(icon5102); diff --git a/src/ui/MainGUI.java b/src/ui/MainGUI.java index ee31f9042a..9f3a938b71 100755 --- a/src/ui/MainGUI.java +++ b/src/ui/MainGUI.java @@ -1198,8 +1198,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe if (index == -1) { index = tabs.size(); } - - TraceManager.addDev("New avatar methodo panel"); + + TraceManager.addDev("New avatar methodo panel"); AvatarMethodologyPanel dp = new AvatarMethodologyPanel(this); tabs.add(index, dp); mainTabbedPane.add(dp.tabbedPane, index); @@ -1219,7 +1219,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe if (index == -1) { index = tabs.size(); } - TraceManager.addDev("New SysMLSec Methodopanel"); + TraceManager.addDev("New SysMLSec Methodopanel"); SysmlsecMethodologyPanel dp = new SysmlsecMethodologyPanel(this); tabs.add(index, dp); mainTabbedPane.add(dp.tabbedPane, index); @@ -1597,7 +1597,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return index; } - public int createSysmlsecMethodology(String name) { + public int createSysmlsecMethodology(String name) { int index = addSysmlsecMethodologyPanel(name, -1, false); mainTabbedPane.setSelectedIndex(index); return index; @@ -3793,9 +3793,9 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe } if (!automatic) { JOptionPane.showMessageDialog(frame, - "RT-LOTOS specification generated", - "RT-LOTOS specification", - JOptionPane.INFORMATION_MESSAGE); + "RT-LOTOS specification generated", + "RT-LOTOS specification", + JOptionPane.INFORMATION_MESSAGE); } dtree.toBeUpdated(); return true; @@ -3826,9 +3826,9 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe //TraceManager.addDev("LOTOS generated"); if (!automatic) { JOptionPane.showMessageDialog(frame, - "LOTOS specification generated (" + getCheckingWarnings().size() + " warning(s))", - "LOTOS specification", - JOptionPane.INFORMATION_MESSAGE); + "LOTOS specification generated (" + getCheckingWarnings().size() + " warning(s))", + "LOTOS specification", + JOptionPane.INFORMATION_MESSAGE); } } setMode(MainGUI.RTLOTOS_OK); @@ -3948,9 +3948,9 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe public void generateAUTS() { JDialogGenAUTS jdgauts = new JDialogGenAUTS(frame, this, "Generation of automata via LOTOS", gtm.getPathCaesar(), - gtm.getPathBcgio(), - REMOTE_RTL_LOTOS_FILE, - gtm.getCaesarHost(), ConfigurationTTool.TGraphPath); + gtm.getPathBcgio(), + REMOTE_RTL_LOTOS_FILE, + gtm.getCaesarHost(), ConfigurationTTool.TGraphPath); jdgauts.setSize(450, 600); GraphicLib.centerOnParent(jdgauts); jdgauts.setVisible(true); @@ -3983,9 +3983,9 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe formalValidation(true); } else { JOptionPane.showMessageDialog(frame, - "" + getCheckingErrors().size() + " errors, " +getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated", - "Translation to UPPAAL failed", - JOptionPane.INFORMATION_MESSAGE); + "" + getCheckingErrors().size() + " errors, " +getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated", + "Translation to UPPAAL failed", + JOptionPane.INFORMATION_MESSAGE); return; } } @@ -4018,18 +4018,18 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe } // DG - public void avatarddExecutableCodeGeneration(){ - TraceManager.addDev("Avatar code generation"); - JDialogAvatarddExecutableCodeGeneration jgen = new JDialogAvatarddExecutableCodeGeneration(frame, this, "Executable Code generation, compilation and execution", -ConfigurationTTool.AVATARExecutableCodeHost, -ConfigurationTTool.AVATARMPSoCCodeDirectory, -ConfigurationTTool.AVATARMPSoCCompileCommand, -ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); + public void avatarddExecutableCodeGeneration(){ + TraceManager.addDev("Avatar code generation"); + JDialogAvatarddExecutableCodeGeneration jgen = new JDialogAvatarddExecutableCodeGeneration(frame, this, "Executable Code generation, compilation and execution", + ConfigurationTTool.AVATARExecutableCodeHost, + ConfigurationTTool.AVATARMPSoCCodeDirectory, + ConfigurationTTool.AVATARMPSoCCompileCommand, + ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); jgen.setSize(500, 450); GraphicLib.centerOnParent(jgen); jgen.setVisible(true); dtree.toBeUpdated(); - } + } // --------------------------------------------------------------------- @@ -4047,14 +4047,14 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); if (showWindow) { if (result) { JOptionPane.showMessageDialog(frame, - "0 error, " + getCheckingWarnings().size() + " warning(s). UPPAAL specification generated", - "Successful translation to UPPAAL", - JOptionPane.INFORMATION_MESSAGE); + "0 error, " + getCheckingWarnings().size() + " warning(s). UPPAAL specification generated", + "Successful translation to UPPAAL", + JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(frame, - "" + getCheckingErrors().size() + " errors, " +getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated", - "Translation to UPPAAL failed", - JOptionPane.INFORMATION_MESSAGE); + "" + getCheckingErrors().size() + " errors, " +getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated", + "Translation to UPPAAL failed", + JOptionPane.INFORMATION_MESSAGE); } @@ -4163,8 +4163,8 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); avatarSimulation(); } else if ((tp instanceof TMLDesignPanel) || (tp instanceof TMLComponentDesignPanel) || (tp instanceof TMLArchiPanel)) { JDialogSystemCGeneration jgen = new JDialogSystemCGeneration(frame, this, "Simulation code generation and compilation", - ConfigurationTTool.SystemCHost, ConfigurationTTool.SystemCCodeDirectory, ConfigurationTTool.SystemCCodeCompileCommand, - ConfigurationTTool.SystemCCodeExecuteCommand, ConfigurationTTool.SystemCCodeInteractiveExecuteCommand, ConfigurationTTool.GGraphPath, _mode); + ConfigurationTTool.SystemCHost, ConfigurationTTool.SystemCCodeDirectory, ConfigurationTTool.SystemCCodeCompileCommand, + ConfigurationTTool.SystemCCodeExecuteCommand, ConfigurationTTool.SystemCCodeInteractiveExecuteCommand, ConfigurationTTool.GGraphPath, _mode); jgen.setSize(500, 750); GraphicLib.centerOnParent(jgen); jgen.setVisible(true); @@ -4275,11 +4275,11 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); path = file.getAbsolutePath(); } JDialogCCodeGeneration jgen = new JDialogCCodeGeneration( frame, this, "Application code generation and compilation", - ConfigurationTTool.SystemCHost, ConfigurationTTool.CcodeDirectory, - "make -C " + ConfigurationTTool.CcodeDirectory, - ConfigurationTTool.SystemCCodeExecuteCommand, - ConfigurationTTool.SystemCCodeInteractiveExecuteCommand, - ConfigurationTTool.GGraphPath, gtm ); + ConfigurationTTool.SystemCHost, ConfigurationTTool.CcodeDirectory, + "make -C " + ConfigurationTTool.CcodeDirectory, + ConfigurationTTool.SystemCCodeExecuteCommand, + ConfigurationTTool.SystemCCodeInteractiveExecuteCommand, + ConfigurationTTool.GGraphPath, gtm ); jgen.setSize(500, 750); GraphicLib.centerOnParent(jgen); jgen.setVisible(true); @@ -4358,22 +4358,22 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); public void checkCode() { if (gtm.getLanguageID() == GTURTLEModeling.RT_LOTOS) { JDialogTextProcess jdtp = new JDialogTextProcess(frame, - "Checking RT-LOTOS specification with RTL", - gtm.getPathRTL() + " __FILENAME -max-spec-t-1", - REMOTE_RTL_LOTOS_FILE, - gtm.getLastRTLOTOSSpecification(), - gtm.getHost()); + "Checking RT-LOTOS specification with RTL", + gtm.getPathRTL() + " __FILENAME -max-spec-t-1", + REMOTE_RTL_LOTOS_FILE, + gtm.getLastRTLOTOSSpecification(), + gtm.getHost()); jdtp.setSize(450, 600); GraphicLib.centerOnParent(jdtp); jdtp.setVisible(true); dtree.toBeUpdated(); } else if (gtm.getLanguageID() == GTURTLEModeling.LOTOS) { JDialogLOTOSAnalysis jdla = new JDialogLOTOSAnalysis(frame, - this, "Checking LOTOS specification with CAESAR", - gtm.getPathCaesar(), - REMOTE_RTL_LOTOS_FILE, - gtm.getLastRTLOTOSSpecification(), - gtm.getCaesarHost()); + this, "Checking LOTOS specification with CAESAR", + gtm.getPathCaesar(), + REMOTE_RTL_LOTOS_FILE, + gtm.getLastRTLOTOSSpecification(), + gtm.getCaesarHost()); jdla.setSize(450, 600); GraphicLib.centerOnParent(jdla); jdla.setVisible(true); @@ -4385,12 +4385,12 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); public void simulation() { if (gtm.getLanguageID() == GTURTLEModeling.RT_LOTOS) { JDialogSimulation jds = new JDialogSimulation(frame, - this, - "Intensive simulation with RTL", - gtm.getPathRTL(), - REMOTE_RTL_LOTOS_FILE, - gtm.getLastRTLOTOSSpecification(), - gtm.getHost()); + this, + "Intensive simulation with RTL", + gtm.getPathRTL(), + REMOTE_RTL_LOTOS_FILE, + gtm.getLastRTLOTOSSpecification(), + gtm.getHost()); jds.setSize(450, 600); GraphicLib.centerOnParent(jds); jds.setVisible(true); @@ -4421,17 +4421,17 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); public void formalValidation(boolean automatic, TURTLEPanel _tp) { if (gtm.getLanguageID() == GTURTLEModeling.RT_LOTOS) { JDialogFormalValidation jdfv = new JDialogFormalValidation(frame, - this, - "Formal Validation with RTL", - gtm.getPathRTL(), - gtm.getPathDTA2DOT(), - gtm.getPathRGSTRAP(), - gtm.getPathRG2TLSA(), - REMOTE_RTL_LOTOS_FILE, - gtm.getLastRTLOTOSSpecification(), - gtm.getHost(), - gtm.getHostAldebaran(), - gtm.getPathBcgio()); + this, + "Formal Validation with RTL", + gtm.getPathRTL(), + gtm.getPathDTA2DOT(), + gtm.getPathRGSTRAP(), + gtm.getPathRG2TLSA(), + REMOTE_RTL_LOTOS_FILE, + gtm.getLastRTLOTOSSpecification(), + gtm.getHost(), + gtm.getHostAldebaran(), + gtm.getPathBcgio()); jdfv.setAutomatic(automatic); jdfv.setSize(450, 600); GraphicLib.centerOnParent(jdfv); @@ -4439,14 +4439,14 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); dtree.toBeUpdated(); } else if (gtm.getLanguageID() == GTURTLEModeling.LOTOS) { JDialogLOTOSValidation jdla = new JDialogLOTOSValidation(frame, - this, "Generating RG with CAESAR", - gtm.getPathCaesar(), - gtm.getPathCaesarOpen(), - gtm.getPathBcgio(), - gtm.getPathBcgmerge(), - REMOTE_RTL_LOTOS_FILE, - gtm.getLastRTLOTOSSpecification(), - gtm.getCaesarHost()); + this, "Generating RG with CAESAR", + gtm.getPathCaesar(), + gtm.getPathCaesarOpen(), + gtm.getPathBcgio(), + gtm.getPathBcgmerge(), + REMOTE_RTL_LOTOS_FILE, + gtm.getLastRTLOTOSSpecification(), + gtm.getCaesarHost()); jdla.setAutomatic(automatic); jdla.setSize(450, 600); GraphicLib.centerOnParent(jdla); @@ -4454,30 +4454,30 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); dtree.toBeUpdated(); } else if (gtm.getLanguageID() == GTURTLEModeling.UPPAAL) { JDialogUPPAALValidation jduv = new JDialogUPPAALValidation(frame, - this, "Formal verification with UPPAAL", - gtm.getPathUPPAALVerifier(), - gtm.getPathUPPAALFile(), - REMOTE_UPPAAL_FILE, - gtm.getLastUPPAALSpecification().getStringSpec(), - gtm.getUPPAALVerifierHost(), - _tp); + this, "Formal verification with UPPAAL", + gtm.getPathUPPAALVerifier(), + gtm.getPathUPPAALFile(), + REMOTE_UPPAAL_FILE, + gtm.getLastUPPAALSpecification().getStringSpec(), + gtm.getUPPAALVerifierHost(), + _tp); jduv.setSize(450, 600); GraphicLib.centerOnParent(jduv); jduv.setVisible(true); dtree.toBeUpdated(); } else if (gtm.getLanguageID() == GTURTLEModeling.MATRIX) { JDialogTMatrixManagement jdfv = new JDialogTMatrixManagement(frame, - this, - "Observers's Based Formal Verification", - gtm.getRequirementModeling(), - gtm.getPathRTL(), - gtm.getPathDTA2DOT(), - gtm.getPathRGSTRAP(), - gtm.getPathRG2TLSA(), - REMOTE_RTL_LOTOS_FILE, - gtm.getHost(), - GTURTLEModeling.getHostAldebaran(), - gtm.getPathBcgio()); + this, + "Observers's Based Formal Verification", + gtm.getRequirementModeling(), + gtm.getPathRTL(), + gtm.getPathDTA2DOT(), + gtm.getPathRGSTRAP(), + gtm.getPathRG2TLSA(), + REMOTE_RTL_LOTOS_FILE, + gtm.getHost(), + GTURTLEModeling.getHostAldebaran(), + gtm.getPathBcgio()); jdfv.setSize(550, 600); jdfv.setIconImage(IconManager.img8); GraphicLib.centerOnParent(jdfv); @@ -4492,16 +4492,16 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); tcdp = ((DesignPanel)(getCurrentTURTLEPanel())).tcdp; } JDialogProjection jdfv = new JDialogProjection(frame, - this, - tcdp, - gtm.getTURTLEModeling(), - GTURTLEModeling.getHostAldebaran(), - GTURTLEModeling.getPathAldebaran(), - gtm.getPathBcgmin(), - gtm.getPathBcgio(), - gtm.getLastRGAUT(), - REMOTE_ALDEBARAN_AUT_FILE, - "Minimization using Aldebaran"); + this, + tcdp, + gtm.getTURTLEModeling(), + GTURTLEModeling.getHostAldebaran(), + GTURTLEModeling.getPathAldebaran(), + gtm.getPathBcgmin(), + gtm.getPathBcgio(), + gtm.getLastRGAUT(), + REMOTE_ALDEBARAN_AUT_FILE, + "Minimization using Aldebaran"); jdfv.setSize(900, 700); GraphicLib.centerOnParent(jdfv); jdfv.setVisible(true); @@ -4511,19 +4511,19 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); JDialogGraphModification jdgm; if (gtm == null ){ jdgm = new JDialogGraphModification(frame, - GTURTLEModeling.getHostAldebaran(), - GTURTLEModeling.getPathBcgio(), - "graph", - "Minimization using Aldebaran", - null, null); + GTURTLEModeling.getHostAldebaran(), + GTURTLEModeling.getPathBcgio(), + "graph", + "Minimization using Aldebaran", + null, null); } else { jdgm = new JDialogGraphModification(frame, - GTURTLEModeling.getHostAldebaran(), - gtm.getPathBcgio(), - "graph", - "Minimization using Aldebaran", - gtm.getLastRGAUT(), - gtm.getLastTextualRGAUTProj()); + GTURTLEModeling.getHostAldebaran(), + gtm.getPathBcgio(), + "graph", + "Minimization using Aldebaran", + gtm.getLastRGAUT(), + gtm.getLastTextualRGAUTProj()); } jdgm.setSize(600, 500); GraphicLib.centerOnParent(jdgm); @@ -4539,11 +4539,11 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); public void bisimulation() { JDialogBisimulation jdb = new JDialogBisimulation(frame, - GTURTLEModeling.getHostAldebaran(), - GTURTLEModeling.getPathAldebaran(), - REMOTE_ALDEBARAN_BISIMU_FILE1, - REMOTE_ALDEBARAN_BISIMU_FILE2, - "Bisimulation using Aldebaran"); + GTURTLEModeling.getHostAldebaran(), + GTURTLEModeling.getPathAldebaran(), + REMOTE_ALDEBARAN_BISIMU_FILE1, + REMOTE_ALDEBARAN_BISIMU_FILE2, + "Bisimulation using Aldebaran"); jdb.setSize(650, 800); GraphicLib.centerOnParent(jdb); jdb.setVisible(true); @@ -4552,12 +4552,12 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); public void bisimulationCADP() { JDialogBisimulationBisimulator jdb = new JDialogBisimulationBisimulator(frame, - GTURTLEModeling.getCaesarHost(), - GTURTLEModeling.getPathBisimulator(), - GTURTLEModeling.getPathBcgio(), - REMOTE_BISIMULATOR_FILE1, - REMOTE_BISIMULATOR_FILE2, - "Bisimulation using BISIMULATOR"); + GTURTLEModeling.getCaesarHost(), + GTURTLEModeling.getPathBisimulator(), + GTURTLEModeling.getPathBcgio(), + REMOTE_BISIMULATOR_FILE1, + REMOTE_BISIMULATOR_FILE2, + "Bisimulation using BISIMULATOR"); jdb.setSize(650, 800); GraphicLib.centerOnParent(jdb); jdb.setVisible(true); @@ -4628,9 +4628,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String spec = loadFile(new File(ConfigurationTTool.TGraphPath + "/tree.aut")); if (spec == null) { JOptionPane.showMessageDialog(frame, - "The fill could not be loaded:", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The fill could not be loaded:", + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } @@ -4789,9 +4789,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = gtm.showDTA(); if (s != null) { JOptionPane.showMessageDialog(frame, - "The DTA could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The DTA could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4804,9 +4804,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = gtm.showRG(); if (s != null) { JOptionPane.showMessageDialog(frame, - "The RG could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The RG could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4814,9 +4814,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = gtm.showTLSA(); if (s != null) { JOptionPane.showMessageDialog(frame, - "The TLSA could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The TLSA could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4824,9 +4824,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = gtm.showRGAut(); if (s != null) { JOptionPane.showMessageDialog(frame, - "The RG could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The RG could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4834,9 +4834,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = gtm.showRGAutProj(); if (s != null) { JOptionPane.showMessageDialog(frame, - "The RG could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The RG could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4844,9 +4844,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = gtm.showRGDiplodocus(); if (s != null) { JOptionPane.showMessageDialog(frame, - "The RG could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The RG could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4854,9 +4854,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = GTURTLEModeling.runDOTTY(modifiedautdot); if (s != null) { JOptionPane.showMessageDialog(frame, - "The RG could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The RG could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } @@ -4866,9 +4866,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = GTURTLEModeling.showGGraph(graph[1]); if (s != null) { JOptionPane.showMessageDialog(frame, - "The graph could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The graph could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } } @@ -4880,9 +4880,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); String s = GTURTLEModeling.showGGraph(graph[1]); if (s != null) { JOptionPane.showMessageDialog(frame, - "The graph could not be displayed: " + s, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The graph could not be displayed: " + s, + "Error", + JOptionPane.INFORMATION_MESSAGE); } } } @@ -4916,9 +4916,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); public void diagramCapture() { if (tabs.size() < 1) { JOptionPane.showMessageDialog(frame, - "No diagram is under edition", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "No diagram is under edition", + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } @@ -4939,9 +4939,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); if (tabs.size() < 1) { JOptionPane.showMessageDialog(frame, - "No diagram is under edition", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "No diagram is under edition", + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } @@ -4957,24 +4957,24 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); FileUtils.saveFile(file.getAbsolutePath(), s); } catch (Exception e) { JOptionPane.showMessageDialog(frame, - "File could not be saved: " + e.getMessage(), - "Error", - JOptionPane.INFORMATION_MESSAGE); + "File could not be saved: " + e.getMessage(), + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } JOptionPane.showMessageDialog(frame, - "The capture was correctly performed and saved in " + file.getAbsolutePath(), - "Save in svg format ok", - JOptionPane.INFORMATION_MESSAGE); + "The capture was correctly performed and saved in " + file.getAbsolutePath(), + "Save in svg format ok", + JOptionPane.INFORMATION_MESSAGE); } } public void allDiagramCapture() { if (tabs.size() < 1) { JOptionPane.showMessageDialog(frame, - "No diagram is under edition", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "No diagram is under edition", + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } @@ -5011,9 +5011,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); } JOptionPane.showMessageDialog(frame, - "All diagrams were sucessfully captured", - "Capture ok", - JOptionPane.INFORMATION_MESSAGE); + "All diagrams were sucessfully captured", + "Capture ok", + JOptionPane.INFORMATION_MESSAGE); } public void selectedCapture() { @@ -5034,9 +5034,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); } if(!checkFileForSave(file)) { JOptionPane.showMessageDialog(frame, - "The capture could not be performed: invalid file", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The capture could not be performed: invalid file", + "Error", + JOptionPane.INFORMATION_MESSAGE); return null; } return file; @@ -5052,9 +5052,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); } if(!checkFileForSave(file)) { JOptionPane.showMessageDialog(frame, - "The capture could not be performed: invalid file", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The capture could not be performed: invalid file", + "Error", + JOptionPane.INFORMATION_MESSAGE); return null; } return file; @@ -5069,15 +5069,15 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); ImageIO.write(image, "png", file); } catch (Exception e) { JOptionPane.showMessageDialog(frame, - "The capture could not be performed:" + e.getMessage(), - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The capture could not be performed:" + e.getMessage(), + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } JOptionPane.showMessageDialog(frame, - "The capture was correctly performed", - "Screen capture ok", - JOptionPane.INFORMATION_MESSAGE); + "The capture was correctly performed", + "Screen capture ok", + JOptionPane.INFORMATION_MESSAGE); return; } @@ -5088,16 +5088,16 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); ImageIO.write(image, "png", file); } catch (Exception e) { JOptionPane.showMessageDialog(frame, - "The capture could not be performed:" + e.getMessage(), - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The capture could not be performed:" + e.getMessage(), + "Error", + JOptionPane.INFORMATION_MESSAGE); return false; } if (info) { JOptionPane.showMessageDialog(frame, - "The capture was correctly performed and saved in " + file.getAbsolutePath(), - "Screen capture ok", - JOptionPane.INFORMATION_MESSAGE); + "The capture was correctly performed and saved in " + file.getAbsolutePath(), + "Screen capture ok", + JOptionPane.INFORMATION_MESSAGE); } return true; } @@ -5790,8 +5790,8 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); if (tp.panelAt(i) instanceof AttackTreeDiagramPanel) return (AttackTreeDiagramPanel)(tp.panelAt(i)); } - } - return null;*/ + } + return null;*/ } @@ -6079,21 +6079,21 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); //And removed by Emil /* - LinkedList cmps=gtm.gpdtemp.getProCSDComponentsList(); - for (int i=0;i<cmps.size();i++) - { - ProCSDComponent c = (ProCSDComponent)cmps.get(i); - - if (c.getType()== TGComponentManager.PROCSD_COMPONENT) - { - if(c.getComponentID().equals(temp.getName())) - { - c.mySMD=temp; - i=cmps.size(); - } - } - } - */ + LinkedList cmps=gtm.gpdtemp.getProCSDComponentsList(); + for (int i=0;i<cmps.size();i++) + { + ProCSDComponent c = (ProCSDComponent)cmps.get(i); + + if (c.getType()== TGComponentManager.PROCSD_COMPONENT) + { + if(c.getComponentID().equals(temp.getName())) + { + c.mySMD=temp; + i=cmps.size(); + } + } + } + */ // setPanelMode(); return(s); //Changes by Solange from return true @@ -8085,12 +8085,16 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.AVATARRD_REQUIREMENT); } else if (command.equals(actions[TGUIAction.ARD_PROPERTY].getActionCommand())) { actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.AVATARRD_PROPERTY); + } else if (command.equals(actions[TGUIAction.ARD_ELEMENT_REFERENCE].getActionCommand())) { + actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.AVATARRD_ELEMENT_REFERENCE); } else if (command.equals(actions[TGUIAction.ARD_DERIVE_CONNECTOR].getActionCommand())) { actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARRD_DERIVE_CONNECTOR); } else if (command.equals(actions[TGUIAction.ARD_REFINE_CONNECTOR].getActionCommand())) { actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARRD_REFINE_CONNECTOR); } else if (command.equals(actions[TGUIAction.ARD_VERIFY_CONNECTOR].getActionCommand())) { actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARRD_VERIFY_CONNECTOR); + } else if (command.equals(actions[TGUIAction.ARD_SATISFY_CONNECTOR].getActionCommand())) { + actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARRD_SATISFY_CONNECTOR); } else if (command.equals(actions[TGUIAction.ARD_COPY_CONNECTOR].getActionCommand())) { actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARRD_COPY_CONNECTOR); } else if (command.equals(actions[TGUIAction.ARD_COMPOSITION_CONNECTOR].getActionCommand())) { @@ -8630,9 +8634,9 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.PROCSD_COMPONENT); //Delegate ports removed, by Solange /* - } else if (command.equals(actions[TGUIAction.PROCSD_DELEGATE_PORT].getActionCommand())) { - actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.PROCSD_DELEGATE_PORT); - */ + } else if (command.equals(actions[TGUIAction.PROCSD_DELEGATE_PORT].getActionCommand())) { + actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.PROCSD_DELEGATE_PORT); + */ } else if (command.equals(actions[TGUIAction.PROCSD_IN_PORT].getActionCommand())) { actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.PROCSD_IN_PORT); } else if (command.equals(actions[TGUIAction.PROCSD_OUT_PORT].getActionCommand())) { @@ -8661,7 +8665,7 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); private JPopupMenu menu; private JMenuItem rename, remove, moveRight, moveLeft, newDesign, newAnalysis, newDeployment, newRequirement, newTMLDesign, newTMLComponentDesign, newTMLArchi, newProactiveDesign, newTURTLEOSDesign, - newNCDesign, sort, clone, newAttackTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo; + newNCDesign, sort, clone, newAttackTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo; private JMenuItem newAVATARAnalysis; public PopupListener(MainGUI _mgui) { @@ -8856,65 +8860,65 @@ ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand); private Action listener = new AbstractAction() { - public void actionPerformed(ActionEvent e) { - JMenuItem item = (JMenuItem)e.getSource(); - String ac = item.getActionCommand(); - if(ac.equals("Rename")) { - mgui.requestRenameTab(mainTabbedPane.getSelectedIndex()); - } else if (ac.equals("Remove")) { - mgui.requestRemoveTab(mainTabbedPane.getSelectedIndex()); - } else if (ac.equals("Move to the left")) { - mgui.requestMoveLeftTab(mainTabbedPane.getSelectedIndex()); - } else if (ac.equals("Move to the right")) { - mgui.requestMoveRightTab(mainTabbedPane.getSelectedIndex()); - } else if (ac.equals("Sort")) { - GraphicLib.sortJTabbedPane(mgui.mainTabbedPane, mgui.tabs, 0, mgui.mainTabbedPane.getTabCount()); - mgui.changeMade(null, -1); - } else if (ac.equals("Clone")) { - mgui.cloneTab(mainTabbedPane.getSelectedIndex()); - } else if (ac.equals("New TURTLE Analysis")) { - mgui.newAnalysis(); - } else if (ac.equals("New TURTLE Design")) { - mgui.newDesign(); - } else if (ac.equals("New TURTLE Deployment")) { - mgui.newDeployment(); - } else if (e.getSource() == newAttackTree) { - mgui.newAttackTree(); - } else if (ac.equals("New TURTLE Requirement Diagram")) { - mgui.newRequirement(); - } else if (e.getSource() == newTMLMethodo) { - mgui.newDiplodocusMethodology(); - } else if (e.getSource() == newAvatarMethodo) { - mgui.newAvatarMethodology(); - } else if (e.getSource() == newSysmlsecMethodo) { - mgui.newSysmlsecMethodology(); - } else if (ac.equals("New DIPLODOCUS Design")) { - mgui.newTMLDesign(); - } else if (e.getSource() == newTMLComponentDesign) { - mgui.newTMLComponentDesign(); - } else if (e.getSource() == newTMLCP) { - mgui.newTMLCP(); - } else if (e.getSource() == newTMLArchi) { - mgui.newTMLArchi(); - } else if (ac.equals("New Proactive Design")) { - mgui.newProactiveDesign(); - } else if (ac.equals("New TURTLE-OS Design")) { - mgui.newTURTLEOSDesign(); - } else if (e.getSource() == newNCDesign) { - mgui.newNCDesign(); - } else if (e.getSource() == newAVATARBD) { - mgui.newAvatarBD(); - } else if (e.getSource() == newAVATARDD) { - mgui.newADD(); - } else if (e.getSource() == newAVATARRequirement) { - mgui.newAvatarRequirement(); - } else if (e.getSource() == newMAD) { - mgui.newAvatarMADs(); - } else if (e.getSource() == newAVATARAnalysis) { - mgui.newAvatarAnalysis(); + public void actionPerformed(ActionEvent e) { + JMenuItem item = (JMenuItem)e.getSource(); + String ac = item.getActionCommand(); + if(ac.equals("Rename")) { + mgui.requestRenameTab(mainTabbedPane.getSelectedIndex()); + } else if (ac.equals("Remove")) { + mgui.requestRemoveTab(mainTabbedPane.getSelectedIndex()); + } else if (ac.equals("Move to the left")) { + mgui.requestMoveLeftTab(mainTabbedPane.getSelectedIndex()); + } else if (ac.equals("Move to the right")) { + mgui.requestMoveRightTab(mainTabbedPane.getSelectedIndex()); + } else if (ac.equals("Sort")) { + GraphicLib.sortJTabbedPane(mgui.mainTabbedPane, mgui.tabs, 0, mgui.mainTabbedPane.getTabCount()); + mgui.changeMade(null, -1); + } else if (ac.equals("Clone")) { + mgui.cloneTab(mainTabbedPane.getSelectedIndex()); + } else if (ac.equals("New TURTLE Analysis")) { + mgui.newAnalysis(); + } else if (ac.equals("New TURTLE Design")) { + mgui.newDesign(); + } else if (ac.equals("New TURTLE Deployment")) { + mgui.newDeployment(); + } else if (e.getSource() == newAttackTree) { + mgui.newAttackTree(); + } else if (ac.equals("New TURTLE Requirement Diagram")) { + mgui.newRequirement(); + } else if (e.getSource() == newTMLMethodo) { + mgui.newDiplodocusMethodology(); + } else if (e.getSource() == newAvatarMethodo) { + mgui.newAvatarMethodology(); + } else if (e.getSource() == newSysmlsecMethodo) { + mgui.newSysmlsecMethodology(); + } else if (ac.equals("New DIPLODOCUS Design")) { + mgui.newTMLDesign(); + } else if (e.getSource() == newTMLComponentDesign) { + mgui.newTMLComponentDesign(); + } else if (e.getSource() == newTMLCP) { + mgui.newTMLCP(); + } else if (e.getSource() == newTMLArchi) { + mgui.newTMLArchi(); + } else if (ac.equals("New Proactive Design")) { + mgui.newProactiveDesign(); + } else if (ac.equals("New TURTLE-OS Design")) { + mgui.newTURTLEOSDesign(); + } else if (e.getSource() == newNCDesign) { + mgui.newNCDesign(); + } else if (e.getSource() == newAVATARBD) { + mgui.newAvatarBD(); + } else if (e.getSource() == newAVATARDD) { + mgui.newADD(); + } else if (e.getSource() == newAVATARRequirement) { + mgui.newAvatarRequirement(); + } else if (e.getSource() == newMAD) { + mgui.newAvatarMADs(); + } else if (e.getSource() == newAVATARAnalysis) { + mgui.newAvatarAnalysis(); + } } - } - }; + }; } diff --git a/src/ui/TGComponentManager.java b/src/ui/TGComponentManager.java index b6d0d19d3c..74fb0075e2 100755 --- a/src/ui/TGComponentManager.java +++ b/src/ui/TGComponentManager.java @@ -362,7 +362,9 @@ public class TGComponentManager { // AVATAR RD -> starts at 5200 public static final int AVATARRD_REQUIREMENT = 5200; public static final int AVATARRD_PROPERTY = 5201; + public static final int AVATARRD_ELEMENT_REFERENCE = 5207; public static final int AVATARRD_DERIVE_CONNECTOR = 5202; + public static final int AVATARRD_SATISFY_CONNECTOR = 5208; public static final int AVATARRD_REFINE_CONNECTOR = 5206; public static final int AVATARRD_VERIFY_CONNECTOR = 5203; public static final int AVATARRD_COPY_CONNECTOR = 5204; @@ -533,6 +535,9 @@ public class TGComponentManager { case AVATARRD_PROPERTY: tgc = new AvatarRDProperty(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; + case AVATARRD_ELEMENT_REFERENCE: + tgc = new AvatarRDElementReference(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; case AVATARMAD_ASSUMPTION: tgc = new AvatarMADAssumption(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); @@ -1380,8 +1385,12 @@ public class TGComponentManager { return AVATARRD_REQUIREMENT; } else if (tgc instanceof AvatarRDProperty) { return AVATARRD_PROPERTY; + } else if (tgc instanceof AvatarRDElementReference) { + return AVATARRD_ELEMENT_REFERENCE; } else if (tgc instanceof AvatarRDDeriveConnector) { return AVATARRD_DERIVE_CONNECTOR; + } else if (tgc instanceof AvatarRDSatisfyConnector) { + return AVATARRD_SATISFY_CONNECTOR; } else if (tgc instanceof AvatarRDRefineConnector) { return AVATARRD_REFINE_CONNECTOR; } else if (tgc instanceof AvatarRDVerifyConnector) { @@ -1920,6 +1929,8 @@ public class TGComponentManager { // AVATAR RD case AVATARRD_DERIVE_CONNECTOR: tgc = new AvatarRDDeriveConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + case AVATARRD_SATISFY_CONNECTOR: + tgc = new AvatarRDSatisfyConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); break; case AVATARRD_REFINE_CONNECTOR: tgc = new AvatarRDRefineConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); diff --git a/src/ui/TGUIAction.java b/src/ui/TGUIAction.java index a916661efe..91fd14e080 100755 --- a/src/ui/TGUIAction.java +++ b/src/ui/TGUIAction.java @@ -350,9 +350,11 @@ public class TGUIAction extends AbstractAction { public static final int ARD_EDIT = 300; public static final int ARD_REQUIREMENT = 301; public static final int ARD_PROPERTY = 302; + public static final int ARD_ELEMENT_REFERENCE = 423; public static final int ARD_VERIFY_CONNECTOR = 303; public static final int ARD_DERIVE_CONNECTOR = 304; public static final int ARD_REFINE_CONNECTOR = 343; + public static final int ARD_SATISFY_CONNECTOR = 422; public static final int ARD_COPY_CONNECTOR = 305; public static final int ARD_COMPOSITION_CONNECTOR = 306; @@ -499,8 +501,8 @@ public class TGUIAction extends AbstractAction { public static final int ACT_VIEW_PM_SAVED_AUT = 267; public static final int UML_NOTE = 42; - public static final int PRAGMA = 600; - public static final int SAFETY_PRAGMA = 601; + public static final int PRAGMA = 424; + public static final int SAFETY_PRAGMA = 425; public static final int ACT_CUT = 44; public static final int ACT_COPY = 45; @@ -566,7 +568,7 @@ public class TGUIAction extends AbstractAction { public static final int ACT_INTERNAL_SEARCH = 415; //-- - public static final int NB_ACTION = 700; + public static final int NB_ACTION = 426; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -1062,14 +1064,17 @@ actions[ADD_VGMNNODE] = new TAction("add-add-vgmnnode", "Add a VGMN", IconManage actions[AMAD_BELONGSTOCOMPOSITION_CONNECTOR] = new TAction("amad-belongstocomposition-connector", "Add a composition connector between references", IconManager.imgic5002, IconManager.imgic5002, "Composition connector", "Add a composition between blocks of the currently opened Avatar Modeling Assumptions diagram", 0); // AVATAR Requirement Diagrams - actions[ARD_EDIT] = new TAction("edit-ard-diagram", "Edit AVATAR Requirement Diagram", IconManager.imgic100, IconManager.imgic101, "Edit AVATAR Requirement Diagram", "Make it possible to edit the currently opened AVATAR Requirement Diagram", 0); - actions[ARD_REQUIREMENT] = new TAction("add-ard-requirement", "Add a requirement", IconManager.imgic5006, IconManager.imgic5006, "Requirement", "Add a requirement to the currently opened avatar requirement diagram", 0); - actions[ARD_PROPERTY] = new TAction("add-ard-property", "Add a property", IconManager.imgic5008, IconManager.imgic5008, "Property", "Add a reference to a property of the currently opened avatar requirement diagram", 0); - actions[ARD_DERIVE_CONNECTOR] = new TAction("add-ard-derive", "Add a <<deriveReqt>> link", IconManager.imgic1008, IconManager.imgic1008, "DeriveReqt", "Add a <<deriveReqt>> link between two requirements of the currently opened avatar requirement diagram", 0); - actions[ARD_REFINE_CONNECTOR] = new TAction("add-ard-refine", "Add a <<refine>> link", IconManager.imgic1016, IconManager.imgic1016, "refine", "Add a <<refine>> link between two requirements of the currently opened avatar requirement diagram", 0); - actions[ARD_VERIFY_CONNECTOR] = new TAction("add-ard-verify", "Add a <<verify>> link", IconManager.imgic1006, IconManager.imgic1006, "Verify", "Add a <<verify>> link between an observer and a requirement of the currently opened avatar requirement diagram", 0); - actions[ARD_COPY_CONNECTOR] = new TAction("add-ard-copy", "Add a <<copy>> link", IconManager.imgic1010, IconManager.imgic1010, "Copy", "Add a <<copy>> link between two requirements of the currently opened avatar requirement diagram", 0); - actions[ARD_COMPOSITION_CONNECTOR] = new TAction("add-ard-composition", "Add a composition link", IconManager.imgic1012, IconManager.imgic1012, "Composition", "Add a composition link between two requirements of the currently opened avatar requirement diagram", 0); + actions[ARD_EDIT] = new TAction("edit-ard-diagram", "Edit Requirement Diagram", IconManager.imgic100, IconManager.imgic101, "Edit Requirement Diagram", "Make it possible to edit the currently opened Requirement Diagram", 0); + actions[ARD_REQUIREMENT] = new TAction("add-ard-requirement", "Add a requirement", IconManager.imgic5006, IconManager.imgic5006, "Requirement", "Add a requirement to the currently opened requirement diagram", 0); + actions[ARD_PROPERTY] = new TAction("add-ard-property", "Add a property", IconManager.imgic5008, IconManager.imgic5008, "Property", "Add a reference to a property of the currently opened requirement diagram", 0); + actions[ARD_ELEMENT_REFERENCE] = new TAction("add-ard-element-reference", "Add a reference to an element", IconManager.imgic5068, IconManager.imgic5068, "Element Reference", "Add a reference to an element of the currently opened requirement diagram", 0); + actions[ARD_DERIVE_CONNECTOR] = new TAction("add-ard-derive", "Add a <<deriveReqt>> link", IconManager.imgic1008, IconManager.imgic1008, "DeriveReqt", "Add a <<deriveReqt>> link between two requirements of the currently opened requirement diagram", 0); + actions[ARD_SATISFY_CONNECTOR] = new TAction("add-ard-satisfy", "Add a <<satisfy>> link", IconManager.imgic1018, IconManager.imgic1018, "Satisfy", "Add a <<satisfy>> link between two requirements of the currently opened requirement diagram", 0); + + actions[ARD_REFINE_CONNECTOR] = new TAction("add-ard-refine", "Add a <<refine>> link", IconManager.imgic1016, IconManager.imgic1016, "refine", "Add a <<refine>> link between two requirements of the currently opened requirement diagram", 0); + actions[ARD_VERIFY_CONNECTOR] = new TAction("add-ard-verify", "Add a <<verify>> link", IconManager.imgic1006, IconManager.imgic1006, "Verify", "Add a <<verify>> link between an observer and a requirement of the currently opened requirement diagram", 0); + actions[ARD_COPY_CONNECTOR] = new TAction("add-ard-copy", "Add a <<copy>> link", IconManager.imgic1010, IconManager.imgic1010, "Copy", "Add a <<copy>> link between two requirements of the currently opened requirement diagram", 0); + actions[ARD_COMPOSITION_CONNECTOR] = new TAction("add-ard-composition", "Add a composition link", IconManager.imgic1012, IconManager.imgic1012, "Composition", "Add a composition link between two requirements of the currently opened requirement diagram", 0); // AVATAR Parametric Diagrams actions[APD_EDIT] = new TAction("edit-apd-diagram", "Edit AVATAR Parametric Diagrams", IconManager.imgic100, IconManager.imgic101, "Edit AVATAR Parametric Diagram", "Make it possible to edit the currently opened AVATAR Parametric Diagram", 0); diff --git a/src/ui/avatarrd/AvatarRDConnectingPointDerive.java b/src/ui/avatarrd/AvatarRDConnectingPointDerive.java index 6bd62afcb4..513b91ea3f 100755 --- a/src/ui/avatarrd/AvatarRDConnectingPointDerive.java +++ b/src/ui/avatarrd/AvatarRDConnectingPointDerive.java @@ -51,30 +51,30 @@ package ui.avatarrd; import ui.*; public class AvatarRDConnectingPointDerive extends TGConnectingPointWidthHeight { - + public AvatarRDConnectingPointDerive(CDElement _container, int _x, int _y, boolean _in, boolean _out, double _w, double _h, int _orientation) { super(_container, _x, _y, _in, _out, _w, _h); - orientation = _orientation; + orientation = _orientation; } - + public boolean isCompatibleWith(int type) { //System.out.println("is compatible with " + type); if (type == TGComponentManager.AVATARRD_DERIVE_CONNECTOR) { //System.out.println("is compatible with:true"); return true; } - - if (type == TGComponentManager.AVATARRD_COMPOSITION_CONNECTOR) { + + if (type == TGComponentManager.AVATARRD_COMPOSITION_CONNECTOR) { //System.out.println("is compatible with:true"); return true; } - - if (type == TGComponentManager.AVATARRD_COPY_CONNECTOR) { + + if (type == TGComponentManager.AVATARRD_COPY_CONNECTOR) { //System.out.println("is compatible with:true"); return true; } - - if (type == TGComponentManager.AVATARRD_REFINE_CONNECTOR) { + + if (type == TGComponentManager.AVATARRD_REFINE_CONNECTOR) { //System.out.println("is compatible with:true"); return true; } @@ -82,6 +82,6 @@ public class AvatarRDConnectingPointDerive extends TGConnectingPointWidthHeight //System.out.println("is compatible with:false"); return false; } - -} \ No newline at end of file + +} diff --git a/src/ui/avatarrd/AvatarRDConnectingPointSatisfy.java b/src/ui/avatarrd/AvatarRDConnectingPointSatisfy.java new file mode 100755 index 0000000000..dea95fcd48 --- /dev/null +++ b/src/ui/avatarrd/AvatarRDConnectingPointSatisfy.java @@ -0,0 +1,73 @@ +/**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, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * 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. + * + * /** + * Class AvatarRDConnectingPointSatisfy + * Definition of connecting points on which connectors between blocks and requirements + * may be connected + * Creation: 23/02/2016 + * @version 1.0 23/02/2016 + * @author Ludovic APVRILLE + * @see + */ + +package ui.avatarrd; + +//import java.awt.*; + +import ui.*; + +public class AvatarRDConnectingPointSatisfy extends TGConnectingPointWidthHeight { + + public AvatarRDConnectingPointSatisfy(CDElement _container, int _x, int _y, boolean _in, boolean _out, double _w, double _h) { + super(_container, _x, _y, _in, _out, _w, _h); + } + + public boolean isCompatibleWith(int type) { + //System.out.println("is compatible with " + type); + if (type == TGComponentManager.AVATARRD_SATISFY_CONNECTOR) { + //System.out.println("is compatible with:true"); + return true; + } + + //System.out.pr + //System.out.println("is compatible with:false"); + return false; + } + + +} diff --git a/src/ui/avatarrd/AvatarRDElementReference.java b/src/ui/avatarrd/AvatarRDElementReference.java new file mode 100644 index 0000000000..488a2f7c36 --- /dev/null +++ b/src/ui/avatarrd/AvatarRDElementReference.java @@ -0,0 +1,316 @@ +/**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, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * 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. + * + * /** + * Class AvatarRDElementReference + * Avatar element reference: to be used in avatar RD + * Creation: 23/02/2016 + * @version 1.0 23/02/2016 + * @author Ludovic APVRILLE + * @see + */ + +package ui.avatarrd; + + + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +import org.w3c.dom.*; + +import myutil.*; +import ui.*; +import ui.window.*; + +public class AvatarRDElementReference extends TGCScalableWithInternalComponent implements TGAutoAdjust { + public String oldValue; + protected int textX = 5; + protected int textY = 22; + protected int lineHeight = 30; + private double dlineHeight = 0.0; + //protected int startFontSize = 10; + protected Graphics graphics; + //protected int iconSize = 30; + + private Font myFont, myFontB; + private int maxFontSize = 30; + private int minFontSize = 4; + private int currentFontSize = -1; + private boolean displayText = true; + + protected final static String ELEMENT_REFERENCE = "<<Element ref.>>"; + + protected String diagramText; + + private int iconSize = 18; + private boolean iconIsDrawn = false; + + public AvatarRDElementReference(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + initScaling(150, lineHeight); + oldScaleFactor = tdp.getZoom(); + dlineHeight = lineHeight * oldScaleFactor; + lineHeight = (int)dlineHeight; + dlineHeight = dlineHeight - lineHeight; + + minWidth = 10; + minHeight = lineHeight; + + nbConnectingPoint = 12; + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + connectingPoint[0] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.0, 0.25); + connectingPoint[1] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.0, 0.5); + connectingPoint[2] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.0, 0.75); + connectingPoint[3] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 1.0, 0.25); + connectingPoint[4] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 1.0, 0.5); + connectingPoint[5] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 1.0, 0.75); + connectingPoint[6] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.25, 0.0); + connectingPoint[7] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.5, 0.0); + connectingPoint[8] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.75, 0.0); + connectingPoint[9] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.25, 1.0); + connectingPoint[10] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.5, 1.0); + connectingPoint[11] = new AvatarRDConnectingPointSatisfy(this, 0, 0, false, true, 0.75, 1.0); + + addTGConnectingPointsCommentTop(); + + nbInternalTGComponent = 0; + //tgcomponent = new TGComponent[nbInternalTGComponent]; + + int h = 1; + //TAttributeRequirement tgc0; + //tgc0 = new TAttributeRequirement(x, y+height+h, 0, 0, height + h, height+h, true, this, _tdp); + //tgcomponent[0] = tgc0; + + moveable = true; + editable = true; + removable = true; + userResizable = true; + multieditable = true; + + + // Name of the observer + name = "AvatarElementReference"; + value = "referencedElement"; + //value = tdp.findRequirementName("Requirement_"); + oldValue = value; + + myImageIcon = IconManager.imgic5062; + + + actionOnAdd(); + } + + + public void internalDrawing(Graphics g) { + Font f = g.getFont(); + Font fold = f; + int w, c; + int size; + + if (!tdp.isScaled()) { + graphics = g; + } + + if (((rescaled) && (!tdp.isScaled())) || myFont == null) { + currentFontSize = tdp.getFontSize(); + //System.out.println("Rescaled, font size = " + currentFontSize + " height=" + height); + myFont = f.deriveFont((float)currentFontSize); + myFontB = myFont.deriveFont(Font.BOLD); + + if (rescaled) { + rescaled = false; + } + } + + if(currentFontSize <minFontSize) { + displayText = false; + } else { + displayText = true; + } + + int h = g.getFontMetrics().getHeight(); + + g.drawRect(x, y, width, height); + + g.drawLine(x, y+lineHeight, x+width, y+lineHeight); + g.setColor(ColorManager.AVATAR_REQUIREMENT_TOP); + g.fillRect(x+1, y+1, width-1, lineHeight-1); + g.setColor(ColorManager.AVATAR_BLOCK); + g.fillRect(x+1, y+1+lineHeight, width-1, height-1-lineHeight); + ColorManager.setColor(g, getState(), 0); + if ((lineHeight > 23) && (width > 23)){ + g.drawImage(IconManager.img5100, x + width - iconSize + 1, y + 3, Color.yellow, null); + } + + if (displayText) { + size = currentFontSize - 2; + g.setFont(myFont.deriveFont((float)(myFont.getSize() - 2))); + drawLimitedString(g, ELEMENT_REFERENCE, x, y + size, width, 1); + size += currentFontSize; + g.setFont(myFontB); + w = g.getFontMetrics().stringWidth(value); + drawLimitedString(g, value, x, y + size, width, 1); + + } + + /*g.setFont(myFont); + + size = lineHeight + currentFontSize; + if (size < (height - 2)) { + drawLimitedString(g, "Diagram=\"" + diagramText + "\"", x + textX, y + size, width, 0); + size += currentFontSize; + // Violated action + if (size < (height - 2)) { + drawLimitedString(g, "Violated_Action=\"" + violatedAction + "\"", x + textX, y + size, width, 0); + } + }*/ + g.setFont(f); + } + + public boolean editOndoubleClick(JFrame frame, int _x, int _y) { + oldValue = value; + + if ((displayText) && (_y <= (y + lineHeight))) { + String texti = getName() + ": "; + if (hasFather()) { + texti = getTopLevelName() + " / " + value; + } + String s = (String)JOptionPane.showInputDialog(frame, texti, + "setting value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, + null, + getValue()); + + if ((s != null) && (s.length() > 0) && (!s.equals(oldValue))) { + //boolean b; + if (!TAttribute.isAValidId(s, false, false)) { + JOptionPane.showMessageDialog(frame, + "Could not change the name of the element reference: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); + return false; + } + + + int size = graphics.getFontMetrics().stringWidth(s) + iconSize + 5; + minDesiredWidth = Math.max(size, minWidth); + if (minDesiredWidth != width) { + newSizeForSon(null); + } + setValue(s); + + } + return false; + } else { + //return editAttributes(); + return false; + } + + } + + + + public void rescale(double scaleFactor){ + dlineHeight = (lineHeight + dlineHeight) / oldScaleFactor * scaleFactor; + lineHeight = (int)(dlineHeight); + dlineHeight = dlineHeight - lineHeight; + minHeight = lineHeight; + + super.rescale(scaleFactor); + } + + public TGComponent isOnOnlyMe(int x1, int y1) { + if (GraphicLib.isInRectangle(x1, y1, x, y, width, height)) { + return this; + } + return null; + } + + + public int getType() { + return TGComponentManager.AVATARRD_ELEMENT_REFERENCE; + } + + + public String toString() { + String ret = getValue() + ELEMENT_REFERENCE; + return ret; + } + + public void autoAdjust(int mode) { + //System.out.println("Auto adjust in mode = " + mode); + + if (graphics == null) { + return; + } + + Font f = graphics.getFont(); + Font f0 = f.deriveFont((float)currentFontSize); + Font f1 = f0.deriveFont(Font.BOLD); + Font f2 = f.deriveFont((float)(currentFontSize - 2)); + + // Must find for both modes which width is desirable + String s0, s1; + + s0 = ELEMENT_REFERENCE; + + graphics.setFont(f2); + int w0 = graphics.getFontMetrics().stringWidth(s0); + graphics.setFont(f1); + int w1 = graphics.getFontMetrics().stringWidth(value); + int w2 = Math.max(w0, w1) + (2 * iconSize); + graphics.setFont(f0); + /*int w3 = graphics.getFontMetrics().stringWidth("Diagram=\"" + diagramText + "\"") + textX; + int w4 = graphics.getFontMetrics().stringWidth("Violated_Action=\"" + violatedAction + "\"") + textX; + graphics.setFont(f); + + w2 = Math.max(w2, w3); + w2 = Math.max(w2, w4);*/ + if (mode == 1) { + resize(w2, lineHeight); + return; + } + + int h = (3 * currentFontSize) + lineHeight; + + resize(w2, h); + + } + +} diff --git a/src/ui/avatarrd/AvatarRDRequirement.java b/src/ui/avatarrd/AvatarRDRequirement.java index 1eb87a6402..c9bcc57a81 100755 --- a/src/ui/avatarrd/AvatarRDRequirement.java +++ b/src/ui/avatarrd/AvatarRDRequirement.java @@ -125,7 +125,7 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem minWidth = 1; minHeight = lineHeight; - nbConnectingPoint = 28; + nbConnectingPoint = 40; connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint[0] = new AvatarRDConnectingPointDerive(this, 0, 0, true, true, 0.0, 0.25, TGConnectingPoint.WEST); connectingPoint[1] = new AvatarRDConnectingPointDerive(this, 0, 0, true, true, 0.0, 0.5, TGConnectingPoint.WEST); @@ -155,7 +155,19 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem connectingPoint[25] = new AvatarRDConnectingPointDerive(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH); connectingPoint[26] = new AvatarRDConnectingPointDerive(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH); connectingPoint[27] = new AvatarRDConnectingPointDerive(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH); - + int i = 28; + connectingPoint[0+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.0, 0.25); + connectingPoint[1+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.0, 0.5); + connectingPoint[2+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.0, 0.75); + connectingPoint[3+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 1.0, 0.25); + connectingPoint[4+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 1.0, 0.5); + connectingPoint[5+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 1.0, 0.75); + connectingPoint[6+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.25, 0.0); + connectingPoint[7+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.5, 0.0); + connectingPoint[8+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.75, 0.0); + connectingPoint[9+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.25, 1.0); + connectingPoint[10+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.5, 1.0); + connectingPoint[11+i] = new AvatarRDConnectingPointSatisfy(this, 0, 0, true, false, 0.75, 1.0); addTGConnectingPointsCommentTop(); diff --git a/src/ui/avatarrd/AvatarRDSatisfyConnector.java b/src/ui/avatarrd/AvatarRDSatisfyConnector.java new file mode 100755 index 0000000000..ff11f0093c --- /dev/null +++ b/src/ui/avatarrd/AvatarRDSatisfyConnector.java @@ -0,0 +1,95 @@ +/**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, + that may mean that it is complicated to manipulate, and that also + therefore means that it is reserved for developers and experienced + professionals having in-depth computer knowledge. Users are therefore + encouraged to load and test the software's suitability as regards their + 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. + + * /** + * Class AvatarRDSatisfyConnector + * Connector to be used in Avatar RD. Connects one block reference to + * one requirement + * Creation: 23/02/2016 + * @version 1.0 23/02/2016 + * @author Ludovic APVRILLE + * @see + */ + +package ui.avatarrd; + +import java.awt.*; +//import java.awt.geom.*; +import java.util.*; + +import myutil.*; + +import ui.*; + +public class AvatarRDSatisfyConnector extends TGConnectorWithCommentConnectionPoints { + int w, h; + + public AvatarRDSatisfyConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + value = "<<satisfy>>"; + + myImageIcon = IconManager.imgic1006; + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + GraphicLib.dashedArrowWithLine(g, 1, 1, 0, x1, y1, x2, y2, false); + + Font f = g.getFont(); + Font old = f; + if (f.getSize() != tdp.getFontSize()) { + f = f.deriveFont((float)tdp.getFontSize()); + g.setFont(f); + } + + w = g.getFontMetrics().stringWidth(value); + h = g.getFontMetrics().getHeight(); + g.drawString(value, (x1 + x2 - w) / 2, (y1 + y2)/2); + g.setFont(old); + } + + public TGComponent extraIsOnOnlyMe(int x1, int y1) { + if (GraphicLib.isInRectangle(x1, y1, (p1.getX() + p2.getX() - w) / 2, (p1.getY() + p2.getY())/2 - h, w, h)) { + return this; + } + return null; + } + + public int getType() { + return TGComponentManager.AVATARRD_SATISFY_CONNECTOR; + } + +} diff --git a/src/ui/avatarrd/AvatarRDToolBar.java b/src/ui/avatarrd/AvatarRDToolBar.java index ffa78ac938..c1b0c30c75 100755 --- a/src/ui/avatarrd/AvatarRDToolBar.java +++ b/src/ui/avatarrd/AvatarRDToolBar.java @@ -1,48 +1,48 @@ /**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, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -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. - -/** - * Class AvatarRDToolBar - * Implements the toolbar to be used in conjunction with the Avatar Requirement Diagram -* Creation: 20/04/2010 -* @version 1.0 20/04/2010 - * @author Ludovic APVRILLE - * @see - */ + 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, + that may mean that it is complicated to manipulate, and that also + therefore means that it is reserved for developers and experienced + professionals having in-depth computer knowledge. Users are therefore + encouraged to load and test the software's suitability as regards their + 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. + + /** + * Class AvatarRDToolBar + * Implements the toolbar to be used in conjunction with the Avatar Requirement Diagram + * Creation: 20/04/2010 + * @version 1.0 20/04/2010 + * @author Ludovic APVRILLE + * @see + */ package ui.avatarrd; @@ -53,94 +53,99 @@ import javax.swing.*; import ui.*; public class AvatarRDToolBar extends TToolBar { - + public AvatarRDToolBar(MainGUI _mgui) { super(_mgui); - + } - + protected void setActive(boolean b) { - mgui.actions[TGUIAction.ACT_ZOOM_MORE].setEnabled(b); - mgui.actions[TGUIAction.ACT_ZOOM_LESS].setEnabled(b); - - mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(b); - mgui.updateZoomInfo(); - + mgui.actions[TGUIAction.ACT_ZOOM_MORE].setEnabled(b); + mgui.actions[TGUIAction.ACT_ZOOM_LESS].setEnabled(b); + + mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(b); + mgui.updateZoomInfo(); + mgui.actions[TGUIAction.ARD_EDIT].setEnabled(b); mgui.actions[TGUIAction.UML_NOTE].setEnabled(b); mgui.actions[TGUIAction.CONNECTOR_COMMENT].setEnabled(b); mgui.actions[TGUIAction.ARD_REQUIREMENT].setEnabled(b); mgui.actions[TGUIAction.ARD_PROPERTY].setEnabled(b); + mgui.actions[TGUIAction.ARD_ELEMENT_REFERENCE].setEnabled(b); mgui.actions[TGUIAction.ARD_VERIFY_CONNECTOR].setEnabled(b); mgui.actions[TGUIAction.ARD_DERIVE_CONNECTOR].setEnabled(b); - mgui.actions[TGUIAction.ARD_REFINE_CONNECTOR].setEnabled(b); - mgui.actions[TGUIAction.ARD_COPY_CONNECTOR].setEnabled(b); - mgui.actions[TGUIAction.ARD_COMPOSITION_CONNECTOR].setEnabled(b); - - mgui.actions[TGUIAction.ACT_TOGGLE_ATTR].setEnabled(b); - - mgui.actions[TGUIAction.ACT_ENHANCE].setEnabled(b); - + mgui.actions[TGUIAction.ARD_REFINE_CONNECTOR].setEnabled(b); + mgui.actions[TGUIAction.ARD_SATISFY_CONNECTOR].setEnabled(b); + mgui.actions[TGUIAction.ARD_COPY_CONNECTOR].setEnabled(b); + mgui.actions[TGUIAction.ARD_COMPOSITION_CONNECTOR].setEnabled(b); + + mgui.actions[TGUIAction.ACT_TOGGLE_ATTR].setEnabled(b); + + mgui.actions[TGUIAction.ACT_ENHANCE].setEnabled(b); + } - + protected void setButtons() { JButton button; - + button = this.add(mgui.actions[TGUIAction.ARD_EDIT]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.UML_NOTE]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.CONNECTOR_COMMENT]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.ARD_REQUIREMENT]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.ARD_PROPERTY]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - - button = this.add(mgui.actions[TGUIAction.ARD_COMPOSITION_CONNECTOR]); + + button = this.add(mgui.actions[TGUIAction.ARD_COMPOSITION_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.ARD_DERIVE_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - - button = this.add(mgui.actions[TGUIAction.ARD_COPY_CONNECTOR]); + + button = this.add(mgui.actions[TGUIAction.ARD_COPY_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); - - button = this.add(mgui.actions[TGUIAction.ARD_REFINE_CONNECTOR]); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.ARD_REFINE_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); - + + this.addSeparator(); + button = this.add(mgui.actions[TGUIAction.ARD_VERIFY_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); - - button = this.add(mgui.actions[TGUIAction.ACT_TOGGLE_ATTR]); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.ARD_ELEMENT_REFERENCE]); button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); - - button = this.add(mgui.actions[TGUIAction.ACT_ENHANCE]); + + button = this.add(mgui.actions[TGUIAction.ARD_SATISFY_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - - } - -} // Class + this.addSeparator(); + button = this.add(mgui.actions[TGUIAction.ACT_TOGGLE_ATTR]); + button.addMouseListener(mgui.mouseHandler); + this.addSeparator(); + button = this.add(mgui.actions[TGUIAction.ACT_ENHANCE]); + button.addMouseListener(mgui.mouseHandler); + + } +} // Class diff --git a/src/ui/images/avatarrdref.gif b/src/ui/images/avatarrdref.gif new file mode 100644 index 0000000000000000000000000000000000000000..28018a6ff1e005f86b9fbd1bfc4941cfa0b34c58 GIT binary patch literal 99 zcmZ?wbhEHb<Yy3ISjfx(1Pe}mJa_-s|Ns9Lf3h%gF)%aefJ8y^3`{0-`d6NQ%eiPy zF+=0#W82+7dOqM_NzG)-Vs~41eBz5WlNQ{(_feIl_WkFR8b?kiG@r4V*3HCV4FK6u BC&T~% literal 0 HcmV?d00001 diff --git a/src/ui/images/reqsatisfy.gif b/src/ui/images/reqsatisfy.gif new file mode 100755 index 0000000000000000000000000000000000000000..fef965b878e39b282ad107ed6807f4c3c9a877c8 GIT binary patch literal 112 zcmZ?wbhEHb<Yy3IIK;>R1poj4{~7ZC-2Gob1{^5<WMSlDU}De#sQ{^EU^dm*b>|<C zha%%#?w+-#cW;L9#v7NYzieHxT~At5Tjff`x7x_7`}!SDW(o<5bnDMvI?dQjnv=mA E0LV!$Q~&?~ literal 0 HcmV?d00001 -- GitLab