From 901c96418d6b18bb96da6bc6da0a38677d381a9a Mon Sep 17 00:00:00 2001 From: Irina LEE <irina.lee@etu.upmc.fr> Date: Sat, 19 May 2018 10:36:29 +0200 Subject: [PATCH] Upload New File --- src/main/java/ui/syscams/SysCAMSFork.java | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/main/java/ui/syscams/SysCAMSFork.java diff --git a/src/main/java/ui/syscams/SysCAMSFork.java b/src/main/java/ui/syscams/SysCAMSFork.java new file mode 100644 index 0000000000..b3ec86bac7 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSFork.java @@ -0,0 +1,111 @@ +/* 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.syscams; + +import myutil.GraphicLib; +import ui.*; +import ui.util.IconManager; + +import java.awt.*; + +/** + * Class SysCAMSFork + * Fork operator. To be used in SystemC-AMS component task diagrams + * Creation: 22/04/2018 + * @version 1.0 22/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSFork extends SysCAMSChannelFacility implements WithAttributes { + protected int radius = 11; + protected int decPoint = 3; + + public SysCAMSFork(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(2*radius, 2*radius); + + nbConnectingPoint = 7; + connectingPoint = new TGConnectingPoint[7]; + + connectingPoint[0] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.0, 0.5); + connectingPoint[1] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 1.0, 0.5); + connectingPoint[2] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 1.0, 0.5); + connectingPoint[3] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 0.75, 0.134); + connectingPoint[4] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 0.75, 0.134); + connectingPoint[5] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 0.75, 0.866); + connectingPoint[6] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 0.75, 0.866); + + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + value = "F"; + name = "Composite port"; + + myImageIcon = IconManager.imgic1204; + } + + public void internalDrawing(Graphics g) { + radius = width / 2; + + if (rescaled) { + rescaled = false; + } + calculatePortColor(); + + // Zoom is assumed to be computed + Color c = g.getColor(); + if ((width > 2) && (height > 2)) { + g.setColor(myColor); + g.fillOval(x, y, radius*2, radius*2); + g.setColor(c); + } + g.drawOval(x, y, radius*2, radius*2); + g.drawLine(x, y+radius, x+radius, y+radius); + + GraphicLib.arrowWithLine(g, 1, 1, 5, x+radius, y+radius, x+2*radius, y+radius, false); + GraphicLib.arrowWithLine(g, 1, 1, 5, x+radius, y+radius, x+3*radius/2, (int)(y+(0.134*radius)), false); + GraphicLib.arrowWithLine(g, 1, 1, 5, x+radius, y+radius, x+3*radius/2, (int)(y+2*radius-(0.134*radius)), false); + } + + public int getType() { + return TGComponentManager.TMLCTD_FORK; + } +} \ No newline at end of file -- GitLab