diff --git a/src/ui/tmldd/TMLArchiDiagramPanel.java b/src/ui/tmldd/TMLArchiDiagramPanel.java index 16da97b477acb517db2b3601131c195610d1f558..99d97097aec75e767ac7cc42278f2ae6c2680265 100755 --- a/src/ui/tmldd/TMLArchiDiagramPanel.java +++ b/src/ui/tmldd/TMLArchiDiagramPanel.java @@ -61,6 +61,7 @@ public class TMLArchiDiagramPanel extends TDiagramPanel implements TDPWithAttrib public static final int VIEW_CHANNEL_MAPPING = 3; public static final int VIEW_COMM_PATTERN = 4; public static final int VIEW_COMM_PATTERN_MAPPING = 5; + public static final int VIEW_SECURITY_MAPPING = 6; private int masterClockFrequency = 200; // in MHz @@ -408,7 +409,9 @@ public class TMLArchiDiagramPanel extends TDiagramPanel implements TDPWithAttrib case VIEW_COMM_PATTERN: return (tgc instanceof TMLArchiElementInterface) || (tgc instanceof TMLArchiCPInterface); case VIEW_COMM_PATTERN_MAPPING: - return (tgc instanceof TMLArchiElementInterface) || (tgc instanceof TMLArchiCPInterface) || (tgc instanceof TMLArchiPortInterface); + return (tgc instanceof TMLArchiElementInterface) || (tgc instanceof TMLArchiCPInterface) || (tgc instanceof TMLArchiPortInterface); + case VIEW_SECURITY_MAPPING: + return (tgc instanceof TMLArchiElementInterface) || (tgc instanceof TMLArchiSecurityInterface); default: return true; } diff --git a/src/ui/tmldd/TMLArchiDiagramToolBar.java b/src/ui/tmldd/TMLArchiDiagramToolBar.java index 54fcefec61747915804fb9117705b24e37e87002..a637ae57eec1e9ad801bae78fb97d20bdce26f2d 100755 --- a/src/ui/tmldd/TMLArchiDiagramToolBar.java +++ b/src/ui/tmldd/TMLArchiDiagramToolBar.java @@ -57,7 +57,7 @@ import myutil.*; public class TMLArchiDiagramToolBar extends TToolBar implements ActionListener { protected JComboBox box; - protected static String[] viewInfos = { "View all", "View architecture only", "View task mapping", "View channel mapping", "View Comm. Pattern", "View Comm. Pattern mapping"}; + protected static String[] viewInfos = { "View all", "View architecture only", "View task mapping", "View channel mapping", "View Comm. Pattern", "View Comm. Pattern mapping", "Security mapping"}; protected TMLArchiDiagramPanel panel; public TMLArchiDiagramToolBar(MainGUI _mgui) { diff --git a/src/ui/tmldd/TMLArchiKey.java b/src/ui/tmldd/TMLArchiKey.java index 6a0e9b2729e502214acc1b7dba1be13eb60f4380..1a59718e38abc708473de19f919047a1cbb731fe 100755 --- a/src/ui/tmldd/TMLArchiKey.java +++ b/src/ui/tmldd/TMLArchiKey.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLArchiKey extends TGCWithoutInternalComponent implements SwallowedTGComponent, WithAttributes { +public class TMLArchiKey extends TGCWithoutInternalComponent implements SwallowedTGComponent, WithAttributes, TMLArchiSecurityInterface { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -77,7 +77,7 @@ public class TMLArchiKey extends TGCWithoutInternalComponent implements Swallowe width = 75; height = 40; minWidth = 75; - minHeight = fileY + 5; + minHeight = fileY + 5; nbConnectingPoint = 0; addTGConnectingPointsComment(); @@ -85,7 +85,7 @@ public class TMLArchiKey extends TGCWithoutInternalComponent implements Swallowe moveable = true; editable = true; removable = true; - userResizable = true; + userResizable = true; value = ""; referenceKey = "TMLKey"; @@ -97,6 +97,19 @@ public class TMLArchiKey extends TGCWithoutInternalComponent implements Swallowe myImageIcon = IconManager.imgic1118; } + + public boolean isHidden() { + //TraceManager.addDev("Archi task artifact: Am I hidden?" + getValue()); + boolean ret = false; + if (tdp != null) { + if (tdp instanceof TMLArchiDiagramPanel) { + ret = !(((TMLArchiDiagramPanel)(tdp)).inCurrentView(this)); + + } + } + //TraceManager.addDev("Hidden? -> " + ret); + return ret; + } public int getPriority() { return priority; } @@ -113,10 +126,10 @@ public class TMLArchiKey extends TGCWithoutInternalComponent implements Swallowe } g.drawRect(x, y, width, height); - Color c = g.getColor(); - g.setColor(ColorManager.MEMORY_BOX_2); - g.fillRect(x+1, y+1, width-1, height-1); - g.setColor(c); + Color c = g.getColor(); + g.setColor(ColorManager.MEMORY_BOX_2); + g.fillRect(x+1, y+1, width-1, height-1); + g.setColor(c); //g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+width-space-fileX, y + space, x+width-space-fileX, y+space+fileY); diff --git a/src/ui/tmldd/TMLArchiSecurityInterface.java b/src/ui/tmldd/TMLArchiSecurityInterface.java new file mode 100755 index 0000000000000000000000000000000000000000..ec3ffc6b089f5877f7774e42f41f4bd48670072e --- /dev/null +++ b/src/ui/tmldd/TMLArchiSecurityInterface.java @@ -0,0 +1,50 @@ +/**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 TMLArchiSecurityInterface + * Interface of a mapped security element + * Creation: 13/09/2016 + * @version 1.0 13/09/2016 + * @author Ludovic APVRILLE + * @see + */ + +package ui.tmldd; + +public interface TMLArchiSecurityInterface { +}