Skip to content
Snippets Groups Projects
Commit da4d4d85 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Adding fauts to sysml-sec method

parent 429906d5
Branches
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<property name="caretWidth" class="java.lang.Integer" /> <property name="caretWidth" class="java.lang.Integer" />
</properties> </properties>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" project-jdk-name="1.7" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build" /> <output url="file://$PROJECT_DIR$/build" />
</component> </component>
</project> </project>
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
*/ */
package ui; package ui;
import myutil.GraphicLib; import myutil.GraphicLib;
...@@ -56,8 +54,9 @@ import java.util.Vector; ...@@ -56,8 +54,9 @@ import java.util.Vector;
* Class SysmlsecMethodologyPanel * Class SysmlsecMethodologyPanel
* Managenemt of the sysmlsec methodology panels * Managenemt of the sysmlsec methodology panels
* Creation: 26/01/2016 * Creation: 26/01/2016
* @version 1.1 26/01/2016 *
* @author Ludovic APVRILLE * @author Ludovic APVRILLE
* @version 1.1 26/01/2016
* @see MainGUI * @see MainGUI
*/ */
public class SysmlsecMethodologyPanel extends TURTLEPanel { public class SysmlsecMethodologyPanel extends TURTLEPanel {
...@@ -88,10 +87,11 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel { ...@@ -88,10 +87,11 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel {
// Put the methodology // Put the methodology
public void initElements() { public void initElements() {
TGComponent tgc1 = dmd.addComponent(50, 300, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_ASSUMPTIONS, false); TGComponent tgc1 = dmd.addComponent(50, 350, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_ASSUMPTIONS, false);
TGComponent tgc2 = dmd.addComponent(350, 200, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_REQUIREMENT, false); TGComponent tgc2 = dmd.addComponent(350, 350, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_REQUIREMENT, false);
TGComponent tgc10 = dmd.addComponent(350, 550, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_ATTACK, false);
TGComponent tgc12 = dmd.addComponent(350, 150, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_FAULT, false);
TGComponent tgc10 = dmd.addComponent(350, 400, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_ATTACK, false);
// Partitioning // Partitioning
TGComponent tgc7 = dmd.addComponent(650, 100, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_FUNCTIONAL_VIEW, false); TGComponent tgc7 = dmd.addComponent(650, 100, TGComponentManager.SYSMLSEC_METHODOLOGY_REF_FUNCTIONAL_VIEW, false);
...@@ -124,15 +124,14 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel { ...@@ -124,15 +124,14 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel {
infoSw.setTextColor(Color.white); infoSw.setTextColor(Color.white);
TGCPanelInfo infoReq = (TGCPanelInfo)(dmd.addComponent(330, 169, TGComponentManager.INFO_PANEL, false)); TGCPanelInfo infoReq = (TGCPanelInfo) (dmd.addComponent(330, 100, TGComponentManager.INFO_PANEL, false));
infoReq.resize(241, 340); infoReq.resize(241, 550);
infoReq.setValue("Req and attacks"); infoReq.setValue("Req / faults / attacks");
infoReq.setStringPos(TGCPanelInfo.UPPER_MIDDLE); infoReq.setStringPos(TGCPanelInfo.UPPER_MIDDLE);
infoReq.setTextColor(Color.white); infoReq.setTextColor(Color.white);
infoReq.setFillColor(ColorManager.SYSMLSEC_REQ); infoReq.setFillColor(ColorManager.SYSMLSEC_REQ);
//Connectors //Connectors
// Assumptions -> reqs // Assumptions -> reqs
...@@ -158,6 +157,26 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel { ...@@ -158,6 +157,26 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel {
p2.setFree(false); p2.setFree(false);
dmd.getComponentList().add(0, tgco); dmd.getComponentList().add(0, tgco);
// Reqs -> Faults
p1 = tgc2.getTGConnectingPointAtIndex(4);
p2 = tgc12.getTGConnectingPointAtIndex(0);
listPoint = new Vector<Point>();
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.SYSMLSEC_METHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false);
p2.setFree(false);
dmd.getComponentList().add(0, tgco);
// Faults -> Reqs
p1 = tgc12.getTGConnectingPointAtIndex(1);
p2 = tgc2.getTGConnectingPointAtIndex(3);
listPoint = new Vector<Point>();
//p = new Point(375, 370);
//listPoint.add(p);
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.SYSMLSEC_METHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false);
p2.setFree(false);
dmd.getComponentList().add(0, tgco);
// Attacks -> Reqs // Attacks -> Reqs
p1 = tgc10.getTGConnectingPointAtIndex(1); p1 = tgc10.getTGConnectingPointAtIndex(1);
p2 = tgc2.getTGConnectingPointAtIndex(2); p2 = tgc2.getTGConnectingPointAtIndex(2);
...@@ -195,7 +214,7 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel { ...@@ -195,7 +214,7 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel {
p1 = tgc2.getTGConnectingPointAtIndex(0); p1 = tgc2.getTGConnectingPointAtIndex(0);
p2 = tgc6.getTGConnectingPointAtIndex(0); p2 = tgc6.getTGConnectingPointAtIndex(0);
listPoint = new Vector<Point>(); listPoint = new Vector<Point>();
p = new Point(xa-305, 235); p = new Point(xa - 305, 385);
listPoint.add(p); listPoint.add(p);
p = new Point(xa - 305, ya + 50); p = new Point(xa - 305, ya + 50);
listPoint.add(p); listPoint.add(p);
...@@ -282,7 +301,6 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel { ...@@ -282,7 +301,6 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel {
} }
public String saveHeaderInXml(String extensionToName) { public String saveHeaderInXml(String extensionToName) {
if (extensionToName == null) { if (extensionToName == null) {
return "<Modeling type=\"Sysmlsec Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; return "<Modeling type=\"Sysmlsec Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
*/ */
package ui; package ui;
import javax.swing.*; import javax.swing.*;
...@@ -47,8 +45,9 @@ import javax.swing.*; ...@@ -47,8 +45,9 @@ import javax.swing.*;
* Class TAction * Class TAction
* Definition of an action to be used in Menu, toolbar, etc. * Definition of an action to be used in Menu, toolbar, etc.
* Creation: 15/12/2003 * Creation: 15/12/2003
* @version 1.0 15/12/2003 *
* @author Ludovic APVRILLE * @author Ludovic APVRILLE
* @version 1.0 15/12/2003
*/ */
public class TAction { public class TAction {
......
...@@ -507,6 +507,7 @@ public class TGComponentManager { ...@@ -507,6 +507,7 @@ public class TGComponentManager {
public static final int SYSMLSEC_METHODOLOGY_REF_MAPPING_VIEW = 5710; public static final int SYSMLSEC_METHODOLOGY_REF_MAPPING_VIEW = 5710;
public static final int SYSMLSEC_METHODOLOGY_REF_CP_VIEW = 5711; public static final int SYSMLSEC_METHODOLOGY_REF_CP_VIEW = 5711;
public static final int SYSMLSEC_METHODOLOGY_REF_ATTACK = 5712; public static final int SYSMLSEC_METHODOLOGY_REF_ATTACK = 5712;
public static final int SYSMLSEC_METHODOLOGY_REF_FAULT = 5719;
public static final int SYSMLSEC_METHODOLOGY_CONNECTOR = 5718; public static final int SYSMLSEC_METHODOLOGY_CONNECTOR = 5718;
// PLUGIN // PLUGIN
...@@ -785,6 +786,9 @@ public class TGComponentManager { ...@@ -785,6 +786,9 @@ public class TGComponentManager {
case SYSMLSEC_METHODOLOGY_REF_ATTACK: case SYSMLSEC_METHODOLOGY_REF_ATTACK:
tgc = new SysmlsecMethodologyReferenceToAttack(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); tgc = new SysmlsecMethodologyReferenceToAttack(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp);
break; break;
case SYSMLSEC_METHODOLOGY_REF_FAULT:
tgc = new SysmlsecMethodologyReferenceToFault(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp);
break;
case SYSMLSEC_METHODOLOGY_DIAGRAM_NAME: case SYSMLSEC_METHODOLOGY_DIAGRAM_NAME:
tgc = new SysmlsecMethodologyDiagramName(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); tgc = new SysmlsecMethodologyDiagramName(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp);
break; break;
...@@ -1522,6 +1526,8 @@ public class TGComponentManager { ...@@ -1522,6 +1526,8 @@ public class TGComponentManager {
return SYSMLSEC_METHODOLOGY_REF_MAPPING_VIEW; return SYSMLSEC_METHODOLOGY_REF_MAPPING_VIEW;
} else if (tgc instanceof SysmlsecMethodologyReferenceToAttack) { } else if (tgc instanceof SysmlsecMethodologyReferenceToAttack) {
return SYSMLSEC_METHODOLOGY_REF_ATTACK; return SYSMLSEC_METHODOLOGY_REF_ATTACK;
} else if (tgc instanceof SysmlsecMethodologyReferenceToFault) {
return SYSMLSEC_METHODOLOGY_REF_FAULT;
// AVATAR MAD // AVATAR MAD
......
...@@ -82,7 +82,9 @@ public abstract class SysmlsecMethodologyDiagramReference extends TGCScalableWit ...@@ -82,7 +82,9 @@ public abstract class SysmlsecMethodologyDiagramReference extends TGCScalableWit
protected int typeOfReference; protected int typeOfReference;
protected final static String[] TYPE_STR = {"Assumptions", "Requirements", "Analysis", "Design", "Properties", "Prototyping", "Functional view", "Architecture view", "Mapping", "Communication pattern", "Attacks"}; protected final static String[] TYPE_STR = {"Assumptions", "Requirements",
"Analysis", "Design", "Properties", "Prototyping", "Functional view",
"Architecture view", "Mapping", "Communication pattern", "Attacks", "Faults"};
protected final static int NB_TYPE = 6; protected final static int NB_TYPE = 6;
protected final static int ASSUMPTIONS = 0; protected final static int ASSUMPTIONS = 0;
...@@ -96,6 +98,7 @@ public abstract class SysmlsecMethodologyDiagramReference extends TGCScalableWit ...@@ -96,6 +98,7 @@ public abstract class SysmlsecMethodologyDiagramReference extends TGCScalableWit
protected final static int MAPPING_VIEW = 8; protected final static int MAPPING_VIEW = 8;
protected final static int CP_VIEW = 9; protected final static int CP_VIEW = 9;
protected final static int ATTACK = 10; protected final static int ATTACK = 10;
protected final static int FAULT = 11;
protected JMenuItem diagramReference; protected JMenuItem diagramReference;
......
...@@ -62,8 +62,8 @@ public class SysmlsecMethodologyReferenceToAttack extends SysmlsecMethodologyDia ...@@ -62,8 +62,8 @@ public class SysmlsecMethodologyReferenceToAttack extends SysmlsecMethodologyDia
nbConnectingPoint = 2; nbConnectingPoint = 2;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 0, TGConnectingPoint.WEST); connectingPoint[0] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 0.0, TGConnectingPoint.WEST);
connectingPoint[1] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.6, 0, TGConnectingPoint.WEST); connectingPoint[1] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.6, 0.0, TGConnectingPoint.WEST);
typeOfReference = ATTACK; typeOfReference = ATTACK;
......
/* 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.
*/
package ui.sysmlsecmethodology;
import ui.*;
/**
* Class SysmlsecMethodologyReferenceToFault
* Diagram reference analysis: Used to reference diagrams from the
* Sysmlsec methodology
* Creation: 26/06/2018
* @version 1.0 26/06/2018
* @author Ludovic APVRILLE
*/
public class SysmlsecMethodologyReferenceToFault extends SysmlsecMethodologyDiagramReference {
public SysmlsecMethodologyReferenceToFault(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(200, 70);
nbConnectingPoint = 2;
connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 1.0, TGConnectingPoint.WEST);
connectingPoint[1] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.6, 1.0, TGConnectingPoint.WEST);
typeOfReference = FAULT;
addTGConnectingPointsCommentTop();
}
public int getType() {
return TGComponentManager.SYSMLSEC_METHODOLOGY_REF_FAULT;
}
public boolean isAValidPanelType(TURTLEPanel panel) {
return panel instanceof FaultTreePanel;
}
public void makeValidationInfos(SysmlsecMethodologyDiagramName dn) {
dn.setValidationsNumber(3);
dn.setValidationsInfo(0, SysmlsecMethodologyDiagramName.SIM_ANIM);
dn.setValidationsInfo(1, SysmlsecMethodologyDiagramName.INTERNAL_MODEL_CHECKER);
dn.setValidationsInfo(2, SysmlsecMethodologyDiagramName.UPP);
}
public boolean makeCall(String diagramName, int index) {
switch (index) {
case 0:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarSimulation();
return true;
}
return false;
case 1:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarModelChecker();
return true;
}
return false;
case 2:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarUPPAALVerification();
return true;
}
return false;
default:
return false;
}
}
}
...@@ -60,11 +60,13 @@ public class SysmlsecMethodologyReferenceToRequirement extends SysmlsecMethodolo ...@@ -60,11 +60,13 @@ public class SysmlsecMethodologyReferenceToRequirement extends SysmlsecMethodolo
initScaling(200, 70); initScaling(200, 70);
nbConnectingPoint = 3; nbConnectingPoint = 5;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 1.0, 0.5, TGConnectingPoint.WEST); connectingPoint[0] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 1.0, 0.5, TGConnectingPoint.WEST);
connectingPoint[1] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 1.0, TGConnectingPoint.WEST); connectingPoint[1] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 1.0, TGConnectingPoint.WEST);
connectingPoint[2] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.6, 1.0, TGConnectingPoint.WEST); connectingPoint[2] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.6, 1.0, TGConnectingPoint.WEST);
connectingPoint[3] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.6, 0.0, TGConnectingPoint.WEST);
connectingPoint[4] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, true, false, 0.3, 0.0, TGConnectingPoint.WEST);
typeOfReference = REQUIREMENT; typeOfReference = REQUIREMENT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment