diff --git a/src/main/java/attacktrees/ANDNode.java b/src/main/java/attacktrees/ANDNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/AfterNode.java b/src/main/java/attacktrees/AfterNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/Attack.java b/src/main/java/attacktrees/Attack.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/AttackElement.java b/src/main/java/attacktrees/AttackElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/AttackNode.java b/src/main/java/attacktrees/AttackNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/AttackTree.java b/src/main/java/attacktrees/AttackTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/BeforeNode.java b/src/main/java/attacktrees/BeforeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/BooleanNode.java b/src/main/java/attacktrees/BooleanNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/ORNode.java b/src/main/java/attacktrees/ORNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/SequenceNode.java b/src/main/java/attacktrees/SequenceNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/TimeNode.java b/src/main/java/attacktrees/TimeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/attacktrees/XORNode.java b/src/main/java/attacktrees/XORNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/automata/Automata.java b/src/main/java/automata/Automata.java old mode 100755 new mode 100644 diff --git a/src/main/java/automata/State.java b/src/main/java/automata/State.java old mode 100755 new mode 100644 diff --git a/src/main/java/automata/Transition.java b/src/main/java/automata/Transition.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIX.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/toexecutable/MainFile.java b/src/main/java/avatartranslator/toexecutable/MainFile.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/toexecutable/TaskFile.java b/src/main/java/avatartranslator/toexecutable/TaskFile.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/toexecutable/TaskFileSoclib.java b/src/main/java/avatartranslator/toexecutable/TaskFileSoclib.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/toproverif/AVATAR2ProVerif.java b/src/main/java/avatartranslator/toproverif/AVATAR2ProVerif.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/totpn/AVATAR2TPN.java b/src/main/java/avatartranslator/totpn/AVATAR2TPN.java old mode 100755 new mode 100644 diff --git a/src/main/java/avatartranslator/touppaal/AVATAR2UPPAAL.java b/src/main/java/avatartranslator/touppaal/AVATAR2UPPAAL.java old mode 100755 new mode 100644 diff --git a/src/main/java/common/ConfigurationTTool.java b/src/main/java/common/ConfigurationTTool.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlCPparser/test.sh b/src/main/java/compiler/tmlCPparser/test.sh old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlgrammar/SimpleNode.java b/src/main/java/compiler/tmlgrammar/SimpleNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlgrammar/TMLExprParser0.2.jjt b/src/main/java/compiler/tmlgrammar/TMLExprParser0.2.jjt old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlgrammar/header.txt b/src/main/java/compiler/tmlgrammar/header.txt old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/AssignmentOperator.java b/src/main/java/compiler/tmlparser/AssignmentOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolComparisonOperator.java b/src/main/java/compiler/tmlparser/BoolComparisonOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolExtendedExpression.java b/src/main/java/compiler/tmlparser/BoolExtendedExpression.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolExtendedExpressionAfterComparison.java b/src/main/java/compiler/tmlparser/BoolExtendedExpressionAfterComparison.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolExtendedExpressionAfterID.java b/src/main/java/compiler/tmlparser/BoolExtendedExpressionAfterID.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolExtendedExpressionAfterIDComparisonID.java b/src/main/java/compiler/tmlparser/BoolExtendedExpressionAfterIDComparisonID.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolFunction1.java b/src/main/java/compiler/tmlparser/BoolFunction1.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolNatComparisonOperator.java b/src/main/java/compiler/tmlparser/BoolNatComparisonOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BoolOperator.java b/src/main/java/compiler/tmlparser/BoolOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/BooleanLiteral.java b/src/main/java/compiler/tmlparser/BooleanLiteral.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/CompilationUnit.java b/src/main/java/compiler/tmlparser/CompilationUnit.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/Expression.java b/src/main/java/compiler/tmlparser/Expression.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/InNatBoolExtendedExpression1.java b/src/main/java/compiler/tmlparser/InNatBoolExtendedExpression1.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/JJTTMLExprParserState.java b/src/main/java/compiler/tmlparser/JJTTMLExprParserState.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/Literal.java b/src/main/java/compiler/tmlparser/Literal.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/NatComparisonOperator.java b/src/main/java/compiler/tmlparser/NatComparisonOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/NatExtendedExpression.java b/src/main/java/compiler/tmlparser/NatExtendedExpression.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/NatFunction2.java b/src/main/java/compiler/tmlparser/NatFunction2.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/NatOperator.java b/src/main/java/compiler/tmlparser/NatOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/NatOperatorExtendedExpression.java b/src/main/java/compiler/tmlparser/NatOperatorExtendedExpression.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/Node.java b/src/main/java/compiler/tmlparser/Node.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/ParseException.java b/src/main/java/compiler/tmlparser/ParseException.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/SimpleCharStream.java b/src/main/java/compiler/tmlparser/SimpleCharStream.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/SimpleNode.java b/src/main/java/compiler/tmlparser/SimpleNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/StrictBoolOperator.java b/src/main/java/compiler/tmlparser/StrictBoolOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/StrictNatComparisonOperator.java b/src/main/java/compiler/tmlparser/StrictNatComparisonOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/TMLExprParser.java b/src/main/java/compiler/tmlparser/TMLExprParser.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/TMLExprParserConstants.java b/src/main/java/compiler/tmlparser/TMLExprParserConstants.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/TMLExprParserTokenManager.java b/src/main/java/compiler/tmlparser/TMLExprParserTokenManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/TMLExprParserTreeConstants.java b/src/main/java/compiler/tmlparser/TMLExprParserTreeConstants.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/Token.java b/src/main/java/compiler/tmlparser/Token.java old mode 100755 new mode 100644 diff --git a/src/main/java/compiler/tmlparser/TokenMgrError.java b/src/main/java/compiler/tmlparser/TokenMgrError.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslator/DDStructLink.java b/src/main/java/ddtranslator/DDStructLink.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslator/DDStructSynchro.java b/src/main/java/ddtranslator/DDStructSynchro.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslator/DDSyntaxException.java b/src/main/java/ddtranslator/DDSyntaxException.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslator/DDTranslator.java b/src/main/java/ddtranslator/DDTranslator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslator/TClassLinkNode.java b/src/main/java/ddtranslator/TClassLinkNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarBridge.java b/src/main/java/ddtranslatorSoclib/AvatarBridge.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarBus.java b/src/main/java/ddtranslatorSoclib/AvatarBus.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarCPU.java b/src/main/java/ddtranslatorSoclib/AvatarCPU.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarChannel.java b/src/main/java/ddtranslatorSoclib/AvatarChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarComponent.java b/src/main/java/ddtranslatorSoclib/AvatarComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarConnectingPoint.java b/src/main/java/ddtranslatorSoclib/AvatarConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarConnector.java b/src/main/java/ddtranslatorSoclib/AvatarConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarCoproMWMR.java b/src/main/java/ddtranslatorSoclib/AvatarCoproMWMR.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarCrossbar.java b/src/main/java/ddtranslatorSoclib/AvatarCrossbar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarICU.java b/src/main/java/ddtranslatorSoclib/AvatarICU.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarMappedObject.java b/src/main/java/ddtranslatorSoclib/AvatarMappedObject.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarRAM.java b/src/main/java/ddtranslatorSoclib/AvatarRAM.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarTTY.java b/src/main/java/ddtranslatorSoclib/AvatarTTY.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarTask.java b/src/main/java/ddtranslatorSoclib/AvatarTask.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarTimer.java b/src/main/java/ddtranslatorSoclib/AvatarTimer.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarVgmn.java b/src/main/java/ddtranslatorSoclib/AvatarVgmn.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/AvatarddSpecification.java b/src/main/java/ddtranslatorSoclib/AvatarddSpecification.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toSoclib/MainFileSoclib.java b/src/main/java/ddtranslatorSoclib/toSoclib/MainFileSoclib.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toSoclib/TaskFileSoclib.java b/src/main/java/ddtranslatorSoclib/toSoclib/TaskFileSoclib.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java b/src/main/java/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Code.java b/src/main/java/ddtranslatorSoclib/toTopCell/Code.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Declaration.java b/src/main/java/ddtranslatorSoclib/toTopCell/Declaration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Deployinfo.java b/src/main/java/ddtranslatorSoclib/toTopCell/Deployinfo.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Header.java b/src/main/java/ddtranslatorSoclib/toTopCell/Header.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Loader.java b/src/main/java/ddtranslatorSoclib/toTopCell/Loader.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/MappingTable.java b/src/main/java/ddtranslatorSoclib/toTopCell/MappingTable.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/NetList.java b/src/main/java/ddtranslatorSoclib/toTopCell/NetList.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Platforminfo.java b/src/main/java/ddtranslatorSoclib/toTopCell/Platforminfo.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Signal.java b/src/main/java/ddtranslatorSoclib/toTopCell/Signal.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Simulation.java b/src/main/java/ddtranslatorSoclib/toTopCell/Simulation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/TopCellGenerator.java b/src/main/java/ddtranslatorSoclib/toTopCell/TopCellGenerator.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/BusContentionResult.java b/src/main/java/dseengine/BusContentionResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/BusContentionWholeResult.java b/src/main/java/dseengine/BusContentionWholeResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/BusResult.java b/src/main/java/dseengine/BusResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/BusWholeResult.java b/src/main/java/dseengine/BusWholeResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/CPUResult.java b/src/main/java/dseengine/CPUResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/CPUWholeResult.java b/src/main/java/dseengine/CPUWholeResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/CPUWithTasks.java b/src/main/java/dseengine/CPUWithTasks.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/DSEConfiguration.java b/src/main/java/dseengine/DSEConfiguration.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/DSEMappingSimulationResults.java b/src/main/java/dseengine/DSEMappingSimulationResults.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/DSEScriptReader.java b/src/main/java/dseengine/DSEScriptReader.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/DSESimulationResult.java b/src/main/java/dseengine/DSESimulationResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/SimulationDurationWholeResult.java b/src/main/java/dseengine/SimulationDurationWholeResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/TaskResult.java b/src/main/java/dseengine/TaskResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/dseengine/TaskWholeResult.java b/src/main/java/dseengine/TaskWholeResult.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/ANDNode.java b/src/main/java/faulttrees/ANDNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/AfterNode.java b/src/main/java/faulttrees/AfterNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/BeforeNode.java b/src/main/java/faulttrees/BeforeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/BooleanNode.java b/src/main/java/faulttrees/BooleanNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/Fault.java b/src/main/java/faulttrees/Fault.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/FaultElement.java b/src/main/java/faulttrees/FaultElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/FaultNode.java b/src/main/java/faulttrees/FaultNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/FaultTree.java b/src/main/java/faulttrees/FaultTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/NOTNode.java b/src/main/java/faulttrees/NOTNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/ORNode.java b/src/main/java/faulttrees/ORNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/SequenceNode.java b/src/main/java/faulttrees/SequenceNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/TimeNode.java b/src/main/java/faulttrees/TimeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/VoteNode.java b/src/main/java/faulttrees/VoteNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/faulttrees/XORNode.java b/src/main/java/faulttrees/XORNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTBlock.java b/src/main/java/graph/AUTBlock.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTElement.java b/src/main/java/graph/AUTElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTGraph.java b/src/main/java/graph/AUTGraph.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTGraphDisplay.java b/src/main/java/graph/AUTGraphDisplay.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTMappingGraph.java b/src/main/java/graph/AUTMappingGraph.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTPartition.java b/src/main/java/graph/AUTPartition.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTSplitter.java b/src/main/java/graph/AUTSplitter.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTState.java b/src/main/java/graph/AUTState.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/AUTTransition.java b/src/main/java/graph/AUTTransition.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/CorePowerConsumption.java b/src/main/java/graph/CorePowerConsumption.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/RG.java b/src/main/java/graph/RG.java old mode 100755 new mode 100644 diff --git a/src/main/java/graph/VCDGenerator.java b/src/main/java/graph/VCDGenerator.java old mode 100755 new mode 100644 diff --git a/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSBlocks.java b/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSBlocks.java deleted file mode 100755 index ad65f4379403da30d18310b78df84daf1ba57557..0000000000000000000000000000000000000000 --- a/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSBlocks.java +++ /dev/null @@ -1,152 +0,0 @@ -/* 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 heterogeneoustranslator.systemCAMStranslator; - -import javax.swing.*; -import java.awt.*; -import java.util.LinkedList; -import java.util.Vector; -import ui.*; - -/** -* Class CAMSBlocks -* Simulation Block for SystemC-AMS Diagrams -* Creation: 28/08/2017 -* @version 1.0 28/08/2017 -* @author Côme DEMARIGNY - */ - -public class CAMSBlocks{ - - private String name; - private int nbOfIn; - private int nbOfOut; - private int nbOfHybridIn; - private int nbOfHybridOut; - private LinkedList<TAttribute> myAttributes; - private LinkedList<CAMSSignal> mySignals; - private String [] processCode; - - - public CAMSBlocks(String _name, int _nbOfIn, int _nbOfOut, int _nbOfHybridIn, int _nbOfHybridOut, LinkedList<TAttribute> _myAttributes, LinkedList<CAMSSignal> _mySignals, String [] _processCode){ - name=_name; - nbOfIn=_nbOfIn; - nbOfOut=_nbOfOut; - nbOfHybridIn=_nbOfHybridIn; - nbOfHybridOut=_nbOfHybridOut; - myAttributes=_myAttributes; - mySignals=_mySignals; - processCode=_processCode; - - } - - public void setBlockName(String newName){ - name = newName; - } - - public void setNbOfIn(int newIn){ - nbOfIn = newIn; - } - - public void setNbOfOut(int newOut){ - nbOfOut = newOut; - } - - public void setNbOfHybridIn(int newIn){ - nbOfHybridIn = newIn; - } - - public void setNbOfHybridOut(int newOut){ - nbOfHybridOut = newOut; - } - - public void setMyAttributes(LinkedList<TAttribute> newMyAttributes){ - myAttributes = newMyAttributes; - } - - public void setMySignals(LinkedList<CAMSSignal> newMySignals){ - mySignals = newMySignals; - } - - public void setProcessCode(String[] newProcessCode){ - processCode = newProcessCode; - } - - public String getBlockName(){ - return name; - } - - public int getNbOfIn() { - return nbOfIn; - } - - public int getNbOfOut() { - return nbOfOut; - } - public int getNbOfHybridIn() { - return nbOfHybridIn; - } - - public int getNbOfHybridOut() { - return nbOfHybridOut; - } - public int getTotalIn() { - return nbOfIn + nbOfHybridIn; - } - - public int getTotalOut() { - return nbOfOut + nbOfHybridOut; - } - - public LinkedList<TAttribute> getMyAttributes(){ - return myAttributes; - } - - public LinkedList<CAMSSignal> getMySignals(){ - return mySignals; - } - - public String[] getProcessCode(){ - return processCode; - } - -} \ No newline at end of file diff --git a/src/main/java/launcher/ExecutionThread.java b/src/main/java/launcher/ExecutionThread.java old mode 100755 new mode 100644 diff --git a/src/main/java/launcher/LauncherException.java b/src/main/java/launcher/LauncherException.java old mode 100755 new mode 100644 diff --git a/src/main/java/launcher/RTLLauncher.java b/src/main/java/launcher/RTLLauncher.java old mode 100755 new mode 100644 diff --git a/src/main/java/launcher/RemoteExecutionThread.java b/src/main/java/launcher/RemoteExecutionThread.java old mode 100755 new mode 100644 diff --git a/src/main/java/launcher/RshClient.java b/src/main/java/launcher/RshClient.java old mode 100755 new mode 100644 diff --git a/src/main/java/launcher/RshClientReader.java b/src/main/java/launcher/RshClientReader.java old mode 100755 new mode 100644 diff --git a/src/main/java/launcher/RshServer.java b/src/main/java/launcher/RshServer.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/BoolExpressionEvaluator.java b/src/main/java/myutil/BoolExpressionEvaluator.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/BrowserControl.java b/src/main/java/myutil/BrowserControl.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/CallbackLoaderInterface.java b/src/main/java/myutil/CallbackLoaderInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/Conversion.java b/src/main/java/myutil/Conversion.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/DijkstraState.java b/src/main/java/myutil/DijkstraState.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/ErrorThread.java b/src/main/java/myutil/ErrorThread.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/ExternalCall.java b/src/main/java/myutil/ExternalCall.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/FileException.java b/src/main/java/myutil/FileException.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/FileUtils.java b/src/main/java/myutil/FileUtils.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/GenericTree.java b/src/main/java/myutil/GenericTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/Graph.java b/src/main/java/myutil/Graph.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/GraphAlgorithms.java b/src/main/java/myutil/GraphAlgorithms.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/GraphicLib.java b/src/main/java/myutil/GraphicLib.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/HTMLCodeGeneratorForTables.java b/src/main/java/myutil/HTMLCodeGeneratorForTables.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/ImageManager.java b/src/main/java/myutil/ImageManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/IntExpressionEvaluator.java b/src/main/java/myutil/IntExpressionEvaluator.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/IntLine.java b/src/main/java/myutil/IntLine.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/IntMatrix.java b/src/main/java/myutil/IntMatrix.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/LoaderFacilityInterface.java b/src/main/java/myutil/LoaderFacilityInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/MalformedConfigurationException.java b/src/main/java/myutil/MalformedConfigurationException.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/MasterProcessInterface.java b/src/main/java/myutil/MasterProcessInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/MyMath.java b/src/main/java/myutil/MyMath.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/PeriodicBehavior.java b/src/main/java/myutil/PeriodicBehavior.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/PeriodicBehaviorThread.java b/src/main/java/myutil/PeriodicBehaviorThread.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/Plugin.java b/src/main/java/myutil/Plugin.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/PluginManager.java b/src/main/java/myutil/PluginManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/ProcessThread.java b/src/main/java/myutil/ProcessThread.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/SVGGraphics.java b/src/main/java/myutil/SVGGraphics.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/ScrolledJTextArea.java b/src/main/java/myutil/ScrolledJTextArea.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/SortedVector.java b/src/main/java/myutil/SortedVector.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/SteppedAlgorithm.java b/src/main/java/myutil/SteppedAlgorithm.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/TableSorter.java b/src/main/java/myutil/TableSorter.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/TreeCell.java b/src/main/java/myutil/TreeCell.java old mode 100755 new mode 100644 diff --git a/src/main/java/myutil/URLManager.java b/src/main/java/myutil/URLManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCCapacityUnit.java b/src/main/java/nc/NCCapacityUnit.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCElement.java b/src/main/java/nc/NCElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCEquipment.java b/src/main/java/nc/NCEquipment.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCLink.java b/src/main/java/nc/NCLink.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCLinkedElement.java b/src/main/java/nc/NCLinkedElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCPath.java b/src/main/java/nc/NCPath.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCStructure.java b/src/main/java/nc/NCStructure.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCSwitch.java b/src/main/java/nc/NCSwitch.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCTimeUnit.java b/src/main/java/nc/NCTimeUnit.java old mode 100755 new mode 100644 diff --git a/src/main/java/nc/NCTraffic.java b/src/main/java/nc/NCTraffic.java old mode 100755 new mode 100644 diff --git a/src/main/java/proverifspec/ProVerifFunction.java b/src/main/java/proverifspec/ProVerifFunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/proverifspec/ProVerifProcess.java b/src/main/java/proverifspec/ProVerifProcess.java old mode 100755 new mode 100644 diff --git a/src/main/java/proverifspec/ProVerifQuery.java b/src/main/java/proverifspec/ProVerifQuery.java old mode 100755 new mode 100644 diff --git a/src/main/java/proverifspec/ProVerifSpec.java b/src/main/java/proverifspec/ProVerifSpec.java old mode 100755 new mode 100644 diff --git a/src/main/java/remotesimulation/CommandParser.java b/src/main/java/remotesimulation/CommandParser.java old mode 100755 new mode 100644 diff --git a/src/main/java/remotesimulation/RemoteConnection.java b/src/main/java/remotesimulation/RemoteConnection.java old mode 100755 new mode 100644 diff --git a/src/main/java/remotesimulation/RemoteConnectionException.java b/src/main/java/remotesimulation/RemoteConnectionException.java old mode 100755 new mode 100644 diff --git a/src/main/java/remotesimulation/SimulationCommand.java b/src/main/java/remotesimulation/SimulationCommand.java old mode 100755 new mode 100644 diff --git a/src/main/java/remotesimulation/SimulationCommandSaveState.java b/src/main/java/remotesimulation/SimulationCommandSaveState.java old mode 100755 new mode 100644 diff --git a/src/main/java/req/ebrdd/EBRDDAttribute.java b/src/main/java/req/ebrdd/EBRDDAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/req/ebrdd/EBRDDChoice.java b/src/main/java/req/ebrdd/EBRDDChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/req/ebrdd/EBRDDLoop.java b/src/main/java/req/ebrdd/EBRDDLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/Evt.java b/src/main/java/sddescription/Evt.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/HMSC.java b/src/main/java/sddescription/HMSC.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/HMSCElement.java b/src/main/java/sddescription/HMSCElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/HMSCNode.java b/src/main/java/sddescription/HMSCNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/Instance.java b/src/main/java/sddescription/Instance.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/LinkEvts.java b/src/main/java/sddescription/LinkEvts.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/MSC.java b/src/main/java/sddescription/MSC.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/MalformedSDException.java b/src/main/java/sddescription/MalformedSDException.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/Order.java b/src/main/java/sddescription/Order.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/SDExchange.java b/src/main/java/sddescription/SDExchange.java old mode 100755 new mode 100644 diff --git a/src/main/java/sddescription/TimeConstraint.java b/src/main/java/sddescription/TimeConstraint.java old mode 100755 new mode 100644 diff --git a/src/main/java/sdtranslator/ActionEvt.java b/src/main/java/sdtranslator/ActionEvt.java old mode 100755 new mode 100644 diff --git a/src/main/java/sdtranslator/ActionInstance.java b/src/main/java/sdtranslator/ActionInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/sdtranslator/EvtToLink.java b/src/main/java/sdtranslator/EvtToLink.java old mode 100755 new mode 100644 diff --git a/src/main/java/sdtranslator/SDTranslationException.java b/src/main/java/sdtranslator/SDTranslationException.java old mode 100755 new mode 100644 diff --git a/src/main/java/sdtranslator/SDTranslator.java b/src/main/java/sdtranslator/SDTranslator.java old mode 100755 new mode 100644 diff --git a/src/main/java/sdtranslator/TimeConstraintLink.java b/src/main/java/sdtranslator/TimeConstraintLink.java old mode 100755 new mode 100644 diff --git a/src/main/java/syscamstranslator/SysCAMSSpecification.java b/src/main/java/syscamstranslator/SysCAMSSpecification.java new file mode 100644 index 0000000000000000000000000000000000000000..e188ae7d110f1bf41f36e040dccb8c3d1ac56e2d --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSSpecification.java @@ -0,0 +1,150 @@ +/* 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 syscamstranslator; + +import java.util.LinkedList; +import java.util.List; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSSpecification{ + private List<SysCAMSTComponent> components; + private List<SysCAMSTConnector> connectors; + + public SysCAMSSpecification(List<SysCAMSTComponent> _components, List<SysCAMSTConnector> _connectors){ + components = _components ; + connectors = _connectors ; + } + + public List<SysCAMSTComponent> getComponents(){ + return components; + } + + public List<SysCAMSTConnector> getConnectors(){ + return connectors; + } + + public LinkedList<SysCAMSTBlockTDF> getAllBlockTDF(){ + LinkedList<SysCAMSTBlockTDF> blocksTDF = new LinkedList<SysCAMSTBlockTDF>(); + for (SysCAMSTComponent blockTDF : components) { + if (blockTDF instanceof SysCAMSTBlockTDF) { + blocksTDF.add((SysCAMSTBlockTDF) blockTDF); + } + } + return blocksTDF; + } + + public LinkedList<SysCAMSTBlockDE> getAllBlockDE(){ + LinkedList<SysCAMSTBlockDE> blocksDE = new LinkedList<SysCAMSTBlockDE>(); + for (SysCAMSTComponent blockDE : components) { + if (blockDE instanceof SysCAMSTBlockDE) { + blocksDE.add((SysCAMSTBlockDE) blockDE); + } + } + return blocksDE; + } + + public LinkedList<SysCAMSTCluster> getAllCluster(){ + LinkedList<SysCAMSTCluster> clusters = new LinkedList<SysCAMSTCluster>(); + for (SysCAMSTComponent cluster : components) { + if (cluster instanceof SysCAMSTCluster) { + clusters.add((SysCAMSTCluster) cluster); + } + } + return clusters; + } + + public LinkedList<SysCAMSTPortConverter> getAllPortConverter(){ + LinkedList<SysCAMSTPortConverter> portsConv = new LinkedList<SysCAMSTPortConverter>(); + for (SysCAMSTComponent portConv : components) { + if (portConv instanceof SysCAMSTPortConverter) { + portsConv.add((SysCAMSTPortConverter) portConv); + } + } + return portsConv; + } + + public LinkedList<SysCAMSTPortTDF> getAllPortTDF(){ + LinkedList<SysCAMSTPortTDF> portsTDF = new LinkedList<SysCAMSTPortTDF>(); + for (SysCAMSTComponent portTDF : components) { + if (portTDF instanceof SysCAMSTPortTDF) { + portsTDF.add((SysCAMSTPortTDF) portTDF); + } + } + return portsTDF; + } + + public LinkedList<SysCAMSTPortDE> getAllPortDE(){ + LinkedList<SysCAMSTPortDE> portsDE = new LinkedList<SysCAMSTPortDE>(); + for (SysCAMSTComponent portDE : components) { + if (portDE instanceof SysCAMSTPortDE) { + portsDE.add((SysCAMSTPortDE) portDE); + } + } + return portsDE; + } + + public int getNbBlockTDF(){ + return (getAllBlockTDF()).size(); + } + + public int getNbBlocDE(){ + return (getAllBlockDE()).size(); + } + + public int getNbCluster(){ + return (getAllCluster()).size(); + } + + public int getNbPortConverter(){ + return (getAllPortConverter()).size(); + } + + public int getNbPortTDF(){ + return (getAllPortTDF()).size(); + } + + public int getNbPortDE(){ + return (getAllPortDE()).size(); + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTBlockDE.java b/src/main/java/syscamstranslator/SysCAMSTBlockDE.java new file mode 100644 index 0000000000000000000000000000000000000000..6696aa5d1f6f9e2505f856c9c745accae0e75085 --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTBlockDE.java @@ -0,0 +1,72 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTBlockDE extends SysCAMSTComponent { + + private String blockDEName; + private int period; + + public SysCAMSTBlockDE(String _blockDEName, int _period) { + blockDEName = _blockDEName; + period = _period; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int _period) { + period = _period; + } + + public String getBlockDEName() { + return blockDEName; + } + + public void setBlockDEName(String _blockDEName) { + blockDEName = _blockDEName; + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTBlockTDF.java b/src/main/java/syscamstranslator/SysCAMSTBlockTDF.java new file mode 100644 index 0000000000000000000000000000000000000000..d7d449fd1d1dedb961b3026ae9adc910db3d8edc --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTBlockTDF.java @@ -0,0 +1,82 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTBlockTDF extends SysCAMSTComponent { + + private String blockTDFName; + private int period; + private String processCode; + + public SysCAMSTBlockTDF(String _blockTDFName, int _period, String _processCode) { + blockTDFName = _blockTDFName; + period = _period; + processCode = _processCode; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int _period) { + period = _period; + } + + public String getProcessCode() { + return processCode; + } + + public void setProcessCode(String _processCode) { + processCode = _processCode; + } + + public String getBlockTDFName() { + return blockTDFName; + } + + public void setBlockTDFName(String _blockTDFName) { + blockTDFName = _blockTDFName; + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTCluster.java b/src/main/java/syscamstranslator/SysCAMSTCluster.java new file mode 100644 index 0000000000000000000000000000000000000000..0d82f3673e359784eab9c500d153445474827fb9 --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTCluster.java @@ -0,0 +1,63 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTCluster extends SysCAMSTComponent { + + private String clusterName; + + public SysCAMSTCluster(String _clusterName) { + super(); + clusterName = _clusterName; + } + + public String getClusterName() { + return clusterName; + } + + public void setClusterName(String _clusterName) { + clusterName = _clusterName; + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTComponent.java b/src/main/java/syscamstranslator/SysCAMSTComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..5a4b606380233880214c887c71cffa5e835c9fc0 --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTComponent.java @@ -0,0 +1,58 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTComponent { + + public String name; + + public String getName() { + return name; + } + + public void setName(String _name) { + name = _name; + } +} \ No newline at end of file diff --git a/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSConnection.java b/src/main/java/syscamstranslator/SysCAMSTConnectingPoint.java old mode 100755 new mode 100644 similarity index 73% rename from src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSConnection.java rename to src/main/java/syscamstranslator/SysCAMSTConnectingPoint.java index 1d3961178b432a319805925dd62652b2361b01dc..194e01efd7bf4d0d8996a862c9b150e2eb4be8ee --- a/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSConnection.java +++ b/src/main/java/syscamstranslator/SysCAMSTConnectingPoint.java @@ -36,43 +36,37 @@ * knowledge of the CeCILL license and that you accept its terms. */ - - - -package heterogeneoustranslator.systemCAMStranslator; - -import javax.swing.*; -import java.awt.*; -import java.util.LinkedList; -import java.util.Vector; -import ui.*; +package syscamstranslator; /** -* Class CAMSConnection -* Connection beetwen blocks for SystemC-AMS Diagrams -* Creation: 30/08/2017 -* @version 1.0 30/08/2017 -* @author Côme DEMARIGNY - */ + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ -public class CAMSConnection{ - - public String name; - public CAMSBlocks inputBlock, outputBlock; - public int rate; - public int type; - - public CAMSConnection(CAMSBlocks _inputBlock, CAMSBlocks _outputBlock){ - inputBlock = _inputBlock; - outputBlock = _outputBlock; +public class SysCAMSTConnectingPoint{ + + SysCAMSTConnector ownerConnector ; + SysCAMSTComponent ownerComponent; + + public SysCAMSTConnectingPoint( SysCAMSTComponent _ownerComponent) + { + ownerComponent = _ownerComponent; } - public CAMSBlocks getInputBlock(){ - return inputBlock; + SysCAMSTConnector getConnector(){ + return ownerConnector; } - public CAMSBlocks getOutputBlock(){ - return outputBlock; + public SysCAMSTComponent getComponent(){ + return ownerComponent; } + void setConnector(SysCAMSTConnector _connector){ + ownerConnector = _connector; + } + + boolean ConnectingPointIsFree(){ + return ownerConnector == null; + } } \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTConnector.java b/src/main/java/syscamstranslator/SysCAMSTConnector.java new file mode 100644 index 0000000000000000000000000000000000000000..96ea213429c5edbbcdbbd3a67b376fde2438eadc --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTConnector.java @@ -0,0 +1,65 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTConnector{ + + private SysCAMSTConnectingPoint connectingPoint1; + private SysCAMSTConnectingPoint connectingPoint2; + + public SysCAMSTConnector(SysCAMSTConnectingPoint _connectingPoint1, SysCAMSTConnectingPoint _connectingPoint2){ + + connectingPoint1 = _connectingPoint1; + connectingPoint2 = _connectingPoint2; + } + + public SysCAMSTConnectingPoint get_p1(){ + return connectingPoint1; + } + + public SysCAMSTConnectingPoint get_p2(){ + return connectingPoint2; + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTPortConverter.java b/src/main/java/syscamstranslator/SysCAMSTPortConverter.java new file mode 100644 index 0000000000000000000000000000000000000000..a367d8cfa02e93208c359a2c2128db4348ab1ab3 --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTPortConverter.java @@ -0,0 +1,112 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTPortConverter extends SysCAMSTComponent { + + private String name; + private int period; + private int rate; + private int delay; + private String origin; + private String ConvType; + + public SysCAMSTPortConverter(String _name, int _period, int _rate, int _delay, String _origin, String _ConvType) { + name = _name; + period = _period; + rate = _rate; + delay = _delay; + origin = _origin; + ConvType = _ConvType; + } + + public String getName() { + return name; + } + + public void setName(String _name) { + name = _name; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int _period) { + period = _period; + } + + public int getRate() { + return rate; + } + + public void setRate(int _rate) { + rate = _rate; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int _delay) { + delay = _delay; + } + + public String getOrigin() { + return origin; + } + + public void setOrigin(String _origin) { + origin = _origin; + } + + public String getConvType() { + return ConvType; + } + + public void setConvType(String _ConvType) { + ConvType = _ConvType; + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTPortDE.java b/src/main/java/syscamstranslator/SysCAMSTPortDE.java new file mode 100644 index 0000000000000000000000000000000000000000..f1ec45a4f71c064059a6345ea08a3f9a6dd325fa --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTPortDE.java @@ -0,0 +1,112 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTPortDE extends SysCAMSTComponent { + + private String name; + private int period; + private int rate; + private int delay; + private String origin; + private String DEType; + + public SysCAMSTPortDE(String _name, int _period, int _rate, int _delay, String _origin, String _DEType) { + name = _name; + period = _period; + rate = _rate; + delay = _delay; + origin = _origin; + DEType = _DEType; + } + + public String getName() { + return name; + } + + public void setName(String _name) { + name = _name; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int _period) { + period = _period; + } + + public int getRate() { + return rate; + } + + public void setRate(int _rate) { + rate = _rate; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int _delay) { + delay = _delay; + } + + public String getOrigin() { + return origin; + } + + public void setOrigin(String _origin) { + origin = _origin; + } + + public String getDEType() { + return DEType; + } + + public void setDEType(String _DEType) { + DEType = _DEType; + } +} \ No newline at end of file diff --git a/src/main/java/syscamstranslator/SysCAMSTPortTDF.java b/src/main/java/syscamstranslator/SysCAMSTPortTDF.java new file mode 100644 index 0000000000000000000000000000000000000000..03145f137b9c8ceb910a4690ffd400694da8bcae --- /dev/null +++ b/src/main/java/syscamstranslator/SysCAMSTPortTDF.java @@ -0,0 +1,112 @@ +/* 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 syscamstranslator; + +/** + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSTPortTDF extends SysCAMSTComponent { + + private String name; + private int period; + private int rate; + private int delay; + private String origin; + private String TDFType; + + public SysCAMSTPortTDF(String _name, int _period, int _rate, int _delay, String _origin, String _TDFType) { + name = _name; + period = _period; + rate = _rate; + delay = _delay; + origin = _origin; + TDFType = _TDFType; + } + + public String getName() { + return name; + } + + public void setName(String _name) { + name = _name; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int _period) { + period = _period; + } + + public int getRate() { + return rate; + } + + public void setRate(int _rate) { + rate = _rate; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int _delay) { + delay = _delay; + } + + public String getOrigin() { + return origin; + } + + public void setOrigin(String _origin) { + origin = _origin; + } + + public String getTDFType() { + return TDFType; + } + + public void setTDFType(String _TDFType) { + TDFType = _TDFType; + } +} diff --git a/src/main/java/tmatrix/RequirementModeling.java b/src/main/java/tmatrix/RequirementModeling.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmatrix/Requirements.java b/src/main/java/tmatrix/Requirements.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/DIPLOElement.java b/src/main/java/tmltranslator/DIPLOElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwA.java b/src/main/java/tmltranslator/HwA.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwBridge.java b/src/main/java/tmltranslator/HwBridge.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwBus.java b/src/main/java/tmltranslator/HwBus.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwCPU.java b/src/main/java/tmltranslator/HwCPU.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwCommunicationNode.java b/src/main/java/tmltranslator/HwCommunicationNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwCrossbar.java b/src/main/java/tmltranslator/HwCrossbar.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwDMA.java b/src/main/java/tmltranslator/HwDMA.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwExecutionNode.java b/src/main/java/tmltranslator/HwExecutionNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwFPGA.java b/src/main/java/tmltranslator/HwFPGA.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwLink.java b/src/main/java/tmltranslator/HwLink.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwMemory.java b/src/main/java/tmltranslator/HwMemory.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwNode.java b/src/main/java/tmltranslator/HwNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/HwVGMN.java b/src/main/java/tmltranslator/HwVGMN.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActionState.java b/src/main/java/tmltranslator/TMLActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActivity.java b/src/main/java/tmltranslator/TMLActivity.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActivityElement.java b/src/main/java/tmltranslator/TMLActivityElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActivityElementChannel.java b/src/main/java/tmltranslator/TMLActivityElementChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActivityElementEvent.java b/src/main/java/tmltranslator/TMLActivityElementEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActivityElementWithAction.java b/src/main/java/tmltranslator/TMLActivityElementWithAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLActivityElementWithIntervalAction.java b/src/main/java/tmltranslator/TMLActivityElementWithIntervalAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLArchiTextSpecification.java b/src/main/java/tmltranslator/TMLArchiTextSpecification.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLArchitecture.java b/src/main/java/tmltranslator/TMLArchitecture.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLAttribute.java b/src/main/java/tmltranslator/TMLAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCP.java b/src/main/java/tmltranslator/TMLCP.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCPError.java b/src/main/java/tmltranslator/TMLCPError.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCPLib.java b/src/main/java/tmltranslator/TMLCPLib.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCPLibArtifact.java b/src/main/java/tmltranslator/TMLCPLibArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCPSyntaxChecking.java b/src/main/java/tmltranslator/TMLCPSyntaxChecking.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCPTextSpecification.java b/src/main/java/tmltranslator/TMLCPTextSpecification.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLChannel.java b/src/main/java/tmltranslator/TMLChannel.java old mode 100755 new mode 100644 index 717b2a5d6c5659c8dddb6858a9a6bff0019e12f8..8ddbfd1fe2849f0fb6b1b569a2c839bd6882c66c --- a/src/main/java/tmltranslator/TMLChannel.java +++ b/src/main/java/tmltranslator/TMLChannel.java @@ -505,12 +505,7 @@ public class TMLChannel extends TMLCommunicationElement { } s += "destinationtask=\"" + destTask + "\" "; s += "destinationport=\"" + destPort + "\" "; - if (originPort != null) { - s += "dataFlowType=\"" + originPort.getDataFlowType() + "\" "; - } else if ((originPorts != null) && (originPorts.size() > 0)) { - TMLPort tmpP = originPorts.get(0); - s += "dataFlowType=\"" + tmpP.getDataFlowType() + "\" "; - } + s += "dataFlowType=\"" + originPort.getDataFlowType() + "\" "; } if (isAJoinChannel()) { s += "destinationtask=\"" + destinationTasks.get(0).getName() + "\" "; @@ -547,4 +542,5 @@ public class TMLChannel extends TMLCommunicationElement { s += " />\n"; return s; } + } diff --git a/src/main/java/tmltranslator/TMLChannelPath.java b/src/main/java/tmltranslator/TMLChannelPath.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCheckingError.java b/src/main/java/tmltranslator/TMLCheckingError.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLChoice.java b/src/main/java/tmltranslator/TMLChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLCommunicationElement.java b/src/main/java/tmltranslator/TMLCommunicationElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLDelay.java b/src/main/java/tmltranslator/TMLDelay.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLElement.java b/src/main/java/tmltranslator/TMLElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLError.java b/src/main/java/tmltranslator/TMLError.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLEvent.java b/src/main/java/tmltranslator/TMLEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLExecC.java b/src/main/java/tmltranslator/TMLExecC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLExecCInterval.java b/src/main/java/tmltranslator/TMLExecCInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLExecI.java b/src/main/java/tmltranslator/TMLExecI.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLExecIInterval.java b/src/main/java/tmltranslator/TMLExecIInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLForLoop.java b/src/main/java/tmltranslator/TMLForLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLJunction.java b/src/main/java/tmltranslator/TMLJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLMapping.java b/src/main/java/tmltranslator/TMLMapping.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLMappingTextSpecification.java b/src/main/java/tmltranslator/TMLMappingTextSpecification.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLModeling.java b/src/main/java/tmltranslator/TMLModeling.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLNotifiedEvent.java b/src/main/java/tmltranslator/TMLNotifiedEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLParserSaveElt.java b/src/main/java/tmltranslator/TMLParserSaveElt.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLPort.java b/src/main/java/tmltranslator/TMLPort.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLRandom.java b/src/main/java/tmltranslator/TMLRandom.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLRandomSequence.java b/src/main/java/tmltranslator/TMLRandomSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLReadChannel.java b/src/main/java/tmltranslator/TMLReadChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLRequest.java b/src/main/java/tmltranslator/TMLRequest.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSDAttribute.java b/src/main/java/tmltranslator/TMLSDAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSDType.java b/src/main/java/tmltranslator/TMLSDType.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSelectEvt.java b/src/main/java/tmltranslator/TMLSelectEvt.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSendEvent.java b/src/main/java/tmltranslator/TMLSendEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSendRequest.java b/src/main/java/tmltranslator/TMLSendRequest.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSequence.java b/src/main/java/tmltranslator/TMLSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLStartState.java b/src/main/java/tmltranslator/TMLStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLStopState.java b/src/main/java/tmltranslator/TMLStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLSyntaxChecking.java b/src/main/java/tmltranslator/TMLSyntaxChecking.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLTXTError.java b/src/main/java/tmltranslator/TMLTXTError.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLTask.java b/src/main/java/tmltranslator/TMLTask.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLTextSpecification.java b/src/main/java/tmltranslator/TMLTextSpecification.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLType.java b/src/main/java/tmltranslator/TMLType.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLWaitEvent.java b/src/main/java/tmltranslator/TMLWaitEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/TMLWriteChannel.java b/src/main/java/tmltranslator/TMLWriteChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/CPMEC.java b/src/main/java/tmltranslator/modelcompiler/CPMEC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/CVariable.java b/src/main/java/tmltranslator/modelcompiler/CVariable.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/DataTransfer.java b/src/main/java/tmltranslator/modelcompiler/DataTransfer.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/DoubleDmaMEC.java b/src/main/java/tmltranslator/modelcompiler/DoubleDmaMEC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/FepOperationMEC.java b/src/main/java/tmltranslator/modelcompiler/FepOperationMEC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/Operation.java b/src/main/java/tmltranslator/modelcompiler/Operation.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/OperationMEC.java b/src/main/java/tmltranslator/modelcompiler/OperationMEC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/Signal.java b/src/main/java/tmltranslator/modelcompiler/Signal.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/SingleDmaMEC.java b/src/main/java/tmltranslator/modelcompiler/SingleDmaMEC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/TMLModelCompilerError.java b/src/main/java/tmltranslator/modelcompiler/TMLModelCompilerError.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/modelcompiler/TMLModelCompilerParser.java b/src/main/java/tmltranslator/modelcompiler/TMLModelCompilerParser.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPActivityDiagram.java b/src/main/java/tmltranslator/tmlcp/TMLCPActivityDiagram.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPChoice.java b/src/main/java/tmltranslator/tmlcp/TMLCPChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPConnector.java b/src/main/java/tmltranslator/tmlcp/TMLCPConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPElement.java b/src/main/java/tmltranslator/tmlcp/TMLCPElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPEndGroup.java b/src/main/java/tmltranslator/tmlcp/TMLCPEndGroup.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPForLoop.java b/src/main/java/tmltranslator/tmlcp/TMLCPForLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPFork.java b/src/main/java/tmltranslator/tmlcp/TMLCPFork.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPJoin.java b/src/main/java/tmltranslator/tmlcp/TMLCPJoin.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPJunction.java b/src/main/java/tmltranslator/tmlcp/TMLCPJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPRefAD.java b/src/main/java/tmltranslator/tmlcp/TMLCPRefAD.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPRefSD.java b/src/main/java/tmltranslator/tmlcp/TMLCPRefSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPSequence.java b/src/main/java/tmltranslator/tmlcp/TMLCPSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPSequenceDiagram.java b/src/main/java/tmltranslator/tmlcp/TMLCPSequenceDiagram.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPStart.java b/src/main/java/tmltranslator/tmlcp/TMLCPStart.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPStartGroup.java b/src/main/java/tmltranslator/tmlcp/TMLCPStartGroup.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLCPStop.java b/src/main/java/tmltranslator/tmlcp/TMLCPStop.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDAction.java b/src/main/java/tmltranslator/tmlcp/TMLSDAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDElement.java b/src/main/java/tmltranslator/tmlcp/TMLSDElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDEvent.java b/src/main/java/tmltranslator/tmlcp/TMLSDEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDInstance.java b/src/main/java/tmltranslator/tmlcp/TMLSDInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDMessage.java b/src/main/java/tmltranslator/tmlcp/TMLSDMessage.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDMessageManipulation.java b/src/main/java/tmltranslator/tmlcp/TMLSDMessageManipulation.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDReceiveMessage.java b/src/main/java/tmltranslator/tmlcp/TMLSDReceiveMessage.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tmlcp/TMLSDSendMessage.java b/src/main/java/tmltranslator/tmlcp/TMLSDSendMessage.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/toautomata/TML2AUT.java b/src/main/java/tmltranslator/toautomata/TML2AUT.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/toautomata/TML2AUTviaLOTOS.java b/src/main/java/tmltranslator/toautomata/TML2AUTviaLOTOS.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tomappingsystemc/MappedSystemCTask.java b/src/main/java/tmltranslator/tomappingsystemc/MappedSystemCTask.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tomappingsystemc/TML2MappingSystemC.java b/src/main/java/tmltranslator/tomappingsystemc/TML2MappingSystemC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tosystemc/SystemCTask.java b/src/main/java/tmltranslator/tosystemc/SystemCTask.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/tosystemc/TML2SystemC.java b/src/main/java/tmltranslator/tosystemc/TML2SystemC.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/toturtle/Mapping2TIF.java b/src/main/java/tmltranslator/toturtle/Mapping2TIF.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/toturtle/TML2TURTLE.java b/src/main/java/tmltranslator/toturtle/TML2TURTLE.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/touppaal/RelationTMLUPPAAL.java b/src/main/java/tmltranslator/touppaal/RelationTMLUPPAAL.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/touppaal/TML2UPPAAL.java b/src/main/java/tmltranslator/touppaal/TML2UPPAAL.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/touppaal/TMLActivityElementLocation.java b/src/main/java/tmltranslator/touppaal/TMLActivityElementLocation.java old mode 100755 new mode 100644 diff --git a/src/main/java/tmltranslator/touppaal/TMLTaskTemplate.java b/src/main/java/tmltranslator/touppaal/TMLTaskTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/tpndescription/Place.java b/src/main/java/tpndescription/Place.java old mode 100755 new mode 100644 diff --git a/src/main/java/tpndescription/TPN.java b/src/main/java/tpndescription/TPN.java old mode 100755 new mode 100644 diff --git a/src/main/java/tpndescription/Transition.java b/src/main/java/tpndescription/Transition.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADActionState.java b/src/main/java/translator/ADActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADActionStateWithGate.java b/src/main/java/translator/ADActionStateWithGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADActionStateWithMultipleParam.java b/src/main/java/translator/ADActionStateWithMultipleParam.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADActionStateWithParam.java b/src/main/java/translator/ADActionStateWithParam.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADChoice.java b/src/main/java/translator/ADChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADComponent.java b/src/main/java/translator/ADComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADDelay.java b/src/main/java/translator/ADDelay.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADEmpty.java b/src/main/java/translator/ADEmpty.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADJunction.java b/src/main/java/translator/ADJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADLatency.java b/src/main/java/translator/ADLatency.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADParallel.java b/src/main/java/translator/ADParallel.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADPreempt.java b/src/main/java/translator/ADPreempt.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADSequence.java b/src/main/java/translator/ADSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADStart.java b/src/main/java/translator/ADStart.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADStop.java b/src/main/java/translator/ADStop.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADTLO.java b/src/main/java/translator/ADTLO.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADTimeCapture.java b/src/main/java/translator/ADTimeCapture.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ADTimeInterval.java b/src/main/java/translator/ADTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/AbsoluteTimeConstraintTClass.java b/src/main/java/translator/AbsoluteTimeConstraintTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/ActivityDiagram.java b/src/main/java/translator/ActivityDiagram.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/BasicTimer.java b/src/main/java/translator/BasicTimer.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/CheckingError.java b/src/main/java/translator/CheckingError.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/FIFOFiniteAndGetSizeTClass.java b/src/main/java/translator/FIFOFiniteAndGetSizeTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/FIFOInfiniteAndGetSizeTClass.java b/src/main/java/translator/FIFOInfiniteAndGetSizeTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/FIFOSizeTClass.java b/src/main/java/translator/FIFOSizeTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/FIFOTClass.java b/src/main/java/translator/FIFOTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/Gate.java b/src/main/java/translator/Gate.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/GroupOfGates.java b/src/main/java/translator/GroupOfGates.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/HLProcess.java b/src/main/java/translator/HLProcess.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/JKeyword.java b/src/main/java/translator/JKeyword.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/MalformedTIFException.java b/src/main/java/translator/MalformedTIFException.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/MasterGateManager.java b/src/main/java/translator/MasterGateManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/MultiIncomingElt.java b/src/main/java/translator/MultiIncomingElt.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/NonBlockingADComponent.java b/src/main/java/translator/NonBlockingADComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/Param.java b/src/main/java/translator/Param.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/Process.java b/src/main/java/translator/Process.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/RTLOTOSKeyword.java b/src/main/java/translator/RTLOTOSKeyword.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/Relation.java b/src/main/java/translator/Relation.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/RelativeTimeConstraintTClass.java b/src/main/java/translator/RelativeTimeConstraintTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClass.java b/src/main/java/translator/TClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassBasicFIFO.java b/src/main/java/translator/TClassBasicFIFO.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassBuffer.java b/src/main/java/translator/TClassBuffer.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassBufferIn.java b/src/main/java/translator/TClassBufferIn.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassBufferOut.java b/src/main/java/translator/TClassBufferOut.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassChannelBRBW.java b/src/main/java/translator/TClassChannelBRBW.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassChannelBRNBW.java b/src/main/java/translator/TClassChannelBRNBW.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassChannelNBRNBW.java b/src/main/java/translator/TClassChannelNBRNBW.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassEvent.java b/src/main/java/translator/TClassEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassEventCommon.java b/src/main/java/translator/TClassEventCommon.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassEventFinite.java b/src/main/java/translator/TClassEventFinite.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassEventFiniteBlocking.java b/src/main/java/translator/TClassEventFiniteBlocking.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassEventInfinite.java b/src/main/java/translator/TClassEventInfinite.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassGate.java b/src/main/java/translator/TClassGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassInfiniteFIFO.java b/src/main/java/translator/TClassInfiniteFIFO.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TClassRequest.java b/src/main/java/translator/TClassRequest.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TIFExchange.java b/src/main/java/translator/TIFExchange.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TIFExpressionTree.java b/src/main/java/translator/TIFExpressionTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TIFTreeNode.java b/src/main/java/translator/TIFTreeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TURTLEModeling.java b/src/main/java/translator/TURTLEModeling.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TURTLETranslator.java b/src/main/java/translator/TURTLETranslator.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/TimeConstraintTClass.java b/src/main/java/translator/TimeConstraintTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/ComponentId.java b/src/main/java/translator/tojava/ComponentId.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/JAttribute.java b/src/main/java/translator/tojava/JAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/JGate.java b/src/main/java/translator/tojava/JGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/JOperation.java b/src/main/java/translator/tojava/JOperation.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/JavaClass.java b/src/main/java/translator/tojava/JavaClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/MainClass.java b/src/main/java/translator/tojava/MainClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tojava/TURTLE2Java.java b/src/main/java/translator/tojava/TURTLE2Java.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tosimujava/JSimuGate.java b/src/main/java/translator/tosimujava/JSimuGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tosimujava/MainClassSimu.java b/src/main/java/translator/tosimujava/MainClassSimu.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tosimujava/TJavaProcess.java b/src/main/java/translator/tosimujava/TJavaProcess.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/tosimujava/TURTLE2SimuJava.java b/src/main/java/translator/tosimujava/TURTLE2SimuJava.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/totpn/TURTLE2TPN.java b/src/main/java/translator/totpn/TURTLE2TPN.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/touppaal/ADComponentLocation.java b/src/main/java/translator/touppaal/ADComponentLocation.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/touppaal/RelationTIFUPPAAL.java b/src/main/java/translator/touppaal/RelationTIFUPPAAL.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/touppaal/TClassTemplate.java b/src/main/java/translator/touppaal/TClassTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/translator/touppaal/TURTLE2UPPAAL.java b/src/main/java/translator/touppaal/TURTLE2UPPAAL.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ADDPanel.java b/src/main/java/ui/ADDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ActionPerformer.java b/src/main/java/ui/ActionPerformer.java old mode 100755 new mode 100644 index 0e6085e0ea65bc5bd8264eca9f864114ed9293b7..b707d7c7127c6b0c9ddca1d68bdb2b3a28ca496a --- a/src/main/java/ui/ActionPerformer.java +++ b/src/main/java/ui/ActionPerformer.java @@ -81,10 +81,8 @@ public class ActionPerformer { mgui.openLastProject(); } else if (command.equals(mgui.actions[TGUIAction.ACT_SAVE].getActionCommand())) { mgui.saveProject(); - } else if (command.equals(mgui.actions[TGUIAction.ACT_SAVE_AS_MODEL].getActionCommand())) { - mgui.saveAsNewModel(); - } else if (command.equals(mgui.actions[TGUIAction.ACT_SAVE_AS_PROJECT].getActionCommand())) { - mgui.saveAsNewProject(); + } else if (command.equals(mgui.actions[TGUIAction.ACT_SAVE_AS].getActionCommand())) { + mgui.saveAsProject(); } else if (command.equals(mgui.actions[TGUIAction.ACT_SAVE_TIF].getActionCommand())) { mgui.saveTIF(); } else if (command.equals(mgui.actions[TGUIAction.ACT_OPEN_TIF].getActionCommand())) { @@ -908,13 +906,23 @@ public class ActionPerformer { } else if (command.equals(mgui.actions[TGUIAction.TMLSD_ACTION_STATE].getActionCommand())) { mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.TMLSD_ACTION_STATE); - //SystemC AMS - } else if (command.equals(mgui.actions[TGUIAction.CAMS_EDIT].getActionCommand())) { + // SystemC-AMS + } else if (command.equals(mgui.actions[TGUIAction.CAMS_EDIT].getActionCommand())) { mgui.actionOnButton(TGComponentManager.EDIT, -1); - } else if (command.equals(mgui.actions[TGUIAction.CAMS_BLOCK].getActionCommand())) { - mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_BLOCK); + } else if (command.equals(mgui.actions[TGUIAction.CAMS_BLOCK_TDF].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_BLOCK_TDF); + } else if (command.equals(mgui.actions[TGUIAction.CAMS_BLOCK_DE].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_BLOCK_DE); } else if (command.equals(mgui.actions[TGUIAction.CAMS_CONNECTOR].getActionCommand())) { - mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_CONNECTOR); + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_CONNECTOR); + } else if (command.equals(mgui.actions[TGUIAction.CAMS_PORT_TDF].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_PORT_TDF); + } else if (command.equals(mgui.actions[TGUIAction.CAMS_PORT_DE].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_PORT_DE); + } else if (command.equals(mgui.actions[TGUIAction.CAMS_PORT_CONVERTER].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_PORT_CONVERTER); + } else if (command.equals(mgui.actions[TGUIAction.CAMS_CLUSTER].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.CAMS_CLUSTER); // Attack Tree Diagrams } else if (command.equals(mgui.actions[TGUIAction.ATD_BLOCK].getActionCommand())) { diff --git a/src/main/java/ui/ActionStateErrorHighlight.java b/src/main/java/ui/ActionStateErrorHighlight.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ActivityDiagramPanelInterface.java b/src/main/java/ui/ActivityDiagramPanelInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AnalysisPanel.java b/src/main/java/ui/AnalysisPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AnalysisPanelTranslator.java b/src/main/java/ui/AnalysisPanelTranslator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AnalysisSyntaxException.java b/src/main/java/ui/AnalysisSyntaxException.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ArtifactTClassGate.java b/src/main/java/ui/ArtifactTClassGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AttackTreePanel.java b/src/main/java/ui/AttackTreePanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AvatarAnalysisPanel.java b/src/main/java/ui/AvatarAnalysisPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AvatarMethodologyPanel.java b/src/main/java/ui/AvatarMethodologyPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/AvatarRequirementPanel.java b/src/main/java/ui/AvatarRequirementPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/BasicErrorHighlight.java b/src/main/java/ui/BasicErrorHighlight.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/CDElement.java b/src/main/java/ui/CDElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/CanBeDisabled.java b/src/main/java/ui/CanBeDisabled.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/CheckableAccessibility.java b/src/main/java/ui/CheckableAccessibility.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/CheckableInvariant.java b/src/main/java/ui/CheckableInvariant.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ClassDiagramPanelInterface.java b/src/main/java/ui/ClassDiagramPanelInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ColorManager.java b/src/main/java/ui/ColorManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ComponentPluginInterface.java b/src/main/java/ui/ComponentPluginInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/CompositionOperatorInterface.java b/src/main/java/ui/CompositionOperatorInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/CorrespondanceTGElement.java b/src/main/java/ui/CorrespondanceTGElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/DeploymentPanel.java b/src/main/java/ui/DeploymentPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/DesignPanel.java b/src/main/java/ui/DesignPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/DesignPanelTranslator.java b/src/main/java/ui/DesignPanelTranslator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/DiplodocusMethodologyPanel.java b/src/main/java/ui/DiplodocusMethodologyPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/EBRDDTranslator.java b/src/main/java/ui/EBRDDTranslator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/EmbeddedComment.java b/src/main/java/ui/EmbeddedComment.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ErrorGUI.java b/src/main/java/ui/ErrorGUI.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ErrorHighlight.java b/src/main/java/ui/ErrorHighlight.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/FaultTreePanel.java b/src/main/java/ui/FaultTreePanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/FormatManager.java b/src/main/java/ui/FormatManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/GNCModeling.java b/src/main/java/ui/GNCModeling.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/GProactiveDesign.java b/src/main/java/ui/GProactiveDesign.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/GTMLModeling.java b/src/main/java/ui/GTMLModeling.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java old mode 100755 new mode 100644 index cc1754a0407b7a6f9f83d296de23c7ca9e855ea7..ce15d3899b9f29310f6e668f2cd5221bcbd66882 --- a/src/main/java/ui/GTURTLEModeling.java +++ b/src/main/java/ui/GTURTLEModeling.java @@ -104,7 +104,6 @@ import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel; import ui.ebrdd.EBRDDPanel; import ui.ftd.FaultTreeDiagramPanel; import graph.RG; -import ui.het.CAMSBlockDiagramPanel; import ui.iod.InteractionOverviewDiagramPanel; import ui.ncdd.NCDiagramPanel; import ui.osad.TURTLEOSActivityDiagramPanel; @@ -115,6 +114,7 @@ import ui.procsd.ProactiveCSDPanel; import ui.prosmd.ProactiveSMDPanel; import ui.req.Requirement; import ui.req.RequirementDiagramPanel; +import ui.syscams.SysCAMSComponentTaskDiagramPanel; import ui.sysmlsecmethodology.SysmlsecMethodologyDiagramPanel; import ui.tmlad.*; import ui.tmlcd.TMLTaskDiagramPanel; @@ -6222,14 +6222,14 @@ public class GTURTLEModeling { } } - } else if (tdp instanceof CAMSBlockDiagramPanel) { //ajout CD 24.07----mark - nl = doc.getElementsByTagName("CAMSBlockDiagramPanelCopy"); + } else if (tdp instanceof SysCAMSComponentTaskDiagramPanel) { //ajout CD 24.07----mark + nl = doc.getElementsByTagName("SysCAMSBlockDiagramPanelCopy"); if (nl == null) { return; } - CAMSBlockDiagramPanel camsp = (CAMSBlockDiagramPanel) tdp; + SysCAMSComponentTaskDiagramPanel camsp = (SysCAMSComponentTaskDiagramPanel) tdp; for (i = 0; i < nl.getLength(); i++) { adn = nl.item(i); @@ -6995,7 +6995,7 @@ public class GTURTLEModeling { nameTab = elt.getAttribute("nameTab"); - indexDesign = mgui.createSystemCAMS(nameTab); + indexDesign = mgui.createSysCAMSComponentDesign(nameTab); diagramNl = node.getChildNodes(); @@ -7288,9 +7288,9 @@ public class GTURTLEModeling { ((AvatarADPanel) tdp).setConnectorsToFront(); } - if (tdp instanceof CAMSBlockDiagramPanel) { + if (tdp instanceof SysCAMSComponentTaskDiagramPanel) { //TraceManager.addDev("Connectors..."); - ((CAMSBlockDiagramPanel) tdp).setConnectorsToFront(); + ((SysCAMSComponentTaskDiagramPanel) tdp).setConnectorsToFront(); } } @@ -9255,7 +9255,7 @@ public class GTURTLEModeling { } } - public boolean checkSyntaxSystemCAMS(Vector<TGComponent> blocksToTakeIntoAccount, SystemCAMSPanel scp, boolean optimize) { //ajout CD 04/07 FIXME + public boolean checkSyntaxSystemCAMS(Vector<TGComponent> blocksToTakeIntoAccount, SysCAMSComponentDesignPanel scp, boolean optimize) { //ajout CD 04/07 FIXME // List<TMLError> warningsOptimize = new ArrayList<TMLError>(); // warnings = new LinkedList<CheckingError> (); // mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO); diff --git a/src/main/java/ui/GTURTLEOSModeling.java b/src/main/java/ui/GTURTLEOSModeling.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/HiddenInternalComponents.java b/src/main/java/ui/HiddenInternalComponents.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/Invariant.java b/src/main/java/ui/Invariant.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/InvariantSynchro.java b/src/main/java/ui/InvariantSynchro.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/JMenuBarTurtle.java b/src/main/java/ui/JMenuBarTurtle.java old mode 100755 new mode 100644 index 14c526c4273a7c7616479b986699cf951303f04d..d352f504e217d3f814336c7dceb015cb5a689c35 --- a/src/main/java/ui/JMenuBarTurtle.java +++ b/src/main/java/ui/JMenuBarTurtle.java @@ -106,9 +106,7 @@ public class JMenuBarTurtle extends JMenuBar { menuItem.addMouseListener(mgui.mouseHandler); menuItem = file.add(mgui.actions[TGUIAction.ACT_SAVE]); menuItem.addMouseListener(mgui.mouseHandler); - menuItem = file.add(mgui.actions[TGUIAction.ACT_SAVE_AS_MODEL]); - menuItem.addMouseListener(mgui.mouseHandler); - menuItem = file.add(mgui.actions[TGUIAction.ACT_SAVE_AS_PROJECT]); + menuItem = file.add(mgui.actions[TGUIAction.ACT_SAVE_AS]); menuItem.addMouseListener(mgui.mouseHandler); file.addSeparator(); diff --git a/src/main/java/ui/JScrollDiagramPanel.java b/src/main/java/ui/JScrollDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/JTGComponentButton.java b/src/main/java/ui/JTGComponentButton.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/JToolBarMainTurtle.java b/src/main/java/ui/JToolBarMainTurtle.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/LRArtifactTClassGate.java b/src/main/java/ui/LRArtifactTClassGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/MSCDrawer.java b/src/main/java/ui/MSCDrawer.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java index d1e4243b04d69f24bb600ff552064f02fbe75686..831b2f86f4b4f62604e902e0a91189cd82c283a0 100644 --- a/src/main/java/ui/MainGUI.java +++ b/src/main/java/ui/MainGUI.java @@ -44,8 +44,6 @@ import common.ConfigurationTTool; import common.SpecConfigTTool; import ddtranslatorSoclib.AvatarddSpecification; import ddtranslatorSoclib.toSoclib.TasksAndMainGenerator; -import graph.AUTGraph; -import graph.RG; import launcher.RemoteExecutionThread; import launcher.RshClient; import myutil.*; @@ -70,7 +68,8 @@ import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel; import ui.ebrdd.EBRDDPanel; import ui.file.*; import ui.ftd.FaultTreeDiagramPanel; -import ui.het.CAMSBlockDiagramPanel; +import graph.AUTGraph; +import graph.RG; import ui.interactivesimulation.JFrameInteractiveSimulation; import ui.interactivesimulation.SimulationTransaction; import ui.iod.InteractionOverviewDiagramPanel; @@ -84,7 +83,6 @@ import ui.tmlcd.TMLTaskDiagramPanel; import ui.tmlcompd.TMLCCompositeComponent; import ui.tmlcompd.TMLComponentTaskDiagramPanel; import ui.tmlcp.TMLCPPanel; -import ui.tmldd.TMLArchiCAMSNode; import ui.tmldd.TMLArchiDiagramPanel; import ui.tmlsd.TMLSDPanel; import ui.tree.DiagramTreeModel; @@ -94,6 +92,7 @@ import ui.ucd.UseCaseDiagramPanel; import ui.util.DefaultText; import ui.util.IconManager; import ui.window.*; +import ui.syscams.*; import javax.imageio.ImageIO; import javax.swing.*; @@ -741,7 +740,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per if (!Desktop.isDesktopSupported()) { return; } - File file = new File(SpecConfigTTool.TGraphPath); + File file = new File (SpecConfigTTool.TGraphPath ); TraceManager.addDev("Getting desktop"); Desktop desktop = Desktop.getDesktop(); try { @@ -1060,36 +1059,22 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return index; } - public int addSystemCAMSPanel(String name, int index) { //ajout CD -----Mark + private int addSysCAMSComponentDesignPanel(String name, int index) { if (index == -1) { index = tabs.size(); } - SystemCAMSPanel scp = new SystemCAMSPanel(this); - tabs.add(index, scp); - mainTabbedPane.add(scp.tabbedPane, index); - mainTabbedPane.setToolTipTextAt(index, "Open System C-AMS diagrams "); + SysCAMSComponentDesignPanel sccdp = new SysCAMSComponentDesignPanel(this); + tabs.add(index, sccdp); + mainTabbedPane.add(sccdp.tabbedPane, index); + mainTabbedPane.setToolTipTextAt(index, "Open SystemC-AMS design diagrams"); mainTabbedPane.setTitleAt(index, name); mainTabbedPane.setIconAt(index, IconManager.imgic60); //mainTabbedPane.addTab(name, IconManager.imgic14, dp.tabbedPane, "Opens design diagrams"); - scp.init(); + sccdp.init(); //ystem.out.println("Design added"); return index; } - public CAMSBlockDiagramPanel addSystemCAMSPanel(String name, int index, TMLArchiCAMSNode parent) { - if (index == -1) { - index = tabs.size(); - } - SystemCAMSPanel scp = new SystemCAMSPanel(this); - tabs.add(index, scp); - mainTabbedPane.add(scp.tabbedPane, index); - mainTabbedPane.setToolTipTextAt(index, "Open System C-AMS diagrams "); - mainTabbedPane.setTitleAt(index, name); - mainTabbedPane.setIconAt(index, IconManager.imgic60); - scp.init(); - return scp.getCAMSBlockDiagramPanel(); - } - //Return the list of all the TMLArchiDiagramPanels public Vector<TMLArchiPanel> getTMLArchiDiagramPanels() { @@ -1484,12 +1469,12 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return index; } - public int createSystemCAMS(String name) { //ajout CD - int index = addSystemCAMSPanel(name, -1); + public int createSysCAMSComponentDesign(String name) { + int index = addSysCAMSComponentDesignPanel(name, -1); mainTabbedPane.setSelectedIndex(index); return index; } - + public int createADD(String name) { int index = addADDPanel(name, -1); mainTabbedPane.setSelectedIndex(index); @@ -1877,9 +1862,9 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per //frame.repaint(); } - public void newSystemCAMS() {//ajout CD - //TraceManager.addDev("NEW DIPLO Architecture"); - addSystemCAMSPanel("SystemC-AMS", -1); + public void newSysCAMS() { + //TraceManager.addDev("NEW DESIGN"); + addSysCAMSComponentDesignPanel("SystemC_AMS", -1); tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0); mainTabbedPane.setSelectedIndex(tabs.size() - 1); //paneAction(null); @@ -2530,7 +2515,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per jfc.setAcceptAllFileFilterUsed(false); FileNameExtensionFilter filter = new FileNameExtensionFilter("XML files", "xml"); jfc.setFileFilter(filter); - /*jfc.addMouseListener(new MouseListener() { + /*jfc.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent arg0) { @@ -2967,41 +2952,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } - - protected boolean saveAsNewProject() { - jfc.resetChoosableFileFilters(); - jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - jfc.setAcceptAllFileFilterUsed(false); - FileNameExtensionFilter filter = new FileNameExtensionFilter("TTool project", "ttool"); - jfc.setFileFilter(filter); - - createFileDialog(); - - return mainSave(); - - } - - protected boolean saveAsNewModel() { - jfc.resetChoosableFileFilters(); - jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); - jfc.setAcceptAllFileFilterUsed(false); - FileNameExtensionFilter filter = new FileNameExtensionFilter("XML files", "xml"); - jfc.setFileFilter(filter); - int returnVal = jfc.showSaveDialog(frame); - if (returnVal == JFileChooser.APPROVE_OPTION) { - file = jfc.getSelectedFile(); - file = FileUtils.addFileExtensionIfMissing(file, TFileFilter.getExtension()); - } - - boolean b = mainSave(); - if (b) { - dir = null; - config = null; - SpecConfigTTool.setBasicConfig(systemcOn); - } - return b; - } - protected boolean saveProject() { if (file == null) { if (dir != null) @@ -3015,10 +2965,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } - return mainSave(); - } - - public boolean mainSave() { if (checkFileForSave(file)) { try { if (gtm == null) { @@ -3366,7 +3312,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per public void showTToolConfiguration() { JFrameBasicText jft = new JFrameBasicText("Your configuration of TTool ...", "Default configuration:\n-----------------------\n" + ConfigurationTTool.getConfiguration(systemcOn) - + "\nProject configuration:\n-----------------------\n" + SpecConfigTTool.getConfiguration(systemcOn), + + "\nProject configuration:\n-----------------------\n" + SpecConfigTTool.getConfiguration(systemcOn), IconManager.imgic76); jft.setIconImage(IconManager.img8); //jft.setSize(700, 800); @@ -3819,45 +3765,44 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } } - } else if (tp instanceof SystemCAMSPanel) { //Ajout CD - - SystemCAMSPanel camsp = (SystemCAMSPanel) tp; - JDialogSelectSystemCAMSBlock.validated = camsp.validated; - JDialogSelectSystemCAMSBlock.ignored = camsp.ignored; - Vector<TGComponent> camsBlocksToValidate = new Vector<TGComponent>(); - JDialogSelectSystemCAMSBlock jdsscb = new JDialogSelectSystemCAMSBlock(frame, camsBlocksToValidate, camsp.camsbdp.getComponentList(), "Block Parameter"); - if (!automatic) { - GraphicLib.centerOnParent(jdsscb); - jdsscb.setVisible(true); - } else { - jdsscb.closeDialog(); - } - - if (camsBlocksToValidate.size() > 0) { - camsp.validated = JDialogSelectSystemCAMSBlock.validated; - camsp.ignored = JDialogSelectSystemCAMSBlock.ignored; - expandToWarnings(); - expandToErrors(); - if (b) { - setMode(MainGUI.GEN_SYSTEMC_OK); - setMode(MainGUI.MODEL_OK); - ret = true; - if (!automatic) { - JOptionPane.showMessageDialog(frame, - "0 error, " + getCheckingWarnings().size() + " warning(s). You can now perform verifications (safety, security, performance) or generate executable code", - "Syntax analysis successful on SystemC-AMS", - JOptionPane.INFORMATION_MESSAGE); - } - } else { - if (!automatic) { - JOptionPane.showMessageDialog(frame, - "The SystemC-AMS contains several errors", - "Syntax analysis failed", - JOptionPane.INFORMATION_MESSAGE); - } - } - } - + } else if (tp instanceof SysCAMSComponentDesignPanel) { + SysCAMSComponentDesignPanel syscamscdp = (SysCAMSComponentDesignPanel) tp; + JDialogSelectSysCAMSComponent.validated = syscamscdp.validated; + JDialogSelectSysCAMSComponent.ignored = syscamscdp.ignored; + Vector<TGComponent> syscamsComponentsToValidate = new Vector<TGComponent>(); + JDialogSelectSysCAMSComponent jdssyscamsc = new JDialogSelectSysCAMSComponent(frame, syscamsComponentsToValidate, syscamscdp.syscamsctdp.getComponentList(), "Choosing SystemC-AMS components to validate"); + if (!automatic) { + GraphicLib.centerOnParent(jdssyscamsc); + jdssyscamsc.setVisible(true); // Blocked until dialog has been closed + } else { + jdssyscamsc.closeDialog(); + } + if (syscamsComponentsToValidate.size() > 0) { + syscamscdp.validated = JDialogSelectSysCAMSComponent.validated; + syscamscdp.ignored = JDialogSelectSysCAMSComponent.ignored; +// b = gtm.translateSysCAMSComponentDesign(syscamsComponentsToValidate, syscamscdp, jdssyscamsc.getOptimize()); + expandToWarnings(); + expandToErrors(); + if (b) { + //setMode(MainGUI.MODEL_OK); + setMode(MainGUI.GEN_SYSTEMC_OK); + setMode(MainGUI.MODEL_OK); + ret = true; + if (!automatic) { + JOptionPane.showMessageDialog(frame, + "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate make proofs (safety, security and performance) or generate executable code", + "Syntax analysis successful on SystemC-AMS designs", + JOptionPane.INFORMATION_MESSAGE); + } + } else { + if (!automatic) { + JOptionPane.showMessageDialog(frame, + "The SystemC-AMS design contains several errors", + "Syntax analysis failed", + JOptionPane.INFORMATION_MESSAGE); + } + } + } } else if (tp instanceof TMLArchiPanel) { tmlap = (TMLArchiPanel) tp; JDialogSelectTMLNodes.validated = tmlap.validated; @@ -4933,7 +4878,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per if (file != null) { path = file.getAbsolutePath(); } - TraceManager.addDev("Generating TML code: " + file.getAbsolutePath()); + TraceManager.addDev("Generating TML code: "+file.getAbsolutePath()); if (gtm.generateTMLTxt(path)) { TraceManager.addDev("Done TML generation"); return ConfigurationTTool.TMLCodeDirectory; @@ -6020,7 +5965,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ((TMLComponentDesignPanel) tp).addTMLActivityDiagram(s); setPanelMode(); } - + public TMLActivityDiagramPanel getReferencedTMLActivityDiagramPanel(TDiagramPanel _tdp, String name) { TURTLEPanel tp; TMLActivityDiagramPanel tmladp; @@ -6098,7 +6043,35 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return ll; } + + public List<TGComponent> getAllSysCAMSComponents() { + TURTLEPanel tp; + List<TGComponent> ll = new LinkedList<TGComponent>(); + + for (int i = 0; i < tabs.size(); i++) { + tp = tabs.elementAt(i); + + if (tp instanceof SysCAMSComponentDesignPanel) { + ll.addAll(((SysCAMSComponentDesignPanel) tp).syscamsctdp.getComponentList()); + } + } + + return ll; + } + + public ArrayList<SysCAMSComponentTaskDiagramPanel> getAllPanelsReferencingSysCAMSCompositeComponent(SysCAMSCompositeComponent syscamscc) { + TURTLEPanel tp; + ArrayList<SysCAMSComponentTaskDiagramPanel> foundPanels = new ArrayList<SysCAMSComponentTaskDiagramPanel>(); + for (int i = 0; i < tabs.size(); i++) { + tp = tabs.elementAt(i); + if (tp instanceof SysCAMSComponentDesignPanel) { + ((SysCAMSComponentDesignPanel) tp).syscamsctdp.getPanelsUsingAComponent(syscamscc, foundPanels); + } + } + return foundPanels; + } + public void removeTClass(TURTLEPanel tp, String s) { if (!(tp instanceof DesignPanel)) { return; @@ -6237,6 +6210,17 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } + public void updateReferenceToSysCAMSCompositeComponent(SysCAMSCompositeComponent tmlcc) { + TURTLEPanel tp; + + for (int i = 0; i < tabs.size(); i++) { + tp = tabs.elementAt(i); + if (tp instanceof SysCAMSComponentDesignPanel) { + ((SysCAMSComponentDesignPanel) tp).syscamsctdp.updateReferenceToSysCAMSCompositeComponent(tmlcc); + } + } + } + public TMLCCompositeComponent getCompositeComponent(String name) { int index = name.indexOf("::"); if (index == -1) { @@ -6255,6 +6239,24 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return ((TMLComponentDesignPanel) (tp)).tmlctdp.getCompositeComponentByName(componentName); } + + public SysCAMSCompositeComponent getSysCAMSCompositeComponent(String name) { + int index = name.indexOf("::"); + if (index == -1) { + return null; + } + + String panelName = name.substring(0, index); + String componentName = name.substring(index + 2, name.length()); + + TURTLEPanel tp = getTURTLEPanel(panelName); + + if ((tp == null) || (!(tp instanceof SysCAMSComponentDesignPanel))) { + return null; + } + + return ((SysCAMSComponentDesignPanel) (tp)).syscamsctdp.getCompositeComponentByName(componentName); + } public AvatarSMDPanel getAvatarSMDPanel(int indexDesign, String name) { @@ -6369,6 +6371,11 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per TURTLEPanel tp = tabs.elementAt(indexDesign); tp.tabbedPane.setTitleAt(0, name); } + + public void setSysCAMSComponentTaskDiagramName(int indexDesign, String name) { + TURTLEPanel tp = tabs.elementAt(indexDesign); + tp.tabbedPane.setTitleAt(0, name); + } public void setTMLArchitectureDiagramName(int indexDesign, String name) { TURTLEPanel tp = tabs.elementAt(indexDesign); @@ -7855,6 +7862,34 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ErrorGUI.exit(ErrorGUI.ERROR_TAB); return false; } + + public boolean newSysCAMSTaskName(TURTLEPanel tp, String old, String niou) { + JTabbedPane jtp = tp.tabbedPane; + for (int i = 0; i < jtp.getTabCount(); i++) { + if (jtp.getTitleAt(i).equals(niou)) { + return false; + } + } + for (int i = 0; i < jtp.getTabCount(); i++) { + if (jtp.getTitleAt(i).equals(old)) { + jtp.setTitleAt(i, niou); + jtp.setToolTipTextAt(i, "Opens the SystemC-AMS diagram of " + niou); + TDiagramPanel tdp; + //change panel name + for (int j = 0; j < tp.panels.size(); j++) { + tdp = tp.panels.elementAt(j); + if (tdp.getName().equals(old)) { + tdp.setName(niou); + } + } + + return true; + } + } + // internal error + ErrorGUI.exit(ErrorGUI.ERROR_TAB); + return false; + } public boolean nameComponentInUse(TURTLEPanel tp, String old, String niou) { JTabbedPane jtp = tp.tabbedPane; @@ -7895,6 +7930,36 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ErrorGUI.exit(ErrorGUI.ERROR_TAB); return false; } + + public boolean newSysCAMSComponentTaskName(TURTLEPanel tp, String old, String niou) { + JTabbedPane jtp = tp.tabbedPane; + for (int i = 0; i < jtp.getTabCount(); i++) { + if (jtp.getTitleAt(i).equals(niou)) { + return false; + } + } + TraceManager.addDev("old " + old + " niou " + niou); + for (int i = 0; i < jtp.getTabCount(); i++) { + TraceManager.addDev("Tab " + i + " = " + mainTabbedPane.getTitleAt(i)); + if (jtp.getTitleAt(i).equals(old)) { + jtp.setTitleAt(i, niou); + jtp.setToolTipTextAt(i, "Opens the SystemC-AMS diagram of " + niou); + TDiagramPanel tdp; + //change panel name + for (int j = 0; j < tp.panels.size(); j++) { + tdp = tp.panels.elementAt(j); + if (tdp.getName().equals(old)) { + tdp.setName(niou); + } + } + + return true; + } + } + // internal error + ErrorGUI.exit(ErrorGUI.ERROR_TAB); + return false; + } public void cloneTab(int index) { String s = gtm.makeXMLFromTurtleModeling(index, "_cloned"); @@ -8813,7 +8878,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per private JPopupMenu menu; private JMenuItem rename, remove, moveRight, moveLeft, newDesign, newAnalysis, newDeployment, newRequirement/*, newTMLDesign*/, newTMLComponentDesign, newTMLArchi, newProactiveDesign, newTURTLEOSDesign, - newNCDesign, sort, clone, newAttackTree, newFaultTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo, newSystemCAMS; + newNCDesign, sort, clone, newAttackTree, newFaultTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo, newSysCAMS; private JMenuItem newAVATARAnalysis; public PopupListener(MainGUI _mgui) { @@ -8871,7 +8936,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per newTMLComponentDesign = createMenuItem("New Partitioning - Functional view"); newTMLArchi = createMenuItem("New Partitioning - Architecture and Mapping"); newTMLCP = createMenuItem("New Partitioning - Communication Pattern"); - newSystemCAMS = createMenuItem("New SystemC-AMS Block Diagram"); //ajout CD + newSysCAMS = createMenuItem("New SystemC-AMS Diagram"); newProactiveDesign = createMenuItem("New Proactive Design"); newTURTLEOSDesign = createMenuItem("New TURTLE-OS Design"); newNCDesign = createMenuItem("New Network Calculus Design"); @@ -8958,7 +9023,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per menu.add(newTMLCP); menu.add(newTMLArchi); menu.addSeparator(); - menu.add(newSystemCAMS);//ajout CD + menu.add(newSysCAMS); menu.addSeparator(); } } @@ -8981,6 +9046,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } + + private JMenuItem createMenuItem(String s) { JMenuItem item = new JMenuItem(s); item.setActionCommand(s); @@ -9106,10 +9173,10 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } else if (e.getSource() == newAVATARAnalysis) { ModeManager.setMode(CREATE_NEW_PANEL, actions, mainBar, mgui); mgui.newAvatarAnalysis(); - } else if (e.getSource() == newSystemCAMS) { //ajout CD - ModeManager.setMode(CREATE_NEW_PANEL, actions, mainBar, mgui); - mgui.newSystemCAMS(); - } + } else if (e.getSource() == newSysCAMS) { + ModeManager.setMode(CREATE_NEW_PANEL, actions, mainBar, mgui); + mgui.newSysCAMS(); + } } }; } @@ -9147,7 +9214,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } } - } // Get the currently opened architecture panel diff --git a/src/main/java/ui/MalformedModelingException.java b/src/main/java/ui/MalformedModelingException.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/MalformedTMLDesignException.java b/src/main/java/ui/MalformedTMLDesignException.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/MalformedTURTLEModelingException.java b/src/main/java/ui/MalformedTURTLEModelingException.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ModeManager.java b/src/main/java/ui/ModeManager.java old mode 100755 new mode 100644 index d771aec8268fe34be460b41fd63a79520aadd676..2653a34d44eca7d04f40e9ef08c627440300c25e --- a/src/main/java/ui/ModeManager.java +++ b/src/main/java/ui/ModeManager.java @@ -105,8 +105,7 @@ public class ModeManager { //actions[TGUIAction.ACT_MODEL_CHECKING].setEnabled(true);//DG 06.02. //actions[TGUIAction.ACT_ONECLICK_RTLOTOS_RG].setEnabled(true); //actions[TGUIAction.ACT_ONECLICK_LOTOS_RG].setEnabled(true); - actions[TGUIAction.ACT_SAVE_AS_PROJECT].setEnabled(true); - actions[TGUIAction.ACT_SAVE_AS_MODEL].setEnabled(true); + actions[TGUIAction.ACT_SAVE_AS].setEnabled(true); actions[TGUIAction.ACT_IMPORT_LIB].setEnabled(true); actions[TGUIAction.ACT_SAVE].setEnabled(false); if (TDiagramPanel.copyData != null) { diff --git a/src/main/java/ui/NCPanel.java b/src/main/java/ui/NCPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/NoComponentException.java b/src/main/java/ui/NoComponentException.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/PartOfHighInvariant.java b/src/main/java/ui/PartOfHighInvariant.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/PartOfInvariant.java b/src/main/java/ui/PartOfInvariant.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/PostJavaCode.java b/src/main/java/ui/PostJavaCode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/PreJavaCode.java b/src/main/java/ui/PreJavaCode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ProactiveDesignPanel.java b/src/main/java/ui/ProactiveDesignPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/RequirementPanel.java b/src/main/java/ui/RequirementPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ScalableTGComponent.java b/src/main/java/ui/ScalableTGComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/SpecificActionAfterAdd.java b/src/main/java/ui/SpecificActionAfterAdd.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/SpecificActionAfterMove.java b/src/main/java/ui/SpecificActionAfterMove.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/StoppableGUIElement.java b/src/main/java/ui/StoppableGUIElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/SwallowTGComponent.java b/src/main/java/ui/SwallowTGComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/SwallowedTGComponent.java b/src/main/java/ui/SwallowedTGComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/SysCAMSComponentDesignPanel.java b/src/main/java/ui/SysCAMSComponentDesignPanel.java new file mode 100644 index 0000000000000000000000000000000000000000..5aba677fd0855431f1ca476af10c4a29a9c058f9 --- /dev/null +++ b/src/main/java/ui/SysCAMSComponentDesignPanel.java @@ -0,0 +1,178 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici + * + * ludovic.apvrille AT enst.fr + * andrea.enrici 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; + +import myutil.GraphicLib; +import ui.syscams.*; +import ui.util.IconManager; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.util.Vector; + +/** + * Class SysCAMSComponentDesignPanel + * Managenemt of SystemC-AMS component-based design panels + * Creation: 22/04/2018 + * @version 1.0 22/04/2018 + * @author Irina Kit Yan LEE + * @see MainGUI + */ + +public class SysCAMSComponentDesignPanel extends TURTLEPanel { + + public SysCAMSComponentTaskDiagramPanel syscamsctdp; + + public Vector<TGComponent> validated, ignored; + + public SysCAMSComponentDesignPanel(MainGUI _mgui) { + super(_mgui); + + // Issue #41 Ordering of tabbed panes + tabbedPane = GraphicLib.createTabbedPane();//new JTabbedPane(); + + cl = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e){ + mgui.paneDesignAction(e); + } + }; + + tabbedPane.addChangeListener(cl); + tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui)); + + // Issue #41: Ordering of tabbed panes + tabbedPane.setTabLayoutPolicy( JTabbedPane.SCROLL_TAB_LAYOUT ); + } + + public void init() { + + // Toolbar + SysCAMSComponentTaskDiagramToolBar toolBarSysCAMS = new SysCAMSComponentTaskDiagramToolBar(mgui); + toolbars.add(toolBarSysCAMS); + + toolBarPanel = new JPanel(); + toolBarPanel.setLayout(new BorderLayout()); + + // Diagram + syscamsctdp = new SysCAMSComponentTaskDiagramPanel(mgui, toolBarSysCAMS); + syscamsctdp.setName("SystemC-AMS Component Diagram"); + syscamsctdp.tp = this; + tdp = syscamsctdp; + panels.add(syscamsctdp); // Always first in list + JScrollDiagramPanel jsp = new JScrollDiagramPanel(syscamsctdp); + syscamsctdp.jsp = jsp; + jsp.setWheelScrollingEnabled(true); + jsp.getVerticalScrollBar().setUnitIncrement( MainGUI.INCREMENT ); + toolBarPanel.add(toolBarSysCAMS, BorderLayout.NORTH); + toolBarPanel.add(jsp, BorderLayout.CENTER); + tabbedPane.addTab("SystemC-AMS Component Diagram", IconManager.imgic1208, toolBarPanel, "Opens SysCAMS component diagram"); + tabbedPane.setSelectedIndex(0); + + mgui.changeMade(syscamsctdp, TDiagramPanel.NEW_COMPONENT); + } + + public String saveHeaderInXml(String extensionToName) { + if (extensionToName == null) { + return "<Modeling type=\"SystemC-AMS\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; + } + return "<Modeling type=\"SystemC-AMS\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n"; + + } + + public String saveTailInXml() { + return "</Modeling>\n\n\n"; + } + + public String toString() { + return mgui.getTitleAt(this) + "(SystemC-AMS Component Application diagram)"; + } + + public SysCAMSPrimitiveComponent getPrimitiveComponentByName(String _name) { + return syscamsctdp.getPrimitiveComponentByName(_name); + } +// +// public String[] getCompOutChannels(){ +// return syscamsctdp.getCompOutChannels(); +// } +// +// public String[] getCompInChannels(){ +// return syscamsctdp.getCompInChannels(); +// } +// +// public java.util.List<String> getAllSysCAMSCommunicationNames(String _name) { +// return syscamsctdp.getAllSysCAMSCommunicationNames(_name); +// } +// +// public java.util.List<String> getAllSysCAMSInputPorts( String _name ) { +// return syscamsctdp.getAllSysCAMSInputPorts( _name ); +// } + + public java.util.List<String> getAllCompositeComponent(String _name) { + return syscamsctdp.getAllCompositeComponent(_name); + } + + public Vector<String> getAllSysCAMSTasksAttributes() { + return syscamsctdp.getAllSysCAMSTasksAttributes(); + } + + public java.util.List<String> getAllSysCAMSTaskNames(String _name) { + return syscamsctdp.getAllSysCAMSTaskNames(_name); + } + + public String[] getAllOutTDF(String nameOfComponent) { + return syscamsctdp.getAllOutTDF(nameOfComponent); + } + + public String[] getAllInTDF(String nameOfComponent) { + return syscamsctdp.getAllInTDF(nameOfComponent); + } + + public String[] getAllOutDE(String nameOfComponent) { + return syscamsctdp.getAllOutDE(nameOfComponent); + } + + public String[] getAllInDE(String nameOfComponent) { + return syscamsctdp.getAllInDE(nameOfComponent); + } +} diff --git a/src/main/java/ui/SysCAMSPanelTranslator.java b/src/main/java/ui/SysCAMSPanelTranslator.java new file mode 100644 index 0000000000000000000000000000000000000000..c079ba37db0273b461a025e3c53c0faf5d1cd763 --- /dev/null +++ b/src/main/java/ui/SysCAMSPanelTranslator.java @@ -0,0 +1,172 @@ +/* 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; + +import syscamstranslator.*; +import ui.syscams.*; + +import java.util.*; + +/** + * Class SysCAMSPanelTranslator + * Translation of semantics of SystemC-AMS Diagrams + * Creation: 08/05/2018 + * @version 1.0 08/05/2018 + * @author Irina Kit Yan LEE +*/ + +public class SysCAMSPanelTranslator { + + private List<TGComponent> tgcComponents; + + private List<SysCAMSTComponent> syscamsComponents; + private List<SysCAMSTConnector> syscamsConnectors; + + public SysCAMSPanelTranslator(SysCAMSComponentTaskDiagramPanel _syscamsDiagramPanel) { + tgcComponents = _syscamsDiagramPanel.getComponentList(); + + syscamsComponents = new LinkedList<SysCAMSTComponent>(); + syscamsConnectors = new LinkedList<SysCAMSTConnector>(); + + MakeListOfComponent(_syscamsDiagramPanel); + } + + private void MakeListOfComponent(SysCAMSComponentTaskDiagramPanel syscamsDiagramPanel) { + + Map<TGComponent, SysCAMSTComponent> syscamsMap = new HashMap<TGComponent, SysCAMSTComponent>(); + + for (TGComponent dp : tgcComponents) { + if (dp instanceof SysCAMSBlockTDF) { + SysCAMSBlockTDF blockTDF = (SysCAMSBlockTDF) dp; + + String blockTDFName = blockTDF.getValue(); + int period = blockTDF.getPeriod(); + String processCode = blockTDF.getProcessCode(); + + SysCAMSTBlockTDF syscamsBlockTDF = new SysCAMSTBlockTDF(blockTDFName, period, processCode); + + syscamsMap.put(dp, syscamsBlockTDF); + syscamsComponents.add(syscamsBlockTDF); + + } else if (dp instanceof SysCAMSBlockDE) { + SysCAMSBlockDE blockDE = (SysCAMSBlockDE) dp; + + String blockDEName = blockDE.getValue(); + int period = blockDE.getPeriod(); + + SysCAMSTBlockDE syscamsBlockDE = new SysCAMSTBlockDE(blockDEName, period); + + syscamsMap.put(dp, syscamsBlockDE); + syscamsComponents.add(syscamsBlockDE); + } else if (dp instanceof SysCAMSCompositeComponent) { + SysCAMSCompositeComponent cluster = (SysCAMSCompositeComponent) dp; + + String clusterName = cluster.getValue(); + + SysCAMSTCluster syscamsCluster = new SysCAMSTCluster(clusterName); + + syscamsMap.put(dp, syscamsCluster); + syscamsComponents.add(syscamsCluster); + } else if (dp instanceof SysCAMSPortConverter) { + SysCAMSPortConverter portConverter = (SysCAMSPortConverter) dp; + + String portName = portConverter.getValue(); + int period = portConverter.getPeriod(); + int rate = portConverter.getRate(); + int delay = portConverter.getDelay(); + String type = portConverter.getConvType(); + String origin = portConverter.getOrigin(); + + SysCAMSTPortConverter syscamsClusterPort = new SysCAMSTPortConverter(portName, period, rate, delay, origin, type); + + syscamsMap.put(dp, syscamsClusterPort); + syscamsComponents.add(syscamsClusterPort); + } else if (dp instanceof SysCAMSPortTDF) { + SysCAMSPortTDF portTDF = (SysCAMSPortTDF) dp; + + String portName = portTDF.getValue(); + int period = portTDF.getPeriod(); + int rate = portTDF.getRate(); + int delay = portTDF.getDelay(); + String type = portTDF.getTDFType(); + String origin = portTDF.getOrigin(); + + SysCAMSTPortTDF syscamsPortTDF = new SysCAMSTPortTDF(portName, period, rate, delay, origin, type); + + syscamsMap.put(dp, syscamsPortTDF); + syscamsComponents.add(syscamsPortTDF); + } else if (dp instanceof SysCAMSPortDE) { + SysCAMSPortDE portDE = (SysCAMSPortDE) dp; + + String portName = portDE.getValue(); + int period = portDE.getPeriod(); + int rate = portDE.getRate(); + int delay = portDE.getDelay(); + String type = portDE.getDEType(); + String origin = portDE.getOrigin(); + + SysCAMSTPortDE syscamsPortDE = new SysCAMSTPortDE(portName, period, rate, delay, origin, type); + + syscamsMap.put(dp, syscamsPortDE); + syscamsComponents.add(syscamsPortDE); + } else if (dp instanceof SysCAMSPortConnector) { + SysCAMSPortConnector connector = (SysCAMSPortConnector) dp; + + TGConnectingPoint connectingPoint1 = connector.get_p1(); + TGConnectingPoint connectingPoint2 = connector.get_p2(); + + TGComponent owner_p1 = syscamsDiagramPanel.getComponentToWhichBelongs(connectingPoint1); + TGComponent owner_p2 = syscamsDiagramPanel.getComponentToWhichBelongs(connectingPoint2); + + SysCAMSTComponent avowner_p1 = syscamsMap.get(owner_p1); + SysCAMSTComponent avowner_p2 = syscamsMap.get(owner_p2); + + SysCAMSTConnectingPoint avConnectingPoint1 = new SysCAMSTConnectingPoint(avowner_p1); + SysCAMSTConnectingPoint avConnectingPoint2 = new SysCAMSTConnectingPoint(avowner_p2); + + SysCAMSTConnector avconnector = new SysCAMSTConnector(avConnectingPoint1, avConnectingPoint2); + syscamsConnectors.add(avconnector); + } + } + } + + public SysCAMSSpecification getSysCAMSSpecification() { + return new SysCAMSSpecification(syscamsComponents, syscamsConnectors); + } +} \ No newline at end of file diff --git a/src/main/java/ui/SysmlsecMethodologyPanel.java b/src/main/java/ui/SysmlsecMethodologyPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/SystemCAMSPanel.java b/src/main/java/ui/SystemCAMSPanel.java deleted file mode 100755 index 19587244f2999b9acaf9975317b845d3b20b6add..0000000000000000000000000000000000000000 --- a/src/main/java/ui/SystemCAMSPanel.java +++ /dev/null @@ -1,140 +0,0 @@ -/* 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; - -import myutil.GraphicLib; -import ui.het.CAMSBlockDiagramToolBar; -import ui.het.CAMSBlockDiagramPanel; -import ui.util.IconManager; -import ui.TDiagramPanel; -import ui.window.JDialogCAMSBlocks; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.util.Vector; - -/** - * Class SystemCAMSPanel - * Managenemt of TML architecture panels - * Creation: 23/06/2017 - * @version 0.1 23/06/2107 - * @author Côme DEMARIGNY - * @see MainGUI - */ -public class SystemCAMSPanel extends TURTLEPanel { - public SystemCAMSPanel scp; - public CAMSBlockDiagramPanel camsbdp; - public TURTLEPanel tp; - public TDiagramPanel tdp; - public Vector<TGComponent> validated, ignored; - - public SystemCAMSPanel(MainGUI _mgui) { - super(_mgui); - - tabbedPane = GraphicLib.createTabbedPane();//new JTabbedPane(); - - cl = new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e){ - mgui.paneDesignAction(e); - } - }; - tabbedPane.addChangeListener(cl); - tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui)); - } - - public void init() { - - // Class Diagram toolbar - CAMSBlockDiagramToolBar camstoolBar = new CAMSBlockDiagramToolBar(mgui); - toolbars.add(camstoolBar); - toolBarPanel = new JPanel(); - toolBarPanel.setLayout(new BorderLayout()); - - //Class Diagram Panel - camsbdp = new CAMSBlockDiagramPanel(mgui, camstoolBar); - camsbdp.setName("SystemC-AMS Diagram"); - - // Diagram toolbar - camsbdp.tp = this; - tp = scp; - panels.add(camsbdp); // Always first in list - JScrollDiagramPanel jsp = new JScrollDiagramPanel(camsbdp); - camsbdp.jsp = jsp; - jsp.setWheelScrollingEnabled(true); - jsp.getVerticalScrollBar().setUnitIncrement( MainGUI.INCREMENT ); - toolBarPanel.add(camstoolBar, BorderLayout.NORTH); - toolBarPanel.add(jsp, BorderLayout.CENTER); - tabbedPane.addTab("SystemC-AMS Diagram", IconManager.imgic60, toolBarPanel, "opens SystemC-AMS diagram"); - tabbedPane.setSelectedIndex(0); - mgui.changeMade(camsbdp, TDiagramPanel.NEW_COMPONENT); - - - } - - public String saveHeaderInXml(String extensionToName) { - if (extensionToName == null) { - return "<Modeling type=\"SystemC-AMS\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; - } - return "<Modeling type=\"SystemC-AMS\" nameTab=\"" + mgui.getTabName(this) + extensionToName +"\" >\n"; - } - - public String saveTailInXml() { - return "</Modeling>\n\n\n"; - } - - public String toString() { - return mgui.getTitleAt(this) + " (SystemC-AMS Diagram)"; - } - - public void renameMapping(String oldName, String newName) { - if (scp != null) { - scp.renameMapping(oldName, newName); - } - } - - public CAMSBlockDiagramPanel getCAMSBlockDiagramPanel(){ - return camsbdp; - } -} diff --git a/src/main/java/ui/TAction.java b/src/main/java/ui/TAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TAttribute.java b/src/main/java/ui/TAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TClassAndGateDS.java b/src/main/java/ui/TClassAndGateDS.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TClassInterface.java b/src/main/java/ui/TClassInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TClassSynchroInterface.java b/src/main/java/ui/TClassSynchroInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TDPWithAttributes.java b/src/main/java/ui/TDPWithAttributes.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TDiagramMouseManager.java b/src/main/java/ui/TDiagramMouseManager.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TDiagramPanel.java b/src/main/java/ui/TDiagramPanel.java old mode 100755 new mode 100644 index d19697e2f1f2df753f686c8ba6762db00600b7f1..17aa47f8f0f841eb3da59bd3279ae41e87b0e986 --- a/src/main/java/ui/TDiagramPanel.java +++ b/src/main/java/ui/TDiagramPanel.java @@ -52,16 +52,15 @@ import ui.avatarmad.AvatarMADAssumption; import ui.avatarrd.AvatarRDRequirement; import ui.avatarsmd.AvatarSMDState; import ui.cd.*; -import ui.het.CAMSBlock; -import ui.het.CAMSBlockConnector; -import ui.het.CAMSBlockDiagramPanel; -import ui.het.CAMSConnectingPoint; import ui.ncdd.NCEqNode; import ui.ncdd.NCRouteArtifact; import ui.ncdd.NCSwitchNode; import ui.ncdd.NCTrafficArtifact; import ui.oscd.TOSClass; import ui.req.Requirement; +import ui.syscams.SysCAMSCompositeComponent; +import ui.syscams.SysCAMSPrimitiveComponent; +import ui.syscams.SysCAMSRecordComponent; import ui.tmlcd.TMLTaskOperator; import ui.tmlcompd.TMLCCompositeComponent; import ui.tmlcompd.TMLCPrimitiveComponent; @@ -114,7 +113,6 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { protected List<TGComponent> componentList; protected TGConnectingPoint selectedConnectingPoint; - protected CAMSConnectingPoint selectedCAMSConnectingPoints; protected TGComponent componentPointed; protected TGComponent componentPopup; protected TToolBar ttb; @@ -184,7 +182,6 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { protected int y2; protected Vector<Point> listPoint; protected TGConnectingPoint p1, p2; - protected CAMSConnectingPoint cp1, cp2; protected int type; // For component selection @@ -502,9 +499,6 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { if (this.javaVisible && (tgc.hasPostJavaCode() || tgc.hasPreJavaCode())) tgc.drawJavaCode(g); - - if (this instanceof CAMSBlockDiagramPanel) //Connecting points should always be visible in System-C AMS panels - tgc.drawTGConnectingPoint(g, this.type); } // Draw name of component selected @@ -948,10 +942,6 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { return selectedConnectingPoint; } - public CAMSConnectingPoint getSelectedCAMSConnectingPoint() { - return selectedCAMSConnectingPoints; - } - // Adding component public TGComponent addComponent(int x, int y, boolean swallow) { //TraceManager.addDev("Add component"); @@ -1096,46 +1086,6 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { listPoint = null; } - public void addingCAMSConnector() { - listPoint = new Vector<Point>(); - cp1 = getSelectedCAMSConnectingPoint(); - x1 = cp1.getX(); - y1 = cp1.getY(); - selectedConnectingPoint.setFree(false); - } - - public void setAddingCAMSConnector(int _x2, int _y2) { - x2 = _x2; - y2 = _y2; - } - - public void addPointToCAMSConnector(int x, int y) { - listPoint.addElement(new Point(x, y)); - x1 = x; - y1 = y; - } - - public void finishAddingConnector(CAMSConnectingPoint cp2) { - CAMSBlockConnector camsco = TGComponentManager.addCAMSConnector(cp1.getX(), cp1.getY(), mgui.getIdButtonSelected(), this, cp1, cp2, listPoint); - if (camsco != null) { - TraceManager.addDev("Adding connector"); - cp2.setFree(false); - this.componentList.add(0, camsco); - if (camsco instanceof SpecificActionAfterAdd) { - ((SpecificActionAfterAdd) camsco).specificActionAfterAdd(); - } - stopAddingConnector(false); - cp1.setFree(false); - cp1 = null; - cp2 = null; - } else { - TraceManager.addDev("Cancel adding connector"); - cp2.setFree(true); - stopAddingConnector(true); - cp1.setFree(true); - } - } - // -------------mark @@ -2755,6 +2705,25 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { } }); } + + public String findSysCAMSPrimitiveComponentName(String name) { + return this.findGoodName(name, new NameChecker() { + public boolean checkSysCAMSCPrimitiveComponent(SysCAMSPrimitiveComponent o, String name) { + return o.getValue().equals(name); + } + + public boolean checkSysCAMSRecordComponent(SysCAMSRecordComponent o, String name) { + return o.getValue().equals(name); + } + + public boolean checkSysCAMSCompositeComponent(SysCAMSCompositeComponent o, String name) { + for (int i = 0; i < o.getNbInternalTGComponent(); i++) + if (this.isNameAlreadyTaken(o.getInternalTGComponent(i), name)) + return true; + return false; + } + }); + } public String findTMLRecordComponentName(String name) { return this.findTMLPrimitiveComponentName(name); @@ -2804,16 +2773,6 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { }); } - public String findCAMSBlockName(String name) { - return this.findGoodName(name, new NameChecker() { - public boolean checkCAMSBlock(CAMSBlock o, String name) { - if (o.getValue().equals(name)) - return true; - return o.hasBlockWithName(); - } - }); - } - public String findAvatarSMDStateName(String name) { return this.findGoodName(name, new NameChecker() { public boolean checkAvatarSMDState(AvatarSMDState o, String name) { diff --git a/src/main/java/ui/TGAutoAdjust.java b/src/main/java/ui/TGAutoAdjust.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCAttributeBox.java b/src/main/java/ui/TGCAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCNote.java b/src/main/java/ui/TGCNote.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCOneLineText.java b/src/main/java/ui/TGCOneLineText.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCPanelInfo.java b/src/main/java/ui/TGCPanelInfo.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCPointOfConnector.java b/src/main/java/ui/TGCPointOfConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCScalableOneLineText.java b/src/main/java/ui/TGCScalableOneLineText.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCScalableWithInternalComponent.java b/src/main/java/ui/TGCScalableWithInternalComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCScalableWithoutInternalComponent.java b/src/main/java/ui/TGCScalableWithoutInternalComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCScalableWithoutInternalComponentOneLineText.java b/src/main/java/ui/TGCScalableWithoutInternalComponentOneLineText.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCTimeInterval.java b/src/main/java/ui/TGCTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCWithInternalComponent.java b/src/main/java/ui/TGCWithInternalComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCWithOneLineText.java b/src/main/java/ui/TGCWithOneLineText.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGCWithoutInternalComponent.java b/src/main/java/ui/TGCWithoutInternalComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGComponent.java b/src/main/java/ui/TGComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGComponentAndUPPAALQuery.java b/src/main/java/ui/TGComponentAndUPPAALQuery.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGComponentManager.java b/src/main/java/ui/TGComponentManager.java old mode 100755 new mode 100644 index dacd22c7869066ddc1fd79f39cffafdb34fb3e47..1996150bc529212afeabe55c7fce0a814e2e5ab6 --- a/src/main/java/ui/TGComponentManager.java +++ b/src/main/java/ui/TGComponentManager.java @@ -60,9 +60,6 @@ import ui.dd.TGConnectorLinkNode; import ui.diplodocusmethodology.*; import ui.ebrdd.*; import ui.ftd.*; -import ui.het.CAMSBlock; -import ui.het.CAMSBlockConnector; -import ui.het.CAMSConnectingPoint; import ui.iod.*; import ui.ncdd.*; import ui.osad.*; @@ -70,6 +67,7 @@ import ui.oscd.*; import ui.procsd.*; import ui.prosmd.*; import ui.req.*; +import ui.syscams.*; import ui.sysmlsecmethodology.*; import ui.tmlad.*; import ui.tmlcd.*; @@ -337,7 +335,12 @@ public class TGComponentManager { // SystemC-AMS public static final int CAMS_CONNECTOR = 1601; - public static final int CAMS_BLOCK = 1602; + public static final int CAMS_BLOCK_TDF = 1602; + public static final int CAMS_BLOCK_DE = 1603; + public static final int CAMS_PORT_TDF = 1604; + public static final int CAMS_PORT_DE = 1605; + public static final int CAMS_PORT_CONVERTER = 1606; + public static final int CAMS_CLUSTER = 1607; // SMD diagram public static final int PROSMD_START_STATE = 2000; @@ -1208,9 +1211,6 @@ public class TGComponentManager { case TMLARCHI_HWANODE: tgc = new TMLArchiHWANode(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; - case TMLARCHI_CAMSNODE: - tgc = new TMLArchiCAMSNode(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); - break; case TMLARCHI_MEMORYNODE: tgc = new TMLArchiMemoryNode(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; @@ -1232,9 +1232,25 @@ public class TGComponentManager { case TMLARCHI_KEY: tgc = new TMLArchiKey(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; - case CAMS_BLOCK: - tgc = new CAMSBlock(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); - break; + // SystemC-AMS + case CAMS_BLOCK_TDF: + tgc = new SysCAMSBlockTDF(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case CAMS_BLOCK_DE: + tgc = new SysCAMSBlockDE(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case CAMS_PORT_TDF: + tgc = new SysCAMSPortTDF(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case CAMS_PORT_DE: + tgc = new SysCAMSPortDE(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case CAMS_PORT_CONVERTER: + tgc = new SysCAMSPortConverter(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case CAMS_CLUSTER: + tgc = new SysCAMSCompositeComponent(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; // Communication patterns + SD case TMLCP_CHOICE: @@ -1615,9 +1631,21 @@ public class TGComponentManager { } else if (tgc instanceof AvatarADAssociationConnector) { return AAD_ASSOCIATION_CONNECTOR; - //SystemC-AMS -----mark - } else if (tgc instanceof CAMSBlockConnector) { + // SystemC-AMS + } else if (tgc instanceof SysCAMSPortConnector) { return CAMS_CONNECTOR; + } else if (tgc instanceof SysCAMSBlockTDF) { + return CAMS_BLOCK_TDF; + } else if (tgc instanceof SysCAMSBlockDE) { + return CAMS_BLOCK_DE; + } else if (tgc instanceof SysCAMSPortTDF) { + return CAMS_PORT_TDF; + } else if (tgc instanceof SysCAMSPortDE) { + return CAMS_PORT_DE; + } else if (tgc instanceof SysCAMSPortConverter) { + return CAMS_PORT_CONVERTER; + } else if (tgc instanceof SysCAMSCompositeComponent) { + return CAMS_CLUSTER; // Others } else if (tgc instanceof TADDeterministicDelay) { @@ -1952,8 +1980,6 @@ public class TGComponentManager { return AVATAR_FIREWALL; } else if (tgc instanceof TMLArchiHWANode) { return TMLARCHI_HWANODE; - } else if (tgc instanceof TMLArchiCAMSNode) { - return TMLARCHI_CAMSNODE; } else if (tgc instanceof TMLArchiMemoryNode) { return TMLARCHI_MEMORYNODE; } else if (tgc instanceof TMLArchiDMANode) { @@ -2316,6 +2342,9 @@ public class TGComponentManager { case CONNECTOR_PORT_TMLC: tgc = new TMLCPortConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); break; + case CAMS_CONNECTOR: + tgc = new SysCAMSPortConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + break; case CONNECTOR_NODE_TMLARCHI: tgc = new TMLArchiConnectorNode(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); break; @@ -2364,10 +2393,4 @@ public class TGComponentManager { } - public final static CAMSBlockConnector addCAMSConnector(int x, int y, int id, TDiagramPanel tdp, CAMSConnectingPoint p1, CAMSConnectingPoint p2, Vector<Point> listPoint) { - CAMSBlockConnector cbc = null; - cbc = new CAMSBlockConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); - return cbc; - } - } // Class diff --git a/src/main/java/ui/TGComponentPlugin.java b/src/main/java/ui/TGComponentPlugin.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectingPoint.java b/src/main/java/ui/TGConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectingPointComment.java b/src/main/java/ui/TGConnectingPointComment.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectingPointGroup.java b/src/main/java/ui/TGConnectingPointGroup.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectingPointTmp.java b/src/main/java/ui/TGConnectingPointTmp.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectingPointTwoFathers.java b/src/main/java/ui/TGConnectingPointTwoFathers.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectingPointWidthHeight.java b/src/main/java/ui/TGConnectingPointWidthHeight.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnector.java b/src/main/java/ui/TGConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectorAttribute.java b/src/main/java/ui/TGConnectorAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectorBetweenElementsInterface.java b/src/main/java/ui/TGConnectorBetweenElementsInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectorComment.java b/src/main/java/ui/TGConnectorComment.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectorFullArrow.java b/src/main/java/ui/TGConnectorFullArrow.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGConnectorWithCommentConnectionPoints.java b/src/main/java/ui/TGConnectorWithCommentConnectionPoints.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGState.java b/src/main/java/ui/TGState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TGUIAction.java b/src/main/java/ui/TGUIAction.java old mode 100755 new mode 100644 index b28909c4b3505c2cfa752426749fb21b36d282c5..dbaa115ce4281e4209c50cd15f779d16d7741c01 --- a/src/main/java/ui/TGUIAction.java +++ b/src/main/java/ui/TGUIAction.java @@ -77,8 +77,7 @@ public class TGUIAction extends AbstractAction { public static final int ACT_MERGE = 228; public static final int ACT_SAVE = 2; - public static final int ACT_SAVE_AS_PROJECT = 31; - public static final int ACT_SAVE_AS_MODEL = 475; + public static final int ACT_SAVE_AS = 31; public static final int ACT_SAVE_TIF = 213; public static final int ACT_OPEN_TIF = 214; public static final int ACT_OPEN_SD = 268; @@ -276,8 +275,13 @@ public class TGUIAction extends AbstractAction { public static final int TMLSD_EDIT = 391; public static final int CAMS_EDIT = 458; - public static final int CAMS_BLOCK = 459; + public static final int CAMS_BLOCK_TDF = 459; public static final int CAMS_CONNECTOR = 460; + public static final int CAMS_BLOCK_DE = 475; + public static final int CAMS_PORT_TDF = 476; + public static final int CAMS_PORT_DE = 477; + public static final int CAMS_PORT_CONVERTER = 478; + public static final int CAMS_CLUSTER = 479; public static final int EBRDD_EDIT = 271; public static final int EBRDD_CONNECTOR = 272; @@ -631,7 +635,7 @@ public class TGUIAction extends AbstractAction { public static final int MOVE_ENABLED = 463; public static final int FIRST_DIAGRAM = 464; - public static final int NB_ACTION = 476; + public static final int NB_ACTION = 480; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -708,8 +712,7 @@ public class TGUIAction extends AbstractAction { actions[ACT_SAVE_TIF] = new TAction("save-tif-command", "Save TIF specification",IconManager.imgic24, IconManager.imgic25, "Save TIF Specification", "Save in TIF a TURTLE modeling", 0); actions[ACT_OPEN_TIF] = new TAction("open-tif-command", "Open TIF specification",IconManager.imgic24, IconManager.imgic25, "Open TIF Specification", "Open a TURTLE modeling given in TIF", 0); actions[ACT_OPEN_SD] = new TAction("open-sd-command", "Open MSC specification",IconManager.imgic24, IconManager.imgic25, "Open MSC Specification", "Open a MSC specification given in xml format", 0); - actions[ACT_SAVE_AS_PROJECT] = new TAction("saveasproject-command", "Save as Project",IconManager.imgic24, IconManager.imgic25, "Save as Project", "Save an opened or a new TTool modeling under a new project", 0); - actions[ACT_SAVE_AS_MODEL] = new TAction("saveasmodel-command", "Save as Model",IconManager.imgic24, IconManager.imgic25, "Save as Model", "Save an opened or a new TTool modeling under a new model", 0); + actions[ACT_SAVE_AS] = new TAction("saveas-command", "Save as",IconManager.imgic24, IconManager.imgic25, "Save as", "Save an opened or a new TTool modeling under a new name", 0); actions[ACT_QUIT] = new TAction("quit-command", "Quit", IconManager.imgic26, IconManager.imgic27, "Quit", "Quit TTool", 'Q'); actions[ACT_SAVE_LOTOS] = new TAction("save-last-lotos", "Save last RT-LOTOS specification",IconManager.imgic24, IconManager.imgic25, "Save last RT-LOTOS specification", "Save the lastest automatically generated RT-LOTOS specification", 0); @@ -1090,9 +1093,13 @@ public class TGUIAction extends AbstractAction { //System C-AMS actions[CAMS_EDIT] = new TAction("add-action-C-AMS", "Action state", IconManager.imgic100, IconManager.imgic101, "Action state", "Add an action state to the currently opened SystemC-AMS diagram", 0); - actions[CAMS_BLOCK] = new TAction("C-AMS-block", "Add a block", IconManager.imgic5000, IconManager.imgic5000, "Block", "Add a Block to the currently opened SystemC-AMS Diagram", 0); + actions[CAMS_BLOCK_TDF] = new TAction("C-AMS-block-TDF", "Add a TDF block", IconManager.imgic5000, IconManager.imgic5000, "TDF block", "Add a TDF block to the currently opened SystemC-AMS Diagram", 0); + actions[CAMS_BLOCK_DE] = new TAction("C-AMS-block-DE", "Add a DE block", IconManager.imgic5000, IconManager.imgic5000, "DE block", "Add a DE block to the currently opened SystemC-AMS Diagram", 0); actions[CAMS_CONNECTOR] = new TAction("C-AMS-connector", "Add a connection", IconManager.imgic202, IconManager.imgic202, "Connector", "Connects two block of the currently opened SystemC-AMS Diagram", 0); - + actions[CAMS_PORT_TDF] = new TAction("C-AMS-port-TDF", "Add a TDF port", IconManager.imgic8000, IconManager.imgic8000, "TDF port", "Add a TDF port to the currently opened SystemC-AMS Diagram", 0); + actions[CAMS_PORT_DE] = new TAction("C-AMS-port-DE", "Add a DE port", IconManager.imgic8001, IconManager.imgic8001, "DE port", "Add a DE port to the currently opened SystemC-AMS Diagram", 0); + actions[CAMS_PORT_CONVERTER] = new TAction("C-AMS-port-converter", "Add a converter port", IconManager.imgic8003, IconManager.imgic8003, "Converter port", "Add a converter port to the currently opened SystemC-AMS Diagram", 0); + actions[CAMS_CLUSTER] = new TAction("C-AMS-cluster", "Add a cluster", IconManager.imgic5000, IconManager.imgic5000, "Cluster", "Add a cluster to the currently opened SystemC-AMS Diagram", 0); //ProActive State Machine Diagram actions[PROSMD_EDIT] = new TAction("edit-prosmd-diagram", "Edit ProActive state machine diagram", IconManager.imgic100, IconManager.imgic101, "Edit ProActive state machine diagram", "Make it possible to edit the currently opened ProActive state machine diagram", 0); diff --git a/src/main/java/ui/TMLArchiPanel.java b/src/main/java/ui/TMLArchiPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TMLCommunicationPatternPanel.java b/src/main/java/ui/TMLCommunicationPatternPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TMLComponentDesignPanel.java b/src/main/java/ui/TMLComponentDesignPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TMLDesignPanel.java b/src/main/java/ui/TMLDesignPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TMLTaskInterface.java b/src/main/java/ui/TMLTaskInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TOneAttribute.java b/src/main/java/ui/TOneAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TToolBar.java b/src/main/java/ui/TToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TToolUpdater.java b/src/main/java/ui/TToolUpdater.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TTwoAttributes.java b/src/main/java/ui/TTwoAttributes.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TType.java b/src/main/java/ui/TType.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TURTLEDesignPanelInterface.java b/src/main/java/ui/TURTLEDesignPanelInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TURTLEModelChecker.java b/src/main/java/ui/TURTLEModelChecker.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TURTLEModelingDrawer.java b/src/main/java/ui/TURTLEModelingDrawer.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TURTLEOSDesignPanel.java b/src/main/java/ui/TURTLEOSDesignPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TURTLEPanel.java b/src/main/java/ui/TURTLEPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/TURTLEPanelPopupListener.java b/src/main/java/ui/TURTLEPanelPopupListener.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ThreadGUIElement.java b/src/main/java/ui/ThreadGUIElement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/UICheckingError.java b/src/main/java/ui/UICheckingError.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/VectorLRArtifactTClassGate.java b/src/main/java/ui/VectorLRArtifactTClassGate.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/WithAttributes.java b/src/main/java/ui/WithAttributes.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ZoomGraphics.java b/src/main/java/ui/ZoomGraphics.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADActionState.java b/src/main/java/ui/ad/TADActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADArrayGetState.java b/src/main/java/ui/ad/TADArrayGetState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADArraySetState.java b/src/main/java/ui/ad/TADArraySetState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADChoice.java b/src/main/java/ui/ad/TADChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADDeterministicDelay.java b/src/main/java/ui/ad/TADDeterministicDelay.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADJunction.java b/src/main/java/ui/ad/TADJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADNonDeterministicDelay.java b/src/main/java/ui/ad/TADNonDeterministicDelay.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADParallel.java b/src/main/java/ui/ad/TADParallel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADPreemption.java b/src/main/java/ui/ad/TADPreemption.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADSequence.java b/src/main/java/ui/ad/TADSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADStartState.java b/src/main/java/ui/ad/TADStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADStopState.java b/src/main/java/ui/ad/TADStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADTimeCapture.java b/src/main/java/ui/ad/TADTimeCapture.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADTimeInterval.java b/src/main/java/ui/ad/TADTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADTimeLimitedOffer.java b/src/main/java/ui/ad/TADTimeLimitedOffer.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TADTimeLimitedOfferWithLatency.java b/src/main/java/ui/ad/TADTimeLimitedOfferWithLatency.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TActivityDiagramPanel.java b/src/main/java/ui/ad/TActivityDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TActivityDiagramToolBar.java b/src/main/java/ui/ad/TActivityDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ad/TGConnectingPointAD.java b/src/main/java/ui/ad/TGConnectingPointAD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/atd/ATDAttack.java b/src/main/java/ui/atd/ATDAttack.java index 22ee35e5f565976190b511128d11aa62f262ee3b..5d65a5723f20274805a6eadfa2e687a55da06019 100644 --- a/src/main/java/ui/atd/ATDAttack.java +++ b/src/main/java/ui/atd/ATDAttack.java @@ -1,26 +1,26 @@ /* 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, @@ -31,12 +31,14 @@ * 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.atd; import myutil.GraphicLib; @@ -52,18 +54,17 @@ import javax.swing.*; import java.awt.*; /** - * Class ATDAttack - * Attack -> SysML value type - * Creation: 09/12/2009 - * - * @author Ludovic APVRILLE - * @version 1.0 09/12/2009 + * Class ATDAttack + * Attack -> SysML value type + * Creation: 09/12/2009 + * @version 1.0 09/12/2009 + * @author Ludovic APVRILLE */ public class ATDAttack extends TGCScalableWithInternalComponent implements SwallowedTGComponent, WithAttributes, CheckableAccessibility, CanBeDisabled { private int textY1 = 3; - // private int textY2 = 3; + // private int textY2 = 3; - // private static int arc = 7; + // private static int arc = 7; //private int textX = 10; protected String oldValue = ""; @@ -78,11 +79,11 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall private boolean displayText = true; private int textX = 10; - public ATDAttack(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + public ATDAttack(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); width = 125; - height = (int) (40 * tdp.getZoom()); + height = (int)(40 * tdp.getZoom()); minWidth = 100; nbConnectingPoint = 24; @@ -100,7 +101,7 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall connectingPoint[9] = new ATDAttackConnectingPoint(this, 0, 0, true, true, 1.0, 0.75); connectingPoint[10] = new ATDAttackConnectingPoint(this, 0, 0, true, true, 0.25, 1.0); connectingPoint[11] = new ATDAttackConnectingPoint(this, 0, 0, true, true, 0.75, 1.0); - connectingPoint[12] = new ATDCountermeasureConnectingPoint(this, 0, 0, true, true, 0.5, 0.0); + connectingPoint[12] = new ATDCountermeasureConnectingPoint(this, 0, 0, true, true, 0.5, 0.0); connectingPoint[13] = new ATDCountermeasureConnectingPoint(this, 0, 0, true, true, 0.0, 0.5); connectingPoint[14] = new ATDCountermeasureConnectingPoint(this, 0, 0, true, true, 1.0, 0.5); connectingPoint[15] = new ATDCountermeasureConnectingPoint(this, 0, 0, true, true, 0.5, 1.0); @@ -150,6 +151,7 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall rescaled = false; + // Must set the font size .. // Find the biggest font not greater than max_font size // By Increment of 1 @@ -183,9 +185,9 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall }*/ - float scale = (float) (f.getSize() * tdp.getZoom()); + float scale = (float)(f.getSize()*tdp.getZoom()); scale = Math.min(maxFontSize, scale); - currentFontSize = (int) scale; + currentFontSize = (int)scale; if (scale < minFontSize) { displayText = false; } else { @@ -206,7 +208,7 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall g.setColor(ColorManager.ATD_ATTACK_DISABLED); } - g.fill3DRect(x + 1, y + 1, width - 1, height - 1, true); + g.fill3DRect(x+1, y+1, width-1, height-1, true); g.setColor(c); // Strings @@ -215,54 +217,55 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall //TraceManager.addDev("display text of attack=" + displayText); if (displayText) { - f = f.deriveFont((float) currentFontSize); + f = f.deriveFont((float)currentFontSize); g.setFont(f); //Font f0 = g.getFont(); - boolean cannotWriteAttack = (height < (2 * currentFontSize + (int) (textY1 * tdp.getZoom()))); + boolean cannotWriteAttack = (height < (2 * currentFontSize + (int)(textY1 * tdp.getZoom()))); //TraceManager.addDev("Zoom=" + tdp.getZoom() + " Cannot write attack=" + cannotWriteAttack + "Font=" + f0); if (cannotWriteAttack) { - w = g.getFontMetrics().stringWidth(value); - int h = currentFontSize + (int) (textY1 * tdp.getZoom()); - if ((w < (2 * textX + width)) && (h < height)) { - g.drawString(value, x + (width - w) / 2, y + h); + w = g.getFontMetrics().stringWidth(value); + int h = currentFontSize + (int)(textY1 * tdp.getZoom()); + if ((w < (2*textX + width)) && (h < height)) { + g.drawString(value, x + (width - w)/2, y + h); } else { - w = g.getFontMetrics().stringWidth(ster); - if ((w < (2 * textX + width)) && (h < height)) { - g.drawString(ster, x + (width - w) / 2, y + h); + w = g.getFontMetrics().stringWidth(ster); + if ((w < (2*textX + width)) && (h < height)) { + g.drawString(ster, x + (width - w)/2, y + h); } } } else { g.setFont(f.deriveFont(Font.BOLD)); - int h = currentFontSize + (int) (textY1 * tdp.getZoom()); + int h = currentFontSize + (int)(textY1 * tdp.getZoom()); int cumulated = 0; w = g.getFontMetrics().stringWidth(ster); - if ((w < (2 * textX + width)) && (h < height)) { - g.drawString(ster, x + (width - w) / 2, y + h); + if ((w < (2*textX + width)) && (h < height)) { + g.drawString(ster, x + (width - w)/2, y + h); cumulated = h; } g.setFont(f); - w = g.getFontMetrics().stringWidth(value); - h = cumulated + currentFontSize + (int) (textY1 * tdp.getZoom()); - if ((w < (2 * textX + width)) && (h < height)) { + w = g.getFontMetrics().stringWidth(value); + h = cumulated + currentFontSize + (int)(textY1 * tdp.getZoom()); + if ((w < (2*textX + width)) && (h < height)) { //TraceManager.addDev("Drawing value=" + value); - g.drawString(value, x + (width - w) / 2, y + h); + g.drawString(value, x + (width - w)/2, y + h); } else { - g.drawString(value, x + (width - w) / 2, y + h); + g.drawString(value, x + (width - w)/2, y + h); //TraceManager.addDev("--------------------------------------------------- Cannot draw value=" + value); //TraceManager.addDev("w=" + w + " val=" + (2*textX + width) + "h=" + h + " height=" + height + " zoom=" + tdp.getZoom() + " Font=" + f0); } } - if (!isEnabled()) { - String val = "disabled"; - w = g.getFontMetrics().stringWidth(val); - //int h = currentFontSize + (int)(textY1 * tdp.getZoom()); - g.setFont(f.deriveFont(Font.ITALIC)); - g.drawString(val, x + (width - w - 5), y + height - 2); - } - + if (!isEnabled()) { + String val = "disabled"; + w = g.getFontMetrics().stringWidth(val); + //int h = currentFontSize + (int)(textY1 * tdp.getZoom()); + g.setFont(f.deriveFont(Font.ITALIC)); + g.drawString(val, x + (width - w - 5), y + height - 2); + } + + } else { TraceManager.addDev("-------------------------------------------------- Cannot display text of attack"); } @@ -284,12 +287,12 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall if (currentFontSize != -1) { if (currentFontSize != f0.getSize()) { - g.setFont(f0.deriveFont((float) currentFontSize)); + g.setFont(f0.deriveFont((float)currentFontSize)); } } - int w = Math.max(g.getFontMetrics().stringWidth(value), g.getFontMetrics().stringWidth(ster)); - int w1 = Math.max((int) (minWidth * tdp.getZoom()), w + 2 * textX); + int w = Math.max(g.getFontMetrics().stringWidth(value), g.getFontMetrics().stringWidth(ster)); + int w1 = Math.max((int)(minWidth*tdp.getZoom()), w + 2 * textX); //System.out.println("width=" + width + " w1=" + w1 + " w2=" + w2 + " value=" + value); if (w1 != width) { @@ -318,9 +321,9 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall boolean error = false; JDialogAttack dialog = new JDialogAttack(frame, "Setting attack attributes", this); - // dialog.setSize(450, 350); + // dialog.setSize(450, 350); GraphicLib.centerOnParent(dialog, 450, 350); - dialog.setVisible(true); // blocked until dialog has been closed + dialog.setVisible( true ); // blocked until dialog has been closed if (!dialog.isRegularClose()) { return false; @@ -348,9 +351,9 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall if (error) { JOptionPane.showMessageDialog(frame, - "Name is non-valid", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "Name is non-valid", + "Error", + JOptionPane.INFORMATION_MESSAGE); } return !error; @@ -371,31 +374,31 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall protected String translateExtraParam() { StringBuffer sb = new StringBuffer("<extraparam>\n"); sb.append("<info description=\"" + description); - sb.append("\" root=\"" + isRootAttack); + sb.append("\" root=\"" +isRootAttack); sb.append("\" />\n"); sb.append("</extraparam>\n"); return new String(sb); } @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ //System.out.println("*** load extra synchro ***"); try { NodeList nli; Node n1, n2; Element elt; - // int t1id; + // int t1id; String sdescription = null; - // String prio; + // String prio; String isRoot = null; - for (int i = 0; i < nl.getLength(); i++) { + for(int i=0; i<nl.getLength(); i++) { n1 = nl.item(i); //System.out.println(n1); if (n1.getNodeType() == Node.ELEMENT_NODE) { nli = n1.getChildNodes(); - for (int j = 0; j < nli.getLength(); j++) { + for(int j=0; j<nli.getLength(); j++) { n2 = nli.item(j); //System.out.println(n2); if (n2.getNodeType() == Node.ELEMENT_NODE) { @@ -445,4 +448,6 @@ public class ATDAttack extends TGCScalableWithInternalComponent implements Swall } + + } diff --git a/src/main/java/ui/avatarad/AvatarADAcceptEventAction.java b/src/main/java/ui/avatarad/AvatarADAcceptEventAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADAction.java b/src/main/java/ui/avatarad/AvatarADAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADAssociationConnector.java b/src/main/java/ui/avatarad/AvatarADAssociationConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADChoice.java b/src/main/java/ui/avatarad/AvatarADChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADJunction.java b/src/main/java/ui/avatarad/AvatarADJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADParallel.java b/src/main/java/ui/avatarad/AvatarADParallel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADPartition.java b/src/main/java/ui/avatarad/AvatarADPartition.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADSendSignalAction.java b/src/main/java/ui/avatarad/AvatarADSendSignalAction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADStartState.java b/src/main/java/ui/avatarad/AvatarADStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADStopFlow.java b/src/main/java/ui/avatarad/AvatarADStopFlow.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarad/AvatarADStopState.java b/src/main/java/ui/avatarad/AvatarADStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarbd/AvatarBDDataType.java b/src/main/java/ui/avatarbd/AvatarBDDataType.java index b6a6de30a662c734eca065cc6405603d04aede15..e010f3a42f12bf0321b16a5e447dd2967aeaaf04 100644 --- a/src/main/java/ui/avatarbd/AvatarBDDataType.java +++ b/src/main/java/ui/avatarbd/AvatarBDDataType.java @@ -1,26 +1,26 @@ /* 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, @@ -31,12 +31,14 @@ * 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.avatarbd; import myutil.GenericTree; @@ -54,14 +56,13 @@ import java.util.LinkedList; /** - * Class AvatarBDDataType - * Data type. To be used in AVATAR Block Diagrams - * Creation: 18/06/2010 - * - * @author Ludovic APVRILLE - * @version 1.1 18/06/2010 + * Class AvatarBDDataType + * Data type. To be used in AVATAR Block Diagrams + * Creation: 18/06/2010 + * @version 1.1 18/06/2010 + * @author Ludovic APVRILLE */ -public class AvatarBDDataType extends TGCScalableWithInternalComponent implements GenericTree { +public class AvatarBDDataType extends TGCScalableWithInternalComponent implements GenericTree { private int textY1 = 3; private String stereotype = "datatype"; @@ -72,12 +73,12 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement private int textX = 7; private int limitName = -1; - // private int limitAttr = -1; - // private int limitMethod = -1; + // private int limitAttr = -1; + // private int limitMethod = -1; // Icon private int iconSize = 15; - // private boolean iconIsDrawn = false; + // private boolean iconIsDrawn = false; // TAttribute, AvatarMethod, AvatarSignal @@ -85,7 +86,7 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement public String oldValue; - public AvatarBDDataType(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + public AvatarBDDataType(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); width = 250; @@ -115,7 +116,7 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement myImageIcon = IconManager.imgic700; - myAttributes = new LinkedList<TAttribute>(); + myAttributes = new LinkedList<TAttribute> (); actionOnAdd(); } @@ -141,27 +142,27 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement int maxCurrentFontSize = Math.max(0, Math.min(height, maxFontSize)); int w0, w1, w2; - f = f.deriveFont((float) maxCurrentFontSize); + f = f.deriveFont((float)maxCurrentFontSize); g.setFont(f); //System.out.println("max current font size:" + maxCurrentFontSize); - while (maxCurrentFontSize > (minFontSize - 1)) { + while(maxCurrentFontSize > (minFontSize-1)) { w0 = g.getFontMetrics().stringWidth(value); w1 = g.getFontMetrics().stringWidth(ster); w2 = Math.min(w0, w1); - if (w2 < (width - (2 * textX))) { + if (w2 < (width - (2*textX))) { break; } - maxCurrentFontSize--; - f = f.deriveFont((float) maxCurrentFontSize); + maxCurrentFontSize --; + f = f.deriveFont((float)maxCurrentFontSize); g.setFont(f); } currentFontSize = maxCurrentFontSize; - if (currentFontSize < minFontSize) { + if(currentFontSize <minFontSize) { displayText = false; } else { displayText = true; - f = f.deriveFont((float) currentFontSize); + f = f.deriveFont((float)currentFontSize); g.setFont(f); } @@ -173,27 +174,27 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement g.draw3DRect(x, y, width, height, true); g.setColor(ColorManager.AVATAR_DATATYPE); - g.fill3DRect(x + 1, y + 1, width - 1, height - 1, true); + g.fill3DRect(x+1, y+1, width-1, height-1, true); g.setColor(c); // Strings int w; int h = 0; if (displayText) { - f = f.deriveFont((float) currentFontSize); + f = f.deriveFont((float)currentFontSize); Font f0 = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); w = g.getFontMetrics().stringWidth(ster); - h = currentFontSize + (int) (textY1 * tdp.getZoom()); - if ((w < (2 * textX + width)) && (h < height)) { - g.drawString(ster, x + (width - w) / 2, y + h); + h = currentFontSize + (int)(textY1 * tdp.getZoom()); + if ((w < (2*textX + width)) && (h < height)) { + g.drawString(ster, x + (width - w)/2, y +h); } g.setFont(f0); - w = g.getFontMetrics().stringWidth(value); - h = 2 * (currentFontSize + (int) (textY1 * tdp.getZoom())); - if ((w < (2 * textX + width)) && (h < height)) { - g.drawString(value, x + (width - w) / 2, y + h); + w = g.getFontMetrics().stringWidth(value); + h = 2* (currentFontSize + (int)(textY1 * tdp.getZoom())); + if ((w < (2*textX + width)) && (h < height)) { + g.drawString(value, x + (width - w)/2, y + h); } limitName = y + h; } else { @@ -202,14 +203,14 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement g.setFont(fold); - h = h + 2; + h = h +2; if (h < height) { - g.drawLine(x, y + h, x + width, y + h); + g.drawLine(x, y+h, x+width, y+h); } // Icon - if ((width > 30) && (height > (iconSize + 2 * textX))) { - // iconIsDrawn = true; + if ((width>30) && (height > (iconSize + 2*textX))) { + // iconIsDrawn = true; g.drawImage(IconManager.img5100, x + width - iconSize - textX, y + textX, null); } // else { @@ -219,21 +220,21 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement int cpt = h; // Attributes if (tdp.areAttributesVisible()) { - // limitAttr = -1; + // limitAttr = -1; int index = 0; String attr; TAttribute a; - int si = Math.min(12, (int) ((float) currentFontSize - 2)); + int si = Math.min(12, (int)((float)currentFontSize - 2)); f = g.getFont(); - f = f.deriveFont((float) si); + f = f.deriveFont((float)si); g.setFont(f); int step = si + 2; - while (index < myAttributes.size()) { - cpt += step; + while(index < myAttributes.size()) { + cpt += step ; if (cpt >= (height - textX)) { break; } @@ -242,21 +243,21 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement w = g.getFontMetrics().stringWidth(attr); if ((w + (2 * textX) + 1) < width) { g.drawString(attr, x + textX, y + cpt); - // limitAttr = y + cpt; + // limitAttr = y + cpt; } else { attr = "..."; w = g.getFontMetrics().stringWidth(attr); if ((w + textX + 2) < width) { g.drawString(attr, x + textX + 1, y + cpt); - // limitAttr = y + cpt; + // limitAttr = y + cpt; } else { // skip attribute cpt -= step; } } - index++; + index ++; } - } + } // else { // limitAttr = -1; // } @@ -264,6 +265,7 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement g.setFont(fold); + // Icon //g.drawImage(IconManager.imgic1100.getImage(), x + 4, y + 4, null); //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); @@ -289,30 +291,30 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement public boolean editOndoubleClick(JFrame frame, int _x, int _y) { // On the name ? - if ((((limitName == -1) && (displayText) && (_y <= (y + 2 * currentFontSize)))) || ((displayText) && (_y < limitName))) { + if ((((limitName == -1) && (displayText) && (_y <= (y + 2*currentFontSize)))) || ((displayText) && (_y < limitName))) { oldValue = value; //String text = getName() + ": "; - String s = (String) JOptionPane.showInputDialog(frame, "Datatype name", - "setting value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, - null, - getValue()); + String s = (String)JOptionPane.showInputDialog(frame, "Datatype name", + "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 data type: the new name is not a valid name", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "Could not change the name of the data type: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); return false; } if (!tdp.isAvatarBlockNameUnique(s)) { JOptionPane.showMessageDialog(frame, - "Could not change the name of the data type: the new name is already in use", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "Could not change the name of the data type: the new name is already in use", + "Error", + JOptionPane.INFORMATION_MESSAGE); return false; } @@ -323,9 +325,9 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement return true; } else { JOptionPane.showMessageDialog(frame, - "Could not change the name of the data type: this name is already in use", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "Could not change the name of the data type: this name is already in use", + "Error", + JOptionPane.INFORMATION_MESSAGE); setValue(oldValue); } } @@ -334,11 +336,9 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement // And so -> attributes! - JDialogAvatarBlock jdab = new JDialogAvatarBlock(myAttributes, null, null, null, frame, - "Setting attributes of " + value, "Attribute", 0, - null, false, null); + JDialogAvatarBlock jdab = new JDialogAvatarBlock(myAttributes, null, null, null, frame, "Setting attributes of " + value, "Attribute", 0, null, false, null); setJDialogOptions(jdab); - // jdab.setSize(650, 575); + // jdab.setSize(650, 575); GraphicLib.centerOnParent(jdab, 650, 575); jdab.setVisible(true); // blocked until dialog has been closed //makeValue(); @@ -370,9 +370,9 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement //System.out.println("Loading extra params of " + value); //value = ""; StringBuffer sb = new StringBuffer("<extraparam>\n"); - for (int i = 0; i < myAttributes.size(); i++) { + for(int i=0; i<myAttributes.size(); i++) { //System.out.println("Attribute:" + i); - a = myAttributes.get(i); + a = myAttributes.get (i); //System.out.println("Attribute:" + i + " = " + a.getId()); //value = value + a + "\n"; sb.append("<Attribute access=\""); @@ -392,7 +392,7 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement } @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ try { NodeList nli; Node n1, n2; @@ -404,12 +404,12 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement //System.out.println("Loading attributes"); //System.out.println(nl.toString()); - for (int i = 0; i < nl.getLength(); i++) { + for(int i=0; i<nl.getLength(); i++) { n1 = nl.item(i); //System.out.println(n1); if (n1.getNodeType() == Node.ELEMENT_NODE) { nli = n1.getChildNodes(); - for (int j = 0; j < nli.getLength(); j++) { + for(int j=0; j<nli.getLength(); j++) { n2 = nli.item(j); //System.out.println(n2); if (n2.getNodeType() == Node.ELEMENT_NODE) { @@ -436,7 +436,7 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement } TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); ta.isAvatar = true; - myAttributes.add(ta); + myAttributes.add (ta); } } } @@ -460,13 +460,12 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement public LinkedList<TAttribute> getAttributeList() { return myAttributes; } - - public void addAttribute(TAttribute ta) { + public void addAttribute(TAttribute ta){ myAttributes.add(ta); } public String toString() { - return "Data type: " + getValue(); + return "Data type: " + getValue(); } public int getChildCount() { @@ -476,15 +475,15 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent implement public Object getChild(int index) { - return this.myAttributes.get(index); + return this.myAttributes.get(index); } public int getIndexOfChild(Object child) { - if (child instanceof TAttribute) { - return this.myAttributes.indexOf(child); + if (child instanceof TAttribute) { + return this.myAttributes.indexOf(child); } - + return -1; } - + } diff --git a/src/main/java/ui/avatarbd/AvatarBDFirewall.java b/src/main/java/ui/avatarbd/AvatarBDFirewall.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarbd/AvatarBDLibraryFunction.java b/src/main/java/ui/avatarbd/AvatarBDLibraryFunction.java index 1fa414916a3eaf0e21f837b2e6dc4ce2d5674d4f..cb67068a67f3ab2a5d1f6f760008f9614efa3f60 100644 --- a/src/main/java/ui/avatarbd/AvatarBDLibraryFunction.java +++ b/src/main/java/ui/avatarbd/AvatarBDLibraryFunction.java @@ -1,26 +1,26 @@ /* 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, @@ -31,12 +31,14 @@ * 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.avatarbd; import myutil.GraphicLib; @@ -58,8 +60,8 @@ import java.util.LinkedList; /** * This class represent a Library Function block on an avatar block diagram. * - * @author Florian LUGOU * @version 1.0 04.08.2016 + * @author Florian LUGOU */ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent, AvatarBDStateMachineOwner, Comparable<AvatarBDLibraryFunction> { @@ -91,7 +93,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent /** * The vertical spacing between lines. */ - private static final int paddingVertical = 3; + private static final int paddingVertical = 3; /** * Used to know where the user double clicked @@ -107,7 +109,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent * Used to know where the user double clicked */ private int limitSignals; - + /** * Current font size. */ @@ -151,17 +153,26 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent /** * Standard constructor for a library function block. * - * @param x The absolute coordinate of the block along X. - * @param y The absolute coordinate of the block along Y. - * @param minX The minimum authorized coordinate along X. - * @param maxX The maximum authorized coordinate along X. - * @param minY The minimum authorized coordinate along Y. - * @param maxY The maximum authorized coordinate along Y. - * @param pos Indicates whether the position is considered as relative to this father's component. - * @param father The father component in the diagram. - * @param tdp The diagram panel. + * @param x + * The absolute coordinate of the block along X. + * @param y + * The absolute coordinate of the block along Y. + * @param minX + * The minimum authorized coordinate along X. + * @param maxX + * The maximum authorized coordinate along X. + * @param minY + * The minimum authorized coordinate along Y. + * @param maxY + * The maximum authorized coordinate along Y. + * @param pos + * Indicates whether the position is considered as relative to this father's component. + * @param father + * The father component in the diagram. + * @param tdp + * The diagram panel. */ - public AvatarBDLibraryFunction( + public AvatarBDLibraryFunction ( int x, int y, int minX, @@ -193,16 +204,16 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent // Find a new unused name int i; - for (i = 0; i < 100; i++) { + for (i=0; i<100; i++) { String tmpName = "LibraryFunction" + i; - if (this.tdp.isAvatarBlockNameUnique(tmpName) && - true) { // TODO: check if no other tab has same name + if (this.tdp.isAvatarBlockNameUnique (tmpName) && + true) { // TODO: check if no other tab has same name this.name = tmpName; this.value = tmpName; break; } } - if (i == 100) { + if (i == 100) { // TODO: throw exception } @@ -212,27 +223,29 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent // TODO: change that this.myImageIcon = IconManager.imgic700; - this.parameters = new LinkedList<TAttribute>(); - this.attributes = new LinkedList<TAttribute>(); - this.signals = new LinkedList<AvatarSignal>(); - this.returnAttributes = new LinkedList<TAttribute>(); - this.methods = new LinkedList<AvatarMethod>(); + this.parameters = new LinkedList<TAttribute> (); + this.attributes = new LinkedList<TAttribute> (); + this.signals = new LinkedList<AvatarSignal> (); + this.returnAttributes = new LinkedList<TAttribute> (); + this.methods = new LinkedList<AvatarMethod> (); // Ask the panel to add a tab for the state machine diagram. this.actionOnAdd(); } - public TDiagramPanel getDiagramPanel() { + public TDiagramPanel getDiagramPanel () { return this.tdp; } - public String getFunctionName() { + public String getFunctionName () { return this.name; } - public String getFullyQualifiedName() { + public String getFullyQualifiedName() + { String result = ""; - if (this.father != null && (this.father instanceof AvatarBDBlock)) { + if (this.father != null && (this.father instanceof AvatarBDBlock)) + { result = ((AvatarBDBlock) this.father).getFullyQualifiedName() + "."; } result += this.name; @@ -240,87 +253,88 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent return result; } - public LinkedList<TAttribute> getParameters() { + public LinkedList<TAttribute> getParameters () { return this.parameters; } - public void resetParameters() { - this.parameters = new LinkedList<TAttribute>(); + public void resetParameters () { + this.parameters = new LinkedList<TAttribute> (); } - public void addParameter(TAttribute parameter) { - this.parameters.add(parameter); + public void addParameter (TAttribute parameter) { + this.parameters.add (parameter); } - public LinkedList<AvatarSignal> getSignals() { + public LinkedList<AvatarSignal> getSignals () { return this.signals; } - public void resetSignals() { - this.signals = new LinkedList<AvatarSignal>(); + public void resetSignals () { + this.signals = new LinkedList<AvatarSignal> (); } - public void addSignal(AvatarSignal signal) { - this.signals.add(signal); + public void addSignal (AvatarSignal signal) { + this.signals.add (signal); } - public LinkedList<TAttribute> getAttributes() { + public LinkedList<TAttribute> getAttributes () { return this.attributes; } - public void resetAttributes() { - this.attributes = new LinkedList<TAttribute>(); + public void resetAttributes () { + this.attributes = new LinkedList<TAttribute> (); } - public void addAttribute(TAttribute attribute) { - this.attributes.add(attribute); + public void addAttribute (TAttribute attribute) { + this.attributes.add (attribute); } - public LinkedList<TAttribute> getReturnAttributes() { + public LinkedList<TAttribute> getReturnAttributes () { return this.returnAttributes; } - public void resetReturnAttributes() { - this.returnAttributes = new LinkedList<TAttribute>(); + public void resetReturnAttributes () { + this.returnAttributes = new LinkedList<TAttribute> (); } - public void addReturnAttribute(TAttribute returnAttribute) { - this.returnAttributes.add(returnAttribute); + public void addReturnAttribute (TAttribute returnAttribute) { + this.returnAttributes.add (returnAttribute); } - public LinkedList<AvatarMethod> getMethods() { + public LinkedList<AvatarMethod> getMethods () { return this.methods; } - public void resetMethods() { - this.methods = new LinkedList<AvatarMethod>(); + public void resetMethods () { + this.methods = new LinkedList<AvatarMethod> (); } - public void addMethod(AvatarMethod method) { - this.methods.add(method); + public void addMethod (AvatarMethod method) { + this.methods.add (method); } @Override - public void internalDrawing(Graphics graph) { - Font font = graph.getFont(); - this.internalDrawingAux(graph); - graph.setFont(font); + public void internalDrawing (Graphics graph) { + Font font = graph.getFont (); + this.internalDrawingAux (graph); + graph.setFont (font); } /** * Draws the Library Function object. * - * @param graph The {@link Graphics} object used to draw this component. + * @param graph + * The {@link Graphics} object used to draw this component. */ - private void internalDrawingAux(Graphics graph) { + private void internalDrawingAux (Graphics graph) { // Draw outer rectangle (for border) - Color c = graph.getColor(); - graph.drawRect(this.x, this.y, this.width, this.height); + Color c = graph.getColor (); + graph.drawRect (this.x, this.y, this.width, this.height); // Draw inner rectangle - graph.setColor(ColorManager.AVATAR_LIBRARYFUNCTION); - graph.fillRect(this.x + 1, this.y + 1, this.width - 1, this.height - 1); - graph.setColor(c); + graph.setColor (ColorManager.AVATAR_LIBRARYFUNCTION); + graph.fillRect (this.x+1, this.y+1, this.width-1, this.height-1); + graph.setColor (c); // limits this.limitName = -1; @@ -330,16 +344,16 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent // h retains the coordinate along X where an element was last drawn int h = 0; - int paddingVertical = (int) (AvatarBDLibraryFunction.paddingVertical * this.tdp.getZoom()); - int paddingHorizontal = (int) (AvatarBDLibraryFunction.paddingHorizontal * this.tdp.getZoom()); + int paddingVertical = (int) (AvatarBDLibraryFunction.paddingVertical * this.tdp.getZoom ()); + int paddingHorizontal = (int) (AvatarBDLibraryFunction.paddingHorizontal * this.tdp.getZoom ()); // Draw icon - this.iconIsDrawn = this.width > IconManager.iconSize + 2 * paddingHorizontal && height > IconManager.iconSize + 2 * paddingHorizontal; + this.iconIsDrawn = this.width > IconManager.iconSize + 2*paddingHorizontal && height > IconManager.iconSize + 2*paddingHorizontal; if (this.iconIsDrawn) - graph.drawImage(IconManager.img5100, this.x + this.width - IconManager.iconSize - paddingHorizontal, this.y + paddingHorizontal, null); + graph.drawImage (IconManager.img5100, this.x + this.width - IconManager.iconSize - paddingHorizontal, this.y + paddingHorizontal, null); - Font font = graph.getFont(); + Font font = graph.getFont (); String ster; if (!this.isCrypto) @@ -347,56 +361,56 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent else ster = "<<" + stereotypeCrypto + ">>"; - if (this.rescaled && !this.tdp.isScaled()) { + if (this.rescaled && !this.tdp.isScaled ()) { this.rescaled = false; // Must set the font size... // Incrementally find the biggest font not greater than max_font size // If font is less than min_font, no text is displayed // This is the maximum font size possible - int maxCurrentFontSize = Math.max(0, Math.min(this.height, (int) (AvatarBDLibraryFunction.maxFontSize * this.tdp.getZoom()))); - font = font.deriveFont((float) maxCurrentFontSize); + int maxCurrentFontSize = Math.max (0, Math.min (this.height, (int) (AvatarBDLibraryFunction.maxFontSize*this.tdp.getZoom ()))); + font = font.deriveFont ((float) maxCurrentFontSize); // Try to decrease font size until we get below the minimum - while (maxCurrentFontSize > (AvatarBDLibraryFunction.minFontSize * this.tdp.getZoom() - 1)) { + while (maxCurrentFontSize > (AvatarBDLibraryFunction.minFontSize*this.tdp.getZoom () - 1)) { // Compute width of name of the function - int w0 = graph.getFontMetrics(font).stringWidth(this.value); + int w0 = graph.getFontMetrics (font).stringWidth (this.value); // Compute width of string stereotype - int w1 = graph.getFontMetrics(font).stringWidth(ster); + int w1 = graph.getFontMetrics (font).stringWidth (ster); // if one of the two width is small enough use this font size - if (Math.min(w0, w1) < this.width - (2 * paddingHorizontal)) + if (Math.min (w0, w1) < this.width - (2*paddingHorizontal)) break; // Decrease font size - maxCurrentFontSize--; + maxCurrentFontSize --; // Scale the font - font = font.deriveFont((float) maxCurrentFontSize); + font = font.deriveFont ((float) maxCurrentFontSize); } // Box is too damn small - if (this.currentFontSize < AvatarBDLibraryFunction.minFontSize * this.tdp.getZoom()) { - maxCurrentFontSize++; + if (this.currentFontSize < AvatarBDLibraryFunction.minFontSize*this.tdp.getZoom ()) { + maxCurrentFontSize ++; // Scale the font - font = font.deriveFont((float) maxCurrentFontSize); + font = font.deriveFont ((float) maxCurrentFontSize); } // Use this font - graph.setFont(font); + graph.setFont (font); this.currentFontSize = maxCurrentFontSize; } else - font = font.deriveFont(this.currentFontSize); + font = font.deriveFont (this.currentFontSize); - graph.setFont(font.deriveFont(Font.BOLD)); - h = graph.getFontMetrics().getAscent() + graph.getFontMetrics().getLeading() + paddingVertical; + graph.setFont (font.deriveFont (Font.BOLD)); + h = graph.getFontMetrics ().getAscent () + graph.getFontMetrics ().getLeading () + paddingVertical; - if (h + graph.getFontMetrics().getDescent() + paddingVertical >= this.height) + if (h + graph.getFontMetrics ().getDescent () + paddingVertical >= this.height) return; // Write stereotype if small enough - int w = graph.getFontMetrics().stringWidth(ster); - if (w + 2 * paddingHorizontal < this.width) - graph.drawString(ster, this.x + (this.width - w) / 2, this.y + h); + int w = graph.getFontMetrics ().stringWidth (ster); + if (w + 2*paddingHorizontal < this.width) + graph.drawString (ster, this.x + (this.width - w)/2, this.y + h); else { // try to draw with "..." instead if (!this.isCrypto) @@ -404,38 +418,38 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent else ster = stereotypeCrypto; - for (int stringLength = ster.length() - 1; stringLength >= 0; stringLength--) { - String abbrev = "<<" + ster.substring(0, stringLength) + "...>>"; - w = graph.getFontMetrics().stringWidth(abbrev); - if (w + 2 * paddingHorizontal < this.width) { - graph.drawString(abbrev, this.x + (this.width - w) / 2, this.y + h); + for (int stringLength = ster.length ()-1; stringLength >= 0; stringLength--) { + String abbrev = "<<" + ster.substring (0, stringLength) + "...>>"; + w = graph.getFontMetrics ().stringWidth (abbrev); + if (w + 2*paddingHorizontal < this.width) { + graph.drawString (abbrev, this.x + (this.width - w)/2, this.y + h); break; } } } // Write value if small enough - graph.setFont(font); - h += graph.getFontMetrics().getHeight() + paddingVertical; - if (h + graph.getFontMetrics().getDescent() + paddingVertical >= this.height) + graph.setFont (font); + h += graph.getFontMetrics ().getHeight () + paddingVertical; + if (h + graph.getFontMetrics ().getDescent () + paddingVertical >= this.height) return; - w = graph.getFontMetrics().stringWidth(this.value); - if (w + 2 * paddingHorizontal < this.width) - graph.drawString(this.value, this.x + (this.width - w) / 2, this.y + h); + w = graph.getFontMetrics ().stringWidth (this.value); + if (w + 2*paddingHorizontal < this.width) + graph.drawString (this.value, this.x + (this.width - w)/2, this.y + h); else { // try to draw with "..." instead - for (int stringLength = this.value.length() - 1; stringLength >= 0; stringLength--) { - String abbrev = this.value.substring(0, stringLength) + "..."; - w = graph.getFontMetrics().stringWidth(abbrev); - if (w + 2 * paddingHorizontal < this.width) { - graph.drawString(abbrev, this.x + (this.width - w) / 2, this.y + h); + for (int stringLength = this.value.length ()-1; stringLength >= 0; stringLength--) { + String abbrev = this.value.substring (0, stringLength) + "..."; + w = graph.getFontMetrics ().stringWidth (abbrev); + if (w + 2*paddingHorizontal < this.width) { + graph.drawString (abbrev, this.x + (this.width - w)/2, this.y + h); break; } } } - h += graph.getFontMetrics().getDescent() + paddingVertical; + h += graph.getFontMetrics ().getDescent () + paddingVertical; // Update lower bound of text this.limitName = this.y + h; @@ -444,21 +458,21 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent return; // Draw separator - graph.drawLine(this.x, this.y + h, this.x + this.width, this.y + h); + graph.drawLine (this.x, this.y+h, this.x+this.width, this.y+h); - if (!this.tdp.areAttributesVisible()) + if (! this.tdp.areAttributesVisible ()) return; // Set font size // int attributeFontSize = Math.min (12, this.currentFontSize - 2); - int attributeFontSize = this.currentFontSize * 5 / 6; - graph.setFont(font.deriveFont((float) attributeFontSize)); - int step = graph.getFontMetrics().getHeight(); + int attributeFontSize = this.currentFontSize*5/6; + graph.setFont (font.deriveFont ((float) attributeFontSize)); + int step = graph.getFontMetrics ().getHeight (); h += paddingVertical; // Parameters - for (TAttribute attr : this.parameters) { + for (TAttribute attr: this.parameters) { h += step; if (h >= this.height - paddingHorizontal) { this.limitParameters = this.y + this.height; @@ -466,20 +480,20 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent } // Get the string for this parameter - String attrString = attr.toAvatarString(); + String attrString = attr.toAvatarString (); // Try to draw it - w = graph.getFontMetrics().stringWidth(attrString); - if (w + 2 * paddingHorizontal < this.width) - graph.drawString(attrString, this.x + paddingHorizontal, this.y + h); + w = graph.getFontMetrics ().stringWidth (attrString); + if (w + 2*paddingHorizontal < this.width) + graph.drawString (attrString, this.x + paddingHorizontal, this.y + h); else { // If we can't, try to draw with "..." instead int stringLength; - for (stringLength = attrString.length() - 1; stringLength >= 0; stringLength--) { - String abbrev = attrString.substring(0, stringLength) + "..."; - w = graph.getFontMetrics().stringWidth(abbrev); - if (w + 2 * paddingHorizontal < this.width) { - graph.drawString(abbrev, this.x + paddingHorizontal, this.y + h); + for (stringLength = attrString.length ()-1; stringLength >= 0; stringLength--) { + String abbrev = attrString.substring (0, stringLength) + "..."; + w = graph.getFontMetrics ().stringWidth (abbrev); + if (w + 2*paddingHorizontal < this.width) { + graph.drawString (abbrev, this.x + paddingHorizontal, this.y + h); break; } } @@ -490,7 +504,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent } } - h += graph.getFontMetrics().getDescent() + paddingVertical; + h += graph.getFontMetrics ().getDescent () + paddingVertical; // Remember the end of parameters this.limitParameters = this.y + h; @@ -498,29 +512,29 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent if (h + paddingVertical >= this.height) return; - graph.drawLine(this.x, this.y + h, this.x + this.width, this.y + h); + graph.drawLine (this.x, this.y+h, this.x+this.width, this.y+h); h += paddingVertical; // Signals - for (AvatarSignal signal : this.signals) { - h += step; + for (AvatarSignal signal: this.signals) { + h += step ; if (h >= this.height - paddingHorizontal) { this.limitSignals = this.y + this.height; return; } - String signalString = "~ " + signal.toString(); - w = graph.getFontMetrics().stringWidth(signalString); - if (w + 2 * paddingHorizontal < this.width) - graph.drawString(signalString, this.x + paddingHorizontal, this.y + h); + String signalString = "~ " + signal.toString (); + w = graph.getFontMetrics ().stringWidth (signalString); + if (w + 2*paddingHorizontal < this.width) + graph.drawString (signalString, this.x + paddingHorizontal, this.y + h); else { // If we can't, try to draw with "..." instead int stringLength; - for (stringLength = signalString.length() - 1; stringLength >= 0; stringLength--) { - String abbrev = signalString.substring(0, stringLength) + "..."; - w = graph.getFontMetrics().stringWidth(abbrev); - if (w + 2 * paddingHorizontal < this.width) { - graph.drawString(abbrev, this.x + paddingHorizontal, this.y + h); + for (stringLength = signalString.length ()-1; stringLength >= 0; stringLength--) { + String abbrev = signalString.substring (0, stringLength) + "..."; + w = graph.getFontMetrics ().stringWidth (abbrev); + if (w + 2*paddingHorizontal < this.width) { + graph.drawString (abbrev, this.x + paddingHorizontal, this.y + h); break; } } @@ -531,7 +545,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent } } - h += graph.getFontMetrics().getDescent() + paddingVertical; + h += graph.getFontMetrics ().getDescent () + paddingVertical; // Remember limit of signals this.limitSignals = this.y + h; @@ -539,29 +553,29 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent if (h + paddingVertical >= this.height) return; - graph.drawLine(this.x, this.y + h, this.x + this.width, this.y + h); + graph.drawLine (this.x, this.y+h, this.x+this.width, this.y+h); h += paddingVertical; // Return Attributes - for (TAttribute attr : this.returnAttributes) { + for (TAttribute attr: this.returnAttributes) { h += step; if (h >= this.height - paddingHorizontal) return; // Get the string for this return attribute - String attrString = attr.toAvatarString(); + String attrString = attr.toAvatarString (); - w = graph.getFontMetrics().stringWidth(attrString); - if (w + 2 * paddingHorizontal < this.width) - graph.drawString(attrString, this.x + paddingHorizontal, this.y + h); + w = graph.getFontMetrics ().stringWidth (attrString); + if (w + 2*paddingHorizontal < this.width) + graph.drawString (attrString, this.x + paddingHorizontal, this.y + h); else { // If we can't, try to draw with "..." instead int stringLength; - for (stringLength = attrString.length() - 1; stringLength >= 0; stringLength--) { - String abbrev = attrString.substring(0, stringLength) + "..."; - w = graph.getFontMetrics().stringWidth(abbrev); - if (w + 2 * paddingHorizontal < this.width) { - graph.drawString(abbrev, this.x + paddingHorizontal, this.y + h); + for (stringLength = attrString.length ()-1; stringLength >= 0; stringLength--) { + String abbrev = attrString.substring (0, stringLength) + "..."; + w = graph.getFontMetrics ().stringWidth (abbrev); + if (w + 2*paddingHorizontal < this.width) { + graph.drawString (abbrev, this.x + paddingHorizontal, this.y + h); break; } } @@ -574,14 +588,14 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent } @Override - public void setName(String s) { - this.tdp.changeStateMachineTabName(this.name, s); + public void setName (String s) { + this.tdp.changeStateMachineTabName (this.name, s); this.name = s; - this.setValue(s); + this.setValue (s); } @Override - public TGComponent isOnMe(int x1, int y1) { + public TGComponent isOnMe (int x1, int y1) { if (GraphicLib.isInRectangle(x1, y1, this.x, this.y, this.width, this.height)) return this; @@ -591,26 +605,26 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent @Override public boolean editOndoubleClick(JFrame frame, int _x, int _y) { - int paddingHorizontal = (int) (AvatarBDLibraryFunction.paddingHorizontal * this.tdp.getZoom()); + int paddingHorizontal = (int) (AvatarBDLibraryFunction.paddingHorizontal*this.tdp.getZoom ()); if (this.iconIsDrawn && GraphicLib.isInRectangle( - _x, - _y, - this.x + this.width - IconManager.iconSize - paddingHorizontal, - this.y + paddingHorizontal, - IconManager.iconSize, - IconManager.iconSize)) { - this.tdp.selectTab(this.getValue()); + _x, + _y, + this.x + this.width - IconManager.iconSize - paddingHorizontal, + this.y + paddingHorizontal, + IconManager.iconSize, + IconManager.iconSize)) { + this.tdp.selectTab (this.getValue ()); return true; } // Click on the name if (_y < limitName) { - String s = (String) JOptionPane.showInputDialog(frame, "Library Function Name", + String s = (String) JOptionPane.showInputDialog (frame, "Library Function Name", "setting value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, null, this.getValue()); - if (s == null || s.isEmpty() || s.equals(this.value)) + if (s == null || s.isEmpty () || s.equals(this.value)) return false; if (!TAttribute.isAValidId(s, false, false)) { @@ -621,7 +635,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent return false; } - if (!this.tdp.isAvatarBlockNameUnique(s)) { + if (!this.tdp.isAvatarBlockNameUnique (s)) { JOptionPane.showMessageDialog(frame, "Could not change the name of the Library Function: the new name is already used by another element.", "Error", @@ -630,7 +644,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent } // Update the name of the tab corresponding to the state machine of the library function - if (!this.tdp.changeStateMachineTabName(this.value, s)) { + if (!this.tdp.changeStateMachineTabName (this.value, s)) { JOptionPane.showMessageDialog(frame, "Could not change the name of the Library Function: this name is already used by another tab.", "Error", @@ -640,7 +654,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent this.name = s; this.value = s; - this.recalculateSize(); + this.recalculateSize (); this.repaint = true; return true; @@ -649,28 +663,28 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent // Click on parameters // Create a new dialog to change parameters, signals, return values, etc. - JDialogAvatarLibraryFunction dialog = new JDialogAvatarLibraryFunction( + JDialogAvatarLibraryFunction dialog = new JDialogAvatarLibraryFunction ( this, frame, "Settings of library function " + value, "Library Function"); - this.setJDialogOptions(dialog); - // dialog.setSize (650, 575); - GraphicLib.centerOnParent(dialog, 650, 575); + this.setJDialogOptions (dialog); + // dialog.setSize (650, 575); + GraphicLib.centerOnParent (dialog,650, 575); // Focus on the right input depending on the part that was clicked. // FIXME: if nothing is displayed, focus will go on tab 2 instead of tab 0 if (_y < this.limitParameters) - dialog.selectTabIndex(0); + dialog.selectTabIndex (0); else if (_y < this.limitSignals) - dialog.selectTabIndex(1); + dialog.selectTabIndex (1); else - dialog.selectTabIndex(2); + dialog.selectTabIndex (2); // Set visible and block until dialog is closed - dialog.setVisible(true); + dialog.setVisible (true); - ((AvatarBDPanel) tdp).updateAllSignalsOnConnectors(); + ((AvatarBDPanel) tdp).updateAllSignalsOnConnectors (); // Tag so that it is rescaled this.rescaled = true; @@ -678,7 +692,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent return true; } - protected void setJDialogOptions(JDialogAvatarLibraryFunction jdab) { + protected void setJDialogOptions (JDialogAvatarLibraryFunction jdab) { /* jdab.addAccess (TAttribute.getStringAccess (TAttribute.PRIVATE)); jdab.addType (TAttribute.getStringAvatarType (TAttribute.BOOLEAN), true); @@ -705,10 +719,10 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent * * @return The string for the corresponding XML element. */ - protected String translateExtraParam() { - StringBuffer sb = new StringBuffer("<extraparam>\n"); + protected String translateExtraParam () { + StringBuffer sb = new StringBuffer ("<extraparam>\n"); sb.append("<CryptoLibraryFunction value=\"" + isCrypto + "\" />\n"); - for (TAttribute attr : this.parameters) { + for (TAttribute attr: this.parameters) { sb.append("<Parameter access=\""); sb.append(attr.getAccess()); sb.append("\" id=\""); @@ -722,13 +736,13 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent sb.append("\" />\n"); } - for (AvatarSignal signal : this.signals) { + for(AvatarSignal signal: this.signals) { sb.append("<Signal value=\""); sb.append(signal.toString()); sb.append("\" />\n"); } - for (TAttribute attr : this.returnAttributes) { + for (TAttribute attr: this.returnAttributes) { sb.append("<ReturnAttribute access=\""); sb.append(attr.getAccess()); sb.append("\" id=\""); @@ -742,7 +756,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent sb.append("\" />\n"); } - for (TAttribute attr : this.attributes) { + for (TAttribute attr: this.attributes) { sb.append("<Attribute access=\""); sb.append(attr.getAccess()); sb.append("\" id=\""); @@ -756,7 +770,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent sb.append("\" />\n"); } - for (AvatarMethod method : this.methods) { + for(AvatarMethod method: this.methods) { sb.append("<Method value=\""); sb.append(method.toSaveString()); sb.append("\" />\n"); @@ -769,19 +783,23 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent /** * Load a Library Function element from a XML description. - * <p> + * * TODO + * @param nl + * The {@link NodeList} representing the XML extraparam node + * @param decX + * Unused. + * @param decY + * Unused. + * @param decId + * Unused. * - * @param nl The {@link NodeList} representing the XML extraparam node - * @param decX Unused. - * @param decY Unused. - * @param decId Unused. * @throws MalformedModelingExpresion When the provided XML is corrupted. */ @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { + public void loadExtraParam (NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { try { - for (int i = 0; i < nl.getLength(); i++) { + for(int i=0; i<nl.getLength(); i++) { Node n1 = nl.item(i); // Ignore if it's not an element @@ -790,7 +808,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent // Fetch the children nodes NodeList nli = n1.getChildNodes(); - for (int j = 0; j < nli.getLength(); j++) { + for(int j=0; j<nli.getLength(); j++) { Node n2 = nli.item(j); // Ignore if it's not an element @@ -798,93 +816,96 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent continue; Element elt = (Element) n2; - switch (elt.getTagName()) { + switch (elt.getTagName ()) { case "CryptoLibraryFunction": - if (elt.getAttribute("value").equals("true")) + if (elt.getAttribute("value").equals ("true")) this.isCrypto = true; break; - case "Parameter": { - Integer access = Integer.decode(elt.getAttribute("access")).intValue(); - Integer type = Integer.decode(elt.getAttribute("type")).intValue(); - String typeOther = elt.getAttribute("typeOther"); - String id = elt.getAttribute("id"); - String valueAtt = elt.getAttribute("value"); - if (valueAtt.equals("null")) - valueAtt = ""; - - if (TAttribute.isAValidId(id, false, false) && TAttribute.isAValidInitialValue(type, valueAtt)) { - if (type == TAttribute.NATURAL) - type = TAttribute.INTEGER; - - TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); - ta.isAvatar = true; - this.parameters.add(ta); + case "Parameter": + { + Integer access = Integer.decode (elt.getAttribute ("access")).intValue (); + Integer type = Integer.decode (elt.getAttribute ("type")).intValue (); + String typeOther = elt.getAttribute ("typeOther"); + String id = elt.getAttribute("id"); + String valueAtt = elt.getAttribute("value"); + if (valueAtt.equals("null")) + valueAtt = ""; + + if (TAttribute.isAValidId (id, false, false) && TAttribute.isAValidInitialValue (type, valueAtt)) { + if (type == TAttribute.NATURAL) + type = TAttribute.INTEGER; + + TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); + ta.isAvatar = true; + this.parameters.add (ta); + } } - } - break; + break; case "Signal": String signal = elt.getAttribute("value"); - if (signal.equals("null")) + if (signal.equals ("null")) break; - AvatarSignal as = AvatarSignal.isAValidSignal(signal); + AvatarSignal as = AvatarSignal.isAValidSignal (signal); if (as != null) - this.signals.add(as); + this.signals.add (as); else TraceManager.addDev("Invalid signal ignored:" + signal); break; - case "ReturnAttribute": { - Integer access = Integer.decode(elt.getAttribute("access")).intValue(); - Integer type = Integer.decode(elt.getAttribute("type")).intValue(); - String typeOther = elt.getAttribute("typeOther"); - String id = elt.getAttribute("id"); - String valueAtt = elt.getAttribute("value"); - if (valueAtt.equals("null")) - valueAtt = ""; - - if (TAttribute.isAValidId(id, false, false) && TAttribute.isAValidInitialValue(type, valueAtt)) { - if (type == TAttribute.NATURAL) - type = TAttribute.INTEGER; - - TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); - ta.isAvatar = true; - this.returnAttributes.add(ta); + case "ReturnAttribute": + { + Integer access = Integer.decode (elt.getAttribute ("access")).intValue (); + Integer type = Integer.decode (elt.getAttribute ("type")).intValue (); + String typeOther = elt.getAttribute ("typeOther"); + String id = elt.getAttribute("id"); + String valueAtt = elt.getAttribute("value"); + if (valueAtt.equals("null")) + valueAtt = ""; + + if (TAttribute.isAValidId (id, false, false) && TAttribute.isAValidInitialValue (type, valueAtt)) { + if (type == TAttribute.NATURAL) + type = TAttribute.INTEGER; + + TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); + ta.isAvatar = true; + this.returnAttributes.add (ta); + } } - } - break; + break; - case "Attribute": { - Integer access = Integer.decode(elt.getAttribute("access")).intValue(); - Integer type = Integer.decode(elt.getAttribute("type")).intValue(); - String typeOther = elt.getAttribute("typeOther"); - String id = elt.getAttribute("id"); - String valueAtt = elt.getAttribute("value"); - if (valueAtt.equals("null")) - valueAtt = ""; - - if (TAttribute.isAValidId(id, false, false) && TAttribute.isAValidInitialValue(type, valueAtt)) { - if (type == TAttribute.NATURAL) - type = TAttribute.INTEGER; - - TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); - ta.isAvatar = true; - this.attributes.add(ta); + case "Attribute": + { + Integer access = Integer.decode (elt.getAttribute ("access")).intValue (); + Integer type = Integer.decode (elt.getAttribute ("type")).intValue (); + String typeOther = elt.getAttribute ("typeOther"); + String id = elt.getAttribute("id"); + String valueAtt = elt.getAttribute("value"); + if (valueAtt.equals("null")) + valueAtt = ""; + + if (TAttribute.isAValidId (id, false, false) && TAttribute.isAValidInitialValue (type, valueAtt)) { + if (type == TAttribute.NATURAL) + type = TAttribute.INTEGER; + + TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); + ta.isAvatar = true; + this.attributes.add (ta); + } } - } - break; + break; case "Method": String method = elt.getAttribute("value"); - if (method.equals("null")) + if (method.equals ("null")) break; boolean implementation = false; @@ -899,7 +920,7 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent AvatarMethod am = AvatarMethod.isAValidMethod(method); if (am != null) { am.setImplementationProvided(implementation); - this.methods.add(am); + this.methods.add (am); } break; @@ -922,8 +943,8 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent * * @return The panel of the corresponding state machine diagram. */ - public AvatarSMDPanel getAvatarSMDPanel() { - return ((AvatarDesignPanel) (this.tdp.tp)).getAvatarSMDPanel(this.value); + public AvatarSMDPanel getAvatarSMDPanel () { + return ((AvatarDesignPanel) (this.tdp.tp)).getAvatarSMDPanel (this.value); } /** @@ -932,8 +953,8 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent public void removeCryptoElements() { this.isCrypto = false; - for (String method : AvatarMethod.cryptoMethods) - this.removeMethodIfApplicable(method); + for (String method: AvatarMethod.cryptoMethods) + this.removeMethodIfApplicable (method); } /** @@ -942,22 +963,23 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent public void addCryptoElements() { this.isCrypto = true; - for (String method : AvatarMethod.cryptoMethods) - this.addMethodIfApplicable(method); + for (String method: AvatarMethod.cryptoMethods) + this.addMethodIfApplicable (method); } /** * Removes a method from the list of methods if it exists. * - * @param methodString The String corresponding to the method to remove. + * @param methodString + * The String corresponding to the method to remove. */ private void removeMethodIfApplicable(String methodString) { - Iterator<AvatarMethod> iterator = this.methods.iterator(); - while (iterator.hasNext()) { - AvatarMethod am = iterator.next(); + Iterator<AvatarMethod> iterator = this.methods.iterator (); + while (iterator.hasNext ()) { + AvatarMethod am = iterator.next (); // TODO: replace by a more OO way... - if (am.toString().equals(methodString)) { - iterator.remove(); + if (am.toString ().equals (methodString)) { + iterator.remove (); break; } } @@ -966,45 +988,46 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent /** * Adds a method to the list of methods if it doesn't already exist. * - * @param methodString The String corresponding to the method to add. + * @param methodString + * The String corresponding to the method to add. */ - private void addMethodIfApplicable(String methodString) { - for (AvatarMethod am : this.methods) + private void addMethodIfApplicable (String methodString) { + for (AvatarMethod am: this.methods) // TODO: replace by a more OO way... - if (am.toString().equals(methodString)) - return; + if (am.toString ().equals (methodString)) + return; - AvatarMethod am = AvatarMethod.isAValidMethod(methodString); + AvatarMethod am = AvatarMethod.isAValidMethod (methodString); if (am != null) - this.methods.add(am); + this.methods.add (am); } @Override - public String getOwnerName() { - return this.getFunctionName(); + public String getOwnerName () { + return this.getFunctionName (); } @Override - public LinkedList<TAttribute> getAttributeList() { - LinkedList<TAttribute> list = new LinkedList<TAttribute>(); - list.addAll(this.parameters); - list.addAll(this.returnAttributes); - list.addAll(this.attributes); + public LinkedList<TAttribute> getAttributeList () { + LinkedList<TAttribute> list = new LinkedList<TAttribute> (); + list.addAll (this.parameters); + list.addAll (this.returnAttributes); + list.addAll (this.attributes); return list; } @Override - public LinkedList<String> getAllTimerList() { - LinkedList<String> v = new LinkedList<String>(); + public LinkedList<String> getAllTimerList () { + LinkedList<String> v = new LinkedList<String> (); - for (TAttribute a : this.parameters) + for (TAttribute a: this.parameters) if (a.getType() == TAttribute.TIMER) v.add(a.getId()); - for (TAttribute a : this.returnAttributes) + for (TAttribute a: this.returnAttributes) if (a.getType() == TAttribute.TIMER) v.add(a.getId()); - for (TAttribute a : this.attributes) + for (TAttribute a: this.attributes) if (a.getType() == TAttribute.TIMER) v.add(a.getId()); @@ -1012,38 +1035,38 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent } @Override - public TAttribute getAttributeByName(String _name) { - for (TAttribute a : this.parameters) + public TAttribute getAttributeByName (String _name) { + for (TAttribute a: this.parameters) if (a.getId().compareTo(_name) == 0) return a; - for (TAttribute a : this.returnAttributes) + for (TAttribute a: this.returnAttributes) if (a.getId().compareTo(_name) == 0) return a; - for (TAttribute a : this.attributes) + for (TAttribute a: this.attributes) if (a.getId().compareTo(_name) == 0) return a; return null; } @Override - public LinkedList<AvatarSignal> getSignalList() { - return new LinkedList<AvatarSignal>(this.signals); + public LinkedList<AvatarSignal> getSignalList () { + return new LinkedList<AvatarSignal> (this.signals); } @Override - public LinkedList<AvatarSignal> getAllSignalList() { - return this.getSignalList(); + public LinkedList<AvatarSignal> getAllSignalList () { + return this.getSignalList (); } @Override - public AvatarSignal getSignalNameBySignalDef(String _id) { + public AvatarSignal getSignalNameBySignalDef (String _id) { int index0 = _id.indexOf('('); if (index0 > -1) _id = _id.substring(0, index0); _id = _id.trim(); - for (AvatarSignal as : this.signals) - if (as.getId().equals(_id)) + for (AvatarSignal as: this.signals) + if (as.getId().equals (_id)) return as; return null; @@ -1055,23 +1078,23 @@ public class AvatarBDLibraryFunction extends TGCScalableWithoutInternalComponent // Too large to fit in the father? -> resize it! this.resizeToFatherSize(); - this.setCdRectangle(0, this.father.getWidth() - this.getWidth(), 0, this.father.getHeight() - this.getHeight()); - this.setMoveCd(this.x, this.y); + this.setCdRectangle (0, this.father.getWidth() - this.getWidth(), 0, this.father.getHeight() - this.getHeight()); + this.setMoveCd (this.x, this.y); } } @Override - public LinkedList<AvatarMethod> getMethodList() { - return new LinkedList<AvatarMethod>(this.methods); + public LinkedList<AvatarMethod> getMethodList () { + return new LinkedList<AvatarMethod> (this.methods); } @Override - public LinkedList<AvatarMethod> getAllMethodList() { - return this.getMethodList(); + public LinkedList<AvatarMethod> getAllMethodList () { + return this.getMethodList (); } @Override - public int compareTo(AvatarBDLibraryFunction f) { - return this.name.compareTo(f.getFunctionName()); + public int compareTo (AvatarBDLibraryFunction f) { + return this.name.compareTo (f.getFunctionName ()); } } diff --git a/src/main/java/ui/avatarbd/AvatarBDPragma.java b/src/main/java/ui/avatarbd/AvatarBDPragma.java old mode 100755 new mode 100644 index a0c6e121dd37f2c4b57edec19b9bb516c4f98940..dc9666557e223d2ecd276fda949489e7b371ccda --- a/src/main/java/ui/avatarbd/AvatarBDPragma.java +++ b/src/main/java/ui/avatarbd/AvatarBDPragma.java @@ -1,26 +1,26 @@ /* 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, @@ -31,7 +31,7 @@ * 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. */ @@ -229,7 +229,7 @@ public class AvatarBDPragma extends TGCScalableWithoutInternalComponent { int i = 1; Font heading = new Font("heading", Font.BOLD, this.tdp.getFontSize() * 7 / 6); g.setFont(heading); - g.drawString("Security features", x + textX, y + textY + currentFontSize); + g.drawString("Model Pragmas", x + textX, y + textY + currentFontSize); g.setFont(fold); for (String s : models) { g.drawString(s, x + textX, y + textY + (i + 1) * currentFontSize); diff --git a/src/main/java/ui/avatarbd/AvatarBDStateMachineOwner.java b/src/main/java/ui/avatarbd/AvatarBDStateMachineOwner.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarbd/AvatarBDToolBar.java b/src/main/java/ui/avatarbd/AvatarBDToolBar.java index 53de8d401cef89276a7930dc16af1a2c01dfd2e2..4177b34d9d5f3ee05f1a7f51ec440b03cac174e6 100644 --- a/src/main/java/ui/avatarbd/AvatarBDToolBar.java +++ b/src/main/java/ui/avatarbd/AvatarBDToolBar.java @@ -1,26 +1,26 @@ /* 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, @@ -31,12 +31,14 @@ * 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.avatarbd; import ui.MainGUI; @@ -49,13 +51,12 @@ import javax.swing.*; //import java.awt.event.*; /** - * Class AvatarBDToolBar - * Implements the toolbar to be used in conjunction with the panel of an AVATAR block diagram - * Creation: 06/04/2010 - * - * @author Ludovic APVRILLE - * @version 1.0 06/04/2010 - * @see AvatarBDPanel + * Class AvatarBDToolBar + * Implements the toolbar to be used in conjunction with the panel of an AVATAR block diagram + * Creation: 06/04/2010 + * @version 1.0 06/04/2010 + * @author Ludovic APVRILLE + * @see AvatarBDPanel */ public class AvatarBDToolBar extends TToolBar { @@ -109,20 +110,17 @@ public class AvatarBDToolBar extends TToolBar { button = this.add(mgui.actions[TGUIAction.UML_NOTE]); button.addMouseListener(mgui.mouseHandler); - button = this.add(mgui.actions[TGUIAction.CONNECTOR_COMMENT]); + button = this.add(mgui.actions[TGUIAction.PRAGMA]); button.addMouseListener(mgui.mouseHandler); - this.addSeparator(); - button = this.add(mgui.actions[TGUIAction.SAFETY_PRAGMA]); button.addMouseListener(mgui.mouseHandler); - button = this.add(mgui.actions[TGUIAction.PRAGMA]); - button.addMouseListener(mgui.mouseHandler); - button = this.add(mgui.actions[TGUIAction.PERFORMANCE_PRAGMA]); button.addMouseListener(mgui.mouseHandler); + button = this.add(mgui.actions[TGUIAction.CONNECTOR_COMMENT]); + button.addMouseListener(mgui.mouseHandler); this.addSeparator(); @@ -134,9 +132,9 @@ public class AvatarBDToolBar extends TToolBar { button = this.add(mgui.actions[TGUIAction.ABD_CRYPTOBLOCK]); button.addMouseListener(mgui.mouseHandler); if (MainGUI.experimentalOn) { - button = this.add(mgui.actions[TGUIAction.AVATAR_FIREWALL]); - button.addMouseListener(mgui.mouseHandler); - } + button = this.add(mgui.actions[TGUIAction.AVATAR_FIREWALL]); + button.addMouseListener(mgui.mouseHandler); + } this.addSeparator(); button = this.add(mgui.actions[TGUIAction.ABD_DATATYPE]); diff --git a/src/main/java/ui/avatarcd/AvatarCDActorBox.java b/src/main/java/ui/avatarcd/AvatarCDActorBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarcd/AvatarCDActorStickman.java b/src/main/java/ui/avatarcd/AvatarCDActorStickman.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarcd/AvatarCDAssociationConnector.java b/src/main/java/ui/avatarcd/AvatarCDAssociationConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDArtifact.java b/src/main/java/ui/avatardd/ADDArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDBlockArtifact.java b/src/main/java/ui/avatardd/ADDBlockArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDBridgeNode.java b/src/main/java/ui/avatardd/ADDBridgeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDBusNode.java b/src/main/java/ui/avatardd/ADDBusNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDCPUNode.java b/src/main/java/ui/avatardd/ADDCPUNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDChannelArtifact.java b/src/main/java/ui/avatardd/ADDChannelArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDCommunicationNode.java b/src/main/java/ui/avatardd/ADDCommunicationNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDConnectingPoint.java b/src/main/java/ui/avatardd/ADDConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDConnector.java b/src/main/java/ui/avatardd/ADDConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDCoproMWMRNode.java b/src/main/java/ui/avatardd/ADDCoproMWMRNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDCrossbarNode.java b/src/main/java/ui/avatardd/ADDCrossbarNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDDMANode.java b/src/main/java/ui/avatardd/ADDDMANode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDDiagramPanel.java b/src/main/java/ui/avatardd/ADDDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDDiagramToolBar.java b/src/main/java/ui/avatardd/ADDDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDICUNode.java b/src/main/java/ui/avatardd/ADDICUNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDMemoryNode.java b/src/main/java/ui/avatardd/ADDMemoryNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDNode.java b/src/main/java/ui/avatardd/ADDNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDRAMNode.java b/src/main/java/ui/avatardd/ADDRAMNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDROMNode.java b/src/main/java/ui/avatardd/ADDROMNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDTTYNode.java b/src/main/java/ui/avatardd/ADDTTYNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDTimerNode.java b/src/main/java/ui/avatardd/ADDTimerNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatardd/ADDVgmnNode.java b/src/main/java/ui/avatardd/ADDVgmnNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationBar.java b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationFIFOData.java b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationFIFOData.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarMainCommandsToolBar.java b/src/main/java/ui/avatarinteractivesimulation/AvatarMainCommandsToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarSaveCommandsToolBar.java b/src/main/java/ui/avatarinteractivesimulation/AvatarSaveCommandsToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/BlockTableModel.java b/src/main/java/ui/avatarinteractivesimulation/BlockTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java b/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java old mode 100755 new mode 100644 index 8b064420be0e53be31327fdd24d8f5da881cd0c0..5cb98aa1e92f7b93fff6bb22ac4ea766adc29392 --- a/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java +++ b/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java @@ -68,17 +68,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Collections; - -import java.io.Writer; -import java.io.OutputStreamWriter; -import java.io.IOException; - -import org.apache.batik.svggen.SVGGraphics2D; -import org.apache.batik.dom.GenericDOMImplementation; - -import org.w3c.dom.Document; -import org.w3c.dom.DOMImplementation; - /** * Class JFrameAvatarInteractiveSimulation * Creation: 21/01/2011 @@ -1828,7 +1817,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar } else { // Using model directory String path = mgui.getModelFileFullPath(); - fileName = path.substring(0, path.lastIndexOf(File.separator) + 1) + fileName; + fileName = path.substring(0,path.lastIndexOf(File.separator)+1) + fileName; TraceManager.addDev("New Filename = " + fileName); } @@ -1842,17 +1831,15 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar if (!ok) { JOptionPane.showMessageDialog(this, - "The capture could not be performed: the specified file is not valid", - "Error", - JOptionPane.INFORMATION_MESSAGE); + "The capture could not be performed: the specified file is not valid", + "Error", + JOptionPane.INFORMATION_MESSAGE); return; } - newSVGSave("NEW" + fileName); - - StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" standalone=\"no\"?>\n"); + StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" standalone=\"no\"?>\n"); sb.append("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"); sb.append("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n"); @@ -1891,31 +1878,6 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar } - // FileName must be valid - private void newSVGSave(String fileName) { - TraceManager.addDev("New SVG save in " + fileName); - // Get a DOMImplementation. - DOMImplementation domImpl = - GenericDOMImplementation.getDOMImplementation(); - - // Create an instance of org.w3c.dom.Document. - String svgNS = "http://www.w3.org/2000/svg"; - Document document = domImpl.createDocument(svgNS, "svg", null); - - // Create an instance of the SVG Generator. - SVGGraphics2D svgGenerator = new SVGGraphics2D(document); - - // Ask the test to render into the SVG Graphics2D implementation. - /*TestSVGGen test = new TestSVGGen(); - test.paint(svgGenerator); - - // Finally, stream out SVG to the standard output using - // UTF-8 encoding. - boolean useCSS = true; // we want to use CSS style attributes - Writer out = new OutputStreamWriter(System.out, "UTF-8"); - svgGenerator.stream(out, useCSS);*/ - } - public void actSaveSDPNG() { //Saving PNG file; BufferedImage bi; diff --git a/src/main/java/ui/avatarinteractivesimulation/MetElementsTableModel.java b/src/main/java/ui/avatarinteractivesimulation/MetElementsTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/TransactionTableModel.java b/src/main/java/ui/avatarinteractivesimulation/TransactionTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarinteractivesimulation/VariableTableModel.java b/src/main/java/ui/avatarinteractivesimulation/VariableTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyConnectingPoint.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyConnector.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramName.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramName.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramPanel.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramReference.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramReference.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramToolbar.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyDiagramToolbar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToAnalysis.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToAnalysis.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToAssumptions.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToAssumptions.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToDesign.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToDesign.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToProperties.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToProperties.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToPrototype.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToPrototype.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToRequirement.java b/src/main/java/ui/avatarmethodology/AvatarMethodologyReferenceToRequirement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarpd/AvatarPDProperty.java b/src/main/java/ui/avatarpd/AvatarPDProperty.java index d1e119387359f57ebe03f15731ce96f6c8b7f809..52df0fac3934bb562bf991bc3812c68853010601 100644 --- a/src/main/java/ui/avatarpd/AvatarPDProperty.java +++ b/src/main/java/ui/avatarpd/AvatarPDProperty.java @@ -245,7 +245,7 @@ public class AvatarPDProperty extends TGCScalableWithInternalComponent implement String oldValue = value; JDialogAvatarProperty jdap = new JDialogAvatarProperty(frame, value, kind, not); // jdap.setSize(300, 280); - GraphicLib.centerOnParent(jdap, 400, 280); + GraphicLib.centerOnParent(jdap, 300, 280); jdap.setVisible(true); // blocked until dialog has been closed if (jdap.hasBeenCancelled()) { diff --git a/src/main/java/ui/avatarrd/AvatarRDConnectingPointDerive.java b/src/main/java/ui/avatarrd/AvatarRDConnectingPointDerive.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDConnectingPointSatisfy.java b/src/main/java/ui/avatarrd/AvatarRDConnectingPointSatisfy.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDConnectingPointVerify.java b/src/main/java/ui/avatarrd/AvatarRDConnectingPointVerify.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDCopyConnector.java b/src/main/java/ui/avatarrd/AvatarRDCopyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDDeriveConnector.java b/src/main/java/ui/avatarrd/AvatarRDDeriveConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDPanel.java b/src/main/java/ui/avatarrd/AvatarRDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDProperty.java b/src/main/java/ui/avatarrd/AvatarRDProperty.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDRefineConnector.java b/src/main/java/ui/avatarrd/AvatarRDRefineConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDRequirement.java b/src/main/java/ui/avatarrd/AvatarRDRequirement.java old mode 100755 new mode 100644 index 7fde2f61a84b7a4845fe7e3d57e58ebd1c568b76..baed332ed2d5ef9e315265094cd34ade68c50663 --- a/src/main/java/ui/avatarrd/AvatarRDRequirement.java +++ b/src/main/java/ui/avatarrd/AvatarRDRequirement.java @@ -64,8 +64,6 @@ import java.awt.event.ActionListener; * @version 1.0 20/04/2010 */ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implements WithAttributes, TGAutoAdjust { - public static int SIZE_LIMIT = 35; - public String oldValue; protected int textX = 5; protected int textY = 22; @@ -422,7 +420,7 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem JDialogRequirement jdr = new JDialogRequirement(tdp.getGUI().getFrame(), "Setting attributes of Requirement " + getRequirementName(), id, text, kind, criticality, va, reqType, atn, referenceElements); // jdr.setSize(750, 400); - GraphicLib.centerOnParent(jdr, 800, 400); + GraphicLib.centerOnParent(jdr, 750, 400); jdr.setVisible(true); if (!jdr.isRegularClose()) { @@ -570,10 +568,6 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem ret += " " + text; ret += " criticality=" + criticality; - if (SIZE_LIMIT > 0) { - ret = ret.substring(0, SIZE_LIMIT) + "..."; - } - return ret; } diff --git a/src/main/java/ui/avatarrd/AvatarRDSatisfyConnector.java b/src/main/java/ui/avatarrd/AvatarRDSatisfyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDToolBar.java b/src/main/java/ui/avatarrd/AvatarRDToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarrd/AvatarRDVerifyConnector.java b/src/main/java/ui/avatarrd/AvatarRDVerifyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarsmd/AvatarSMDChoice.java b/src/main/java/ui/avatarsmd/AvatarSMDChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarsmd/AvatarSMDPanel.java b/src/main/java/ui/avatarsmd/AvatarSMDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarsmd/AvatarSMDParallel.java b/src/main/java/ui/avatarsmd/AvatarSMDParallel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarsmd/AvatarSMDRandom.java b/src/main/java/ui/avatarsmd/AvatarSMDRandom.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarsmd/AvatarSMDToolBar.java b/src/main/java/ui/avatarsmd/AvatarSMDToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/avatarsmd/AvatarSMDTransitionInfo.java b/src/main/java/ui/avatarsmd/AvatarSMDTransitionInfo.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDActivityDiagramBox.java b/src/main/java/ui/cd/TCDActivityDiagramBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDAttributeBox.java b/src/main/java/ui/cd/TCDAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDAttributeBoxNoConnection.java b/src/main/java/ui/cd/TCDAttributeBoxNoConnection.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDAttributeGateBox.java b/src/main/java/ui/cd/TCDAttributeGateBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDCompositionOperator.java b/src/main/java/ui/cd/TCDCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDCompositionOperatorWithSynchro.java b/src/main/java/ui/cd/TCDCompositionOperatorWithSynchro.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDInvocationOperator.java b/src/main/java/ui/cd/TCDInvocationOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDOperationBox.java b/src/main/java/ui/cd/TCDOperationBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDOperationBoxNoConnection.java b/src/main/java/ui/cd/TCDOperationBoxNoConnection.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDParallelOperator.java b/src/main/java/ui/cd/TCDParallelOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDPreemptionOperator.java b/src/main/java/ui/cd/TCDPreemptionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDReducedAttributeBox.java b/src/main/java/ui/cd/TCDReducedAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDReducedAttributeGateBox.java b/src/main/java/ui/cd/TCDReducedAttributeGateBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDSequenceOperator.java b/src/main/java/ui/cd/TCDSequenceOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDSynchroGateList.java b/src/main/java/ui/cd/TCDSynchroGateList.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDSynchroOperator.java b/src/main/java/ui/cd/TCDSynchroOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDTClass.java b/src/main/java/ui/cd/TCDTClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDTData.java b/src/main/java/ui/cd/TCDTData.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDTObject.java b/src/main/java/ui/cd/TCDTObject.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDWatchdogGateList.java b/src/main/java/ui/cd/TCDWatchdogGateList.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TCDWatchdogOperator.java b/src/main/java/ui/cd/TCDWatchdogOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TClassDiagramPanel.java b/src/main/java/ui/cd/TClassDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TClassDiagramToolBar.java b/src/main/java/ui/cd/TClassDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TGCReducedAttributeBox.java b/src/main/java/ui/cd/TGCReducedAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TGConnectingPointAssociation.java b/src/main/java/ui/cd/TGConnectingPointAssociation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TGConnectingPointCompositionOperator.java b/src/main/java/ui/cd/TGConnectingPointCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TGConnectingPointTClasses.java b/src/main/java/ui/cd/TGConnectingPointTClasses.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TGConnectorAssociation.java b/src/main/java/ui/cd/TGConnectorAssociation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/cd/TGConnectorAssociationWithNavigation.java b/src/main/java/ui/cd/TGConnectorAssociationWithNavigation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/dd/TDDArtifact.java b/src/main/java/ui/dd/TDDArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/dd/TDDNode.java b/src/main/java/ui/dd/TDDNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/dd/TDeploymentDiagramPanel.java b/src/main/java/ui/dd/TDeploymentDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/dd/TDeploymentDiagramToolBar.java b/src/main/java/ui/dd/TDeploymentDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/dd/TGConnectingPointDD.java b/src/main/java/ui/dd/TGConnectingPointDD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/dd/TGConnectorLinkNode.java b/src/main/java/ui/dd/TGConnectorLinkNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyConnectingPoint.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyConnector.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramName.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramName.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramPanel.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReference.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReference.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToApplication.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToApplication.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToArchitecture.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToArchitecture.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToCP.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToCP.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToMapping.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToMapping.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToRequirement.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramReferenceToRequirement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramToolbar.java b/src/main/java/ui/diplodocusmethodology/DiplodocusMethodologyDiagramToolbar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/EBRDDActionState.java b/src/main/java/ui/ebrdd/EBRDDActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/EBRDDChoice.java b/src/main/java/ui/ebrdd/EBRDDChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/EBRDDForLoop.java b/src/main/java/ui/ebrdd/EBRDDForLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/EBRDDStartState.java b/src/main/java/ui/ebrdd/EBRDDStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/EBRDDStopState.java b/src/main/java/ui/ebrdd/EBRDDStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/EBRDDToolBar.java b/src/main/java/ui/ebrdd/EBRDDToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/TGConnectingPointEBRDD.java b/src/main/java/ui/ebrdd/TGConnectingPointEBRDD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/TGConnectingPointEBRDDERC.java b/src/main/java/ui/ebrdd/TGConnectingPointEBRDDERC.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/TGConnectorEBRDD.java b/src/main/java/ui/ebrdd/TGConnectorEBRDD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ebrdd/TGConnectorEBRDDERC.java b/src/main/java/ui/ebrdd/TGConnectorEBRDDERC.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/AUTFileFilter.java b/src/main/java/ui/file/AUTFileFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/BCGFileFilter.java b/src/main/java/ui/file/BCGFileFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/DTAFileFilter.java b/src/main/java/ui/file/DTAFileFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/MSCFilter.java b/src/main/java/ui/file/MSCFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/PNGFilter.java b/src/main/java/ui/file/PNGFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/RGFileFilter.java b/src/main/java/ui/file/RGFileFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/RTLFileFilter.java b/src/main/java/ui/file/RTLFileFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/TDotFilter.java b/src/main/java/ui/file/TDotFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/TFileFilter.java b/src/main/java/ui/file/TFileFilter.java old mode 100755 new mode 100644 index c76da383fd1c1090cd14c6a67c7440ef5b729937..2b801a6e6f19d73d942b34f6ef9204703f9914c0 --- a/src/main/java/ui/file/TFileFilter.java +++ b/src/main/java/ui/file/TFileFilter.java @@ -37,6 +37,8 @@ */ + + package ui.file; import myutil.FileUtils; @@ -48,12 +50,11 @@ import java.io.File; /** * Class TFileFilter * Creation : 12/12/2003 - * * @author Ludovic APVRILLE */ public class TFileFilter extends FileFilter { - //Accept all directories and xml files +//Accept all directories and xml files public boolean accept(File f) { if (f.isDirectory()) { return true; @@ -66,13 +67,13 @@ public class TFileFilter extends FileFilter { return false; } - + public String getDescription() { - return "TTool Files"; + return "TURTLE Files"; } - + public static String getExtension() { - return FileUtils.xml; + return FileUtils.xml; } } diff --git a/src/main/java/ui/file/TImgFilter.java b/src/main/java/ui/file/TImgFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/TLSAFileFilter.java b/src/main/java/ui/file/TLSAFileFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/TLibFilter.java b/src/main/java/ui/file/TLibFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/TSVGFilter.java b/src/main/java/ui/file/TSVGFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/file/TTIFFilter.java b/src/main/java/ui/file/TTIFFilter.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/het/CAMSBlock.java b/src/main/java/ui/het/CAMSBlock.java deleted file mode 100755 index 97852637283904d48b72f3e71f9ce9ff1391c7b0..0000000000000000000000000000000000000000 --- a/src/main/java/ui/het/CAMSBlock.java +++ /dev/null @@ -1,394 +0,0 @@ -/* 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.het; - -import myutil.GraphicLib; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import ui.*; -import ui.util.IconManager; -import ui.window.JDialogCAMSBlocks; -import heterogeneoustranslator.systemCAMStranslator.*; - -import javax.swing.*; -import java.awt.*; -import java.util.LinkedList; -import java.util.Vector; - - -/** -* Class CAMSBlock -* Block for SystemC-AMS Diagrams -* Creation: 27/06/2017 -* @version 1.0 27/06/2017 -* @author Côme DEMARIGNY - */ -public class CAMSBlock extends TGComponent { - private int textY1 = 15; - private int textY2 = 30; - private int derivationx = 2; - private int derivationy = 3; - private String stereotype = "block"; - - private int nbOfIn = 0; - private int nbOfOut = 0; - private int nbOfHybridIn = 0; - private int nbOfHybridOut = 0; - private int totIn = 0; - private int totOut = 0; - - protected int index = 0; - - private int maxFontSize = 12; - private int minFontSize = 4; - private int currentFontSize = -1; - private boolean displayText = true; - private int textX = 7; - - private int limitName = -1; - private int limitAttr = -1; - private int limitMethod = -1; - - public String name; - public String Value= "Block0"; - private JDialogCAMSBlocks dialog; - - // TAttribute, ProcessCode, CAMSSignal - protected LinkedList<TAttribute> myAttributes; - protected LinkedList<CAMSSignal> mySignals; - protected String [] processCode; - - //Simulation Object - private CAMSBlocks SBlock; - - public CAMSBlock (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); - tdp = _tdp; - width = 250; - height = 200; - minWidth = 150; - minHeight = 100; - - createConnectingPoints(); - - moveable = true; - editable = true; - removable = true; - userResizable = true; - - getBlockName(); - - myImageIcon = IconManager.imgic700; - - if(this.myAttributes == null){this.myAttributes = new LinkedList<TAttribute>();} - if(this.mySignals == null){this.mySignals = new LinkedList<CAMSSignal>();} - - SBlock= new CAMSBlocks(name, nbOfIn, nbOfOut, nbOfHybridIn, nbOfHybridOut, myAttributes, mySignals, processCode); - } - - public void createConnectingPoints(){ - int i; - double h; - - resetInOut(); - - if(this.mySignals!=null){ - for(i=0;i<mySignals.size();i++){ - if(mySignals.get(i).getInout()==0){ - nbOfIn++; - } else if(mySignals.get(i).getInout()==1) { - nbOfOut++; - } else if(mySignals.get(i).getInout()==2) { - nbOfHybridIn++; - } else{ - nbOfHybridOut++; - } - } - } - - nbConnectingPoint = nbOfIn + nbOfOut + nbOfHybridIn + nbOfHybridOut; - totIn = nbOfIn + nbOfHybridIn; - totOut = nbOfOut + nbOfHybridOut; - - connectingPoint = new CAMSConnectingPoint[nbConnectingPoint]; - - for (i = 1; i<= totIn; i++){ - h = i/(totIn + 1.0); - if((i-1)<nbOfIn){ - connectingPoint[i-1] = new CAMSConnectingPoint(this, 0, 0, true, false, false, 0.0, h); - } else{ - connectingPoint[i-1] = new CAMSConnectingPoint(this, 0, 0, true, false, true, 0.0, h); - } - } - - for (i = 1; i<=totOut; i++){ - h = i/(totOut + 1.0); - if ((i+totIn-1)<(nbOfOut + totIn)){ - connectingPoint[i+totIn-1] = new CAMSConnectingPoint(this, 0, 0, false, true, false, 1.0, h); - } else { - connectingPoint[i+totIn-1] = new CAMSConnectingPoint(this, 0, 0, false, true, true, 1.0, h); - } - } - - addTGConnectingPointsComment(); - } - - public void internalDrawing(Graphics g) { - Color c = g.getColor(); - g.draw3DRect(x, y, width, height, true); - - - // Top lines - g.drawLine(x, y, x + derivationx, y - derivationy); - g.drawLine(x + width, y, x + width + derivationx, y - derivationy); - g.drawLine(x + derivationx, y - derivationy, x + width + derivationx, y - derivationy); - - // Right lines - g.drawLine(x + width, y + height, x + width + derivationx, y - derivationy + height); - g.drawLine(x + derivationx + width, y - derivationy, x + width + derivationx, y - derivationy + height); - - // Filling color - g.setColor(ColorManager.HWA_BOX); - g.fill3DRect(x+1, y+1, width-1, height-1, true); - g.setColor(c); - - // Strings - String ster = "<<" + stereotype + ">>"; - int w = g.getFontMetrics().stringWidth(ster); - Font f = g.getFont(); - g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY1); - g.setFont(f); - w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + textY2); - - - actionOnAdd(); - } - - public void addSignal(CAMSSignal sig){ - mySignals.add(sig); - } - - public TGComponent isOnOnlyMe(int x1, int y1) { - return null; - } - - public void setState(int _s){ - } - - public TGComponent isOnMe(int _x, int _y){ - if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { - return this; - } - return null; - } - - public String getStereotype() { - return stereotype; - - } - - public boolean editOndoubleClick(JFrame frame) { - - boolean error = false; - String errors = ""; - int tmp; - String tmpName; - boolean changeMade=false; - - if(dialog ==null){ - dialog = new JDialogCAMSBlocks(this.myAttributes, this.mySignals, null, frame, "Setting Block attributes", "Attributes", this, processCode, true); - } - setJDialogOptions(dialog); - GraphicLib.centerOnParent(dialog, 1050, 700); - dialog.setVisible( true ); // blocked until dialog has been closed - mySignals = dialog.getSignals(); - createConnectingPoints(); - getBlockName(); - setSimulationBlock(); - - - if (error) { - JOptionPane.showMessageDialog(frame, - "Invalid value for the following attributes: " + errors, - "Error", - JOptionPane.INFORMATION_MESSAGE); - return false; - } - return true; - } - - - @Override - public void loadExtraParam(NodeList bl, int decX, int decY, int decId) throws MalformedModelingException{ - try { - - NodeList bli; - Node b1, b2; - Element elt; - String sstereotype = null, sblockName = null; - - for(int i=0; i<bl.getLength(); i++) { - b1 = bl.item(i); - //System.out.println(n1); - if (b1.getNodeType() == Node.ELEMENT_NODE) { - bli = b1.getChildNodes(); - for(int j=0; j<bli.getLength(); j++) { - b2 = bli.item(j); - if (b2.getNodeType() == Node.ELEMENT_NODE) { - elt = (Element) b2; - if (elt.getTagName().equals("info")) { - sstereotype = elt.getAttribute("stereotype"); - sblockName = elt.getAttribute("blockName"); - } - if (sstereotype != null) { - stereotype = sstereotype; - } - if (sblockName != null){ - name = sblockName; - } - - if (elt.getTagName().equals("attributes")) { - - nbOfIn = Integer.decode(elt.getAttribute("nbOfIn")).intValue(); - nbOfOut =Integer.decode(elt.getAttribute("nbOfOut")).intValue(); - - } - } - } - } - } - } catch (Exception e) { - System.out.println("load failure"); - throw new MalformedModelingException(); - } - } - - public void setSimulationBlock(){ - SBlock.setBlockName(name); - SBlock.setNbOfIn(nbOfIn); - SBlock.setNbOfOut(nbOfOut); - SBlock.setNbOfHybridIn(nbOfHybridIn); - SBlock.setNbOfHybridOut(nbOfHybridOut); - SBlock.setMyAttributes(myAttributes); - SBlock.setMySignals(mySignals); - SBlock.setProcessCode(processCode); - } - - protected void setJDialogOptions(JDialogCAMSBlocks _jdab) { - _jdab.addAccess(TAttribute.getStringAccess(TAttribute.PRIVATE)); - _jdab.addAccess(TAttribute.getStringAccess(TAttribute.PUBLIC)); - _jdab.addType(TAttribute.getStringCAMSType(TAttribute.BOOLEAN), true); - _jdab.addType(TAttribute.getStringCAMSType(TAttribute.DOUBLE), true); - _jdab.enableInitialValue(true); - _jdab.enableRTLOTOSKeyword(false); - _jdab.enableJavaKeyword(false); - } - - public String getAttributes() { - String attr = ""; - attr += "Nb of in = " + totIn + "\n"; - attr += "Nb of out = " + totOut + "\n"; - - return attr; - } - - public int getType() { - return TGComponentManager.CAMS_BLOCK; - } - - public boolean hasBlockWithName(){ - return true; - } - - public void getBlockName() { - if(dialog != null) { - name = dialog.getBlockName(); - if (name.length()==0){ - name = tdp.findCAMSBlockName("Block"); - return ; - } - return ; - } - name = Value; - } - - public void resetInOut(){ - nbOfIn = 0; - nbOfOut= 0; - nbOfHybridIn = 0; - nbOfHybridOut= 0; - totIn = 0; - totOut= 0; - } - - public int getNbOfIn() { - return totIn; - } - - public int getNbOfOut() { - return totOut; - } - - public int getNbOfHybridIn() { - return nbOfHybridIn; - } - - public int getNbOfHybridOut() { - return nbOfHybridOut; - } - - public int getNbOfNonHybridIn() { - return nbOfIn; - } - - public int getNbOfNonHybridOut() { - return nbOfOut; - } - - public int getDefaultConnector() { - return TGComponentManager.CAMS_CONNECTOR; - } - -} diff --git a/src/main/java/ui/het/CAMSBlockConnector.java b/src/main/java/ui/het/CAMSBlockConnector.java deleted file mode 100755 index 36edcd8bc817943e4d5235292b3dd35ee622489c..0000000000000000000000000000000000000000 --- a/src/main/java/ui/het/CAMSBlockConnector.java +++ /dev/null @@ -1,302 +0,0 @@ -/* 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.het; - -import myutil.GraphicLib; -import ui.*; -import ui.util.IconManager; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import java.awt.*; -import java.awt.geom.Point2D; -import java.util.Vector; - - -/** - * Class SystemCAMSConnectingPoint - * Definition of connecting points on which attribute connectors can be connected - * Creation: 27/06/2017 - * @version 1.0 27/06/2017 - * @author Côme Demarigny - */ -public class CAMSBlockConnector extends TGConnector { - - public CAMSBlockConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, CAMSConnectingPoint _p1, CAMSConnectingPoint _p2, Vector<Point> _listPoint){ - super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); - myImageIcon = IconManager.imgic202; - - name = "connector"; - _p1.setReferenceToConnector( this ); - _p2.setReferenceToConnector( this ); - - } - - public int getType() { - return TGComponentManager.CAMS_CONNECTOR; - } - - protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ - if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { - g.drawLine(x1, y1, x2, y2); - } else { - GraphicLib.arrowWithLine(g, 1, 0, 10, x1, y1, x2, y2, true); - } - } - - // protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ - // Point p_one; - // boolean isp1; - // if (getIndexOfLastTGCPointOfConnector() == -1) { - // p_one = new Point(p1.getX(), p1.getY()); - // isp1 = true; - // } else { - // TGComponent tmpc = tgcomponent[getIndexOfLastTGCPointOfConnector()]; - // p_one = new Point(tmpc.getX(), tmpc.getY()); - // isp1 = false; - // } - - // //g.drawLine(x1, y1, x2, y2); - // Color col = g.getColor(); - // int cz = (int)(tdp.getZoom() * c); - // if (isAsynchronous()) { - // g.setColor(Color.WHITE); - // } - // g.fillRect(x2-(cz/2), y2-(cz/2), cz, cz); - // g.fillRect(p1.getX()-(cz/2), p1.getY()-(cz/2), cz, cz); - // g.setColor(col); - // if (isAsynchronous()) { - // g.drawRect(x2-(cz/2), y2-(cz/2), cz, cz); - // g.drawRect(p1.getX()-(cz/2), p1.getY()-(cz/2), cz, cz); - // if (isBlocking()) { - // g.drawLine(x2-(cz/2), y2-(cz/2), x2-(cz/2)+cz, y2-(cz/2)+cz); - // g.drawLine(x2-(cz/2), y2-(cz/2)+cz, x2-(cz/2)+cz, y2-(cz/2)); - // g.drawLine(p1.getX()-(cz/2), p1.getY()+(cz/2), p1.getX()+(cz/2), p1.getY()-(cz/2)); - // g.drawLine(p1.getX()-(cz/2), p1.getY()-(cz/2), p1.getX()+(cz/2), p1.getY()+(cz/2)); - // } - // } - - - // if (!isPrivate() /*&& !isAsynchronous()*/) { - // int czz = (int)(cz*1.4); - // int x3 = p1.getX(); - // int y3 = p1.getY(); - - // Polygon p1 = new Polygon(); - // p1.addPoint(x2-(czz/2)+czz, y2-cz); - // p1.addPoint(x2+(czz/2)+czz, y2-cz); - // p1.addPoint(x2+czz, y2-(2*czz)); - - // Polygon p2 = new Polygon(); - // p2.addPoint(x3-(czz/2)+czz, y3-cz); - // p2.addPoint(x3+(czz/2)+czz, y3-cz); - // p2.addPoint(x3+czz, y3-(2*czz)); - - // // Adding illuminatis sign at the end - // g.setColor(Color.WHITE); - // g.fillPolygon(p1); - // g.fillPolygon(p2); - - // g.setColor(col); - // g.drawPolygon(p1); - // g.drawPolygon(p2); - // g.drawOval(x2+czz-4, y2-cz-7, 8, 6); - // g.drawOval(x3+czz-4, y3-cz-7, 8, 6); - // g.fillOval(x2+czz-2, y2-cz-6, 5, 4); - // g.fillOval(x3+czz-2, y3-cz-6, 5, 4); - - // } - - - // Point p11; - // if (isp1) { - // p11 = GraphicLib.intersectionRectangleSegment(p1.getX()-(cz/2), p1.getY()-(cz/2), cz, cz, x1, y1, x2, y2); - // } else { - // p11 = new Point(p_one.x, p_one.y); - // } - // if (p11 == null) { - // p11 = new Point(p1.getX(), p1.getY()); - // //System.out.println("null point"); - // } - // Point p22 = GraphicLib.intersectionRectangleSegment(x2-(cz/2), y2-(cz/2), cz, cz, x1, y1, x2, y2); - // if (p22 == null) { - // p22 = new Point(p2.getX(), p2.getY()); - // //System.out.println("null point"); - // } - - // g.drawLine(p11.x, p11.y, p22.x, p22.y); - - // Font f = g.getFont(); - // Font fold = f; - // f = f.deriveFont((float)fontSize); - // g.setFont(f); - // int h = - decY; - // int step = fontSize + 1; - // int w; - // String s; - - - // if (((g.getColor() == ColorManager.POINTER_ON_ME_0) && (tdp.getAttributeState() == tdp.PARTIAL)) || (tdp.getAttributeState() == tdp.FULL)) { - // // Signals at origin - // if (inSignalsAtOrigin.size() > 0) { - // //g.drawString("in:", p1.getX() + decX, p1.getY() + h); - // for(String iso: inSignalsAtOrigin) { - // h += step; - // s = getShortName(iso); - // if (p1.getX() <= p2.getX()) { - // g.drawString(s, p1.getX() + decX, p1.getY() + h); - // } else { - // w = g.getFontMetrics().stringWidth(s); - // g.drawString(s, p1.getX() - decX - w, p1.getY() + h); - // } - // } - // } - // if (outSignalsAtOrigin.size() > 0) { - // //h += step; - // //g.drawString("out:", p1.getX() + decX, p1.getY() + h); - // for(String oso: outSignalsAtOrigin) { - // h += step; - // s = getShortName(oso); - // if (p1.getX() <= p2.getX()) { - // g.drawString(s, p1.getX() + decX, p1.getY() + h); - // } else { - // w = g.getFontMetrics().stringWidth(s); - // g.drawString(s, p1.getX() - decX - w, p1.getY() + h); - // } - // } - // } - // // Signals at destination - // h = - decY; - // if (outSignalsAtDestination.size() > 0) { - // //h += step; - // //g.drawString("out:", p2.getX() + decX, p2.getY() + h); - // for(String osd: outSignalsAtDestination) { - // h += step; - // s = getShortName(osd); - // if (p1.getX() > p2.getX()) { - // g.drawString(s, p2.getX() + decX, p2.getY() + h); - // } else { - // w = g.getFontMetrics().stringWidth(s); - // g.drawString(s, p2.getX() - decX - w, p2.getY() + h); - // } - // } - // } - // if (inSignalsAtDestination.size() > 0) { - // //g.drawString("in:", p2.getX() + decX, p2.getY() + h); - // for(String isd: inSignalsAtDestination) { - // h += step; - // s = getShortName(isd); - // if (p1.getX() > p2.getX()) { - // g.drawString(s, p2.getX() + decX, p2.getY() + h); - // } else { - // w = g.getFontMetrics().stringWidth(s); - // g.drawString(s, p2.getX() - decX - w, p2.getY() + h); - // } - // } - // } - // } - - // g.setFont(fold); - - // /*if (value.length() > 0) { - // Font f = g.getFont(); - // if (tdp.getZoom() < 1) { - // Font f0 = f.deriveFont((float)(fontSize*tdp.getZoom())); - // g.setFont(f0); - // } - // g.drawString(value, x2-(cz/2), y2-(cz/2)-1); - // g.setFont(f); - // }*/ - - // // Animation? - // if ((TDiagramPanel.AVATAR_ANIMATE_ON) && (isAsynchronous())){ - // //TraceManager.addDev("anim port connector: " + this); - // String messageInformation[] = tdp.getMGUI().hasMessageInformationForAvatarConnector(this); - // if (messageInformation != null) { - // if (messageInformation[0] != null) { - // g.setColor(Color.BLUE); - // g.drawString(messageInformation[0], p1.getX() + decX, p1.getY()); - // } - // if (messageInformation[1] != null) { - // g.setColor(Color.BLUE); - // g.drawString(messageInformation[1], p2.getX() + decX, p2.getY()); - // } - // g.setColor(Color.BLACK); - // } - // } - // } - - @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ - //System.out.println("*** load extra synchro ***"); - try { - - NodeList nli; - Node n1, n2; - Element elt; - //int t1id; - String tmp = null; - - for(int i=0; i<nl.getLength(); i++) { - n1 = nl.item(i); - //System.out.println(n1); - if (n1.getNodeType() == Node.ELEMENT_NODE) { - nli = n1.getChildNodes(); - - // Issue #17 copy-paste error on j index - for(int j=0; j<nli.getLength(); j++) { - n2 = nli.item(j); - //System.out.println(n2); - if (n2.getNodeType() == Node.ELEMENT_NODE) { - elt = (Element) n2; - } - } - } - } - - } catch (Exception e) { - throw new MalformedModelingException(); - } - } - -} //class diff --git a/src/main/java/ui/het/CAMSBlockDiagramPanel.java b/src/main/java/ui/het/CAMSBlockDiagramPanel.java deleted file mode 100755 index b00ae26c6af890492710c3841dc5df1dada4b84c..0000000000000000000000000000000000000000 --- a/src/main/java/ui/het/CAMSBlockDiagramPanel.java +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici - * - * ludovic.apvrille AT enst.fr - * andrea.enrici 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.het; - - -import myutil.TraceManager; -import org.w3c.dom.Element; -import ui.*; - -import java.util.*; - -/** - * Class CAMSBlockDiagramPanel - * Panel for drawing TML Blocks - * Creation: 26/06/2017 - * @version 1.0 26/06/2017 - * @author Côme DEMARIGNY - */ -public class CAMSBlockDiagramPanel extends TDiagramPanel implements TDPWithAttributes { - - public CAMSBlockDiagramPanel(MainGUI mgui, TToolBar _ttb) { - super(mgui, _ttb); - } - - public void initFromDiplodocus(){ - TGComponentManager.addComponent(100,100,TGComponentManager.CAMS_BLOCK,this); - TGComponentManager.addComponent(600,100,TGComponentManager.CAMS_BLOCK,this); - } - - public boolean actionOnDoubleClick(TGComponent tgc) { - /*if (tgc instanceof TCDTClass) { - TCDTClass t = (TCDTClass)tgc; - return mgui.newTClassName(tp, t.oldValue, t.getValue()); - } else if (tgc instanceof TCDActivityDiagramBox) { - if (tgc.getFather() instanceof TCDTClass) { - mgui.selectTab(tp, tgc.getFather().getValue()); - } else if (tgc.getFather() instanceof TCDTObject) { - TCDTObject to = (TCDTObject)(tgc.getFather()); - TCDTClass t = to.getMasterTClass(); - if (t != null) { - mgui.selectTab(tp, t.getValue()); - } - } - return false; // because no change made on any diagram - }*/ - return false; - } - - public boolean actionOnAdd(TGComponent tgc) { - return false; - } - - public boolean actionOnRemove(TGComponent tgc) { - return false; - } - - public boolean actionOnValueChanged(TGComponent tgc) { - return false; - } - - public void setConnectorsToFront() { - TGComponent tgc; - - //System.out.println("list size=" + componentList.size()); - - Iterator iterator = componentList.listIterator(); - - ArrayList<TGComponent> list = new ArrayList<TGComponent>(); - - while(iterator.hasNext()) { - tgc = (TGComponent)(iterator.next()); - if (!(tgc instanceof TGConnector)) { - list.add(tgc); - } - } - - //System.out.println("Putting to back ..."); - for(TGComponent tgc1: list) { - //System.out.println("Putting to back: " + tgc1); - componentList.remove(tgc1); - componentList.add(tgc1); - } - } - - public String getXMLHead() { - return "<CAMSBlockDiagramPanel name=\"" + name + "\"" + sizeParam() + displayParam() + zoomParam() +" >"; - } - - public String getXMLTail() { - return "</CAMSBlockDiagramPanel>"; - } - - public String getXMLSelectedHead() { - return "<CAMSBlockDiagramPanelCopy name=\"" + name + "\" xSel=\"" + xSel + "\" ySel=\"" + ySel + "\" widthSel=\"" + widthSel + "\" heightSel=\"" + heightSel + "\" >"; - } - - public String getXMLSelectedTail() { - return "</CAMSBlockDiagramPanelCopy>"; - } - - public String getXMLCloneHead() { - return "<CAMSBlockDiagramPanelCopy name=\"" + name + "\" xSel=\"" + 0 + "\" ySel=\"" + 0 + "\" widthSel=\"" + 0 + "\" heightSel=\"" + 0 + "\" >"; - } - - public String getXMLCloneTail() { - return "</CAMSBlockDiagramPanelCopy>"; - } - - - - public boolean areAttributesVisible() { - return attributesVisible; - } - - - public boolean areChannelVisible() { - return synchroVisible; - } - - public void setAttributesVisible(boolean b) { - attributesVisible = b; - } - - - public void setChannelVisible(boolean b) { - channelVisible = b; - } - - public String displayParam() { - String s = ""; - if (channelsVisible) { - s += " channels=\"true\""; - } else { - s += " channels=\"false\""; - } - if (eventsVisible) { - s += " events=\"true\""; - } else { - s += " events=\"false\""; - } - if (requestsVisible) { - s += " requests=\"true\""; - } else { - s += " requests=\"false\""; - } - - return s; - } - - public boolean areAllVisible() { - return channelsVisible && eventsVisible && requestsVisible; - } - - public boolean areChannelsVisible() { - return channelsVisible; - } - - public boolean areEventsVisible() { - return eventsVisible; - } - - public boolean areRequestsVisible() { - return requestsVisible; - } - - public void setChannelsVisible(boolean b) { - channelsVisible = b; - } - - public void setEventsVisible(boolean b) { - eventsVisible = b; - } - - public void setRequestsVisible(boolean b) { - requestsVisible = b; - } -} diff --git a/src/main/java/ui/het/CAMSBlockDiagramToolBar.java b/src/main/java/ui/het/CAMSBlockDiagramToolBar.java deleted file mode 100755 index 993669fd52105317a60f42e93a515ea6a5ac23c3..0000000000000000000000000000000000000000 --- a/src/main/java/ui/het/CAMSBlockDiagramToolBar.java +++ /dev/null @@ -1,134 +0,0 @@ -/* 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.het; - -import ui.MainGUI; -import ui.TGUIAction; -import ui.TToolBar; - -import javax.swing.*; - -/** - * Class TMLTaskDiagramToolBar - * Implements the toolbar to be used in conjunction with the panel of a TMLTask diagram - * Creation: 26/06/2017 - * @version 1.0 26/06/2017 - * @author Côme DEMARIGNY - * @see TMLBlockDiagramToolbar - */ -public class CAMSBlockDiagramToolBar extends TToolBar { - - public CAMSBlockDiagramToolBar(MainGUI _mgui) { - super(_mgui); - - } - - protected void setActive(boolean b) { - mgui.actions[TGUIAction.CAMS_EDIT].setEnabled(b); - mgui.actions[TGUIAction.UML_NOTE].setEnabled(b); - mgui.actions[TGUIAction.CAMS_BLOCK].setEnabled(b); - mgui.actions[TGUIAction.CAMS_CONNECTOR].setEnabled(b); - - mgui.actions[TGUIAction.ACT_ZOOM_MORE].setEnabled(true); - mgui.actions[TGUIAction.ACT_ZOOM_LESS].setEnabled(true); - mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(true); - - mgui.actions[TGUIAction.ACT_MODEL_CHECKING].setEnabled(b); - mgui.actions[TGUIAction.ACT_ONECLICK_LOTOS_RG].setEnabled(b); - mgui.actions[TGUIAction.ACT_SIMU_SYSTEMC].setEnabled(b); - - mgui.updateZoomInfo(); - } - - protected void setButtons() { - JButton button; - - button = this.add(mgui.actions[TGUIAction.CAMS_EDIT]); - button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); - - button = this.add(mgui.actions[TGUIAction.UML_NOTE]); - button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); - - button = this.add(mgui.actions[TGUIAction.CAMS_BLOCK]); - button.addMouseListener(mgui.mouseHandler); - - // button = this.add(mgui.actions[TGUIAction.TMLTD_ASSOC]); - // button.addMouseListener(mgui.mouseHandler); - - button = this.add(mgui.actions[TGUIAction.CAMS_CONNECTOR]); - button.addMouseListener(mgui.mouseHandler); - - // this.addSeparator(); - - // button = this.add(mgui.actions[TGUIAction.TMLTD_TASK]); - // button.addMouseListener(mgui.mouseHandler); - - - // this.addSeparator(); - - // button = this.add(mgui.actions[TGUIAction.TMLTD_CHANNEL]); - // button.addMouseListener(mgui.mouseHandler); - - // button = this.add(mgui.actions[TGUIAction.TMLTD_EVENT]); - // button.addMouseListener(mgui.mouseHandler); - - // button = this.add(mgui.actions[TGUIAction.TMLTD_REQ]); - // button.addMouseListener(mgui.mouseHandler); - - - this.addSeparator(); - - // button = this.add(mgui.actions[TGUIAction.ACT_TOGGLE_DIPLO_ID]); - // button.addMouseListener(mgui.mouseHandler); - - } - -} // Class - - - - - diff --git a/src/main/java/ui/het/CAMSConnectingPoint.java b/src/main/java/ui/het/CAMSConnectingPoint.java deleted file mode 100755 index 7839f4d2d9577949633ba47f9f1dfea748b11e29..0000000000000000000000000000000000000000 --- a/src/main/java/ui/het/CAMSConnectingPoint.java +++ /dev/null @@ -1,173 +0,0 @@ -/* 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.het; - -import myutil.GraphicLib; -import ui.*; -import ui.window.JDialogCAMSConnectingPoint; - -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.geom.Point2D; -import javax.swing.*; -import java.util.Vector; - - -/** - * Class SystemCAMSConnectingPoint - * Definition of connecting points on which attribute connectors can be connected - * Creation: 27/06/2017 - * @version 1.0 27/06/2017 - * @author Côme Demarigny - */ -public class CAMSConnectingPoint extends TGConnectingPointWidthHeight { - - protected int x, y; // relative cd and center of the point - protected int state; - protected CDElement container; - private boolean free = true; - protected boolean editable= true; - - private int id; - - protected TGConnectingPointGroup cpg; - - public String type, rate, ccpName = "Connection"; - - protected boolean in; - protected boolean out; - protected boolean hybrid; - - public JDialogCAMSConnectingPoint dialog; - - protected Color myColor; - - protected static final Color IN = Color.gray; - protected static final Color OUT = Color.black; - protected static final Color INOUT = Color.red; - protected static final Color NO = Color.white; - - - protected TGConnector referenceToConnector; - - public CAMSConnectingPoint (CDElement _container, int _x, int _y, boolean _in, boolean _out,boolean _hybrid, double _w, double _h) { - super(_container, _x, _y, _in, _out, _w, _h); - hybrid = _hybrid; - - //color selection - if (_in) { - if (_out) { - myColor = INOUT; - } else { - myColor = IN; - } - } else { - if (_out) { - myColor = OUT; - } else { - myColor = NO; - } - } - - id = TGComponent.getGeneralId(); - TGComponent.setGeneralId(id + 1); - - } - - // public CAMSConnectingPoint (CDElement _container, int _x, int _y, boolean _in, boolean _out, double _w, double _h) { - // super(_container, _x, _y, _in, _out, _w, _h); - // CAMSConnectingPoint camsco = new CAMSConnectingPoint (_container, _x, _y, _in, _out, false, _w, _h); - // } - - public void draw(Graphics g) { - int mx = getX(); - int my = getY(); - g.setColor(myColor); - - //taking into account hybrid connectors - if(this.hybrid==false){ - g.fillRect(mx - width, my - width, width*2, height*2); - }else if (this.in==true){ - System.out.println("test"); - g.setColor(Color.white); - g.fillRect(mx - width, my - width, width*2, height*2); - g.setColor(myColor); - g.fillRect(mx - width, my - width, width, height*2); - }else { - g.setColor(Color.white); - g.fillRect(mx - width, my - width, width*2, height*2); - g.setColor(myColor); - g.fillRect(mx - width, my - width, width, height*2); - } - - GraphicLib.doubleColorRect(g, mx - width, my - width, width*2, height*2, Color.white, Color.black); - } - - public boolean editOndoubleClick(JFrame frame) { - - if(dialog == null){ - dialog = new JDialogCAMSConnectingPoint(frame, "Setting connector attributes", this); - } - dialog.setSize(350, 300); - GraphicLib.centerOnParent(dialog); - dialog.setVisible(true); // blocked until dialog has been closed - - if (!dialog.isRegularClose()) { - return false; - } - return true; - } - - public String getccpName() { - return ccpName; - } - - public String getPointType() { - return type; - } - - public String getRate() { - return rate; - } - -} //class diff --git a/src/main/java/ui/interactivesimulation/BenchmarkCommandsToolBar.java b/src/main/java/ui/interactivesimulation/BenchmarkCommandsToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/BusTableModel.java b/src/main/java/ui/interactivesimulation/BusTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/CPUTableModel.java b/src/main/java/ui/interactivesimulation/CPUTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/FormalVerificationToolBar.java b/src/main/java/ui/interactivesimulation/FormalVerificationToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/GenericTransaction.java b/src/main/java/ui/interactivesimulation/GenericTransaction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/InteractiveSimulationActions.java b/src/main/java/ui/interactivesimulation/InteractiveSimulationActions.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/JFrameInteractiveSimulation.java b/src/main/java/ui/interactivesimulation/JFrameInteractiveSimulation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/JFrameSimulationSDPanel.java b/src/main/java/ui/interactivesimulation/JFrameSimulationSDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/JPanelBreakPoints.java b/src/main/java/ui/interactivesimulation/JPanelBreakPoints.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/JPanelSetVariables.java b/src/main/java/ui/interactivesimulation/JPanelSetVariables.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/JPanelTransactions.java b/src/main/java/ui/interactivesimulation/JPanelTransactions.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/LatencyTableModel.java b/src/main/java/ui/interactivesimulation/LatencyTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/MainCommandsToolBar.java b/src/main/java/ui/interactivesimulation/MainCommandsToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/MemTableModel.java b/src/main/java/ui/interactivesimulation/MemTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/SaveCommandsToolBar.java b/src/main/java/ui/interactivesimulation/SaveCommandsToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/SimulationTransaction.java b/src/main/java/ui/interactivesimulation/SimulationTransaction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/StateCommandsToolBar.java b/src/main/java/ui/interactivesimulation/StateCommandsToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/TaskTableModel.java b/src/main/java/ui/interactivesimulation/TaskTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/TaskVariableTableModel.java b/src/main/java/ui/interactivesimulation/TaskVariableTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/interactivesimulation/TransactionTableModel.java b/src/main/java/ui/interactivesimulation/TransactionTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODChoice.java b/src/main/java/ui/iod/IODChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODJunction.java b/src/main/java/ui/iod/IODJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODParallel.java b/src/main/java/ui/iod/IODParallel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODPreemption.java b/src/main/java/ui/iod/IODPreemption.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODRefIOD.java b/src/main/java/ui/iod/IODRefIOD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODRefSD.java b/src/main/java/ui/iod/IODRefSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODSequence.java b/src/main/java/ui/iod/IODSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODStartState.java b/src/main/java/ui/iod/IODStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/IODStopState.java b/src/main/java/ui/iod/IODStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/InteractionOverviewDiagramPanel.java b/src/main/java/ui/iod/InteractionOverviewDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/InteractionOverviewDiagramToolBar.java b/src/main/java/ui/iod/InteractionOverviewDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/TGConnectingPointIOD.java b/src/main/java/ui/iod/TGConnectingPointIOD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/iod/TGConnectorInteraction.java b/src/main/java/ui/iod/TGConnectorInteraction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCConnectorNode.java b/src/main/java/ui/ncdd/NCConnectorNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCDiagramPanel.java b/src/main/java/ui/ncdd/NCDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCDiagramToolBar.java b/src/main/java/ui/ncdd/NCDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCEqNode.java b/src/main/java/ui/ncdd/NCEqNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCNodeConnectingPoint.java b/src/main/java/ui/ncdd/NCNodeConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCRoute.java b/src/main/java/ui/ncdd/NCRoute.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCRouteArtifact.java b/src/main/java/ui/ncdd/NCRouteArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCSwitchNode.java b/src/main/java/ui/ncdd/NCSwitchNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ncdd/NCTrafficArtifact.java b/src/main/java/ui/ncdd/NCTrafficArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADActionState.java b/src/main/java/ui/osad/TOSADActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADChoice.java b/src/main/java/ui/osad/TOSADChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADConnectingPoint.java b/src/main/java/ui/osad/TOSADConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADConnector.java b/src/main/java/ui/osad/TOSADConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADIntTimeInterval.java b/src/main/java/ui/osad/TOSADIntTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADJunction.java b/src/main/java/ui/osad/TOSADJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADStartState.java b/src/main/java/ui/osad/TOSADStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADStopState.java b/src/main/java/ui/osad/TOSADStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TOSADTimeInterval.java b/src/main/java/ui/osad/TOSADTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TURTLEOSActivityDiagramPanel.java b/src/main/java/ui/osad/TURTLEOSActivityDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/osad/TURTLEOSActivityDiagramToolBar.java b/src/main/java/ui/osad/TURTLEOSActivityDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TGCTOSAttributeBox.java b/src/main/java/ui/oscd/TGCTOSAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TGConnectingPointTOSAssociation.java b/src/main/java/ui/oscd/TGConnectingPointTOSAssociation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TGConnectingPointTOSClasses.java b/src/main/java/ui/oscd/TGConnectingPointTOSClasses.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TGConnectingPointTOSCompositionOperator.java b/src/main/java/ui/oscd/TGConnectingPointTOSCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCDActivityDiagramBox.java b/src/main/java/ui/oscd/TOSCDActivityDiagramBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCDAttributeBox.java b/src/main/java/ui/oscd/TOSCDAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCDAttributeGateBox.java b/src/main/java/ui/oscd/TOSCDAttributeGateBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCDOperationBox.java b/src/main/java/ui/oscd/TOSCDOperationBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCallInfo.java b/src/main/java/ui/oscd/TOSCallInfo.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCallOperator.java b/src/main/java/ui/oscd/TOSCallOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSClass.java b/src/main/java/ui/oscd/TOSClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSCompositionOperator.java b/src/main/java/ui/oscd/TOSCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSConnectorAssociation.java b/src/main/java/ui/oscd/TOSConnectorAssociation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSConnectorAssociationWithNavigation.java b/src/main/java/ui/oscd/TOSConnectorAssociationWithNavigation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSConnectorCompositionOperator.java b/src/main/java/ui/oscd/TOSConnectorCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSEvtInfo.java b/src/main/java/ui/oscd/TOSEvtInfo.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TOSEvtOperator.java b/src/main/java/ui/oscd/TOSEvtOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TURTLEOSClassDiagramPanel.java b/src/main/java/ui/oscd/TURTLEOSClassDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/oscd/TURTLEOSClassDiagramToolBar.java b/src/main/java/ui/oscd/TURTLEOSClassDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/procsd/ProCSDComponent.java b/src/main/java/ui/procsd/ProCSDComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/procsd/ProactiveCSDPanel.java b/src/main/java/ui/procsd/ProactiveCSDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/procsd/ProactiveCSDToolBar.java b/src/main/java/ui/procsd/ProactiveCSDToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/procsd/TGConnectingPointAssociationProCSD.java b/src/main/java/ui/procsd/TGConnectingPointAssociationProCSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/ProSMDGetMsg.java b/src/main/java/ui/prosmd/ProSMDGetMsg.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/ProSMDSendMsg.java b/src/main/java/ui/prosmd/ProSMDSendMsg.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/ProSMDStartState.java b/src/main/java/ui/prosmd/ProSMDStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/ProSMDStopState.java b/src/main/java/ui/prosmd/ProSMDStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/ProactiveSMDPanel.java b/src/main/java/ui/prosmd/ProactiveSMDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/ProactiveSMDToolBar.java b/src/main/java/ui/prosmd/ProactiveSMDToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/TGConnectingPointProSMD.java b/src/main/java/ui/prosmd/TGConnectingPointProSMD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/prosmd/TGConnectorProSMD.java b/src/main/java/ui/prosmd/TGConnectorProSMD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/EBRDDObserver.java b/src/main/java/ui/req/EBRDDObserver.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/Requirement.java b/src/main/java/ui/req/Requirement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/RequirementDiagramPanel.java b/src/main/java/ui/req/RequirementDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/RequirementDiagramToolBar.java b/src/main/java/ui/req/RequirementDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/RequirementObserver.java b/src/main/java/ui/req/RequirementObserver.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TAttributeObserver.java b/src/main/java/ui/req/TAttributeObserver.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TAttributeRequirement.java b/src/main/java/ui/req/TAttributeRequirement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TGConnectingPointDerive.java b/src/main/java/ui/req/TGConnectingPointDerive.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TGConnectingPointVerify.java b/src/main/java/ui/req/TGConnectingPointVerify.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TGConnectorComposition.java b/src/main/java/ui/req/TGConnectorComposition.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TGConnectorCopy.java b/src/main/java/ui/req/TGConnectorCopy.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TGConnectorDerive.java b/src/main/java/ui/req/TGConnectorDerive.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/req/TGConnectorVerify.java b/src/main/java/ui/req/TGConnectorVerify.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDAbsoluteTimeConstraint.java b/src/main/java/ui/sd/SDAbsoluteTimeConstraint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDActionState.java b/src/main/java/ui/sd/SDActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDCoregion.java b/src/main/java/ui/sd/SDCoregion.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDGuard.java b/src/main/java/ui/sd/SDGuard.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDInstance.java b/src/main/java/ui/sd/SDInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDRelativeTimeConstraint.java b/src/main/java/ui/sd/SDRelativeTimeConstraint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDTimeInterval.java b/src/main/java/ui/sd/SDTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDTimerCancellation.java b/src/main/java/ui/sd/SDTimerCancellation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDTimerExpiration.java b/src/main/java/ui/sd/SDTimerExpiration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SDTimerSetting.java b/src/main/java/ui/sd/SDTimerSetting.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SequenceDiagramPanel.java b/src/main/java/ui/sd/SequenceDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/SequenceDiagramToolBar.java b/src/main/java/ui/sd/SequenceDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectingPointMessageSD.java b/src/main/java/ui/sd/TGConnectingPointMessageSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectingPointTimeConstraintSD.java b/src/main/java/ui/sd/TGConnectingPointTimeConstraintSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectorMessageAsyncOrSyncSD.java b/src/main/java/ui/sd/TGConnectorMessageAsyncOrSyncSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectorMessageAsyncSD.java b/src/main/java/ui/sd/TGConnectorMessageAsyncSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectorMessageSD.java b/src/main/java/ui/sd/TGConnectorMessageSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectorMessageSyncSD.java b/src/main/java/ui/sd/TGConnectorMessageSyncSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd/TGConnectorRelativeTimeSD.java b/src/main/java/ui/sd/TGConnectorRelativeTimeSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDAbsoluteTimeConstraint.java b/src/main/java/ui/sd2/SDAbsoluteTimeConstraint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDActionState.java b/src/main/java/ui/sd2/SDActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDCoregion.java b/src/main/java/ui/sd2/SDCoregion.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDGuard.java b/src/main/java/ui/sd2/SDGuard.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDInstance.java b/src/main/java/ui/sd2/SDInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDPortForMessage.java b/src/main/java/ui/sd2/SDPortForMessage.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDRelativeTimeConstraint.java b/src/main/java/ui/sd2/SDRelativeTimeConstraint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDTimeInterval.java b/src/main/java/ui/sd2/SDTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDTimerCancellation.java b/src/main/java/ui/sd2/SDTimerCancellation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDTimerExpiration.java b/src/main/java/ui/sd2/SDTimerExpiration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SDTimerSetting.java b/src/main/java/ui/sd2/SDTimerSetting.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SequenceDiagramPanel.java b/src/main/java/ui/sd2/SequenceDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/SequenceDiagramToolBar.java b/src/main/java/ui/sd2/SequenceDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/TGConnectingPointMessageSD.java b/src/main/java/ui/sd2/TGConnectingPointMessageSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/TGConnectingPointTimeConstraintSD.java b/src/main/java/ui/sd2/TGConnectingPointTimeConstraintSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/TGConnectorMessageAsyncSD.java b/src/main/java/ui/sd2/TGConnectorMessageAsyncSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/TGConnectorMessageSD.java b/src/main/java/ui/sd2/TGConnectorMessageSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/TGConnectorMessageSyncSD.java b/src/main/java/ui/sd2/TGConnectorMessageSyncSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sd2/TGConnectorRelativeTimeSD.java b/src/main/java/ui/sd2/TGConnectorRelativeTimeSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/syscams/SysCAMSBlockDE.java b/src/main/java/ui/syscams/SysCAMSBlockDE.java new file mode 100644 index 0000000000000000000000000000000000000000..27cb244370c46088603c021522743cd9daf56e63 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSBlockDE.java @@ -0,0 +1,67 @@ +/* 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 ui.TDiagramPanel; +import ui.TGComponent; + +/** + * Class SysCAMSBlockDE + * Primitive Component. To be used in SystemC-AMS component task diagrams + * Creation: 23/04/2018 + * @version 1.0 23/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSBlockDE extends SysCAMSPrimitiveComponent { + private int period; + + public SysCAMSBlockDE(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); + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int period) { + this.period = period; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSBlockTDF.java b/src/main/java/ui/syscams/SysCAMSBlockTDF.java new file mode 100644 index 0000000000000000000000000000000000000000..a354f6566f1ef0c9df301a83054d527a98d7fd19 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSBlockTDF.java @@ -0,0 +1,76 @@ +/* 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 ui.TDiagramPanel; +import ui.TGComponent; + +/** + * Class SysCAMSBlockTDF + * Primitive Component. To be used in SystemC-AMS component task diagrams + * Creation: 23/04/2018 + * @version 1.0 23/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSBlockTDF extends SysCAMSPrimitiveComponent { + private int period; + private String processCode; + + public SysCAMSBlockTDF(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); + } + + public String getProcessCode() { + return processCode; + } + + public void setProcessCode(String processCode) { + this.processCode = processCode; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int period) { + this.period = period; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSChannelFacility.java b/src/main/java/ui/syscams/SysCAMSChannelFacility.java new file mode 100644 index 0000000000000000000000000000000000000000..3ac59014a0fd603d977865ab3065da69bd21ff9a --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSChannelFacility.java @@ -0,0 +1,180 @@ +/* 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 java.awt.*; + +/** + * Class SysCAMSChannelFacility + * Channel facility. 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 abstract class SysCAMSChannelFacility extends TGCScalableWithInternalComponent { + protected Color myColor, portColor; + + protected SysCAMSPrimitivePort inp, outp; + protected int inpIndex, outpIndex; + protected boolean conflict = false; + protected String conflictMessage; + + public SysCAMSChannelFacility(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); + + minWidth = 10; + minHeight = 10; + + moveable = true; + editable = false; + removable = true; + userResizable = false; + } + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + public void calculatePortColor() { + if (conflict) { + myColor = Color.red; + } else { + SysCAMSPrimitivePort port = inp; + if (port == null) { + port = outp; + } + if (port == null) { + portColor = null; + if (myColor == null) { + myColor = new Color(251, 252, 155- (getMyDepth() * 10)); + } + } else { + int typep = port.getPortType(); + if (typep == 0) { + myColor = ColorManager.TML_PORT_CHANNEL; + } else if (typep == 1) { + myColor = ColorManager.TML_PORT_EVENT; + } else { + myColor = ColorManager.TML_PORT_REQUEST; + } + } + } + portColor = myColor; + } + + public void setInPort(SysCAMSPrimitivePort _inp) { + inp = _inp; + calculatePortColor(); + } + + public void setOutPort(SysCAMSPrimitivePort _outp) { + outp = _outp; + calculatePortColor(); + } + + public SysCAMSPrimitivePort getInPort() { + return inp; + } + + public SysCAMSPrimitivePort getOutPort() { + return outp; + } + + public int getInpIndex() { + return inpIndex; + } + + public int getOutpIndex() { + return outpIndex; + } + + public void setInpIndex(int _inpIndex) { + inpIndex = _inpIndex; + } + + public void setOutpIndex(int _outpIndex) { + outpIndex = _outpIndex; + } + + public boolean getConflict() { + return conflict; + } + + public void setConflict(boolean _conflict, String _msg) { + conflict = _conflict; + myColor = null; + conflictMessage = _msg; + calculatePortColor(); + } + + public int getDefaultConnector() { + return TGComponentManager.CONNECTOR_PORT_TMLC; + } + + public Color getPortColor() { + return portColor; + } + + public String getAttributes() { + if (conflict) { + return conflictMessage; + } + String s = ""; + if (inp != null) { + s = s + inp.getAttributes(); + if (outp != null) { + s = s + "\n"; + } + } + if (outp != null) { + s = s + outp.getAttributes(); + } + if (conflict) { + s += "Error in path=" + conflict; + } + return s; + } +} \ No newline at end of file diff --git a/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSSignal.java b/src/main/java/ui/syscams/SysCAMSChannelOutPort.java old mode 100755 new mode 100644 similarity index 57% rename from src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSSignal.java rename to src/main/java/ui/syscams/SysCAMSChannelOutPort.java index 3c0cc72cb5908f9b89a137717286f44bdbde1aa9..ed1f34c0f92c0318cde8476d1ea4978863565536 --- a/src/main/java/heterogeneoustranslator/systemCAMStranslator/CAMSSignal.java +++ b/src/main/java/ui/syscams/SysCAMSChannelOutPort.java @@ -1,4 +1,4 @@ - /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille * * ludovic.apvrille AT enst.fr * @@ -36,76 +36,33 @@ * knowledge of the CeCILL license and that you accept its terms. */ +package ui.syscams; +import ui.TDiagramPanel; +import ui.TGComponent; +import ui.TGComponentManager; - -package heterogeneoustranslator.systemCAMStranslator; - -import myutil.GraphicLib; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import ui.*; -import ui.het.*; -import ui.util.IconManager; -import ui.window.JDialogCAMSBlocks; - -import javax.swing.*; import java.awt.*; -import java.util.LinkedList; -import java.util.Vector; - /** -* Class CAMSSignal -* Signals for SystemC-AMS Diagrams -* Creation: 27/06/2017 -* @version 1.0 27/06/2017 -* @author Côme DEMARIGNY + * Class SysCAMSChannelOutPort + * Channel out port. 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 CAMSSignal { - - public final static int IN = 0; - public final static int OUT= 1; - public final static int HYBRID_IN = 2; - public final static int HYBRID_OUT= 3; - public final static int INCORRECT=-1; - - private static int i=0; - - private String name; - - public int inout; - - public CAMSSignal (String _name, int _inout) { - inout = _inout; - } - - public CAMSSignal makeclone(){ - return this; +public class SysCAMSChannelOutPort extends SysCAMSPrimitivePort { + public SysCAMSChannelOutPort(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); + + initConnectingPoint(true, true, 1); } - - public static CAMSSignal isAValidSignal(String _name, int _inout) { - if (_inout==INCORRECT) { - return null; - } - String s = signalName(_name); - CAMSSignal cs = new CAMSSignal(s, _inout); - - return cs; + + public void drawParticularity(Graphics g) { + } + + public int getType() { + return TGComponentManager.TMLCTD_COPORT; } - - public int getInout(){ - return inout; - } - - public static String signalName(String _n){ - String s=""; - s+= _n + ": " + signalID(); - return s; - } - - public static int signalID(){i++;return i;} - } \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSComponentTaskDiagramPanel.java b/src/main/java/ui/syscams/SysCAMSComponentTaskDiagramPanel.java new file mode 100644 index 0000000000000000000000000000000000000000..90d35bc966eac7b9e58eb4bbaa704858ec980767 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSComponentTaskDiagramPanel.java @@ -0,0 +1,1261 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici + * + * ludovic.apvrille AT enst.fr + * andrea.enrici 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.TraceManager; +import org.w3c.dom.Element; +import ui.*; + +import java.util.*; + +/** + * Class SysCAMSComponentTaskDiagramPanel + * Panel for drawing SystemC-AMS elements + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +@SuppressWarnings("serial") + +public class SysCAMSComponentTaskDiagramPanel extends TDiagramPanel implements TDPWithAttributes { + + public SysCAMSComponentTaskDiagramPanel(MainGUI mgui, TToolBar _ttb) { + super(mgui, _ttb); + } + + public boolean actionOnDoubleClick(TGComponent tgc) { + return false; + } + + public boolean actionOnAdd(TGComponent tgc) { + if (tgc instanceof SysCAMSPrimitiveComponent) { + return true; + } + if (tgc instanceof SysCAMSCompositePort) { + if (tgc.getFather() instanceof SysCAMSCompositeComponent) { + getMGUI().updateReferenceToSysCAMSCompositeComponent((SysCAMSCompositeComponent)(tgc.getFather())); + } + } + + return true; + } + + public boolean actionOnRemove(TGComponent tgc) { + if (tgc instanceof SysCAMSPortConnector) { + updatePorts(); + } + if (tgc instanceof SysCAMSPrimitivePort) { + updatePorts(); + } + + if (tgc instanceof SysCAMSChannelFacility) { + updatePorts(); + } + + if (tgc instanceof SysCAMSCompositePort) { + updatePorts(); + if (fatherOfRemoved instanceof SysCAMSCompositeComponent) { + getMGUI().updateReferenceToSysCAMSCompositeComponent((SysCAMSCompositeComponent)(fatherOfRemoved)); + } + } + + return true; + } + + public List<SysCAMSPrimitivePort> getPortsByName(String name){ + List<SysCAMSPrimitivePort> ports = new ArrayList<SysCAMSPrimitivePort>(); + for (TGComponent tgc : componentList){ + + if (tgc instanceof SysCAMSPrimitiveComponent){ + SysCAMSPrimitiveComponent comp = (SysCAMSPrimitiveComponent) tgc; + List<SysCAMSPrimitivePort> cps = comp.getAllTDFOriginPorts(); + for (SysCAMSPrimitivePort port : cps){ + if (port.commName.equals(name)){ + ports.add(port); + } + } + cps = comp.getAllTDFDestinationPorts(); + for (SysCAMSPrimitivePort port : cps){ + if (port.commName.equals(name)){ + ports.add(port); + } + } + } + if (tgc instanceof SysCAMSPrimitiveComponent){ + SysCAMSPrimitiveComponent comp = (SysCAMSPrimitiveComponent) tgc; + List<SysCAMSPrimitivePort> cps = comp.getAllDEOriginPorts(); + for (SysCAMSPrimitivePort port : cps){ + if (port.commName.equals(name)){ + ports.add(port); + } + } + cps = comp.getAllDEDestinationPorts(); + for (SysCAMSPrimitivePort port : cps){ + if (port.commName.equals(name)){ + ports.add(port); + } + } + } + } + return ports; + } + + public boolean actionOnValueChanged(TGComponent tgc) { + if (tgc instanceof SysCAMSPrimitiveComponent) { + SysCAMSPrimitiveComponent t = (SysCAMSPrimitiveComponent)tgc; + mgui.newSysCAMSTaskName(tp, t.oldValue, t.getValue()); + return true; + } + if (tgc instanceof SysCAMSCompositeComponent) { + SysCAMSCompositeComponent syscamscc = (SysCAMSCompositeComponent)tgc; + getMGUI().updateReferenceToSysCAMSCompositeComponent(syscamscc); + } + return true; + } + + public boolean renamePrimitiveComponent(String oldValue, String newValue) { + return mgui.newSysCAMSComponentTaskName(tp, oldValue, newValue); + } + + public boolean namePrimitiveComponentInUse(String oldValue, String newValue) { + boolean ko = mgui.nameComponentInUse(tp, oldValue, newValue); + return ko ? ko : nameAllRecordComponentInUse(oldValue, newValue); + } + + public boolean nameRecordComponentInUse(String oldValue, String newValue) { + boolean ko = mgui.nameComponentInUse(tp, oldValue, newValue); + return ko? ko : nameAllRecordComponentInUse(oldValue, newValue); + } + + public boolean isCompositeNameUsed(String newvalue) { + for (TGComponent tgc: this.componentList) { + if (tgc.getValue().equals(newvalue)) + return true; + } + return false; + } + + public boolean nameAllRecordComponentInUse(String oldValue, String newValue) { + Iterator<SysCAMSRecordComponent> iterator = getRecordComponentList().listIterator(); + SysCAMSRecordComponent record; + + while(iterator.hasNext()) { + record = iterator.next(); + if (record.getName().compareTo(newValue) == 0) { + return true; + } + } + return false; + } + + public LinkedList<SysCAMSRecordComponent> getRecordComponentList() { + LinkedList<SysCAMSRecordComponent> ll = new LinkedList<SysCAMSRecordComponent>(); + TGComponent tgc; + + Iterator<TGComponent> iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSRecordComponent) { + ll.add((SysCAMSRecordComponent) tgc); + } + if (tgc instanceof SysCAMSCompositeComponent) { + ll.addAll(((SysCAMSCompositeComponent)tgc).getAllRecordComponents()); + } + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + ll.addAll(((SysCAMSRemoteCompositeComponent)tgc).getAllRecordComponents()); + } + } + return ll; + } + + public List<SysCAMSPrimitiveComponent> getPrimitiveComponentList() { + List<SysCAMSPrimitiveComponent> ll = new LinkedList<SysCAMSPrimitiveComponent>(); + TGComponent tgc; + + Iterator<TGComponent> iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSPrimitiveComponent) { + ll.add( (SysCAMSPrimitiveComponent) tgc ); + } + if (tgc instanceof SysCAMSCompositeComponent) { + ll.addAll(((SysCAMSCompositeComponent)tgc).getAllPrimitiveComponents()); + } + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + ll.addAll(((SysCAMSRemoteCompositeComponent)tgc).getAllPrimitiveComponents()); + } + } + return ll; + } + + public List<SysCAMSPrimitivePort> getPortsConnectedTo(SysCAMSPrimitivePort _port, List<? extends TGComponent> componentsToTakeIntoAccount) { + List<TGComponent> ll; + List<SysCAMSPrimitivePort> ret = new LinkedList<SysCAMSPrimitivePort>(); + Object o; + SysCAMSPrimitivePort p; + + ll = getAllPortsConnectedTo(_port); + Iterator<TGComponent> li = ll.listIterator(); + + while(li.hasNext()) { + o = li.next(); + + if (o instanceof SysCAMSPrimitivePort) { + p = (SysCAMSPrimitivePort)o; + + if (p.getFather() instanceof SysCAMSPrimitiveComponent) { + if (componentsToTakeIntoAccount.contains(p.getFather())) { + ret.add( p ); + } + } + } + } + return ret; + } + + public List<TGComponent> getAllPortsConnectedTo(SysCAMSPrimitivePort _port) { + List<TGComponent> ll = new LinkedList<TGComponent>(); + getAllPortsConnectedTo( ll, _port ); + return ll; + } + +// public List<String> getAllSysCAMSCommunicationNames(String _topname) { +// List<String> al = new ArrayList<String>(); +// +// SysCAMSPrimitiveComponent syscamsc; +// List<SysCAMSPrimitiveComponent> components = getPrimitiveComponentList(); +// Iterator<SysCAMSPrimitiveComponent> iterator = components.listIterator(); +// Iterator<SysCAMSPrimitivePort> li;//, li2; +// List<SysCAMSPrimitivePort> ports, portstome; +// String name, name1, name2; +// SysCAMSPrimitivePort port1, port2; +// +// int j; +// +// while( iterator.hasNext() ) { +// syscamsc = iterator.next(); +// ports = syscamsc.getAllChannelsOriginPorts(); +// li = ports.listIterator(); +// while( li.hasNext() ) { +// port1 = li.next(); +// portstome = getPortsConnectedTo( port1, components ); +// Iterator<SysCAMSPrimitivePort> ite = portstome.listIterator(); +// +// while( ite.hasNext()) { +// port2 = ite.next(); +// if (!port2.isOrigin()) { +// String []text1 = port1.getPortName().split( "," ); +// String []text2 = port2.getPortName().split( "," ); +// for ( j = 0; j < Math.min( text1.length, text2.length ); j++ ) { +// name1 = text1[j].trim(); +// name2 = text2[j].trim(); +// if( name1.equals( name2 ) ) { +// name = name1; +// } +// else { +// name = name1 + "__" + name2; +// } +// al.add( _topname + "::" + name ); +// } +// } +// } +// } +// } +// return al; +// } +// +// public List<String> getAllSysCAMSInputPorts( String _topname ) { //the destination ports +// //Use HashSet to avoid returning multiple identical ports due to the presence of join nodes +// Set<String> al = new HashSet<String>(); +// SysCAMSPrimitiveComponent syscamsc; +// List<SysCAMSPrimitiveComponent> components = getPrimitiveComponentList(); +// Iterator<SysCAMSPrimitiveComponent> iterator = components.listIterator(); +// Iterator<SysCAMSPrimitivePort> li;//, li2; +// List<SysCAMSPrimitivePort> ports, portstome; +// String name2; +// SysCAMSPrimitivePort port1, port2; +// int j; +// +// while( iterator.hasNext() ) { +// syscamsc = iterator.next(); +// ports = syscamsc.getAllChannelsOriginPorts(); +// li = ports.listIterator(); +// while( li.hasNext() ) { +// port1 = li.next(); +// portstome = getPortsConnectedTo( port1, components ); //this prints the ports via TraceManager +// Iterator<SysCAMSPrimitivePort> ite = portstome.listIterator(); +// while( ite.hasNext()) { +// port2 = ite.next(); +// if( !port2.isOrigin() ) { +// String []text1 = port1.getPortName().split( "," ); +// String []text2 = port2.getPortName().split( "," ); +// for( j = 0; j < Math.min( text1.length, text2.length ); j++ ) { +// name2 = text2[j].trim(); +// al.add( _topname + "::" + name2 ); +// } +// } +// } +// } +// } +// return new ArrayList<String>(al); +// } +// +// public List<String> getAllSysCAMSEventNames( String _topname ) { +// +// List<String> al = new ArrayList<String>(); +// SysCAMSPrimitiveComponent syscamsc; +// List<SysCAMSPrimitiveComponent> components = getPrimitiveComponentList(); +// Iterator<SysCAMSPrimitiveComponent> iterator = components.listIterator(); +// Iterator<SysCAMSPrimitivePort> li;//, li2; +// List<SysCAMSPrimitivePort> ports, portstome; +// String name, name1, name2; +// SysCAMSPrimitivePort port1, port2; +// int j; +// +// while( iterator.hasNext() ) { +// syscamsc = iterator.next() ; +// ports = syscamsc.getAllEventsOriginPorts(); +// li = ports.listIterator(); +// while( li.hasNext() ) { +// port1 = li.next(); +// portstome = getPortsConnectedTo( port1, components ); +// if ( portstome.size() == 1 ) { +// port2 = portstome.get(0); +// String []text1 = port1.getPortName().split( "," ); +// String []text2 = port2.getPortName().split( "," ); +// for ( j = 0; j < Math.min( text1.length, text2.length ); j++ ) { +// name1 = text1[j].trim(); +// name2 = text2[j].trim(); +// if( name1.equals( name2 ) ) { +// name = name1; +// } +// else { +// name = name1 + "__" + name2; +// } +// al.add( _topname + "::" + name ); +// } +// } +// } +// } +// return al; +// } + + public void getAllPortsConnectedTo( List<TGComponent> ll, SysCAMSPrimitivePort _port) { + List<TGComponent> components = getMGUI().getAllSysCAMSComponents(); + Iterator<TGComponent> iterator = components.listIterator(); + TGComponent tgc, tgc1, tgc2; + SysCAMSPortConnector portco; + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSPortConnector) { + portco = (SysCAMSPortConnector)tgc; + tgc1 = getComponentToWhichBelongs(components, portco.getTGConnectingPointP1()); + tgc2 = getComponentToWhichBelongs(components, portco.getTGConnectingPointP2()); + if ((tgc1 != null) && (tgc2 != null)) { + if (tgc1 instanceof SysCAMSRemoteCompositeComponent) { + tgc1 = ((SysCAMSRemoteCompositeComponent)tgc1).getPortOf(portco.getTGConnectingPointP1()); + } + + if (tgc2 instanceof SysCAMSRemoteCompositeComponent) { + tgc2 = ((SysCAMSRemoteCompositeComponent)tgc2).getPortOf(portco.getTGConnectingPointP2()); + } + if ((!ll.contains(tgc2) && (tgc2 != _port) && ((tgc1 == _port) || (ll.contains(tgc1))))) { + ll.add(tgc2); + iterator = components.listIterator(); + } else { + if ((!ll.contains(tgc1) && (tgc1 != _port) && ((tgc2 == _port) || (ll.contains(tgc2))))) { + ll.add(tgc1); + iterator = components.listIterator(); + } + } + } + } + } + } + + public String getXMLHead() { + return "<SysCAMSComponentTaskDiagramPanel name=\"" + name + "\"" + sizeParam() + displayParam() + zoomParam() +" >"; + } + + public String getXMLTail() { + return "</SysCAMSComponentTaskDiagramPanel>"; + } + + public String getXMLSelectedHead() { + return "<SysCAMSComponentTaskDiagramPanelCopy name=\"" + name + "\" xSel=\"" + xSel + "\" ySel=\"" + ySel + "\" widthSel=\"" + widthSel + "\" heightSel=\"" + heightSel + "\" >"; + } + + public String getXMLSelectedTail() { + return "</SysCAMSComponentTaskDiagramPanelCopy>"; + } + + public String getXMLCloneHead() { + return "<SysCAMSComponentTaskDiagramPanelCopy name=\"" + name + "\" xSel=\"" + 0 + "\" ySel=\"" + 0 + "\" widthSel=\"" + 0 + "\" heightSel=\"" + 0 + "\" >"; + } + + public String getXMLCloneTail() { + return "</SysCAMSComponentTaskDiagramPanelCopy>"; + } + + public boolean areAttributesVisible() { + return attributesVisible; + } + + public boolean areChannelVisible() { + return synchroVisible; + } + + public void setAttributesVisible(boolean b) { + attributesVisible = b; + } + + + public void setChannelVisible(boolean b) { + channelVisible = b; + } + + public String displayParam() { + String s = ""; + if (channelsVisible) { + s += " TDF=\"true\""; + } else { + s += " TDF=\"false\""; + } + if (eventsVisible) { + s += " DE=\"true\""; + } else { + s += " DE=\"false\""; + } + return s; + } + + public ArrayList<String> getAllCompositeComponent(String _name) { + ArrayList<String> list = new ArrayList<String>(); + TGComponent tgc1; + String s; + SysCAMSCompositeComponent syscamscc; + Iterator<TGComponent> iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc1 = iterator.next(); + + if (tgc1 instanceof SysCAMSCompositeComponent) { + syscamscc = (SysCAMSCompositeComponent)tgc1; + s = _name + "::" + syscamscc.getValue(); + list.add(s); + syscamscc.getAllCompositeComponents(list, _name); + } + } + return list; + } + + public String[] getCompOutTDF(){ + List<String> chls = new ArrayList<String>(); + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSPrimitiveComponent) { + SysCAMSPrimitiveComponent comp = (SysCAMSPrimitiveComponent) tgc; + List<SysCAMSPrimitivePort> ll = comp.getAllTDFOriginPorts(); + Iterator<SysCAMSPrimitivePort> ite = ll.listIterator(); + while(ite.hasNext()) { + SysCAMSPrimitivePort port = ite.next(); + chls.add(port.getPortName()); + } + } + } + String[] chlArray = new String[chls.size()]; + chlArray = chls.toArray(chlArray); + return chlArray; + } + + public String[] getCompInTDF(){ + List<String> chls = new ArrayList<String>(); + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSPrimitiveComponent) { + SysCAMSPrimitiveComponent comp = (SysCAMSPrimitiveComponent) tgc; + List<SysCAMSPrimitivePort> ll = comp.getAllTDFDestinationPorts(); + Iterator<SysCAMSPrimitivePort> ite = ll.listIterator(); + while(ite.hasNext()) { + SysCAMSPrimitivePort port = ite.next(); + chls.add(port.getPortName()); + } + } + } + String[] chlArray = new String[chls.size()]; + chlArray = chls.toArray(chlArray); + return chlArray; + } + + public SysCAMSPrimitiveComponent getPrimitiveComponentByName(String _name) { + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + SysCAMSPrimitiveComponent tmp; + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSPrimitiveComponent) { + if (tgc.getValue().equals(_name)) { + return ((SysCAMSPrimitiveComponent)tgc); + } + } + if (tgc instanceof SysCAMSCompositeComponent) { + tmp = ((SysCAMSCompositeComponent)tgc).getPrimitiveComponentByName(_name); + if (tmp != null) { + return tmp; + } + } + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + tmp = ((SysCAMSRemoteCompositeComponent)tgc).getPrimitiveComponentByName(_name); + if (tmp != null) { + return tmp; + } + } + } + return null; + } + + public void updateReferenceToSysCAMSCompositeComponent(SysCAMSCompositeComponent syscamscc) { + Iterator<TGComponent> iterator = componentList.listIterator(); + TGComponent tgc; + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSCompositeComponent) { + ((SysCAMSCompositeComponent)tgc).updateReferenceToSysCAMSCompositeComponent(syscamscc); + } + + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + ((SysCAMSRemoteCompositeComponent)tgc).updateReference(syscamscc); + } + } + } + + public SysCAMSCompositeComponent getCompositeComponentByName(String _name) { + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + SysCAMSCompositeComponent tmp; + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSCompositeComponent) { + tmp = (SysCAMSCompositeComponent)tgc; + if (tmp.getValue().equals(_name)) { + return tmp; + } + + if ((tmp = tmp.getCompositeComponentByName(name)) != null) { + return tmp; + } + } + } + return null; + } + + public void hideConnectors() { + Iterator<TGComponent> iterator = componentList.listIterator(); + SysCAMSPortConnector connector; + TGComponent tgc; + TGComponent tgc1; + TGComponent tgc2; + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSPortConnector) { + connector = (SysCAMSPortConnector) tgc; + tgc1 = getComponentToWhichBelongs(connector.getTGConnectingPointP1()); + tgc2 = getComponentToWhichBelongs(connector.getTGConnectingPointP2()); + if ((tgc1 != null) && (tgc2 != null)) { + if (tgc1.hasAnHiddenAncestor()) { + tgc.setHidden(true); + } else { + if (tgc2.hasAnHiddenAncestor()) { + tgc.setHidden(true); + } else { + tgc.setHidden(false); + } + } + } + } + } + } + + public void loadExtraParameters(Element elt) { + } + + public void setConnectorsToFront() { + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + List<TGComponent> list = new ArrayList<TGComponent>(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (!(tgc instanceof TGConnector)) { + list.add(tgc); + } + } + for(TGComponent tgc1: list) { + componentList.remove(tgc1); + componentList.add(tgc1); + } + } + + public void delayedLoad() { + Iterator<TGComponent> iterator; + TGComponent tgc; + + iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSCompositeComponent) { + ((SysCAMSCompositeComponent)(tgc)).delayedLoad(); + } + + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + try { + ((SysCAMSRemoteCompositeComponent)(tgc)).delayedLoad(); + } catch (Exception e) { + } + } + } + } + + // Returns the faulty paths + public ArrayList<SysCAMSPath> updatePorts() { + List<SysCAMSPath> paths = makePaths(); + ArrayList<SysCAMSPath> faultyPaths = new ArrayList<SysCAMSPath>(); + + // Checking rules of paths, and setting colors accordingly + for(SysCAMSPath path: paths) { + path.checkRules(); + if (path.hasError()) { + TraceManager.addDev("Path error:" + path.getErrorMessage()); + faultyPaths.add(path); + } + path.setColor(); + } + return faultyPaths; + } + + public void updatePorts_oldVersion() { + Iterator<TGComponent> iterator; + TGComponent tgc; + + // Get all SysCAMSPrimitivePort + List<SysCAMSCompositePort> ports = new ArrayList<SysCAMSCompositePort>(); + List<SysCAMSCompositePort> referencedports = new ArrayList<SysCAMSCompositePort>(); + List<SysCAMSPrimitivePort> pports = new ArrayList<SysCAMSPrimitivePort>(); + List<SysCAMSChannelFacility> facilities = new ArrayList<SysCAMSChannelFacility>(); + + iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSCompositeComponent) { + ports.addAll(((SysCAMSCompositeComponent)tgc).getAllInternalCompositePorts()); + pports.addAll(((SysCAMSCompositeComponent)tgc).getAllInternalPrimitivePorts()); + referencedports.addAll(((SysCAMSCompositeComponent)tgc).getAllReferencedCompositePorts()); + } + if (tgc instanceof SysCAMSPrimitiveComponent) { + pports.addAll(((SysCAMSPrimitiveComponent)tgc).getAllInternalPrimitivePorts()); + } + if (tgc instanceof SysCAMSCompositePort) { + ports.add((SysCAMSCompositePort)tgc); + } + if (tgc instanceof SysCAMSPrimitivePort) { + pports.add((SysCAMSPrimitivePort)tgc); + } + if (tgc instanceof SysCAMSChannelFacility) { + facilities.add((SysCAMSChannelFacility)tgc); + } + } + + // Remove All Current Links To Ports + for(SysCAMSCompositePort port:ports) { + if (!referencedports.contains(port)) { + port.purge(); + } + } + + // We take each primitive ports individually and we go thru the graph + ArrayList<SysCAMSChannelFacility> mets = new ArrayList<SysCAMSChannelFacility>(); + TGConnector connector; + TGConnectingPoint tp; + String conflictMessage; + + for(SysCAMSPrimitivePort pport:pports) { + for(int i=0; i<pport.getNbConnectingPoint(); i++) { + tp = pport.getTGConnectingPointAtIndex(i); + connector = findTGConnectorUsing(tp); + if (connector != null) { + mets.clear(); + conflictMessage = propagate(pport, tp, connector, mets); + TraceManager.addDev("Conflict=" + conflictMessage); + analysePorts(pport, mets, (conflictMessage != null), conflictMessage); + } + } + } + } + + public String propagate(SysCAMSPrimitivePort pport, TGConnectingPoint tp, TGConnector connector, ArrayList<SysCAMSChannelFacility> mets) { + TGConnectingPoint tp2; + SysCAMSChannelFacility cp = null; + String conflictMessage = null; + String conflictMessageTmp; + int outindex, inindex; + + if (tp == connector.getTGConnectingPointP1()) { + tp2 = connector.getTGConnectingPointP2(); + } else { + tp2 = connector.getTGConnectingPointP1(); + } + + TGComponent tgc = (TGComponent)(tp2.getFather()); + int index = tgc.getIndexOfTGConnectingPoint(tp2); + + if (tgc instanceof SysCAMSPrimitivePort) { + return conflictMessage; + } + + // Cycle? + if (mets.contains(tgc)) { + return "Connection contains a cycle"; + } + if(tgc instanceof SysCAMSCompositePort) { + cp = (SysCAMSChannelFacility)tgc; + mets.add(cp); + + inindex = cp.getInpIndex(); + outindex = cp.getOutpIndex(); + // Already positionned port? + if (pport.isOrigin()) { + if (cp.getOutPort() != null) { + if (pport.getPortType() != 2) { + conflictMessage = "Conflicting ports types"; + } else { + if (cp.getOutPort().getPortType() != 2) { + conflictMessage = "More than two sending non-request ports "; + } else { + if ((outindex<5 && index>4) || (outindex>4 && index<5)) { + conflictMessage = "Sending ports on both side of a composite port"; + } + } + } + } else { + if (inindex > -1) { + if ((inindex<5 && index<5) || (inindex>4 && index>4)) { + conflictMessage = "Sending and receiving ports on the same side of a composite port"; + } + } + cp.setOutPort(pport); + cp.setOutpIndex(index); + } + conflictMessageTmp = explore(pport, tp2, cp, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + } else { + if (cp.getInPort() != null) { + conflictMessage = "More than two receiving ports "; + } else { + if (outindex > -1) { + if ((index<5 && outindex<5) || (index>4 && outindex>4)) { + conflictMessage = "Sending and receiving ports on the same side of a composite port"; + } + } + cp.setInPort(pport); + cp.setInpIndex(index); + } + conflictMessageTmp = explore(pport, tp2, cp, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + } + } else if(tgc instanceof SysCAMSFork) { + // Only one out, more than one in is ok + // No SysCAMSJoin + cp = (SysCAMSChannelFacility)tgc; + mets.add(cp); + + // Checks that "mets" contains no SysCAMSJoin + for(SysCAMSChannelFacility met: mets) { + if (met instanceof SysCAMSJoin) { + conflictMessage = "Join and Fork operators are mixed in the same channel"; + conflictMessageTmp = explore(pport, tp2, cp, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + return conflictMessage; + } + } + + if (pport.isOrigin()) { + if ((cp.getInPort() != null) && (cp.getInPort() != pport)) { + conflictMessage = "More than two sending ports in a fork architecture"; + } + cp.setInPort(pport); + conflictMessageTmp = explore(pport, tp2, cp, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + } else { + conflictMessage = explore(pport, tp2, cp, mets); + } + } else if(tgc instanceof SysCAMSJoin) { + // Only one out, more than one in is ok + // No SysCAMSFork + cp = (SysCAMSChannelFacility)tgc; + mets.add(cp); + + // Checks that "mets" contains no SysCAMSJoin + for(SysCAMSChannelFacility met: mets) { + if (met instanceof SysCAMSFork) { + conflictMessage = "Fork and Join operators are mixed in the same channel"; + conflictMessageTmp = explore(pport, tp2, cp, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + return conflictMessage; + } + } + + if (!pport.isOrigin()) { + if ((cp.getOutPort() != null) && (cp.getOutPort() != pport)) { + conflictMessage = "More than two receiving ports in a join architecture"; + } + cp.setOutPort(pport); + conflictMessageTmp = explore(pport, tp2, cp, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + } else { + conflictMessage = explore(pport, tp2, cp, mets); + } + } + if (cp != null) { + if ((cp.getInPort() != null) && (cp.getOutPort() != null)){ + if (cp.getInPort().getType() != cp.getOutPort().getType()) { + conflictMessage = "Ports are not compatible"; + } else { + TraceManager.addDev("ports of " + cp + " are compatible out=" + cp.getOutPort().getType() + " in=" + cp.getInPort().getType()); + } + } + } + return conflictMessage; + } + + public String explore(SysCAMSPrimitivePort pport, TGConnectingPoint _tp, SysCAMSChannelFacility cp, ArrayList<SysCAMSChannelFacility> mets) { + String conflictMessage = null; + String conflictMessageTmp; + TGConnectingPoint tp; + TGConnector connector; + + for(int i=0; i<cp.getNbConnectingPoint(); i++) { + tp = cp.getTGConnectingPointAtIndex(i); + if (tp != _tp) { + connector = findTGConnectorUsing(tp); + if (connector != null) { + conflictMessageTmp = propagate(pport, tp, connector, mets); + if (conflictMessageTmp != null) { + conflictMessage = conflictMessageTmp; + } + } + } + } + return conflictMessage; + } + + public void analysePorts(SysCAMSPrimitivePort pport, ArrayList<SysCAMSChannelFacility> mets, boolean conflict, String message) { + if (mets.size() == 0) { + return; + } + for(SysCAMSChannelFacility port: mets) { + port.setConflict(conflict, message); + } + } + + public List<String> getAllSysCAMSTaskNames(String _topname) { + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + List<String> list = new ArrayList<String>(); + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSPrimitiveComponent) { + list.add(_topname + "::" + tgc.getValue()); + } + } + return list; + } + + public Vector<String> getAllSysCAMSTasksAttributes() { + TGComponent tgc; + Iterator<TGComponent> iterator = componentList.listIterator(); + Vector<String> list = new Vector<String>(); + + while(iterator.hasNext()) { + tgc = iterator.next(); + if( tgc instanceof SysCAMSCompositeComponent ) { + for( SysCAMSPrimitiveComponent primComp: ((SysCAMSCompositeComponent)tgc).getAllPrimitiveComponents() ) { + for( Object o: primComp.getAttributeList() ) { + String s = o.toString(); + list.add( primComp.getValue() + "." + s.substring( 2, s.length()-1 ) ); + } + } + } + } + return list; + } + + public Vector<String> getAllRecords(SysCAMSPrimitiveComponent tgc) { + Vector<String> list = new Vector<String>(); + getAllRecords((SysCAMSCompositeComponent)(tgc.getFather()), list); + return list; + } + + public void getAllRecords(SysCAMSCompositeComponent comp, Vector<String> list) { + TGComponent tgc; + if (comp == null) { + Iterator<TGComponent> iterator = componentList.listIterator(); + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSRecordComponent) { + list.add(tgc.getValue()); + } + } + return; + } + + for(int i=0; i<comp.getNbInternalTGComponent(); i++) { + tgc = comp.getInternalTGComponent(i); + if (tgc instanceof SysCAMSRecordComponent) { + list.add(tgc.getValue()); + } + } + getAllRecords((SysCAMSCompositeComponent)(comp.getFather()), list); + } + + public SysCAMSRecordComponent getRecordNamed(SysCAMSPrimitiveComponent tgc, String _nameOfRecord) { + return getRecordNamed((SysCAMSCompositeComponent)(tgc.getFather()), _nameOfRecord); + } + + public SysCAMSRecordComponent getRecordNamed(SysCAMSCompositeComponent comp, String _nameOfRecord) { + TGComponent tgc; + if (comp == null) { + Iterator<TGComponent> iterator = componentList.listIterator(); + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSRecordComponent) { + if (tgc.getValue().compareTo(_nameOfRecord) == 0) { + return (SysCAMSRecordComponent)tgc; + } + } + } + return null; + } + for(int i=0; i<comp.getNbInternalTGComponent(); i++) { + tgc = comp.getInternalTGComponent(i); + if (tgc instanceof SysCAMSRecordComponent) { + if (tgc.getValue().compareTo(_nameOfRecord) == 0) { + return (SysCAMSRecordComponent)tgc; + } + } + } + return getRecordNamed((SysCAMSCompositeComponent)(comp.getFather()), _nameOfRecord); + } + + public void findAllReferencedPanels( List<SysCAMSComponentTaskDiagramPanel> panels) { + if (panels.contains(this)) { + return; + } + panels.add(this); + + Iterator<TGComponent> iterator = componentList.listIterator(); + TGComponent tgc; + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + SysCAMSRemoteCompositeComponent remote = (SysCAMSRemoteCompositeComponent)tgc; + TDiagramPanel panel = remote.getReferencedDiagram(); + if ((panel != null) && (panel instanceof SysCAMSComponentTaskDiagramPanel)){ + ((SysCAMSComponentTaskDiagramPanel)panel).findAllReferencedPanels(panels); + } + } + if (tgc instanceof SysCAMSCompositeComponent) { + //We must find all panels referencing this component + panels.addAll(mgui.getAllPanelsReferencingSysCAMSCompositeComponent((SysCAMSCompositeComponent)tgc)); + } + } + } + + public List<SysCAMSPath> makePaths() { + List<SysCAMSComponentTaskDiagramPanel> panels = new ArrayList<SysCAMSComponentTaskDiagramPanel>(); + + // We first find all the implicated panels + findAllReferencedPanels(panels); + + List<SysCAMSPath> paths = new ArrayList<SysCAMSPath>(); + Iterator<TGComponent> iterator; + TGComponent tgc; + + // Go through the component list of all panels, and make paths. Then, go thru connectors, + // and merge paths until nomore merging is possible + for (TDiagramPanel panel: panels) { + iterator = panel.getComponentList().listIterator(); + List<SysCAMSCompositePort> listcp; + List<SysCAMSPrimitivePort> listpp; + + while(iterator.hasNext()) { + tgc = iterator.next(); + + if (tgc instanceof SysCAMSCompositeComponent) { + listcp = ((SysCAMSCompositeComponent)tgc).getAllInternalCompositePorts(); + for(SysCAMSCompositePort cp: listcp) { + addToPaths(paths, cp); + } + listpp = ((SysCAMSCompositeComponent)tgc).getAllInternalPrimitivePorts(); + for(SysCAMSPrimitivePort pp: listpp) { + addToPaths(paths, pp); + } + } + if (tgc instanceof SysCAMSPrimitiveComponent) { + listpp = ((SysCAMSPrimitiveComponent)tgc).getAllInternalPrimitivePorts(); + for(SysCAMSPrimitivePort pp: listpp) { + addToPaths(paths, pp); + } + } + if (tgc instanceof SysCAMSPrimitivePort) { + addToPaths(paths, tgc); + } + if (tgc instanceof SysCAMSChannelFacility) { + addToPaths(paths, tgc); + } + } + } + + // Use connectors to merge paths with one another + for (TDiagramPanel panel: panels) { + iterator = panel.getComponentList().listIterator(); + SysCAMSPortConnector connector; + TGComponent tgc1, tgc2; + SysCAMSPath path1, path2; + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSPortConnector) { + connector = (SysCAMSPortConnector)tgc; + if (connector.getTGConnectingPointP1().getFather() instanceof TGComponent) { + tgc1 = (TGComponent)(connector.getTGConnectingPointP1().getFather()); + } else { + tgc1 = null; + } + if (connector.getTGConnectingPointP2().getFather() instanceof TGComponent) { + tgc2 = (TGComponent)(connector.getTGConnectingPointP2().getFather()); + } else { + tgc2 = null; + } + if (tgc1 instanceof SysCAMSRemoteCompositeComponent) { + tgc1 = ((SysCAMSRemoteCompositeComponent)tgc1).getPortOf(connector.getTGConnectingPointP1()); + } + if (tgc2 instanceof SysCAMSRemoteCompositeComponent) { + tgc2 = ((SysCAMSRemoteCompositeComponent)tgc2).getPortOf(connector.getTGConnectingPointP2()); + } + if ((tgc1 != null) && (tgc2 != null) && (tgc1 != tgc2)) { + path1 = getPathOf(paths, tgc1); + path2 = getPathOf(paths, tgc2); + if ((path1 != null) && (path2 != null)) { + // Not in the same path -> we must do a merging + // and then we remove path2 from path + if (path1 != path2) { + path1.mergeWith(path2); + paths.remove(path2); + } + } + } else { + // If there is a null component in the path, then, we must set an error in the path + if ((tgc1 == null) && (tgc2 != null)) { + path2 = getPathOf(paths, tgc2); + path2.setErrorOfConnection(true); + + } + if ((tgc2 == null) && (tgc1 != null)) { + path1 = getPathOf(paths, tgc1); + path1.setErrorOfConnection(true); + } + } + } + } + } + return paths; + } + + public SysCAMSPath getPathOf( List<SysCAMSPath> paths, TGComponent tgc) { + for(SysCAMSPath path: paths) { + if (path.contains(tgc)) { + return path; + } + } + return null; + } + + public void addToPaths( List<SysCAMSPath> paths, TGComponent tgc) { + for(SysCAMSPath path: paths) { + if (path.contains(tgc)) { + return; + } + } + // Create a new path + SysCAMSPath ph = new SysCAMSPath(); + ph.addComponent(tgc); + paths.add(ph); + } + + + public void getPanelsUsingAComponent(SysCAMSCompositeComponent syscamscc, ArrayList<SysCAMSComponentTaskDiagramPanel> panels) { + Iterator<TGComponent> iterator = componentList.listIterator(); + TGComponent tgc; + + while(iterator.hasNext()) { + tgc = iterator.next(); + if (tgc instanceof SysCAMSCompositeComponent) { + if (((SysCAMSCompositeComponent)tgc).hasRefencesTo(syscamscc)) { + panels.add(this); + return; + } + } + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + if (((SysCAMSRemoteCompositeComponent)tgc).getReference() == syscamscc) { + panels.add(this); + return; + } + } + } + } + + public String[] getAllOutDE(String nameOfComponent) { + SysCAMSPrimitiveComponent comp = getPrimitiveComponentByName(nameOfComponent); + if (comp == null) { + return null; + } + List<SysCAMSPrimitivePort> ll = comp.getAllDEOriginPorts(); + String[]terms = new String[ll.size()]; + Iterator<SysCAMSPrimitivePort> ite = ll.listIterator(); + int i = 0; + + while(ite.hasNext()) { + SysCAMSPrimitivePort port = ite.next(); + terms[i] = port.getPortName(); + i ++; + } + return terms; + } + + public String[] getAllInDE(String nameOfComponent) { + SysCAMSPrimitiveComponent comp = getPrimitiveComponentByName(nameOfComponent); + if (comp == null) { + return null; + } + List<SysCAMSPrimitivePort> ll = comp.getAllDEDestinationPorts(); + String[]terms = new String[ll.size()]; + ListIterator<SysCAMSPrimitivePort> ite = ll.listIterator(); + int i = 0; + while(ite.hasNext()) { + SysCAMSPrimitivePort port = ite.next(); + terms[i] = port.getPortName(); + i ++; + } + return terms; + } + + public String[] getAllOutTDF(String nameOfComponent) { + SysCAMSPrimitiveComponent comp = getPrimitiveComponentByName(nameOfComponent); + if (comp == null) { + return null; + } + List<SysCAMSPrimitivePort> ll = comp.getAllTDFOriginPorts(); + String[]terms = new String[ll.size()]; + Iterator<SysCAMSPrimitivePort> ite = ll.listIterator(); + int i = 0; + while(ite.hasNext()) { + SysCAMSPrimitivePort port = ite.next(); + terms[i] = port.getPortName(); + i++; + } + return terms; + } + + public String[] getAllInTDF(String nameOfComponent) { + SysCAMSPrimitiveComponent comp = getPrimitiveComponentByName(nameOfComponent); + if (comp == null) { + return null; + } + + List<SysCAMSPrimitivePort> ll = comp.getAllTDFDestinationPorts(); + String[]terms = new String[ll.size()]; + Iterator<SysCAMSPrimitivePort> ite = ll.listIterator(); + int i = 0; + + while(ite.hasNext()) { + SysCAMSPrimitivePort port = ite.next(); + terms[i] = port.getPortName(); + i++; + } + return terms; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSComponentTaskDiagramToolBar.java b/src/main/java/ui/syscams/SysCAMSComponentTaskDiagramToolBar.java new file mode 100644 index 0000000000000000000000000000000000000000..7f20e799aa06359701a85fbf211d023b920ccaad --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSComponentTaskDiagramToolBar.java @@ -0,0 +1,124 @@ +/* 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 ui.MainGUI; +import ui.TGUIAction; +import ui.TToolBar; + +import javax.swing.*; + +/** + * Class SysCAMSComponentTaskDiagramToolBar Implements the toolbar to be used in + * conjunction with the panel of a SystemC-AMS diagram Creation: 22/04/2018 + * + * @version 1.0 22/04/2018 + * @author Irina Kit Yan LEE + * @see SysCAMSComponentTaskDiagramPanel + */ + +@SuppressWarnings("serial") + +public class SysCAMSComponentTaskDiagramToolBar extends TToolBar { + + public SysCAMSComponentTaskDiagramToolBar(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.CAMS_EDIT].setEnabled(b); + mgui.actions[TGUIAction.UML_NOTE].setEnabled(b); + mgui.actions[TGUIAction.CAMS_CONNECTOR].setEnabled(b); + mgui.actions[TGUIAction.CAMS_BLOCK_TDF].setEnabled(b); + mgui.actions[TGUIAction.CAMS_BLOCK_DE].setEnabled(b); + mgui.actions[TGUIAction.CAMS_PORT_TDF].setEnabled(b); + mgui.actions[TGUIAction.CAMS_PORT_DE].setEnabled(b); + mgui.actions[TGUIAction.CAMS_PORT_CONVERTER].setEnabled(b); + mgui.actions[TGUIAction.CAMS_CLUSTER].setEnabled(b); + + mgui.actions[TGUIAction.ACT_MODEL_CHECKING].setEnabled(b); + mgui.actions[TGUIAction.ACT_ONECLICK_LOTOS_RG].setEnabled(b); + mgui.actions[TGUIAction.ACT_SIMU_SYSTEMC].setEnabled(b); + + mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(b); + mgui.updateZoomInfo(); + } + + protected void setButtons() { + JButton button; + + button = this.add(mgui.actions[TGUIAction.CAMS_EDIT]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.UML_NOTE]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.CAMS_CLUSTER]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.CAMS_PORT_CONVERTER]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.CAMS_BLOCK_TDF]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.CAMS_PORT_TDF]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.CAMS_BLOCK_DE]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.CAMS_PORT_DE]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.CAMS_CONNECTOR]); + button.addMouseListener(mgui.mouseHandler); + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSCompositeComponent.java b/src/main/java/ui/syscams/SysCAMSCompositeComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..c99d162ece990667ed5f639462f8f7c967eeb841 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSCompositeComponent.java @@ -0,0 +1,632 @@ +/* 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 org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import ui.*; +import ui.util.IconManager; + +import javax.swing.*; +import java.awt.*; +import java.util.ArrayList; +import java.util.ListIterator; + +/** + * Class SysCAMSCompositeComponent + * Composite Component. To be used in SystemC-AMS diagrams + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSCompositeComponent extends TGCScalableWithInternalComponent implements SwallowTGComponent, SwallowedTGComponent, HiddenInternalComponents { + private int maxFontSize = 20; + private int minFontSize = 4; + private int currentFontSize = -1; + private boolean displayText = true; + private Color myColor; + private int iconSize = 17; + + private int textX = 15; // border for ports + private double dtextX = 0.0; + + private boolean hiddeni; + + private int compositePortNb = 0; + + public SysCAMSCompositeComponent(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(250, 200); + + oldScaleFactor = tdp.getZoom(); + dtextX = textX * oldScaleFactor; + textX = (int)dtextX; + dtextX = dtextX - textX; + + minWidth = 1; + minHeight = 1; + + nbConnectingPoint = 0; + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + maxWidth = 2000; + maxHeight = 2000; + + moveable = true; + editable = true; + removable = true; + userResizable = true; + + value = "Cluster"; + name = "Composite component"; + + myImageIcon = IconManager.imgic1200; + } + + public void internalDrawing(Graphics g) { + int w; + int c; + Font f = g.getFont(); + Font fold = f; + + if (myColor == null) { + if (ColorManager.TML_COMPOSITE_COMPONENT == Color.white) { + myColor = Color.white; + } else { + myColor = Color.white; + } + } + if ((rescaled) && (!tdp.isScaled())) { + if (currentFontSize == -1) { + currentFontSize = f.getSize(); + } + rescaled = false; + // Must set the font size .. + // Find the biggest font not greater than max_font size + // By Increment of 1 + // Or decrement of 1 + // If font is less than 4, no text is displayed + + int maxCurrentFontSize = Math.max(0, Math.min(height-(2*textX), maxFontSize)); + + while(maxCurrentFontSize > (minFontSize-1)) { + f = f.deriveFont((float)maxCurrentFontSize); + g.setFont(f); + w = g.getFontMetrics().stringWidth(value); + c = width - iconSize - (2 * textX); + if (w < c) { + break; + } + maxCurrentFontSize --; + } + currentFontSize = maxCurrentFontSize; + displayText = currentFontSize >= minFontSize; + } + // Zoom is assumed to be computed + Color col = g.getColor(); + g.drawRect(x, y, width, height); + if ((width > 2) && (height > 2)) { + g.setColor(myColor); + g.fillRect(x+1, y+1, width-1, height-1); + g.setColor(col); + } + // Font size + if (displayText) { + f = f.deriveFont((float)currentFontSize); + g.setFont(f); + w = g.getFontMetrics().stringWidth(value); + if (!(w < (width - 2 * (iconSize + textX)))) { + g.drawString(value, x + textX + 1, y + currentFontSize + textX); + } else { + g.drawString(value, x + (width - w)/2, y + currentFontSize + textX); + } + } + g.setFont(fold); +// // Icon +// if ((width>30) && (height > (iconSize + 2*textX))) { +// g.drawImage(IconManager.imgic1200.getImage(), x + width - iconSize - textX, y + textX, null); +// } + } + + public void rescale(double scaleFactor){ + dtextX = (textX + dtextX) / oldScaleFactor * scaleFactor; + textX = (int)(dtextX); + dtextX = dtextX - textX; + super.rescale(scaleFactor); + } + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + public boolean editOndoubleClick(JFrame frame) { + String s = (String)JOptionPane.showInputDialog(frame, "Name:", "Setting component name", + JOptionPane.PLAIN_MESSAGE, IconManager.imgic100, + null, + getValue()); + if ((s != null) && (s.length() > 0)) { + if (!TAttribute.isAValidId(s, false, false)) { + JOptionPane.showMessageDialog(frame, + "Could not change the name of the component: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); + return false; + } + if (((SysCAMSComponentTaskDiagramPanel)(tdp)).isCompositeNameUsed(s)) { + JOptionPane.showMessageDialog(frame, + "Error: the name is already in use", + "Name modification", + JOptionPane.ERROR_MESSAGE); + return false; + } + setValueWithChange(s); + return true; + } + return false; + } + + public int getType() { + return TGComponentManager.TMLCTD_CCOMPONENT; + } + + public void wasSwallowed() { + myColor = null; + } + + public void wasUnswallowed() { + myColor = null; + setFather(null); + TDiagramPanel tdp = getTDiagramPanel(); + setCdRectangle(tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY()); + } + + public boolean acceptSwallowedTGComponent(TGComponent tgc) { + if (tgc instanceof SysCAMSCompositeComponent) { + return true; + } + if (tgc instanceof SysCAMSRecordComponent) { + return true; + } + if (tgc instanceof SysCAMSPrimitiveComponent) { + return true; + } + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + return true; + } + return tgc instanceof SysCAMSCompositePort; + } + + public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { + boolean swallowed = false; + + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SwallowTGComponent) { + if (((SwallowTGComponent)tgcomponent[i]).acceptSwallowedTGComponent(tgc)) { + if (tgcomponent[i].isOnMe(x, y) != null) { + swallowed = true; + ((SwallowTGComponent)tgcomponent[i]).addSwallowedTGComponent(tgc, x, y); + break; + } + } + } + } + if (swallowed) { + return true; + } + if (!acceptSwallowedTGComponent(tgc)) { + return false; + } + // Choose its position + + // Make it an internal component + // It's one of my son + tgc.setFather(this); + tgc.setDrawingZone(true); + + //Set its coordinates + if (tgc instanceof SysCAMSCompositeComponent) { + tgc.resizeWithFather(); + } + + if (tgc instanceof SysCAMSRecordComponent) { + tgc.resizeWithFather(); + } + + if (tgc instanceof SysCAMSPrimitiveComponent) { + tgc.resizeWithFather(); + } + + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + tgc.resizeWithFather(); + } + if (tgc instanceof SysCAMSCompositePort) { + tgc.resizeWithFather(); + compositePortNb ++; + } + //add it + addInternalComponent(tgc, 0); + return true; + } + + public void removeSwallowedTGComponent(TGComponent tgc) { + if (tgc instanceof SysCAMSCompositePort) { + portRemoved(); + } + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] == tgc) { + nbInternalTGComponent = nbInternalTGComponent - 1; + if (nbInternalTGComponent == 0) { + tgcomponent = null; + } else { + TGComponent [] tgcomponentbis = new TGComponent[nbInternalTGComponent]; + for(int j=0; j<nbInternalTGComponent; j++) { + if (j<i) { + tgcomponentbis[j] = tgcomponent[j]; + } + if (j>=i) { + tgcomponentbis[j] = tgcomponent[j+1]; + } + } + tgcomponent = tgcomponentbis; + } + break; + } + } + } + + public void hasBeenResized() { + rescaled = true; + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + tgcomponent[i].resizeWithFather(); + } + if (tgcomponent[i] instanceof SysCAMSPrimitiveComponent) { + tgcomponent[i].resizeWithFather(); + } + if (tgcomponent[i] instanceof SysCAMSRecordComponent) { + tgcomponent[i].resizeWithFather(); + } + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + tgcomponent[i].resizeWithFather(); + } + if (tgcomponent[i] instanceof SysCAMSCompositePort) { + tgcomponent[i].resizeWithFather(); + } + } + if (getFather() != null) { + resizeWithFather(); + } + } + + public void resizeWithFather() { + if ((father != null) && ((father instanceof SysCAMSCompositeComponent) ||(father instanceof SysCAMSPrimitiveComponent))) { + // Too large to fit in the father? -> resize it! + resizeToFatherSize(); + + setCdRectangle(0, father.getWidth() - getWidth(), 0, father.getHeight() - getHeight()); + setMoveCd(x, y); + } + } + + public java.util.List<SysCAMSPrimitiveComponent> getAllPrimitiveComponents() { + ArrayList<SysCAMSPrimitiveComponent> ll = new ArrayList<SysCAMSPrimitiveComponent>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + ll.addAll(((SysCAMSCompositeComponent)tgcomponent[i]).getAllPrimitiveComponents()); + } + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + ll.addAll(((SysCAMSRemoteCompositeComponent)tgcomponent[i]).getAllPrimitiveComponents()); + } + if (tgcomponent[i] instanceof SysCAMSPrimitiveComponent) { + ll.add(((SysCAMSPrimitiveComponent)(tgcomponent[i]))); + } + } + return ll; + } + + public ArrayList<SysCAMSRecordComponent> getAllRecordComponents() { + ArrayList<SysCAMSRecordComponent> ll = new ArrayList<SysCAMSRecordComponent>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + ll.addAll(((SysCAMSCompositeComponent)tgcomponent[i]).getAllRecordComponents()); + } + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + ll.addAll(((SysCAMSRemoteCompositeComponent)tgcomponent[i]).getAllRecordComponents()); + } + + if (tgcomponent[i] instanceof SysCAMSRecordComponent) { + ll.add(((SysCAMSRecordComponent)(tgcomponent[i]))); + } + } + return ll; + } + + public void getAllCompositeComponents(ArrayList<String> list, String _name) { + String s; + SysCAMSCompositeComponent syscamscc; + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + syscamscc = (SysCAMSCompositeComponent)tgcomponent[i]; + s = _name + "::" + syscamscc.getValue(); + list.add(s); + syscamscc.getAllCompositeComponents(list, _name); + } + } + } + + public ArrayList<SysCAMSCompositePort> getAllInternalCompositePorts() { + ArrayList<SysCAMSCompositePort> list = new ArrayList<SysCAMSCompositePort>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + list.addAll(((SysCAMSCompositeComponent)tgcomponent[i]).getAllInternalCompositePorts()); + } + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + list.addAll(((SysCAMSRemoteCompositeComponent)tgcomponent[i]).getAllInternalCompositePorts()); + } + if (tgcomponent[i] instanceof SysCAMSCompositePort) { + list.add((SysCAMSCompositePort)(tgcomponent[i])); + } + } + return list; + } + + public ArrayList<SysCAMSCompositePort> getAllReferencedCompositePorts() { + ArrayList<SysCAMSCompositePort> list = new ArrayList<SysCAMSCompositePort>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + list.addAll(((SysCAMSCompositeComponent)tgcomponent[i]).getAllReferencedCompositePorts()); + } + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + list.addAll(((SysCAMSRemoteCompositeComponent)tgcomponent[i]).getAllInternalCompositePorts()); + } + } + return list; + } + + public ArrayList<SysCAMSCompositePort> getFirstLevelCompositePorts() { + ArrayList<SysCAMSCompositePort> list = new ArrayList<SysCAMSCompositePort>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositePort) { + list.add((SysCAMSCompositePort)(tgcomponent[i])); + } + } + return list; + } + + public ArrayList<SysCAMSPrimitivePort> getAllInternalPrimitivePorts() { + ArrayList<SysCAMSPrimitivePort> list = new ArrayList<SysCAMSPrimitivePort>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + list.addAll(((SysCAMSCompositeComponent)tgcomponent[i]).getAllInternalPrimitivePorts()); + } + if (tgcomponent[i] instanceof SysCAMSPrimitiveComponent) { + list.addAll(((SysCAMSPrimitiveComponent)tgcomponent[i]).getAllInternalPrimitivePorts()); + } + } + return list; + } + + public SysCAMSPrimitiveComponent getPrimitiveComponentByName(String _name) { + SysCAMSPrimitiveComponent tgc; + ListIterator<SysCAMSPrimitiveComponent> li = getAllPrimitiveComponents().listIterator(); + + while(li.hasNext()) { + tgc = li.next(); + if (tgc.getValue().equals(_name)) { + return tgc; + } + } + return null; + } + + public SysCAMSCompositeComponent getCompositeComponentByName(String _name) { + TGComponent tgc; + SysCAMSCompositeComponent tmp; + + for(int i=0; i<nbInternalTGComponent; i++) { + tgc = tgcomponent[i]; + if (tgc instanceof SysCAMSCompositeComponent) { + tmp = (SysCAMSCompositeComponent)tgc; + if (tmp.getValue().equals(_name)) { + return tmp; + } + + if ((tmp = tmp.getCompositeComponentByName(name)) != null) { + return tmp; + } + } + } + return null; + } + + public void setInternalsHidden(boolean hide) { + hiddeni = hide; + for(int i=0; i<nbInternalTGComponent; i++) { + if (!(tgcomponent[i] instanceof SysCAMSCompositePort)) { + tgcomponent[i].setHidden(hide); + } + } + + if (tdp instanceof SysCAMSComponentTaskDiagramPanel) { + ((SysCAMSComponentTaskDiagramPanel)tdp).hideConnectors(); + } + } + + public boolean areInternalsHidden() { + return hiddeni; + } + + public void drawInternalComponentsWhenHidden(Graphics g) { + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositePort) { + tgcomponent[i].draw(g); + } + } + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<info hiddeni=\"" + hiddeni + "\" "); + sb.append("/>\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(int j=0; j<nli.getLength(); j++) { + n2 = nli.item(j); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("info")) { + if (elt.getAttribute("hiddeni").equals("true")) { + setInternalsHidden(true); + } + } + + } + } + } + } + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + + public void drawTGConnectingPoint(Graphics g, int type) { + for (int i=0; i<nbConnectingPoint; i++) { + if (connectingPoint[i].isCompatibleWith(type)) { + connectingPoint[i].draw(g); + } + } + + for(int i=0; i<nbInternalTGComponent; i++) { + if (hiddeni) { + if (tgcomponent[i] instanceof SysCAMSCompositePort) { + tgcomponent[i].drawTGConnectingPoint(g, type); + } + } else { + tgcomponent[i].drawTGConnectingPoint(g, type); + } + } + } + + public String getExtendedValue() { + return getValuePanel() + "::" + getValue(); + } + + public void myActionWhenRemoved() { + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + tgcomponent[i].myActionWhenRemoved(); + } + } + tdp = null; + } + + public void updateReferenceToSysCAMSCompositeComponent(SysCAMSCompositeComponent syscamscc) { + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + ((SysCAMSRemoteCompositeComponent)tgcomponent[i]).updateReference(syscamscc); + } + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + ((SysCAMSCompositeComponent)tgcomponent[i]).updateReferenceToSysCAMSCompositeComponent(syscamscc); + } + } + } + + public void delayedLoad() { + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + try { + ((SysCAMSRemoteCompositeComponent)tgcomponent[i]).delayedLoad(); + } catch (Exception e) { + } + } + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + ((SysCAMSCompositeComponent)tgcomponent[i]).delayedLoad(); + } + } + } + + public int getCompositePortNb() { + return compositePortNb; + } + + public void portRemoved() { + compositePortNb --; + } + + public boolean hasRefencesTo(SysCAMSCompositeComponent syscamscc) { + boolean b; + + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSRemoteCompositeComponent) { + b = ((SysCAMSRemoteCompositeComponent)tgcomponent[i]).getReference() == syscamscc; + if (b) { + return true; + } + } + if (tgcomponent[i] instanceof SysCAMSCompositeComponent) { + b = ((SysCAMSCompositeComponent)tgcomponent[i]).hasRefencesTo(syscamscc); + if (b) { + return true; + } + } + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSCompositePort.java b/src/main/java/ui/syscams/SysCAMSCompositePort.java new file mode 100644 index 0000000000000000000000000000000000000000..5a8ac86da5109dca56b06a5d86c411fa80ca12a4 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSCompositePort.java @@ -0,0 +1,325 @@ +/* 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 ui.window.JDialogSysCAMSPortConverter; + +import java.awt.*; +import javax.swing.ImageIcon; +import javax.swing.JFrame; + +/** + * Class SysCAMSCompositePort + * Composite port. To be used in SystemC-AMS diagrams + * Creation: 29/04/2018 + * @version 1.0 29/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSCompositePort extends SysCAMSChannelFacility implements SwallowedTGComponent, WithAttributes { + private int oldx, oldy; + private int halfwidth = 13; + private int currentOrientation = GraphicLib.NORTH; + protected int decPoint = 3; + private ImageIcon portImageIconW, portImageIconE, portImageIconN, portImageIconS; + public String commName; + + // Attributes + public String portName; + public int period; + public int rate; + public int delay; + public String type; + public String origin; + + public SysCAMSCompositePort(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*halfwidth, 2*halfwidth); + + minWidth = 10; + minHeight = 10; + + nbConnectingPoint = 10; + connectingPoint = new TGConnectingPoint[10]; + int i; + for (i=0; i<5; i++) { + connectingPoint[i] = new SysCAMSPortConnectingPoint(this, 0, 0, true, true, 0.5, 0.0); + } + for(i=5; i<10; i++) { + connectingPoint[i] = new SysCAMSPortConnectingPoint(this, 0, 0, true, true, 0.5, 1.0); + } + + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + value = ""; + name = "Composite port"; + commName = "port"; + + myImageIcon = IconManager.imgic1204; + portImageIconW = IconManager.imgic8002; + portImageIconE = IconManager.imgic8003; + portImageIconN = IconManager.imgic8004; + portImageIconS = IconManager.imgic8005; + + // Initialization of port attributes + ((SysCAMSPortConverter) this).setPeriod(0); + ((SysCAMSPortConverter) this).setDelay(0); + ((SysCAMSPortConverter) this).setRate(0); + ((SysCAMSPortConverter) this).setConvType(""); + ((SysCAMSPortConverter) this).setOrigin(""); + } + + public void internalDrawing(Graphics g) { + if ((x != oldx) | (oldy != y)) { + // Component has moved! + manageMove(); + oldx = x; + oldy = y; + } + if (rescaled) { + rescaled = false; + } + + calculatePortColor(); + + // Zoom is assumed to be computed + Color c = g.getColor(); + g.setColor(c); + + TGComponent tgc = getFather(); + + if ((tgc != null) && (tgc instanceof SysCAMSCompositeComponent)) { + if (tgc instanceof SysCAMSCompositeComponent && this instanceof SysCAMSCompositePort) { + switch(currentOrientation) { + case GraphicLib.NORTH: + g.drawRect(x-1+width/2-portImageIconN.getIconWidth()/2, y-1+height/2-portImageIconN.getIconHeight()/2, portImageIconN.getIconWidth()+2, portImageIconN.getIconHeight()+2); + g.drawImage(portImageIconN.getImage(), x+width/2-portImageIconN.getIconWidth()/2, y+height/2-portImageIconN.getIconHeight()/2, null); + break; + case GraphicLib.SOUTH: + g.drawRect(x+width/2-portImageIconS.getIconWidth()/2, y+height/2-portImageIconS.getIconHeight()/2, portImageIconS.getIconWidth(), portImageIconS.getIconHeight()); + g.drawImage(portImageIconS.getImage(), x+width/2-portImageIconS.getIconWidth()/2, y+height/2-portImageIconS.getIconHeight()/2, null); + break; + case GraphicLib.WEST: + g.drawRect(x+width/2-portImageIconW.getIconWidth()/2, y+height/2-portImageIconW.getIconHeight()/2, portImageIconW.getIconWidth(), portImageIconW.getIconHeight()); + g.drawImage(portImageIconW.getImage(), x+width/2-portImageIconW.getIconWidth()/2, y+height/2-portImageIconW.getIconHeight()/2, null); + break; + case GraphicLib.EAST: + default: + g.drawRect(x+width/2-portImageIconE.getIconWidth()/2, y+height/2-portImageIconE.getIconHeight()/2, portImageIconE.getIconWidth(), portImageIconE.getIconHeight()); + g.drawImage(portImageIconE.getImage(), x+width/2-portImageIconE.getIconWidth()/2, y+height/2-portImageIconE.getIconHeight()/2, null); + } + } + } + + int ft = 10; + if ((tgc != null) && (tgc instanceof SysCAMSPrimitiveComponent)) { + ft = ((SysCAMSPrimitiveComponent)tgc).getCurrentFontSize(); + } + int w; + Font f = g.getFont(); + Font fold = f; + + int si = Math.min(8, (int)((float)ft - 2)); + f = f.deriveFont((float)si); + g.setFont(f); + w = g.getFontMetrics().stringWidth(commName); + if (w < ((int)(width * 1.5))) { + g.drawString(commName, x, y-1); + } + + g.setFont(fold); + + // Draw arrow showing the connection if necessary + if ((!conflict) && (outp != null || inp != null)) { + int wayTo = currentOrientation; + if (inp != null) { + if (inpIndex > 4) { + wayTo = (wayTo + 2 )% 4; + } + } else { + if (outpIndex < 5) { + wayTo = (wayTo + 2 )% 4; + } + } + + int []px = new int[3]; + int []py = new int[3]; + switch(wayTo) { + case GraphicLib.NORTH: + case GraphicLib.SOUTH: + px[0] = x+width/2; + px[1] = x +width/2; + py[0] = y; + py[1] = y + height; + break; + case GraphicLib.EAST: + case GraphicLib.WEST: + default: + px[0] = x; + px[1] = x +width; + py[0] = y+height/2; + py[1] = y + height/2; + break; + } + g.drawPolygon(px, py, 2); + } + } + + public void manageMove() { + if (father != null) { + Point p = GraphicLib.putPointOnRectangle(x+(width/2), y+(height/2), father.getX(), father.getY(), father.getWidth(), father.getHeight()); + + x = p.x - width/2; + y = p.y - height/2; + + setMoveCd(x, y); + + int orientation = GraphicLib.getCloserOrientation(x+(width/2), y+(height/2), father.getX(), father.getY(), father.getWidth(), father.getHeight()); + if (orientation != currentOrientation) { + setOrientation(orientation); + } + } + } + + // TGConnecting points .. + public void setOrientation(int orientation) { + currentOrientation = orientation; + double w0, h0,w1, h1; + + switch(orientation) { + case GraphicLib.NORTH: + w0 = 0.5; + h0 = 0.0; + w1 = 0.5; + h1 = 1.0; + break; + case GraphicLib.WEST: + w0 = 0.0; + h0 = 0.5; + w1 = 1.0; + h1 = 0.5; + break; + case GraphicLib.SOUTH: + w1 = 0.5; + h1 = 0.0; + w0 = 0.5; + h0 = 1.0; + break; + case GraphicLib.EAST: + default: + w1 = 0.0; + h1 = 0.5; + w0 = 1.0; + h0 = 0.5; + } + + for (int i=0; i<5; i++) { + ((SysCAMSPortConnectingPoint)(connectingPoint[i])).setW(w0); + ((SysCAMSPortConnectingPoint)(connectingPoint[i])).setH(h0); + ((SysCAMSPortConnectingPoint)(connectingPoint[i+5])).setW(w1); + ((SysCAMSPortConnectingPoint)(connectingPoint[i+5])).setH(h1); + } + } + + public int getType() { + return TGComponentManager.TMLCTD_CPORT; + } + + public void wasSwallowed() { + myColor = null; + } + + public void wasUnswallowed() { + myColor = null; + setFather(null); + TDiagramPanel tdp = getTDiagramPanel(); + setCdRectangle(tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY()); + } + + public void resizeWithFather() { + if ((father != null) && (father instanceof SysCAMSCompositeComponent)) { + // Too large to fit in the father? -> resize it! + setCdRectangle(0-getWidth()/2, father.getWidth() - (getWidth()/2), 0-getHeight()/2, father.getHeight() - (getHeight()/2)); + setMoveCd(x, y); + oldx = -1; + oldy = -1; + } + } + + public boolean editOndoubleClick(JFrame frame) { + JDialogSysCAMSPortConverter jtdf = new JDialogSysCAMSPortConverter((SysCAMSPortConverter) this); + jtdf.setVisible(true); + + ((SysCAMSComponentTaskDiagramPanel)tdp).updatePorts(); + return true; + } + + public String getPortName() { + return commName; + } + + public void setPortName(String s) { + commName = s; + } + + public void purge() { + inp = null; + outp = null; + conflict = false; + inpIndex = -1; + outpIndex = -1; + myColor = null; + calculatePortColor(); + } + + public void myActionWhenRemoved() { + tdp = null; + TGComponent tgc = getFather(); + if (tgc instanceof SysCAMSCompositeComponent) { + ((SysCAMSCompositeComponent)(tgc)).portRemoved(); + } + father = null; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSFork.java b/src/main/java/ui/syscams/SysCAMSFork.java new file mode 100644 index 0000000000000000000000000000000000000000..b3ec86bac7b60634eb9bb854550d752f2fd4cec0 --- /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 diff --git a/src/main/java/ui/syscams/SysCAMSJoin.java b/src/main/java/ui/syscams/SysCAMSJoin.java new file mode 100644 index 0000000000000000000000000000000000000000..7bd2da853241a502ba8384148de189aa65ccd620 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSJoin.java @@ -0,0 +1,115 @@ +/* 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 SysCAMSJoin + * Join 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 SysCAMSJoin extends SysCAMSChannelFacility implements WithAttributes { + protected int radius = 11; + protected int decPoint = 3; + + public SysCAMSJoin(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]; + + // output + connectingPoint[0] = new SysCAMSPortConnectingPoint(this, 0, 0, false, true, 1.0, 0.5); + // input + connectingPoint[1] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.0, 0.5); + connectingPoint[2] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.0, 0.5); + connectingPoint[3] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.25, 0.134); + connectingPoint[4] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.25, 0.134); + connectingPoint[5] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.25, 0.866); + connectingPoint[6] = new SysCAMSPortConnectingPoint(this, 0, 0, true, false, 0.25, 0.866); + + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + value = "J"; + 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); + g.drawLine(x+radius/2, (int)(y+(0.134*radius)), x+radius, y+radius); + g.drawLine(x+radius/2, (int)(y+2*radius-(0.134*radius)), x+radius, y+radius); + + GraphicLib.arrowWithLine(g, 1, 1, 5, x+radius, y+radius, x+2*radius, y+radius, false); + } + + public int getType() { + return TGComponentManager.TMLCTD_JOIN; + } +} diff --git a/src/main/java/ui/syscams/SysCAMSPath.java b/src/main/java/ui/syscams/SysCAMSPath.java new file mode 100644 index 0000000000000000000000000000000000000000..9b05b7de2dd0bb7c36c54b4c59ede8ca97dae344 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPath.java @@ -0,0 +1,360 @@ +/* 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 ui.TGComponent; +import java.util.ArrayList; + +/** + * Class SysCAMSPath + * Notion of Path. To be used to analyze the correctness of paths in the model + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSPath { + + public ArrayList<SysCAMSPrimitivePort> producerPorts; + public ArrayList<SysCAMSPrimitivePort> consumerPorts; + + // Facilities + public ArrayList<SysCAMSCompositePort> cports; + public ArrayList<SysCAMSFork> forks; + public ArrayList<SysCAMSJoin> joins; + + private boolean errorOfConnection = false; + + private int errorNumber; + private TGComponent faultyComponent; + + + private String[] errors = {"Fork and Join operators in the same path", + "Must have at least one sender", + "Must have at least one receiver", + "More than one sender in a path with a fork", + "Senders and receivers are not of the same kind", + "One of more element of the path is badly connected", + "Events are not compatible with fork/join", + "Requests are not compatible with fork/join", + "Events/requests must all have the same parameters", + "Channels and events can have only one input and one output" + }; + + public SysCAMSPath() { + cports = new ArrayList<SysCAMSCompositePort>(); + producerPorts = new ArrayList<SysCAMSPrimitivePort>(); + consumerPorts = new ArrayList<SysCAMSPrimitivePort>(); + forks = new ArrayList<SysCAMSFork>(); + joins = new ArrayList<SysCAMSJoin>(); + } + + public void addComponent(TGComponent _tgc) { + if (_tgc instanceof SysCAMSCompositePort) { + cports.add((SysCAMSCompositePort)_tgc); + } + if (_tgc instanceof SysCAMSPrimitivePort) { + SysCAMSPrimitivePort p = (SysCAMSPrimitivePort)_tgc; + if (p.isOrigin()) { + producerPorts.add(p); + } else { + consumerPorts.add(p); + } + } + if (_tgc instanceof SysCAMSFork) { + forks.add((SysCAMSFork)_tgc); + } + if (_tgc instanceof SysCAMSJoin) { + joins.add((SysCAMSJoin)_tgc); + } + } + + public void setErrorOfConnection(boolean _err) { + errorOfConnection = _err; + } + + public boolean getErrorOfConnection() { + return errorOfConnection; + } + + public boolean contains(TGComponent tgc) { + if (cports.contains(tgc)) { + return true; + } + if (producerPorts.contains(tgc)) { + return true; + } + if (consumerPorts.contains(tgc)) { + return true; + } + if (forks.contains(tgc)) { + return true; + } + return joins.contains(tgc); + } + + public void mergeWith(SysCAMSPath _path) { + cports.addAll(_path.cports); + producerPorts.addAll(_path.producerPorts); + consumerPorts.addAll(_path.consumerPorts); + forks.addAll(_path.forks); + joins.addAll(_path.joins); + setErrorOfConnection(getErrorOfConnection() || _path.getErrorOfConnection()); + } + + public boolean hasError() { + return (errorNumber != -1); + } + + public String getErrorMessage() { + if (hasError()) { + return errors[errorNumber]; + } + return ""; + } + + public TGComponent getFaultyComponent() { + return faultyComponent; + } + + public void checkRules() { + errorNumber = -1; + + //rule0: fork or join, but not both + if ((forks.size() > 0) && (joins.size() >0)) { + faultyComponent = forks.get(0); + errorNumber = 0; + } + + //rule1: Must have at least one producer + if (producerPorts.size() == 0) { + errorNumber = 1; + if ((consumerPorts != null) && (consumerPorts.size() > 0)) { + faultyComponent = consumerPorts.get(0); + } + } + + //rule2: Must have at least one receiver + if (consumerPorts.size() == 0) { + errorNumber = 2; + if ((producerPorts != null) && (producerPorts.size() > 0)) { + faultyComponent = producerPorts.get(0); + } + } + + //rule3: If fork: must have only one producer + if ((forks.size() > 0) && (producerPorts.size() >1)) { + errorNumber = 3; + faultyComponent = forks.get(0); + } + + //rule4: producers and consumers must be of the same type + if ((consumerPorts.size()>0) && (producerPorts.size()>0)) { + int type = consumerPorts.get(0).getPortType(); + for (SysCAMSPrimitivePort porto: producerPorts) { + if (porto.getPortType() != type) { + errorNumber = 4; + faultyComponent = porto; + break; + } + } + for (SysCAMSPrimitivePort porti: consumerPorts) { + if (porti.getPortType() != type) { + errorNumber = 4; + faultyComponent = porti; + break; + } + } + } + + //rule5: Error of connection + if (errorOfConnection) { + errorNumber = 5; + } + + //rule7: requests cannot be connected through fork or join + if ((forks.size() > 0) || (joins.size() >0)) { + // Look for event, either at origin, or at destination + for (SysCAMSPrimitivePort porto: producerPorts) { + if (porto.getPortType() == 2) { + errorNumber = 7; + faultyComponent = porto; + break; + } + } + for (SysCAMSPrimitivePort porti: consumerPorts) { + if (porti.getPortType() == 2) { + errorNumber = 7; + faultyComponent = porti; + break; + } + } + } + + //rule8: all events/requests with the same parameters +// if ((forks.size() > 0) || (joins.size() >0)) { +// if (producerPorts != null && producerPorts.size() > 0) { +// SysCAMSPrimitivePort referencePort = producerPorts.get(0); +// if (referencePort != null) { +// if ((referencePort.getPortType() == 1) ||(referencePort.getPortType() == 2)) { +// // Event or request found +// // We now check that they are all compatible with the reference +// for (SysCAMSPrimitivePort porto: producerPorts) { +// if (!(porto.hasSameParametersThan(referencePort))) { +// errorNumber = 8; +// faultyComponent = porto; +// break; +// } +// } +// +// for (SysCAMSPrimitivePort porti: consumerPorts) { +// if (!(porti.hasSameParametersThan(referencePort))) { +// errorNumber = 8; +// faultyComponent = porti; +// break; +// } +// } +// } +// } +// } +// } + + // rule9: if no fork, no join, no request: one to one communication + boolean foundReq = true; + if ((forks.size() == 0) && (joins.size() == 0)) { + if (producerPorts != null && producerPorts.size() > 0) { + SysCAMSPrimitivePort referencePort = producerPorts.get(0); + if (referencePort != null) { + if (referencePort.getPortType() != 2) { + foundReq = false; + } + } + } + if (!foundReq) { + if (producerPorts.size() > 1) { + errorNumber = 9; + faultyComponent = producerPorts.get(1); + } else if (consumerPorts.size() > 1) { + errorNumber = 9; + faultyComponent = consumerPorts.get(1); + } + } + } + } + + public void setColor() { + // For each channel facility, + // set the inp and outp primitive ports if possible (otherwise, null) + // if no error: set conflict to false + // If error -> set the conflict to true + + for (SysCAMSFork fork: forks) { + if (producerPorts.size() > 0) { + fork.setOutPort(producerPorts.get(0)); + } else { + fork.setOutPort(null); + } + + if (consumerPorts.size() > 0) { + fork.setInPort(consumerPorts.get(0)); + } else { + fork.setInPort(null); + } + + if (hasError()) { + fork.setConflict(hasError(), errors[errorNumber]); + } else { + fork.setConflict(false, ""); + } + } + + for (SysCAMSJoin join: joins) { + if (producerPorts.size() > 0) { + join.setOutPort(producerPorts.get(0)); + } else { + join.setOutPort(null); + } + + if (consumerPorts.size() > 0) { + join.setInPort(consumerPorts.get(0)); + } else { + join.setInPort(null); + } + if (hasError()) { + join.setConflict(hasError(), errors[errorNumber]); + } else { + join.setConflict(false, ""); + } + } + + for (SysCAMSCompositePort port: cports) { + if (producerPorts.size() > 0) { + port.setOutPort(producerPorts.get(0)); + } else { + port.setOutPort(null); + } + + if (consumerPorts.size() > 0) { + port.setInPort(consumerPorts.get(0)); + } else { + port.setInPort(null); + } + if (hasError()) { + port.setConflict(hasError(), errors[errorNumber]); + } else { + port.setConflict(false, ""); + } + } + + for (SysCAMSPrimitivePort pport: producerPorts) { + if (hasError()) { + pport.setConflict(hasError(), errors[errorNumber]); + } else { + pport.setConflict(false, ""); + } + } + for (SysCAMSPrimitivePort cport: consumerPorts) { + if (hasError()) { + cport.setConflict(hasError(), errors[errorNumber]); + } else { + cport.setConflict(false, ""); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPortConnectingPoint.java b/src/main/java/ui/syscams/SysCAMSPortConnectingPoint.java new file mode 100644 index 0000000000000000000000000000000000000000..24820249358266616b52fedd4f9041bd3322be4e --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPortConnectingPoint.java @@ -0,0 +1,64 @@ +/* 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 ui.CDElement; +import ui.TGComponentManager; +import ui.TGConnectingPointWidthHeight; + +/** + * Class SysCAMSPortConnectingPoint + * Definition of connecting points on which connectors of SystemC-AMS Component Task diagrams can be connected + * Creation: 22/04/2018 + * @version 1.0 22/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSPortConnectingPoint extends TGConnectingPointWidthHeight{ + public SysCAMSPrimitivePort port; + public boolean positionned; + + public SysCAMSPortConnectingPoint(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) { + return type == TGComponentManager.CONNECTOR_PORT_TMLC; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPortConnector.java b/src/main/java/ui/syscams/SysCAMSPortConnector.java new file mode 100644 index 0000000000000000000000000000000000000000..6766b226e7e2da3e737f8d025a877cabf6dd12b8 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPortConnector.java @@ -0,0 +1,139 @@ +/* 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 ui.*; +import ui.util.IconManager; + +import java.awt.*; +import java.util.Vector; + +/** + * Class SysCAMSPortConnector + * Connector used in SystemC-AMS Component task diagrams + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSPortConnector extends TGConnector implements ScalableTGComponent, SpecificActionAfterAdd, SpecificActionAfterMove{ + protected double oldScaleFactor; + + public SysCAMSPortConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector<Point> _listPoint) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + myImageIcon = IconManager.imgic202; + value = "Connector between ports"; + editable = false; + oldScaleFactor = tdp.getZoom(); + p1 = _p1; + p2 = _p2; + } + + public TGConnectingPoint get_p1(){ + return p1; + } + + public TGConnectingPoint get_p2(){ + return p2; + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + try { + SysCAMSPortConnectingPoint pt1 = (SysCAMSPortConnectingPoint)p1; + SysCAMSPortConnectingPoint pt2 = (SysCAMSPortConnectingPoint)p2; + if (!pt1.positionned) { + pt1.positionned = true; + if (pt1.getFather() instanceof SysCAMSPrimitivePort) { + pt1.port = (SysCAMSPrimitivePort)(pt1.getFather()); + } + } + if (!pt2.positionned) { + pt2.positionned = true; + if (pt2.getFather() instanceof SysCAMSPrimitivePort) { + pt2.port = (SysCAMSPrimitivePort)(pt2.getFather()); + } + } + if ((pt1.port != null) && (pt2.port != null)) { + String name1 = pt1.port.getPortName(); + String name2 = pt2.port.getPortName(); + if (name1.equals(name2)) { + int w = g.getFontMetrics().stringWidth(name1); + Font fold = g.getFont(); + Font f = fold.deriveFont(Font.ITALIC, (float)(tdp.getFontSize())); + g.setFont(f); + g.drawString(name1, (x1 + x2 - w)/2, (y1 + y2)/2); + g.setFont(fold); + } + } + g.drawLine(x1, y1, x2, y2); + return; + } catch (Exception e) { + } + g.drawLine(x1, y1, x2, y2); + } + + public void rescale(double scaleFactor){ + int xx, yy; + + for(int i=0; i<nbInternalTGComponent; i++) { + xx = tgcomponent[i].getX(); + yy = tgcomponent[i].getY(); + tgcomponent[i].dx = (tgcomponent[i].dx + xx) / oldScaleFactor * scaleFactor; + tgcomponent[i].dy = (tgcomponent[i].dy + yy) / oldScaleFactor * scaleFactor; + xx = (int)(tgcomponent[i].dx); + tgcomponent[i].dx = tgcomponent[i].dx - xx; + yy = (int)(tgcomponent[i].dy); + tgcomponent[i].dy = tgcomponent[i].dy - yy; + tgcomponent[i].setCd(xx, yy); + } + oldScaleFactor = scaleFactor; + } + + public int getType() { + return TGComponentManager.CONNECTOR_PORT_TMLC; + } + + public void specificActionAfterAdd() { + ((SysCAMSComponentTaskDiagramPanel)tdp).updatePorts(); + } + + public void specificActionAfterMove() { + ((SysCAMSComponentTaskDiagramPanel)tdp).updatePorts(); + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPortConverter.java b/src/main/java/ui/syscams/SysCAMSPortConverter.java new file mode 100644 index 0000000000000000000000000000000000000000..ceaf066a161e5df9411e519ffc91c32ea0c9144a --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPortConverter.java @@ -0,0 +1,57 @@ +package ui.syscams; + +import ui.TDiagramPanel; +import ui.TGComponent; + +public class SysCAMSPortConverter extends SysCAMSCompositePort { + private int period; + private int rate; + private int delay; + private String origin; + private String convType; + + public SysCAMSPortConverter(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); + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int period) { + this.period = period; + } + + public int getRate() { + return rate; + } + + public void setRate(int rate) { + this.rate = rate; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int delay) { + this.delay = delay; + } + + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + public String getConvType() { + return convType; + } + + public void setConvType(String convType) { + this.convType = convType; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPortDE.java b/src/main/java/ui/syscams/SysCAMSPortDE.java new file mode 100644 index 0000000000000000000000000000000000000000..5f837c6d98ef73b27dee5190206b92bf473b6192 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPortDE.java @@ -0,0 +1,62 @@ +package ui.syscams; + +import java.awt.Graphics; + +import ui.TDiagramPanel; +import ui.TGComponent; + +public class SysCAMSPortDE extends SysCAMSPrimitivePort { + private int period; + private int rate; + private int delay; + private String origin; + private String DEType; + + public SysCAMSPortDE(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); + } + + public String getDEType() { + return DEType; + } + + public void setDEType(String DEType) { + this.DEType = DEType; + } + + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int period) { + this.period = period; + } + + public int getRate() { + return rate; + } + + public void setRate(int rate) { + this.rate = rate; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int delay) { + this.delay = delay; + } + + public void drawParticularity(Graphics g) { + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPortTDF.java b/src/main/java/ui/syscams/SysCAMSPortTDF.java new file mode 100644 index 0000000000000000000000000000000000000000..afc054a3a0fdb69e45bb3207c43c9f85f22ec5af --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPortTDF.java @@ -0,0 +1,62 @@ +package ui.syscams; + +import java.awt.Graphics; + +import ui.TDiagramPanel; +import ui.TGComponent; + +public class SysCAMSPortTDF extends SysCAMSPrimitivePort { + private int period; + private int rate; + private int delay; + private String origin; + private String TDFType; + + public SysCAMSPortTDF(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); + } + + public String getTDFType() { + return TDFType; + } + + public void setTDFType(String tDFType) { + TDFType = tDFType; + } + + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + public int getPeriod() { + return period; + } + + public void setPeriod(int period) { + this.period = period; + } + + public int getRate() { + return rate; + } + + public void setRate(int rate) { + this.rate = rate; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int delay) { + this.delay = delay; + } + + public void drawParticularity(Graphics g) { + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPrimitiveComponent.java b/src/main/java/ui/syscams/SysCAMSPrimitiveComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..152f6ea18b922a1fadc144f5289c80d824c64790 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPrimitiveComponent.java @@ -0,0 +1,620 @@ +/* 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 org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import ui.*; +import ui.util.IconManager; +//import ui.window.JDialogAttribute; +import ui.window.JDialogSysCAMSBlockDE; +import ui.window.JDialogSysCAMSBlockTDF; + +import javax.swing.*; +import java.awt.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Vector; + +/** + * Class SysCAMSPrimitiveComponent + * Primitive Component. To be used in SystemC-AMSdiagrams + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSPrimitiveComponent extends TGCScalableWithInternalComponent implements SwallowTGComponent, SwallowedTGComponent, WithAttributes { + private int maxFontSize = 14; + private int minFontSize = 4; + private int currentFontSize = -1; + private boolean displayText = true; + private Color myColor; + + private boolean isAttacker=false; + // Icon + private int iconSize = 15; +// private boolean iconIsDrawn = false; + + // Attributes + public HashMap<String, Integer> attrMap = new HashMap<String, Integer>(); + public String mappingName; + protected LinkedList<TAttribute> myAttributes; + private int textX = 15; // border for ports + private double dtextX = 0.0; + + public String oldValue; + + public SysCAMSPrimitiveComponent(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, 150); + + oldScaleFactor = tdp.getZoom(); + dtextX = textX * oldScaleFactor; + textX = (int)dtextX; + dtextX = dtextX - textX; + + minWidth = 1; + minHeight = 1; + + nbConnectingPoint = 0; + + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + moveable = true; + multieditable = true; + editable = true; + removable = true; + userResizable = true; + + if (this instanceof SysCAMSBlockTDF) { + value = "TDF_Block"; + } else if (this instanceof SysCAMSBlockDE) { + value = "DE_Block"; + } + +// oldValue = value; +// setName("Primitive component"); + name = "Primitive component"; + + myImageIcon = IconManager.imgic1202; + + myAttributes = new LinkedList<TAttribute> (); + + actionOnAdd(); + } + + public void internalDrawing(Graphics g) { + int w; + Font f = g.getFont(); + Font fold = f; + + if (myColor == null) { + if (ColorManager.TML_COMPOSITE_COMPONENT == Color.white) { + myColor = Color.white; + } else { + if (this instanceof SysCAMSBlockTDF) { + myColor = Color.lightGray; + } else { + myColor = Color.white; + } + } + } + if ((rescaled) && (!tdp.isScaled())) { + if (currentFontSize == -1) { + currentFontSize = f.getSize(); + } + rescaled = false; + // Must set the font size .. + // Find the biggest font not greater than max_font size + // By Increment of 1 + // Or decrement of 1 + // If font is less than 4, no text is displayed + + int maxCurrentFontSize = Math.max(0, Math.min(height-(2*textX), maxFontSize)); + f = f.deriveFont((float)maxCurrentFontSize); + g.setFont(f); + while(maxCurrentFontSize > (minFontSize-1)) { + if (g.getFontMetrics().stringWidth(value) < (width - iconSize - (2 * textX))) { + break; + } + maxCurrentFontSize --; + f = f.deriveFont((float)maxCurrentFontSize); + g.setFont(f); + } + currentFontSize = maxCurrentFontSize; + if(currentFontSize <minFontSize) { + displayText = false; + } else { + displayText = true; + f = f.deriveFont((float)currentFontSize); + g.setFont(f); + } + } + + // Zoom is assumed to be computed + Color c = g.getColor(); + g.drawRect(x, y, width, height); + if ((width > 2) && (height > 2)) { + g.setColor(myColor); + g.fillRect(x+1, y+1, width-1, height-1); + g.setColor(c); + } + + // Font size + if (displayText) { + f = f.deriveFont((float)currentFontSize); + g.setFont(f); + w = g.getFontMetrics().stringWidth(value); + if (w > (width - 2 * (iconSize + textX))) { + g.drawString(value, x + textX + 1, y + currentFontSize + textX); + + if (this instanceof SysCAMSBlockTDF) { + String s = "Tm = " + ((SysCAMSBlockTDF) this).getPeriod(); + g.drawString(s, x + textX + 1, y + height - currentFontSize - textX); + } else if (this instanceof SysCAMSBlockDE) { + String s = "Tm = " + ((SysCAMSBlockDE) this).getPeriod(); + g.drawString(s, x + textX + 1, y + height - currentFontSize - textX); + } + } else { + g.drawString(value, x + (width - w)/2, y + currentFontSize + textX); + if (this instanceof SysCAMSBlockTDF) { + String s = "Tm = " + ((SysCAMSBlockTDF) this).getPeriod(); + w = g.getFontMetrics().stringWidth(s); + g.drawString(s, x + (width - w)/2, y + height - currentFontSize - textX); + } else if (this instanceof SysCAMSBlockDE) { + String s = "Tm = " + ((SysCAMSBlockDE) this).getPeriod(); + w = g.getFontMetrics().stringWidth(s); + g.drawString(s, x + (width - w)/2, y + height - currentFontSize - textX); + } + } + } + +// // Icon +// if ((width>30) && (height > (iconSize + 2*textX))) { +// iconIsDrawn = true; +// g.drawImage(IconManager.imgic1200.getImage(), x + width - iconSize - textX, y + textX, null); +// } else { +// iconIsDrawn = false; +// } +// if (isAttacker){ +// g.drawImage(IconManager.imgic7008.getImage(), x + width - 2*iconSize - textX, y + 2*textX, null); +// } + + // Attributes + if (tdp.areAttributesVisible()) { + int index = 0; + int cpt = currentFontSize + 2 * textX; + String attr; + + TAttribute a; + + int si = Math.min(12, (int)((float)currentFontSize - 2)); + + f = g.getFont(); + f = f.deriveFont((float)si); + g.setFont(f); + int step = si + 2; + + while(index < myAttributes.size()) { + cpt += step; + if (cpt >= (height - textX)) { + break; + } + a = myAttributes.get (index); + attr = a.toString(); + w = g.getFontMetrics().stringWidth(attr); + if ((w + (2 * textX) + 1) < width) { + g.drawString(attr, x + textX, y + cpt); + drawVerification(g, x + textX, y+ cpt, a.getConfidentialityVerification()); + } else { + attr = "..."; + w = g.getFontMetrics().stringWidth(attr); + if ((w + textX + 2) < width) { + g.drawString(attr, x + textX + 1, y + cpt); + } else { + // skip attribute + cpt -= step; + } + } + index ++; + } + } + g.setFont(fold); + } + public void drawVerification(Graphics g, int x, int y, int checkConfStatus){ + Color c = g.getColor(); + Color c1; + switch(checkConfStatus) { + case TAttribute.CONFIDENTIALITY_OK: + c1 = Color.green; + break; + case TAttribute.CONFIDENTIALITY_KO: + c1 = Color.red; + break; + default: + return; + } + g.drawOval(x-10, y-10, 6, 9); + g.setColor(c1); + g.fillRect(x-12, y-5, 9, 7); + g.setColor(c); + g.drawRect(x-12, y-5, 9, 7); + } + + public void rescale(double scaleFactor){ + dtextX = (textX + dtextX) / oldScaleFactor * scaleFactor; + textX = (int)(dtextX); + dtextX = dtextX - textX; + super.rescale(scaleFactor); + } + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + + public boolean isAttacker(){ + return isAttacker; + } + + public boolean editOndoubleClick(JFrame frame, int _x, int _y) { +// // On the icon? +// if (iconIsDrawn) { +// if (GraphicLib.isInRectangle(_x, _y, x + width - iconSize - textX, y + textX, iconSize, iconSize)) { +// tdp.getMouseManager().setSelection(-1, -1); +// tdp.selectTab(getValue()); +// return true; +// } +// } + // On the name ? +// if ((displayText) && (_y <= (y + currentFontSize + textX))) { +//// oldValue = value; +// String s = (String)JOptionPane.showInputDialog(frame, "Name:", "Setting component name", +// JOptionPane.PLAIN_MESSAGE, IconManager.imgic100, +// null, +// getValue()); +// if ((s != null) && (s.length() > 0)) { +// // Check whether this name is already in use, or not +// if (!TAttribute.isAValidId(s, false, false)) { +// JOptionPane.showMessageDialog(frame, +// "Could not change the name of the component: the new name is not a valid name", +// "Error", +// JOptionPane.INFORMATION_MESSAGE); +// return false; +// } +// if (oldValue.compareTo(s) != 0) { +// if (((SysCAMSComponentTaskDiagramPanel)(tdp)).namePrimitiveComponentInUse(oldValue, s)) { +// JOptionPane.showMessageDialog(frame, +// "Error: the name is already in use", +// "Name modification", +// JOptionPane.ERROR_MESSAGE); +// return false; +// } +// } +// if (((SysCAMSComponentTaskDiagramPanel)(tdp)).isCompositeNameUsed(s)) { +// JOptionPane.showMessageDialog(frame, +// "Error: the name is already in use", +// "Name modification", +// JOptionPane.ERROR_MESSAGE); +// return false; +// } +// setComponentName(s); +// setValueWithChange(s); +//// isAttacker = s.contains("Attacker"); +// rescaled = true; +// return true; +// +// } +// return false; +// } + + // And so -> attributes! +// JDialogAttribute jda = new JDialogAttribute(myAttributes, null, frame, "Setting attributes of " + value, "Attribute"); +// setJDialogOptions(jda); +// GraphicLib.centerOnParent(jda, 650, 375); + if (this instanceof SysCAMSBlockTDF) { + JDialogSysCAMSBlockTDF jtdf = new JDialogSysCAMSBlockTDF((SysCAMSBlockTDF) this); + jtdf.setVisible(true); + } else { + JDialogSysCAMSBlockDE jde = new JDialogSysCAMSBlockDE((SysCAMSBlockDE) this); + jde.setVisible(true); + } +// jda.setVisible(true); // blocked until dialog has been closed + rescaled = true; + return true; + + } + +// protected void setJDialogOptions(JDialogAttribute jda) { +// jda.addAccess(TAttribute.getStringAccess(TAttribute.PUBLIC)); +// jda.addAccess(TAttribute.getStringAccess(TAttribute.PRIVATE)); +// jda.addType(TAttribute.getStringType(TAttribute.NATURAL), true); +// jda.addType(TAttribute.getStringType(TAttribute.BOOLEAN), true); +// +// Vector<String> records = ((SysCAMSComponentTaskDiagramPanel)(tdp)).getAllRecords(this); +// for(String s: records) { +// jda.addType(s, false); +// } +// jda.enableInitialValue(true); +// jda.enableRTLOTOSKeyword(true); +// jda.enableJavaKeyword(false); +// jda.enableTMLKeyword(false); +// } + + public Vector<String> getAllRecords() { + return ((SysCAMSComponentTaskDiagramPanel)(tdp)).getAllRecords(this); + } + + public SysCAMSRecordComponent getRecordNamed(String _nameOfRecord) { + return ((SysCAMSComponentTaskDiagramPanel)(tdp)).getRecordNamed(this, _nameOfRecord); + } + + public int getType() { + return TGComponentManager.TMLCTD_PCOMPONENT; + } + + public void wasSwallowed() { + myColor = null; + } + + public void wasUnswallowed() { + myColor = null; + setFather(null); + TDiagramPanel tdp = getTDiagramPanel(); + setCdRectangle(tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY()); + } + + public boolean acceptSwallowedTGComponent(TGComponent tgc) { + return tgc instanceof SysCAMSPrimitivePort; + } + + public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { + //TraceManager.addDev("Add swallow component"); + // Choose its position + // Make it an internal component + // It's one of my son + //Set its coordinates + if (tgc instanceof SysCAMSPrimitivePort) { + tgc.setFather(this); + tgc.setDrawingZone(true); + tgc.resizeWithFather(); + addInternalComponent(tgc, 0); + return true; + } + return false; + } + + public void removeSwallowedTGComponent(TGComponent tgc) { + removeInternalComponent(tgc); + } + + public void hasBeenResized() { + rescaled = true; + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSPrimitivePort) { + tgcomponent[i].resizeWithFather(); + } + } + if (getFather() != null) { + resizeWithFather(); + } + } + + public void resizeWithFather() { + if ((father != null) && (father instanceof SysCAMSCompositeComponent)) { + // Too large to fit in the father? -> resize it! + resizeToFatherSize(); + + setCdRectangle(0, father.getWidth() - getWidth(), 0, father.getHeight() - getHeight()); + setMoveCd(x, y); + } + } + + public int getChildCount() { + return myAttributes.size() + nbInternalTGComponent + 1; + } + + public Object getChild(int index) { + if (index == 0) { + return value; + } else { + if (index <= myAttributes.size()) { + return myAttributes.get (index-1); + } else { + return tgcomponent[index-1-myAttributes.size()]; + } + } + } + + public int getIndexOfChild(Object child) { + if (child instanceof String) { + return 0; + } else { + if (myAttributes.indexOf(child) > -1) { + return myAttributes.indexOf(child) + 1; + } else { + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] == child) { + return myAttributes.size() + 1 + i; + } + } + } + } + return -1; + } + + protected String translateExtraParam() { + TAttribute a; + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Data isAttacker=\""); + sb.append(isAttacker() ? "Yes": "No"); + sb.append("\" />\n"); + for(int i=0; i<myAttributes.size(); i++) { + a = myAttributes.get (i); + sb.append("<Attribute access=\""); + sb.append(a.getAccess()); + sb.append("\" id=\""); + sb.append(a.getId()); + sb.append("\" value=\""); + sb.append(a.getInitialValue()); + sb.append("\" type=\""); + sb.append(a.getType()); + sb.append("\" typeOther=\""); + sb.append(a.getTypeOther()); + sb.append("\" />\n"); + } + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + try { + NodeList nli; + Node n1, n2; + Element elt; + int access, type; + String typeOther; + String id, valueAtt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(int j=0; j<nli.getLength(); j++) { + n2 = nli.item(j); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("Data")) { + isAttacker = elt.getAttribute("isAttacker").equals("Yes"); + } + if (elt.getTagName().equals("Attribute")) { + access = Integer.decode(elt.getAttribute("access")).intValue(); + type = Integer.decode(elt.getAttribute("type")).intValue(); + try { + typeOther = elt.getAttribute("typeOther"); + } catch (Exception e) { + typeOther = ""; + } + id = elt.getAttribute("id"); + valueAtt = elt.getAttribute("value"); + + if (valueAtt.equals("null")) { + valueAtt = ""; + } + if ((TAttribute.isAValidId(id, false, false)) && (TAttribute.isAValidInitialValue(type, valueAtt))) { + TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); + myAttributes.add (ta); + } + } + } + } + } + } + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + + public int getCurrentFontSize() { + return currentFontSize; + } + + public java.util.List<TAttribute> getAttributeList() { + return myAttributes; + } + + public java.util.List<SysCAMSPrimitivePort> getAllTDFOriginPorts() { + return getAllPorts(0, true); + } + + public java.util.List<SysCAMSPrimitivePort> getAllTDFDestinationPorts() { + return getAllPorts(0, false); + } + + public java.util.List<SysCAMSPrimitivePort> getAllDEOriginPorts() { + return getAllPorts(1, true); + } + + public java.util.List<SysCAMSPrimitivePort> getAllDEDestinationPorts() { + return getAllPorts(1, false); + } + + public java.util.List<SysCAMSPrimitivePort> getAllPorts(int _type, boolean _isOrigin) { + java.util.List<SysCAMSPrimitivePort> ret = new LinkedList<SysCAMSPrimitivePort>(); + SysCAMSPrimitivePort port; + + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSPrimitivePort) { + port = (SysCAMSPrimitivePort)tgcomponent[i]; + if ((port.getPortType() == _type) && (port.isOrigin() == _isOrigin)) { + ret.add(port); + } + } + } + return ret; + } + + public java.util.List<SysCAMSPrimitivePort> getAllInternalPrimitivePorts() { + java.util.List<SysCAMSPrimitivePort> list = new ArrayList<SysCAMSPrimitivePort>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof SysCAMSPrimitivePort) { + list.add((SysCAMSPrimitivePort)(tgcomponent[i])); + } + } + return list; + } + + public String getAttributes() { + String attr = ""; + for (TAttribute a: myAttributes) { + attr += a.toAvatarString() + "\n"; + } + return attr; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSPrimitivePort.java b/src/main/java/ui/syscams/SysCAMSPrimitivePort.java new file mode 100644 index 0000000000000000000000000000000000000000..2e79885b2fb713cf945dba957a7cf2438538e34f --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSPrimitivePort.java @@ -0,0 +1,878 @@ +/* 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 org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import ui.*; +import ui.tmlad.TMLADNotifiedEvent; +import ui.tmlad.TMLADReadChannel; +import ui.tmlad.TMLADSendEvent; +import ui.tmlad.TMLADSendRequest; +import ui.tmlad.TMLADWaitEvent; +import ui.tmlad.TMLADWriteChannel; +import ui.tmldd.TMLArchiCPNode; +import ui.tmldd.TMLArchiPortArtifact; +import ui.util.IconManager; +import ui.window.JDialogSysCAMSPortDE; +import ui.window.JDialogSysCAMSPortTDF; + +import javax.swing.*; +import java.awt.*; + +/** + * Class SysCAMSPrimitivePort + * Primitive port. To be used in SystemC-AMS diagrams + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +public abstract class SysCAMSPrimitivePort extends TGCScalableWithInternalComponent implements SwallowedTGComponent, LinkedReference, WithAttributes { + protected Color myColor; + protected int orientation; + protected int oldx, oldy; + protected int halfwidth = 13; + protected int currentOrientation = GraphicLib.NORTH; + + protected int nbMaxAttribute = 5; + protected TType list[]; + protected int maxSamples = 8; + protected int widthSamples = 4; + protected boolean isFinite = false; + protected boolean isBlocking = false; + public boolean isOrigin = true; + public int typep = 0; + protected int oldTypep = typep; + public String commName; + + protected boolean isLossy; + protected boolean isPostex = false; + protected boolean isPrex = false; + protected int lossPercentage; + protected int maxNbOfLoss; //-1 means no max + + //Security Verification + public int checkConfStatus; + + public int checkSecConfStatus; + public String secName=""; + + public int checkWeakAuthStatus; + public int checkStrongAuthStatus; + public boolean checkConf; + public boolean checkAuth; + public static int NOCHECK= 0; + public static int TOCHECK = 1; + public static int CHECKED_CONF = 2; + public static int CHECKED_UNCONF = 3; + + public String mappingName="???"; + protected int decPoint = 3; + + protected boolean conflict = false; + protected String conflictMessage; + protected String dataFlowType = "VOID"; + protected String associatedEvent = "VOID"; + + public int verification; + + private ImageIcon portImageIconTDF, portImageIconDE; + + public SysCAMSPrimitivePort(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*halfwidth, 2*halfwidth); + + minWidth = 1; + minHeight = 1; + + nbConnectingPoint = 1; + connectingPoint = new TGConnectingPoint[1]; + for (int i=0; i<1; i++) { + connectingPoint[i] = new SysCAMSPortConnectingPoint(this, 0, 0, true, true, 0.5, 0.0); + } + + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + moveable = true; + editable = true; + removable = true; + userResizable = false; + checkConf=false; + commName = "comm"; + makeValue(); + setName("Primitive port"); + checkConfStatus= NOCHECK; + list = new TType[nbMaxAttribute]; + for(int i=0; i<nbMaxAttribute; i++) { + list[i] = new TType(); + } + myImageIcon = IconManager.imgic1206; + portImageIconTDF = IconManager.imgic8000; + portImageIconDE = IconManager.imgic8001; + + // Initialization of port attributes + if (this instanceof SysCAMSPortTDF) { + ((SysCAMSPortTDF) this).setTDFType(""); + } else if (this instanceof SysCAMSPortDE) { + ((SysCAMSPortDE) this).setDEType(""); + } + } + + public void initConnectingPoint(boolean in, boolean out, int nb) { + nbConnectingPoint = nb; + connectingPoint = new TGConnectingPoint[nb]; + int i; + for (i=0; i<nbConnectingPoint; i++) { + connectingPoint[i] = new SysCAMSPortConnectingPoint(this, 0, 0, in, out, 0.5, 0.0); + } + } + + public Color getMyColor() { + return myColor; + } + + public void internalDrawing(Graphics g) { + if ((x != oldx) | (oldy != y)) { + // Component has moved! + manageMove(); + oldx = x; + oldy = y; + } + calculatePortColor(); + + if (rescaled) { + rescaled = false; + } + + // Zoom is assumed to be computed + Color c = g.getColor(); + g.setColor(c); + + TGComponent tgc = getFather(); + if ((tgc != null) && (tgc instanceof SysCAMSPrimitiveComponent)) { + if (tgc instanceof SysCAMSBlockTDF && this instanceof SysCAMSPortTDF) { + g.drawRect(x+width/2-portImageIconTDF.getIconWidth()/2, y+height/2-portImageIconTDF.getIconHeight()/2, portImageIconTDF.getIconWidth(), portImageIconTDF.getIconHeight()); + g.drawImage(portImageIconTDF.getImage(), x+width/2-portImageIconTDF.getIconWidth()/2, y+height/2-portImageIconTDF.getIconHeight()/2, null); + } else if (tgc instanceof SysCAMSBlockDE && this instanceof SysCAMSPortDE) { + g.drawRect(x+width/2-portImageIconDE.getIconWidth()/2, y+height/2-portImageIconDE.getIconHeight()/2, portImageIconDE.getIconWidth(), portImageIconDE.getIconHeight()); + g.drawImage(portImageIconDE.getImage(), x+width/2-portImageIconDE.getIconWidth()/2, y+height/2-portImageIconDE.getIconHeight()/2, null); + } + } + + int ft = 10; + if ((tgc != null) && (tgc instanceof SysCAMSPrimitiveComponent)) { + ft = ((SysCAMSPrimitiveComponent)tgc).getCurrentFontSize(); + } + int w; + Font f = g.getFont(); + Font fold = f; + + int si = Math.min(8, (int)((float)ft - 2)); + f = f.deriveFont((float)si); + g.setFont(f); + w = g.getFontMetrics().stringWidth(commName); + if (w < ((int)(width * 1.5))) { + g.drawString(commName, x, y-1); + } + + if (checkConf && isOrigin){ + drawConfVerification(g); + } + if (checkAuth && !isOrigin){ + drawAuthVerification(g); + } + g.setFont(fold); + + drawParticularity(g); + } + + public abstract void drawParticularity(Graphics g); + + public void drawAuthVerification(Graphics g){ + int lockwidth=(int) (16*tdp.getZoom()); + int lockheight=(int) (16*tdp.getZoom()); + + int xc=(int) (18*tdp.getZoom()); + int yc= (int) (12*tdp.getZoom()); + + int xoffset= (int) (20*tdp.getZoom()); + int yoffset= (int) (18*tdp.getZoom()); + + int ovalwidth=(int) (10*tdp.getZoom()); + int ovalheight=(int) (15*tdp.getZoom()); + g.drawString(secName, x-xc*2/3, y+yc*2/3); + Color c = g.getColor(); + Color c1; + Color c2; + switch(checkStrongAuthStatus) { + case 2: + c1 = Color.green; + break; + case 3: + c1 = Color.red; + break; + default: + c1 = Color.gray; + } + switch(checkWeakAuthStatus) { + case 2: + c2 = Color.green; + break; + case 3: + c2 = Color.red; + break; + default: + c2= c1; + } + g.drawOval(x-xc, y+yc, ovalwidth, ovalheight); + g.setColor(c1); + int[] xps = new int[]{x-xoffset, x-xoffset, x-xoffset+lockwidth}; + int[] yps = new int[]{y+yoffset, y+yoffset+lockheight, y+yoffset+lockheight}; + int[] xpw = new int[]{x-xoffset+lockwidth, x-xoffset+lockwidth, x-xoffset}; + int[] ypw = new int[]{y+yoffset+lockheight, y+yoffset, y+yoffset}; + g.fillPolygon(xps, yps,3); + + g.setColor(c2); + g.fillPolygon(xpw, ypw, 3); + g.setColor(c); + g.drawPolygon(xps, yps,3); + g.drawPolygon(xpw, ypw, 3); + g.drawString("S", x-xoffset+1, y+yc+yoffset); + g.drawString("W", x-xoffset+lockwidth/2, y+yc+ovalheight); + if (checkStrongAuthStatus ==3){ + g.drawLine(x-xoffset, y+yoffset*3/2, x-xoffset/2, y+yoffset+yc); + g.drawLine(x-xoffset, y+yoffset+yc, x-xoffset/2, y+yoffset*3/2); + } + if (checkWeakAuthStatus==3 || checkStrongAuthStatus==3 && checkWeakAuthStatus <2){ + g.drawLine(x-xc*2/3, y+yoffset, x-xc/3, y+yc+lockheight); + g.drawLine(x-xc*2/3, y+yc+lockheight, x-xc/3, y+yoffset); + } + } + + public void drawConfVerification(Graphics g){ + int lockwidth=(int) (9*tdp.getZoom()); + int lockheight=(int) (7*tdp.getZoom()); + int yoffset = 3*lockheight; + + int ovalwidth=(int) (6*tdp.getZoom()); + int ovalheight=(int) (9*tdp.getZoom()); + + Color c = g.getColor(); + Color c1; + switch(checkConfStatus) { + case 1: + c1 = Color.gray; + break; + case 2: + c1 = Color.green; + break; + case 3: + c1 = Color.red; + break; + default: + return; + } + g.drawString(mappingName, x-lockwidth*2, y-lockheight); + g.drawOval(x-ovalwidth*2, y, ovalwidth, ovalheight); + g.setColor(c1); + g.fillRect(x-lockwidth*3/2, y+lockheight/2, lockwidth, lockheight); + g.setColor(c); + g.drawRect(x-lockwidth*3/2, y+lockheight/2, lockwidth, lockheight); + if (checkConfStatus==3){ + g.drawLine(x-lockwidth*2, y, x, y+lockheight*2); + g.drawLine(x-lockwidth*2, y+lockheight*2, x, y); + } + if (!secName.equals("")){ + switch(checkSecConfStatus) { + case 1: + c1 = Color.gray; + break; + case 2: + c1 = Color.green; + break; + case 3: + c1 = Color.red; + break; + default: + return; + } + g.drawString(secName, x-lockwidth*2, y+lockheight*3); + g.drawOval(x-ovalwidth*2, y+yoffset, ovalwidth, ovalheight); + g.setColor(c1); + g.fillRect(x-lockwidth*3/2, y+lockheight/2+yoffset, lockwidth, lockheight); + g.setColor(c); + g.drawRect(x-lockwidth*3/2, y+lockheight/2+yoffset, lockwidth, lockheight); + } + } + + public void manageMove() { + if (father != null) { + Point p = GraphicLib.putPointOnRectangle(x+(width/2), y+(height/2), father.getX(), father.getY(), father.getWidth(), father.getHeight()); + + x = p.x - width/2; + y = p.y - height/2; + + setMoveCd(x, y); + + int orientation = GraphicLib.getCloserOrientation(x+(width/2), y+(height/2), father.getX(), father.getY(), father.getWidth(), father.getHeight()); + if (orientation != currentOrientation) { + setOrientation(orientation); + } + } + } + + // TGConnecting points .. + public void setOrientation(int orientation) { + currentOrientation = orientation; + double w0, h0; + + switch(orientation) { + case GraphicLib.NORTH: + w0 = 0.5; + h0 = 0.0; + break; + case GraphicLib.WEST: + w0 = 0.0; + h0 = 0.5; + break; + case GraphicLib.SOUTH: + w0 = 0.5; + h0 = 1.0; + break; + case GraphicLib.EAST: + default: + w0 = 1.0; + h0 = 0.5; + } + + for (int i=0; i<nbConnectingPoint; i++) { + ((SysCAMSPortConnectingPoint) connectingPoint[i]).setW(w0); + ((SysCAMSPortConnectingPoint) connectingPoint[i]).setH(h0); + } + } + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + public void wasSwallowed() { + myColor = null; + } + + public void wasUnswallowed() { + myColor = null; + setFather(null); + TDiagramPanel tdp = getTDiagramPanel(); + setCdRectangle(tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY()); + } + + public void resizeWithFather() { + if ((father != null) && (father instanceof SysCAMSPrimitiveComponent)) { + // Too large to fit in the father? -> resize it! + //resizeToFatherSize(); + setCdRectangle(0-getWidth()/2, father.getWidth() - (getWidth()/2), 0-getHeight()/2, father.getHeight() - (getHeight()/2)); + setMoveCd(x, y); + oldx = -1; + oldy = -1; + } + } + + public boolean editOndoubleClick(JFrame frame) { +// int oldSample = maxSamples; +// +// Vector<String> otherTypes; +// +// if (getFather() == null) { +// otherTypes = new Vector<String>(); +// } else { +// SysCAMSPrimitiveComponent tgc = (SysCAMSPrimitiveComponent)(getFather()); +// otherTypes = tgc.getAllRecords(); +// } +// Vector<TGComponent> refs = new Vector<TGComponent>(); +// for (TGComponent req: tdp.getMGUI().getAllRequirements()){ +// if (req instanceof AvatarRDRequirement){ +// refs.add(req); +// } +// } + +// JDialogTMLCompositePort jda = new JDialogTMLCompositePort(commName, typep, list[0], list[1], list[2], list[3], list[4], isOrigin, isFinite, isBlocking, ""+maxSamples, ""+widthSamples, isLossy, lossPercentage, maxNbOfLoss, frame, "Port properties", otherTypes, dataFlowType, associatedEvent, isPrex, isPostex, checkConf, checkAuth, reference, refs); +// GraphicLib.centerOnParent(jda, 350, 700 ); +// jda.setVisible( true ); +// dataFlowType = jda.getDataFlowType(); +// associatedEvent = jda.getAssociatedEvent(); +// isPrex = jda.isChannelPrex(); +// isPostex = jda.isChannelPostex(); + +// TraceManager.addDev( "The Data flow type is: " + dataFlowType ); +// TraceManager.addDev( "The Associated event is: " + associatedEvent ); + +// if (jda.hasNewData()) { +// try { +// maxSamples = Integer.decode(jda.getMaxSamples()).intValue(); +// widthSamples = Integer.decode(jda.getWidthSamples()).intValue(); +// if (maxSamples < 1) { +// maxSamples = oldSample; +// JOptionPane.showMessageDialog(frame, "Non valid value: " + maxSamples + ": Should be at least 1", "Error", JOptionPane.INFORMATION_MESSAGE); +// return false; +// } +// isOrigin = jda.isOrigin(); +// isFinite = jda.isFinite(); +// isBlocking = jda.isBlocking(); +// setPortName(jda.getParamName()); +// commName = jda.getParamName(); +// isLossy = jda.isLossy(); +// lossPercentage = jda.getLossPercentage(); +// maxNbOfLoss = jda.getMaxNbOfLoss(); +// oldTypep = typep; +// typep = jda.getPortType(); +// checkConf = jda.checkConf; +// reference = jda.getReference(); +// if (checkConf){ +// if (checkConfStatus == NOCHECK){ +// checkConfStatus = TOCHECK; +// } +// } +// else { +// if (checkConfStatus != NOCHECK){ +// checkConfStatus = NOCHECK; +// } +// } +// checkAuth = jda.checkAuth; +// if (checkStrongAuthStatus < 2){ +// checkStrongAuthStatus = 1; +// checkWeakAuthStatus = 1; +// } +// for(int i=0; i<nbMaxAttribute; i++) { +// list[i].setType(jda.getStringType(i)); +// } +// } catch (Exception e) { +// JOptionPane.showMessageDialog(frame, "Non valid value: " + e.getMessage(), "Error", JOptionPane.INFORMATION_MESSAGE); +// return false; +// } +// } + + if (this instanceof SysCAMSPortTDF) { + JDialogSysCAMSPortTDF jtdf = new JDialogSysCAMSPortTDF((SysCAMSPortTDF) this); + jtdf.setVisible(true); + } else { + JDialogSysCAMSPortDE jde = new JDialogSysCAMSPortDE((SysCAMSPortDE) this); + jde.setVisible(true); + } + + ((SysCAMSComponentTaskDiagramPanel)tdp).updatePorts(); + return true; + } + + protected String translateExtraParam() { + TType a; + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Prop commName=\""); + sb.append(commName); + sb.append("\" commType=\"" + typep); + sb.append("\" origin=\""); + if (isOrigin) { + sb.append("true"); + } else { + sb.append("false"); + } + sb.append("\" finite=\""); + if (isFinite) { + sb.append("true"); + } else { + sb.append("false"); + } + sb.append("\" blocking=\""); + if (isBlocking) { + sb.append("true"); + } else { + sb.append("false"); + } + sb.append("\" maxSamples=\"" + maxSamples); + sb.append("\" widthSamples=\"" + widthSamples); + sb.append("\" isLossy=\"" + isLossy); + sb.append("\" isPrex=\"" + isPrex); + sb.append("\" isPostex=\"" + isPostex); + sb.append("\" lossPercentage=\"" + lossPercentage); + sb.append("\" maxNbOfLoss=\"" + maxNbOfLoss); + sb.append("\" dataFlowType=\"" + dataFlowType); + sb.append("\" associatedEvent=\"" + associatedEvent); + sb.append("\" checkConf=\"" + checkConf); + sb.append("\" checkConfStatus=\"" + checkConfStatus); + sb.append("\" checkAuth=\"" + checkAuth); + sb.append("\" checkWeakAuthStatus=\"" + checkWeakAuthStatus); + sb.append("\" checkStrongAuthStatus=\"" + checkStrongAuthStatus); + sb.append("\" />\n"); + for(int i=0; i<nbMaxAttribute; i++) { + a = list[i]; + sb.append("<Type"); + sb.append(" type=\""); + sb.append(a.getType()); + sb.append("\" typeOther=\""); + sb.append(a.getTypeOther()); + sb.append("\" />\n"); + } + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + try { + NodeList nli; + Node n1, n2; + Element elt; + int typeAtt; + String typeOther; + int nbAttribute = 0; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(int j=0; j<nli.getLength(); j++) { + n2 = nli.item(j); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if ((elt.getTagName().equals("Type")) && (nbAttribute < nbMaxAttribute)) { + typeAtt = Integer.decode(elt.getAttribute("type")).intValue(); + try { + typeOther = elt.getAttribute("typeOther"); + } catch (Exception e) { + typeOther = ""; + } + TType ta = new TType(typeAtt, typeOther); + list[nbAttribute] = ta; + nbAttribute ++; + } + if (elt.getTagName().equals("Prop")) { + commName = elt.getAttribute("commName"); + try { + typep = Integer.decode(elt.getAttribute("commType")).intValue(); + maxSamples = Integer.decode(elt.getAttribute("maxSamples")).intValue(); + widthSamples = Integer.decode(elt.getAttribute("widthSamples")).intValue(); + } catch (Exception e) { + } + try { + lossPercentage = Integer.decode(elt.getAttribute("lossPercentage")).intValue(); + maxNbOfLoss = Integer.decode(elt.getAttribute("maxNbOfLoss")).intValue(); + dataFlowType = elt.getAttribute("dataFlowType"); + associatedEvent = elt.getAttribute("associatedEvent"); + checkConf = (elt.getAttribute("checkConf").compareTo("true")==0); + if (checkConf){ + checkConfStatus=TOCHECK; + } + checkAuth = (elt.getAttribute("checkAuth").compareTo("true")==0); + isLossy = (elt.getAttribute("isLossy").compareTo("true") ==0); + isPrex = (elt.getAttribute("isPrex").compareTo("true") ==0); + isPostex = (elt.getAttribute("isPostex").compareTo("true") ==0); + } catch (Exception e) { + lossPercentage = 0; + maxNbOfLoss = -1; + isLossy = false; + } + try { + isBlocking = (elt.getAttribute("blocking").compareTo("true") ==0); + isOrigin = (elt.getAttribute("origin").compareTo("true") ==0); + isFinite = (elt.getAttribute("finite").compareTo("true") ==0); + + } catch (Exception e) {} + } + makeValue(); + } + } + } + } + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + + public void makeValue() { + value = getPortTypeName() + " " + getPortName(); + } + + public String getPortName() { + return commName; + } + + public int getPortType() { + return typep; + } + + public String getPortTypeName() { + switch(typep) { + case 0: + return "Channel"; + case 1: + return "Event"; + case 2: + default: + return "Request"; + } + } + + public boolean isBlocking() { + return isBlocking; + } + + public boolean isFinite() { + return isFinite; + } + + public int getMax() { + return maxSamples; + } + + public int getSize() { + return widthSamples; + } + + public boolean isOrigin() { + return isOrigin; + } + + public int getNbMaxAttribute() { + return nbMaxAttribute; + } + + public TType getParamAt(int index) { + return list[index]; + } + public void setParam(int index, TType t){ + list[index] = t; + } + + public int getDefaultConnector() { + return TGComponentManager.CONNECTOR_PORT_TMLC; + } + + public String getAttributes() { + String attr = ""; + if (isOrigin()) { + attr += "out "; + } else { + attr += "in "; + } + attr += getPortTypeName() + ": "; + attr += getPortName() + "\n"; + // Channel + if (typep == 0) { + if (!isBlocking()) { + attr += "N"; + } + attr += "B"; + if (isOrigin()) { + attr += "W\n"; + attr += "Width (in B): " + getSize() + "\n"; + if (isFinite()) { + attr += "Max samples: " + getNbMaxAttribute() + "\n"; + } else { + attr += "Infinite\n"; + } + } else { + attr += "R\n"; + } + // Event and Request + } else { + attr += "("; + for(int i=0; i<nbMaxAttribute; i++) { + if (i!=0) { + attr += ","; + } + attr += TType.getStringType(list[i].getType()); + } + attr += ")\n"; + if (typep == 1) { + if (isOrigin()) { + if (!isFinite()) { + attr += "Infinite FIFO\n"; + } else { + if (isBlocking()) { + attr += "Blocking "; + } else { + attr += "Non-blocking "; + } + attr += "finite FIFO: " + getMax() + "\n"; + } + } + } + } + if (conflict) { + attr += "Error in path=" + conflictMessage; + } + return attr; + } + + public boolean isLossy() { + return isLossy && isOrigin; + } + + public int getLossPercentage() { + return lossPercentage; + } + + public int getMaxNbOfLoss() { + return maxNbOfLoss; + } + + public boolean getConflict() { + return conflict; + } + + public void setConflict(boolean _conflict, String _msg) { + conflict = _conflict; + myColor = null; + conflictMessage = _msg; + calculatePortColor(); + } + + public void calculatePortColor() { + if (conflict) { + myColor = Color.red; + } else { +// if (typep == 0) { +// myColor = ColorManager.TML_PORT_CHANNEL; +// } else if (typep == 1) { +// myColor = ColorManager.TML_PORT_EVENT; +// } else { +// myColor = ColorManager.TML_PORT_REQUEST; +// } + if (this instanceof SysCAMSPortTDF) { + myColor = Color.lightGray; + } else { + myColor = Color.white; + } + } + } + + public String getDataFlowType() { + return dataFlowType; + } + + public boolean isPrex() { + return isPrex; + } + + public boolean isPostex() { + return isPostex; + } + + public String getAssociatedEvent() { + return associatedEvent; + } + + public boolean hasSameParametersThan(SysCAMSPrimitivePort _p) { + for(int i=0; i<5; i++) { + if (!(getParamAt(i).equals(_p.getParamAt(i)))) { + return false; + } + } + return true; + } + + public void setPortName(String s) { + for (TURTLEPanel tp : tdp.getMainGUI().tabs) { + for (TDiagramPanel t : tp.getPanels()) { + for (TGComponent t2 : t.getComponentList()) { + if (t2 instanceof TMLArchiCPNode) { + TMLArchiCPNode tacn = (TMLArchiCPNode) t2; + for (TGComponent tgc : tacn.getRecursiveAllInternalComponent()) { + if (tgc instanceof TMLArchiPortArtifact) { + TMLArchiPortArtifact tapi = (TMLArchiPortArtifact) tgc; + String tmp = tapi.getValue().replaceAll("(?i)" + commName + "$", s); + tapi.setValue(tmp); + } + } + } + } + } + } + + if ( (father != null) && (father instanceof SysCAMSPrimitiveComponent)) { + String name = father.getValue(); + TURTLEPanel tp = tdp.getMainGUI().getCurrentTURTLEPanel(); + for (TDiagramPanel t : tp.getPanels()) { + if (t.getName().compareTo(name) == 0) { + for (TGComponent t2 : t.getComponentList()) { + if (t2 instanceof TMLADWriteChannel) { + TMLADWriteChannel twc = (TMLADWriteChannel) t2; + if (twc.getChannelName().equals(commName)) + twc.setChannelName(s); + } + if (t2 instanceof TMLADReadChannel) { + TMLADReadChannel trc = (TMLADReadChannel) t2; + if (trc.getChannelName().equals(commName)) + trc.setChannelName(s); + } + if (t2 instanceof TMLADSendEvent) { + TMLADSendEvent tse = (TMLADSendEvent) t2; + if (tse.getEventName().equals(commName)) + tse.setEventName(s); + } + if (t2 instanceof TMLADSendRequest) { + TMLADSendRequest tsr = (TMLADSendRequest) t2; + if (tsr.getRequestName().equals(commName)) + tsr.setRequestName(s); + } + if (t2 instanceof TMLADWaitEvent) { + TMLADWaitEvent twe = (TMLADWaitEvent) t2; + if (twe.getEventName().equals(commName)) + twe.setEventName(s); + } + if (t2 instanceof TMLADNotifiedEvent) { + TMLADNotifiedEvent tne = (TMLADNotifiedEvent) t2; + if (tne.getEventName().equals(commName)) + tne.setEventName(s); + } + } + t.repaint(); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSRecordComponent.java b/src/main/java/ui/syscams/SysCAMSRecordComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..b74e5adab77f9195226a19fdcdf0453f7f370b7c --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSRecordComponent.java @@ -0,0 +1,420 @@ +/* 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 org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import ui.*; +import ui.util.IconManager; +import ui.window.JDialogAttribute; + +import javax.swing.*; +import java.awt.*; +import java.util.LinkedList; + +/** + * Class SysCAMSRecordComponent + * Record Component. 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 SysCAMSRecordComponent extends TGCScalableWithInternalComponent implements SwallowedTGComponent { + private int maxFontSize = 14; + private int minFontSize = 4; + private int currentFontSize = -1; + private boolean displayText = true; + private Color myColor; + + // Icon + private int iconSize = 15; + + // Attributes + protected LinkedList<TAttribute> myAttributes; + private int textX = 15; // border for ports + private double dtextX = 0.0; + + public String oldValue; + + public SysCAMSRecordComponent(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, 150); + + oldScaleFactor = tdp.getZoom(); + dtextX = textX * oldScaleFactor; + textX = (int)dtextX; + dtextX = dtextX - textX; + + minWidth = 1; + minHeight = 1; + + nbConnectingPoint = 0; + + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + moveable = true; + multieditable = true; + editable = true; + removable = true; + userResizable = true; + + value = tdp.findTMLRecordComponentName("Record_"); + oldValue = value; + setName("Record component"); + + myImageIcon = IconManager.imgic1202; + + myAttributes = new LinkedList<TAttribute> (); + + actionOnAdd(); + } + + public void internalDrawing(Graphics g) { + int w; + Font f = g.getFont(); + Font fold = f; + + if (myColor == null) { + myColor = new Color(193, 218, 241- (getMyDepth() * 10), 200); + } + + if ((rescaled) && (!tdp.isScaled())) { + + if (currentFontSize == -1) { + currentFontSize = f.getSize(); + } + rescaled = false; + // Must set the font size .. + // Find the biggest font not greater than max_font size + // By Increment of 1 + // Or decrement of 1 + // If font is less than 4, no text is displayed + + int maxCurrentFontSize = Math.max(0, Math.min(height-(2*textX), maxFontSize)); + + f = f.deriveFont((float)maxCurrentFontSize); + g.setFont(f); + while(maxCurrentFontSize > (minFontSize-1)) { + if (g.getFontMetrics().stringWidth(value) < (width - iconSize - (2 * textX))) { + break; + } + maxCurrentFontSize --; + f = f.deriveFont((float)maxCurrentFontSize); + g.setFont(f); + } + + currentFontSize = maxCurrentFontSize; + + if(currentFontSize <minFontSize) { + displayText = false; + } else { + displayText = true; + f = f.deriveFont((float)currentFontSize); + g.setFont(f); + } + } + + // Zoom is assumed to be computed + Color c = g.getColor(); + g.drawRect(x, y, width, height); + if ((width > 2) && (height > 2)) { + g.setColor(myColor); + g.fillRect(x+1, y+1, width-1, height-1); + g.setColor(c); + } + + // Font size + if (displayText) { + f = f.deriveFont((float)currentFontSize); + g.setFont(f); + w = g.getFontMetrics().stringWidth(value); + if (w > (width - 2 * (iconSize + textX))) { + g.drawString(value, x + textX + 1, y + currentFontSize + textX); + } else { + g.drawString(value, x + (width - w)/2, y + currentFontSize + textX); + } + } + + // Icon + if ((width>30) && (height > (iconSize + 2*textX))) { + g.drawImage(IconManager.imgic1200.getImage(), x + width - iconSize - textX, y + textX, null); + } + + // Attributes + if (tdp.areAttributesVisible()) { + int index = 0; + int cpt = currentFontSize + 2 * textX; + String attr; + + TAttribute a; + + int si = Math.min(12, (int)((float)currentFontSize - 2)); + + f = g.getFont(); + f = f.deriveFont((float)si); + g.setFont(f); + int step = si + 2; + + while(index < myAttributes.size()) { + cpt += step; + if (cpt >= (height - textX)) { + break; + } + a = myAttributes.get (index); + attr = a.toString(); + w = g.getFontMetrics().stringWidth(attr); + if ((w + (2 * textX) + 1) < width) { + g.drawString(attr, x + textX, y + cpt); + } else { + attr = "..."; + w = g.getFontMetrics().stringWidth(attr); + if ((w + textX + 2) < width) { + g.drawString(attr, x + textX + 1, y + cpt); + } else { + // skip attribute + cpt -= step; + } + } + index ++; + } + } + g.setFont(fold); + } + + public void rescale(double scaleFactor){ + dtextX = (textX + dtextX) / oldScaleFactor * scaleFactor; + textX = (int)(dtextX); + dtextX = dtextX - textX; + + super.rescale(scaleFactor); + } + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + public boolean editOndoubleClick(JFrame frame, int _x, int _y) { + // On the name ? + if ((displayText) && (_y <= (y + currentFontSize + textX))) { + oldValue = value; + String s = (String)JOptionPane.showInputDialog(frame, "Name:", "Setting component name", + JOptionPane.PLAIN_MESSAGE, IconManager.imgic100, + null, + getValue()); + if ((s != null) && (s.length() > 0)) { + // Check whether this name is already in use, or not + + if (!TAttribute.isAValidId(s, false, false)) { + JOptionPane.showMessageDialog(frame, + "Could not change the name of the component: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); + return false; + } + + if (((SysCAMSComponentTaskDiagramPanel)(tdp)).nameRecordComponentInUse(oldValue, s)) { + JOptionPane.showMessageDialog(frame, + "Error: the name is already in use", + "Name modification", + JOptionPane.ERROR_MESSAGE); + return false; + } else { + setValueWithChange(s); + rescaled = true; + return true; + } + } + return false; + } + + // And so -> attributes! + JDialogAttribute jda = new JDialogAttribute(myAttributes, null, frame, "Setting fields of " + value, "Field"); + setJDialogOptions(jda); + GraphicLib.centerOnParent(jda, 650, 375); + jda.setVisible(true); // blocked until dialog has been closed + rescaled = true; + return true; + } + + protected void setJDialogOptions(JDialogAttribute jda) { + jda.addAccess(TAttribute.getStringAccess(TAttribute.PUBLIC)); + jda.addAccess(TAttribute.getStringAccess(TAttribute.PRIVATE)); + jda.addType(TAttribute.getStringType(TAttribute.NATURAL), true); + jda.addType(TAttribute.getStringType(TAttribute.BOOLEAN), true); + jda.enableInitialValue(true); + jda.enableRTLOTOSKeyword(true); + jda.enableJavaKeyword(false); + } + + public int getType() { + return TGComponentManager.TMLCTD_RCOMPONENT; + } + + public void wasSwallowed() { + myColor = null; + } + + public void wasUnswallowed() { + myColor = null; + setFather(null); + TDiagramPanel tdp = getTDiagramPanel(); + setCdRectangle(tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY()); + } + + public void hasBeenResized() { + rescaled = true; + + if (getFather() != null) { + resizeWithFather(); + } + } + + public void resizeWithFather() { + if ((father != null) && (father instanceof SysCAMSCompositeComponent)) { + // Too large to fit in the father? -> resize it! + resizeToFatherSize(); + + setCdRectangle(0, father.getWidth() - getWidth(), 0, father.getHeight() - getHeight()); + setMoveCd(x, y); + } + } + + public int getChildCount() { + return myAttributes.size(); + } + + public Object getChild(int index) { + if (index == 0) { + return value; + } else { + return myAttributes.get (index-1); + } + } + + public int getIndexOfChild(Object child) { + if (child instanceof String) { + return 0; + } else { + return myAttributes.indexOf(child) + 1; + } + } + + protected String translateExtraParam() { + TAttribute a; + StringBuffer sb = new StringBuffer("<extraparam>\n"); + for(int i=0; i<myAttributes.size(); i++) { + a = myAttributes.get (i); + sb.append("<Attribute access=\""); + sb.append(a.getAccess()); + sb.append("\" id=\""); + sb.append(a.getId()); + sb.append("\" value=\""); + sb.append(a.getInitialValue()); + sb.append("\" type=\""); + sb.append(a.getType()); + sb.append("\" typeOther=\""); + sb.append(a.getTypeOther()); + sb.append("\" />\n"); + } + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + try { + NodeList nli; + Node n1, n2; + Element elt; + int access, type; + String typeOther; + String id, valueAtt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(int j=0; j<nli.getLength(); j++) { + n2 = nli.item(j); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("Attribute")) { + access = Integer.decode(elt.getAttribute("access")).intValue(); + type = Integer.decode(elt.getAttribute("type")).intValue(); + try { + typeOther = elt.getAttribute("typeOther"); + } catch (Exception e) { + typeOther = ""; + } + id = elt.getAttribute("id"); + valueAtt = elt.getAttribute("value"); + + if (valueAtt.equals("null")) { + valueAtt = ""; + } + if ((TAttribute.isAValidId(id, false, false)) && (TAttribute.isAValidInitialValue(type, valueAtt))) { + TAttribute ta = new TAttribute(access, id, valueAtt, type, typeOther); + myAttributes.add (ta); + } + } + } + } + } + } + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + + public int getCurrentFontSize() { + return currentFontSize; + } + + public LinkedList<TAttribute> getAttributes() { + return myAttributes; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSReferencePortConnectingPoint.java b/src/main/java/ui/syscams/SysCAMSReferencePortConnectingPoint.java new file mode 100644 index 0000000000000000000000000000000000000000..88945a228fd3055cc42a6a0a633b252f534eb80f --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSReferencePortConnectingPoint.java @@ -0,0 +1,122 @@ +/* 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 ui.CDElement; +import ui.TGComponent; + +/** + * Class SysCAMSReferencePortConnectingPoint + * Definition of referenced connecting points on which connectors of SystemC-AMS Component Task diagrams can be connected + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSReferencePortConnectingPoint extends SysCAMSPortConnectingPoint{ + + private SysCAMSCompositePort port; + + public SysCAMSReferencePortConnectingPoint(SysCAMSCompositePort _port, CDElement _container, double _w, double _h) { + super(_container, 0, 0, true, true, _w, _h); + port = _port; + } + + public void setPort(SysCAMSCompositePort _port) { + port = _port; + } + + public SysCAMSCompositePort getPort() { + return port; + } + + public static double getDecX(SysCAMSCompositePort _port) { + if (_port != null) { + TGComponent tgc = _port.getFather(); + if (tgc != null) { + int x1 = _port.getX() + _port.getWidth()/2; + int x2 = tgc.getX(); + int w1 = tgc.getWidth(); + return ((double)x1 - x2) / w1; + } + } + return 0; + } + + public double getDecX() { + if (port != null) { + return getDecX(port); + } + return 0; + } + + public static double getDecY(SysCAMSCompositePort _port) { + if (_port != null) { + TGComponent tgc = _port.getFather(); + if (tgc != null) { + int y1 = _port.getY() + _port.getHeight()/2; + int y2 = tgc.getY(); + int h1 = tgc.getHeight(); + return ((double)y1 - y2) / h1; + } + } + return 0; + } + + public double getDecY() { + if (port != null) { + return getDecY(port); + } + return 0; + } + + public int getX() { + if (container != null) { + return x + container.getX() + (int)(container.getWidth() * getDecX()); + } + return x; + } + + public int getY() { + if (container != null) { + return y + container.getY() + (int)(container.getHeight() * getDecY()); + } + return y; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSRemoteCompositeComponent.java b/src/main/java/ui/syscams/SysCAMSRemoteCompositeComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..b85c1ea3c7bd64ed862adc4bfe1343f7623bb128 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSRemoteCompositeComponent.java @@ -0,0 +1,596 @@ +/* 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 myutil.TraceManager; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import ui.*; +import ui.util.IconManager; +//import ui.window.JDialogTMLRemoteCompositeComponent; + +import javax.swing.*; +import java.awt.*; +import java.util.ArrayList; + +/** +* Class SysCAMSRemoteCompositeComponent +* Composite Component. To be used in SystemC-AMS diagrams + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSRemoteCompositeComponent extends TGCScalableWithInternalComponent implements SwallowTGComponent, SwallowedTGComponent { + private int maxFontSize = 20; + private int minFontSize = 4; + private int currentFontSize = -1; + private boolean displayText = true; + private Color myColor; + private int iconSize = 17; + private boolean iconIsDrawn = false; + + private int textX = 15; // border for ports + private double dtextX = 0.0; + + private int defaultDiag = 10; + private double ddefaultDiag = 0.0; + + private SysCAMSCompositeComponent syscamscc; + private ArrayList<SysCAMSCompositePort> ports; + + private NodeList nl; + + public SysCAMSRemoteCompositeComponent(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(250, 200); + + oldScaleFactor = tdp.getZoom(); + dtextX = textX * oldScaleFactor; + textX = (int)dtextX; + dtextX = dtextX - textX; + + minWidth = 1; + minHeight = 1; + + nbConnectingPoint = 0; + nbInternalTGComponent = 0; + + moveable = true; + editable = true; + removable = true; + userResizable = true; + multieditable = true; + + value = "No reference"; + name = "Remote composite component"; + + ports = new ArrayList<SysCAMSCompositePort>(); + + myImageIcon = IconManager.imgic1200; + } + + public void updateReference(SysCAMSCompositeComponent syscamsccc) { + if (syscamscc == syscamsccc) { + updateReference(); + } + } + + public void updateReference() { + if (syscamscc != null) { + if (syscamscc.getTDiagramPanel() == null) { + syscamscc = null; + value = "No reference"; + } else { + // Update + value = syscamscc.getExtendedValue(); + updatePorts(); + } + } + } + + public void internalDrawing(Graphics g) { + int w; + int c; + Font f = g.getFont(); + Font fold = f; + + if (syscamscc == null) { + // Use value to find the component + syscamscc = tdp.getMGUI().getSysCAMSCompositeComponent(value); + if (syscamscc == null) { + value = "No reference"; + } + } else { + if (syscamscc.getTDiagramPanel() == null) { + syscamscc = null; + value = "No reference"; + } else { + if (ports.size() != syscamscc.getCompositePortNb()) { + updateReference(); + } + } + } + if (myColor == null) { + myColor = new Color(251, 252, 200- (getMyDepth() * 10), 200); + } + + if ((rescaled) && (!tdp.isScaled())) { + if (currentFontSize == -1) { + currentFontSize = f.getSize(); + } + rescaled = false; + // Must set the font size .. + // Find the biggest font not greater than max_font size + // By Increment of 1 + // Or decrement of 1 + // If font is less than 4, no text is displayed + int maxCurrentFontSize = Math.max(0, Math.min(height-(2*textX), maxFontSize)); + while(maxCurrentFontSize > (minFontSize-1)) { + f = f.deriveFont((float)maxCurrentFontSize); + g.setFont(f); + w = g.getFontMetrics().stringWidth(value); + c = width - iconSize - (2 * textX); + if (w < c) { + break; + } + maxCurrentFontSize --; + } + currentFontSize = maxCurrentFontSize; + displayText = currentFontSize >= minFontSize; + } + + // Zoom is assumed to be computed + Color col = g.getColor(); + g.drawRect(x, y, width, height); + if ((width > 2) && (height > 2)) { + g.setColor(myColor); + g.fillRect(x+1, y+1, width-1, height-1); + g.setColor(col); + } + + // Font size + if (displayText) { + f = f.deriveFont((float)currentFontSize); + g.setFont(f); + w = g.getFontMetrics().stringWidth(value); + if (!(w < (width - 2 * (iconSize + textX)))) { + g.drawString(value, x + textX + 1, y + currentFontSize + textX); + } else { + g.drawString(value, x + (width - w)/2, y + currentFontSize + textX); + } + } + g.setFont(fold); + + // Icon + if ((width>30) && (height > (iconSize + 2*textX))) { + g.drawImage(IconManager.imgic1200.getImage(), x + width - iconSize - textX, y + textX, null); + iconIsDrawn = true; + } else { + iconIsDrawn = false; + } + } + + public void rescale(double scaleFactor){ + dtextX = (textX + dtextX) / oldScaleFactor * scaleFactor; + textX = (int)(dtextX); + dtextX = dtextX - textX; + + ddefaultDiag = (defaultDiag + ddefaultDiag) / oldScaleFactor * scaleFactor; + defaultDiag = (int)(ddefaultDiag); + ddefaultDiag = ddefaultDiag - defaultDiag; + + super.rescale(scaleFactor); + } + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + return null; + } + + public boolean editOndoubleClick(JFrame frame, int _x, int _y) { + // On the icon? + if (iconIsDrawn && (syscamscc != null)) { + if (GraphicLib.isInRectangle(_x, _y, x + width - iconSize - textX, y + textX, iconSize, iconSize)) { + boolean b = tdp.getMGUI().selectHighLevelTab(syscamscc.getValuePanel()); + if (b) { + return false; + } + } + } + +// JDialogTMLRemoteCompositeComponent dialog = new JDialogTMLRemoteCompositeComponent(frame, "Setting referenced component", this); +// GraphicLib.centerOnParent(dialog, 400, 350); +// dialog.setVisible( true ); // blocked until dialog has been closed +// +// if (!dialog.isRegularClose()) { +// return false; +// } +// +// if (dialog.getReferenceComponentName() == null) { +// return false; +// } +// +// if (dialog.getReferenceComponentName().length() != 0) { +// tmlcc = getTDiagramPanel().getMGUI().getCompositeComponent(dialog.getReferenceComponentName()); +// if (tmlcc != null ){ +// updateReference(); +// rescaled = true; +// } +// tdp.repaint(); +// } + return false; + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<info ref=\"" + value + "\" "); + sb.append("/>\n"); + + for (SysCAMSCompositePort port: ports) { + sb.append("<port id=\"" + port.getId() + "\" />\n"); + } + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList _nl, int decX, int decY, int decId) throws MalformedModelingException{ + nl = _nl; + } + + public void delayedLoad() throws MalformedModelingException { + try { + NodeList nli; + Node n1, n2; + Element elt; + int j, k; + int index; + int cptk = 0; + SysCAMSRemotePortCompositeComponent pcc; + TGConnectingPoint[] old = null; + ArrayList<SysCAMSCompositePort> tmp = null; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(j=0; j<nli.getLength(); j++) { + n2 = nli.item(j); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("info")) { + value = elt.getAttribute("ref"); + syscamscc = getTDiagramPanel().getMGUI().getSysCAMSCompositeComponent(value); + if (syscamscc != null ){ + updateReference(); + rescaled = true; + tmp = ports; + ports = new ArrayList<SysCAMSCompositePort>(); + for (SysCAMSCompositePort port: tmp) { + ports.add(port); + } + } + } + + if (elt.getTagName().equals("port")) { + if (old == null) { + old = connectingPoint; + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + } + try { + int portid = Integer.decode(elt.getAttribute("id")).intValue(); + + for (SysCAMSCompositePort port: tmp) { + if (port.getId() == portid) { + index = tmp.indexOf(port); + for (k=index*5; k<(index+1)*5; k++) { + // Must update position of connecting point + connectingPoint[k] = old[cptk]; + + if ((k % 5) == 0) { + if (nbInternalTGComponent > (k/5)) { + pcc = (SysCAMSRemotePortCompositeComponent)(tgcomponent[k/5]); + if (pcc != null) { + pcc.setElements(port, (SysCAMSReferencePortConnectingPoint)(connectingPoint[k])); + } + } + } + ((SysCAMSReferencePortConnectingPoint)(connectingPoint[k])).setPort(port); + if (connectingPoint[k] == null) { + TraceManager.addDev("null cp"); + } + cptk ++; + } + break; + } + } + } catch (Exception e) { + } + } + + } + } + } + } + // Make paths + ((SysCAMSComponentTaskDiagramPanel)getTDiagramPanel()).makePaths(); + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + + public int getType() { + return TGComponentManager.TMLCTD_CREMOTECOMPONENT; + } + + public void wasSwallowed() { + myColor = null; + } + + public void wasUnswallowed() { + myColor = null; + setFather(null); + TDiagramPanel tdp = getTDiagramPanel(); + setCdRectangle(tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY()); + } + + public void hasBeenResized() { + rescaled = true; + if (getFather() != null) { + resizeWithFather(); + } + } + + public void resizeWithFather() { + if ((father != null) && ((father instanceof SysCAMSCompositeComponent) ||(father instanceof SysCAMSPrimitiveComponent))) { + // Too large to fit in the father? -> resize it! + resizeToFatherSize(); + setCdRectangle(0, father.getWidth() - getWidth(), 0, father.getHeight() - getHeight()); + setMoveCd(x, y); + } + } + + public java.util.List<SysCAMSPrimitiveComponent> getAllPrimitiveComponents() { + if (syscamscc == null) { + return new ArrayList<SysCAMSPrimitiveComponent>(); + } + return syscamscc.getAllPrimitiveComponents(); + } + + public java.util.List<SysCAMSRecordComponent> getAllRecordComponents() { + if (syscamscc == null) { + return new ArrayList<SysCAMSRecordComponent>(); + } + return syscamscc.getAllRecordComponents(); + } + + public java.util.List<SysCAMSCompositePort> getAllInternalCompositePorts() { + java.util.List<SysCAMSCompositePort> list = new ArrayList<SysCAMSCompositePort>(); + if (syscamscc == null) { + return list; + } + return syscamscc.getAllInternalCompositePorts(); + } + + public ArrayList<SysCAMSPrimitivePort> getAllInternalPrimitivePorts() { + ArrayList<SysCAMSPrimitivePort> list = new ArrayList<SysCAMSPrimitivePort>(); + if (syscamscc == null) { + return list; + } + return syscamscc.getAllInternalPrimitivePorts(); + } + + public SysCAMSPrimitiveComponent getPrimitiveComponentByName(String _name) { + if (syscamscc == null) { + return null; + } + return syscamscc.getPrimitiveComponentByName(_name); + } + + public void drawTGConnectingPoint(Graphics g, int type) { + for (int i=0; i<nbConnectingPoint; i++) { + if (connectingPoint[i].isCompatibleWith(type)) { + connectingPoint[i].draw(g); + } + } + } + + // 5 tgconnecting per port: we show only them toward the exterior of the component + // Add to ports the new port and remove to ports the removed ports + // Update tgconnecting points accordingly. Those points should point to their original ones so as to be sure to be drawn at the right place + // to a list of those points, keep that list, and then, generate a array of those points. + public void updatePorts() { + ArrayList<SysCAMSCompositePort> list = syscamscc.getFirstLevelCompositePorts(); + int cpt=0; + + int i, j; + SysCAMSCompositePort tmp; + SysCAMSReferencePortConnectingPoint point; + + // Close attention to the list + boolean change = true; + if (list.size() != ports.size()) { + change = true; + } else { + for (SysCAMSCompositePort port: ports) { + if (!list.contains(port)) { + change = true; + break; + } + } + } + + if (change) { + TraceManager.addDev("change on ports!"); + // Delete unused ports and + ArrayList<SysCAMSReferencePortConnectingPoint> points = new ArrayList<SysCAMSReferencePortConnectingPoint>(); + cpt=0; + + for(i=0; i<ports.size(); i++) { + tmp = ports.get(i); + if (list.contains(tmp)) { + for (j=cpt; j<cpt+5; j++) { + points.add((SysCAMSReferencePortConnectingPoint)(connectingPoint[cpt])); + } + } else { + ports.remove(tmp); + for (j=cpt; j<cpt+5; j++) { + tdp.removeOneConnector(connectingPoint[cpt]); + // Shall we remove the connecting points? + } + i --; + } + cpt = cpt + 5; + } + // Add new ports + for (SysCAMSCompositePort port1: list) { + if (!ports.contains(port1)) { + ports.add(port1); + for(j=0; j<5; j++) { + point = new SysCAMSReferencePortConnectingPoint(port1, this, 0.5, 0.5); + points.add(point); + } + } + } + + if (nbConnectingPoint == points.size()) { + } else { + nbConnectingPoint = points.size(); + SysCAMSRemotePortCompositeComponent tgp; + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + nbInternalTGComponent = nbConnectingPoint/5; + tgcomponent = new TGComponent[nbInternalTGComponent]; + cpt = 0; + int cpttg = 0; + + for(SysCAMSPortConnectingPoint pt: points) { + connectingPoint[cpt] = pt; + if ((cpt % 5) == 0) { + tgp = new SysCAMSRemotePortCompositeComponent(getX(), getY(), 0, 0, 10, 10, false, this, tdp); + tgp.setElements(ports.get(cpttg), (SysCAMSReferencePortConnectingPoint)pt); + tgcomponent[cpttg] = tgp; + cpttg ++; + } + cpt ++; + } + } + } + } + + public TGComponent getPortOf(TGConnectingPoint tp) { + if (ports == null) { + return null; + } + for (int i=0; i<nbConnectingPoint; i++) { + if (connectingPoint[i] == tp) { + if (i/5 < ports.size()) { + return ports.get(i/5); + } + } + } + return null; + } + + public boolean setIdTGConnectingPoint(int num, int id) { + int i; + try { + if (connectingPoint == null) { + nbConnectingPoint = num + 1; + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + for(i=0; i<nbConnectingPoint; i++) { + connectingPoint[i] = new SysCAMSReferencePortConnectingPoint(null, this, 0.5, 0.5); + } + } else { + if (num >= nbConnectingPoint) { + nbConnectingPoint = num + 1; + TGConnectingPoint[] old = connectingPoint; + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + for(i=0; i<old.length; i++) { + connectingPoint[i] = old[i]; + } + for(i=old.length; i<nbConnectingPoint; i++) { + connectingPoint[i] = new SysCAMSReferencePortConnectingPoint(null, this, 0.5, 0.5); + } + } + } + connectingPoint[num].forceId(id); + return true; + } catch (Exception e) { + TraceManager.addDev("Exception remote 1:" + e.getMessage()); + return false; + } + } + + public boolean acceptSwallowedTGComponent(TGComponent tgc) { + return tgc instanceof SysCAMSRemotePortCompositeComponent; + } + + public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { + if (!acceptSwallowedTGComponent(tgc)) { + return false; + } + tgc.setFather(this); + tgc.setDrawingZone(true); + addInternalComponent(tgc, 0); + return true; + } + + public void removeSwallowedTGComponent(TGComponent tgc) { + } + + public String getAttributes() { + return ""; + } + + public TDiagramPanel getReferencedDiagram() { + if (syscamscc == null) { + return null; + } + return syscamscc.getTDiagramPanel(); + } + + public SysCAMSCompositeComponent getReference() { + return syscamscc; + } +} \ No newline at end of file diff --git a/src/main/java/ui/syscams/SysCAMSRemotePortCompositeComponent.java b/src/main/java/ui/syscams/SysCAMSRemotePortCompositeComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..6d43d813253ee8003aa2e2cfdb73d095f0534c75 --- /dev/null +++ b/src/main/java/ui/syscams/SysCAMSRemotePortCompositeComponent.java @@ -0,0 +1,138 @@ +/* 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 SysCAMSRemotePortCompositeComponent + * Port referencing the port of a composite component + * Creation: 22/04/2018 + * @version 1.0 22/04/2018 + * @author Irina Kit Yan LEE + */ + +public class SysCAMSRemotePortCompositeComponent extends TGCWithInternalComponent implements SwallowedTGComponent, WithAttributes { + private SysCAMSCompositePort port; + SysCAMSReferencePortConnectingPoint point; + private int defaultDiag = 10; + private Color myColor = new Color(251, 252, 200); + + public SysCAMSRemotePortCompositeComponent(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); + + nbConnectingPoint = 0; + nbInternalTGComponent = 0; + + moveable = false; + editable = false; + removable = false; + userResizable = false; + multieditable = false; + + value = "Reference Port"; + name = "Reference Port"; + + myImageIcon = IconManager.imgic1200; + } + + public void internalDrawing(Graphics g) { + int xp, yp; + Color pc = myColor; + Color col = g.getColor(); + + if (port != null) { + pc = port.getPortColor(); + if (pc == null) { + pc = myColor; + } + } + + if (point != null) { + xp = point.getX() - (defaultDiag / 2); + yp = point.getY() - (defaultDiag / 2); + x = point.getX(); + y = point.getY() ; + forceSize(0, 0); + g.setColor(pc); + g.fillOval(xp, yp, defaultDiag+1, defaultDiag+1); + g.setColor(col); + g.drawOval(xp, yp, defaultDiag, defaultDiag); + } + } + + public void setElements(SysCAMSCompositePort _port, SysCAMSReferencePortConnectingPoint _point) { + port = _port; + point = _point; + } + + public SysCAMSCompositePort getPort() { + return port; + } + + public String getAttributes() { + if (port != null) { + return port.getAttributes(); + } + return ""; + } + + public TGComponent isOnOnlyMe(int x1, int y1) { + if (point == null) { + return null; + } + + int xp, yp; + xp = point.getX() - (defaultDiag / 2); + yp = point.getY() - (defaultDiag / 2); + + if (GraphicLib.isInRectangle(x1, y1, xp, yp, defaultDiag, defaultDiag)) { + return this; + } + return null; + } + + public int getType() { + return TGComponentManager.TMLCTD_CREMOTEPORTCOMPONENT; + } +} \ No newline at end of file diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyConnectingPoint.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyConnector.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramName.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramName.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramPanel.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramReference.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramReference.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramToolbar.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyDiagramToolbar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToAnalysis.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToAnalysis.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToApplication.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToApplication.java old mode 100755 new mode 100644 index 039b121a3d7f452300ca51c989bb86797885dcbc..458e25bf47bf958e3246c888c372cac2016af043 --- a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToApplication.java +++ b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToApplication.java @@ -83,12 +83,12 @@ public class SysmlsecMethodologyReferenceToApplication extends SysmlsecMethodolo } public void makeValidationInfos(SysmlsecMethodologyDiagramName dn) { - dn.setValidationsNumber(4); + dn.setValidationsNumber(5); dn.setValidationsInfo(0, SysmlsecMethodologyDiagramName.SIM_ANIM_APP_DIPLO); dn.setValidationsInfo(1, SysmlsecMethodologyDiagramName.SIM_TRACE_APP_DIPLO); - //dn.setValidationsInfo(2, SysmlsecMethodologyDiagramName.LOT_APP_DIPLO); - dn.setValidationsInfo(2, SysmlsecMethodologyDiagramName.UPP_APP_DIPLO); - dn.setValidationsInfo(3, SysmlsecMethodologyDiagramName.TML_APP_DIPLO); + dn.setValidationsInfo(2, SysmlsecMethodologyDiagramName.LOT_APP_DIPLO); + dn.setValidationsInfo(3, SysmlsecMethodologyDiagramName.UPP_APP_DIPLO); + dn.setValidationsInfo(4, SysmlsecMethodologyDiagramName.TML_APP_DIPLO); } public boolean makeCall(String diagramName, int index) { @@ -113,7 +113,7 @@ public class SysmlsecMethodologyReferenceToApplication extends SysmlsecMethodolo return true; } return false; - /*case 2: + case 2: if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) { if (!tdp.getMGUI().generateLOTOS(true)) { TraceManager.addDev("Generate LOTOS: error"); @@ -127,9 +127,9 @@ public class SysmlsecMethodologyReferenceToApplication extends SysmlsecMethodolo } else { giveInformation("Syntax error"); return false; - }*/ + } - case 2: + case 3: if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) { tdp.getMGUI().generateUPPAAL(false); boolean result = tdp.getMGUI().gtm.generateUPPAALFromTML(SpecConfigTTool.UPPAALCodeDirectory, false, 8, false); @@ -146,7 +146,7 @@ public class SysmlsecMethodologyReferenceToApplication extends SysmlsecMethodolo } break; - case 3: + case 4: if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) { TraceManager.addDev("Generate TML"); tmp = tdp.getMGUI().generateTMLTxt(); diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToArchitecture.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToArchitecture.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToAssumptions.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToAssumptions.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToAttack.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToAttack.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToCP.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToCP.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToDesign.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToDesign.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToMapping.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToMapping.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToProperties.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToProperties.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToPrototype.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToPrototype.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToRequirement.java b/src/main/java/ui/sysmlsecmethodology/SysmlsecMethodologyReferenceToRequirement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TGConnectingPointTMLAD.java b/src/main/java/ui/tmlad/TGConnectingPointTMLAD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TGConnectorTMLAD.java b/src/main/java/ui/tmlad/TGConnectorTMLAD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADActionState.java b/src/main/java/ui/tmlad/TMLADActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADChoice.java b/src/main/java/ui/tmlad/TMLADChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADDecrypt.java b/src/main/java/ui/tmlad/TMLADDecrypt.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADDelay.java b/src/main/java/ui/tmlad/TMLADDelay.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADDelayInterval.java b/src/main/java/ui/tmlad/TMLADDelayInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADEncrypt.java b/src/main/java/ui/tmlad/TMLADEncrypt.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADExecC.java b/src/main/java/ui/tmlad/TMLADExecC.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADExecCInterval.java b/src/main/java/ui/tmlad/TMLADExecCInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADExecI.java b/src/main/java/ui/tmlad/TMLADExecI.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADExecIInterval.java b/src/main/java/ui/tmlad/TMLADExecIInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADForEverLoop.java b/src/main/java/ui/tmlad/TMLADForEverLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADForLoop.java b/src/main/java/ui/tmlad/TMLADForLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADForStaticLoop.java b/src/main/java/ui/tmlad/TMLADForStaticLoop.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADNotifiedEvent.java b/src/main/java/ui/tmlad/TMLADNotifiedEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADRandom.java b/src/main/java/ui/tmlad/TMLADRandom.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADReadChannel.java b/src/main/java/ui/tmlad/TMLADReadChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADReadRequestArg.java b/src/main/java/ui/tmlad/TMLADReadRequestArg.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADSelectEvt.java b/src/main/java/ui/tmlad/TMLADSelectEvt.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADSendEvent.java b/src/main/java/ui/tmlad/TMLADSendEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADSendRequest.java b/src/main/java/ui/tmlad/TMLADSendRequest.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADSequence.java b/src/main/java/ui/tmlad/TMLADSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADStartState.java b/src/main/java/ui/tmlad/TMLADStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADStopState.java b/src/main/java/ui/tmlad/TMLADStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADUnorderedSequence.java b/src/main/java/ui/tmlad/TMLADUnorderedSequence.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADWaitEvent.java b/src/main/java/ui/tmlad/TMLADWaitEvent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLADWriteChannel.java b/src/main/java/ui/tmlad/TMLADWriteChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLActivityDiagramPanel.java b/src/main/java/ui/tmlad/TMLActivityDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlad/TMLActivityDiagramToolBar.java b/src/main/java/ui/tmlad/TMLActivityDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TGConnectingPointTMLAssociation.java b/src/main/java/ui/tmlcd/TGConnectingPointTMLAssociation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TGConnectingPointTMLCompositionOperator.java b/src/main/java/ui/tmlcd/TGConnectingPointTMLCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TGConnectingPointTMLTask.java b/src/main/java/ui/tmlcd/TGConnectingPointTMLTask.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TGConnectorTMLAssociationNav.java b/src/main/java/ui/tmlcd/TGConnectorTMLAssociationNav.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TGConnectorTMLCompositionOperator.java b/src/main/java/ui/tmlcd/TGConnectorTMLCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLActivityDiagramBox.java b/src/main/java/ui/tmlcd/TMLActivityDiagramBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLAttributeBox.java b/src/main/java/ui/tmlcd/TMLAttributeBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLChannelOperator.java b/src/main/java/ui/tmlcd/TMLChannelOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLChannelProperties.java b/src/main/java/ui/tmlcd/TMLChannelProperties.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLCompositionOperator.java b/src/main/java/ui/tmlcd/TMLCompositionOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLDataFlowType.java b/src/main/java/ui/tmlcd/TMLDataFlowType.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLEventOperator.java b/src/main/java/ui/tmlcd/TMLEventOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLEventProperties.java b/src/main/java/ui/tmlcd/TMLEventProperties.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLOperationBox.java b/src/main/java/ui/tmlcd/TMLOperationBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLRequestOperator.java b/src/main/java/ui/tmlcd/TMLRequestOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLRequestProperties.java b/src/main/java/ui/tmlcd/TMLRequestProperties.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLTaskDiagramPanel.java b/src/main/java/ui/tmlcd/TMLTaskDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLTaskDiagramToolBar.java b/src/main/java/ui/tmlcd/TMLTaskDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcd/TMLTaskOperator.java b/src/main/java/ui/tmlcd/TMLTaskOperator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCChannelFacility.java b/src/main/java/ui/tmlcompd/TMLCChannelFacility.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCChannelOutPort.java b/src/main/java/ui/tmlcompd/TMLCChannelOutPort.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCCompositeComponent.java b/src/main/java/ui/tmlcompd/TMLCCompositeComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCCompositePort.java b/src/main/java/ui/tmlcompd/TMLCCompositePort.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCFork.java b/src/main/java/ui/tmlcompd/TMLCFork.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCJoin.java b/src/main/java/ui/tmlcompd/TMLCJoin.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCPath.java b/src/main/java/ui/tmlcompd/TMLCPath.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCPortConnectingPoint.java b/src/main/java/ui/tmlcompd/TMLCPortConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCPortConnector.java b/src/main/java/ui/tmlcompd/TMLCPortConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCPrimitiveComponent.java b/src/main/java/ui/tmlcompd/TMLCPrimitiveComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCPrimitivePort.java b/src/main/java/ui/tmlcompd/TMLCPrimitivePort.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCRecordComponent.java b/src/main/java/ui/tmlcompd/TMLCRecordComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCReferencePortConnectingPoint.java b/src/main/java/ui/tmlcompd/TMLCReferencePortConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLCRemoteCompositeComponent.java b/src/main/java/ui/tmlcompd/TMLCRemoteCompositeComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramPanel.java b/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramToolBar.java b/src/main/java/ui/tmlcompd/TMLComponentTaskDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TGConnectingPointTMLCP.java b/src/main/java/ui/tmlcp/TGConnectingPointTMLCP.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TGConnectorTMLCP.java b/src/main/java/ui/tmlcp/TGConnectorTMLCP.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPChoice.java b/src/main/java/ui/tmlcp/TMLCPChoice.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPForLoop.java b/src/main/java/ui/tmlcp/TMLCPForLoop.java old mode 100755 new mode 100644 index 19808cab1d4f1a358e1ada5eb2b3afc1f33dd577..2f25ac9e780e7f13cd951499db4c6b230d19e3fa --- a/src/main/java/ui/tmlcp/TMLCPForLoop.java +++ b/src/main/java/ui/tmlcp/TMLCPForLoop.java @@ -37,6 +37,8 @@ */ + + package ui.tmlcp; import myutil.GraphicLib; @@ -55,14 +57,13 @@ import java.awt.geom.Line2D; * Class TMLCPForLoop * For loop of a TML activity diagram * Creation: 03/06/2015 - * - * @author Ludovic APVRILLE * @version 1.0 03/06/2015 + * @author Ludovic APVRILLE */ public class TMLCPForLoop extends TGCWithoutInternalComponent implements EmbeddedComment, BasicErrorHighlight { protected int lineLength = 5; - protected int textX = 5; - protected int textY = 15; + protected int textX = 5; + protected int textY = 15; protected int arc = 5; protected String init = "i=0"; @@ -71,7 +72,7 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde protected int stateOfError = 0; // Not yet checked - public TMLCPForLoop(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + public TMLCPForLoop(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); width = 30; @@ -96,38 +97,38 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde } public void internalDrawing(Graphics g) { - final int textWidth = g.getFontMetrics().stringWidth(value); + final int textWidth = g.getFontMetrics().stringWidth(value); int w1 = Math.max(minWidth, textWidth + 2 * textX); if ((w1 != width) & (!tdp.isScaled())) { - setCd(x + width / 2 - w1 / 2, y); + setCd(x + width/2 - w1/2, y); width = w1; //updateConnectingPoints(); } - if (stateOfError > 0) { + if (stateOfError > 0) { Color c = g.getColor(); - switch (stateOfError) { - case ErrorHighlight.OK: - g.setColor(ColorManager.FOR); - break; - default: - g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.FOR); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); } g.fillRoundRect(x, y, width, height, arc, arc); g.setColor(c); } g.drawRoundRect(x, y, width, height, arc, arc); - g.drawLine(x + (width / 2), y, x + (width / 2), y - lineLength); - g.drawLine(x + (width / 2), y + height, x + (width / 2), y + lineLength + height); - g.drawLine(x + width, y + height / 2, x + width + lineLength, y + height / 2); + g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); + g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); + g.drawLine(x+width, y+height/2, x+width +lineLength, y+height/2); - g.drawString(value, x + (width - textWidth) / 2, y + textY); + g.drawString(value, x + (width - textWidth) / 2 , y + textY); } public boolean editOndoubleClick(JFrame frame) { - String[] labels = new String[3]; - String[] values = new String[3]; + String [] labels = new String[3]; + String [] values = new String[3]; labels[0] = "Initialisation of variable"; values[0] = init; labels[1] = "Condition to stay in loop"; @@ -137,9 +138,9 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde JDialogMultiString jdms = new JDialogMultiString(frame, "Setting loop's properties", 3, labels, values); - // jdms.setSize(400, 300); + // jdms.setSize(400, 300); GraphicLib.centerOnParent(jdms, 400, 300); - jdms.setVisible(true); // blocked until dialog has been closed + jdms.setVisible( true ); // blocked until dialog has been closed if (jdms.hasBeenSet()) { init = jdms.getString(0); @@ -159,11 +160,11 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde return this; } - if ((int) (Line2D.ptSegDistSq(x + (width / 2), y - lineLength, x + (width / 2), y + lineLength + height, _x, _y)) < distanceSelected) { + if ((int)(Line2D.ptSegDistSq(x+(width/2), y-lineLength, x+(width/2), y + lineLength + height, _x, _y)) < distanceSelected) { return this; } - if ((int) (Line2D.ptSegDistSq(x + width, y + height / 2, x + width + lineLength, y + height / 2, _x, _y)) < distanceSelected) { + if ((int)(Line2D.ptSegDistSq(x+width, y+height/2, x+width +lineLength, y+height/2, _x, _y)) < distanceSelected) { return this; } @@ -204,7 +205,7 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde } @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ //System.out.println("*** load extra synchro *** " + getId()); try { @@ -217,12 +218,12 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde //System.out.println("Loading Synchronization gates"); //System.out.println(nl.toString()); - for (int i = 0; i < nl.getLength(); i++) { + for(int i=0; i<nl.getLength(); i++) { n1 = nl.item(i); //System.out.println(n1); if (n1.getNodeType() == Node.ELEMENT_NODE) { nli = n1.getChildNodes(); - for (int j = 0; j < nli.getLength(); j++) { + for(int j=0; j<nli.getLength(); j++) { n2 = nli.item(j); //System.out.println(n2); if (n2.getNodeType() == Node.ELEMENT_NODE) { @@ -250,7 +251,7 @@ public class TMLCPForLoop extends TGCWithoutInternalComponent implements Embedde } public int getDefaultConnector() { - return TGComponentManager.CONNECTOR_TMLCP; + return TGComponentManager.CONNECTOR_TMLCP; } public void setStateAction(int _stateAction) { diff --git a/src/main/java/ui/tmlcp/TMLCPFork.java b/src/main/java/ui/tmlcp/TMLCPFork.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPJoin.java b/src/main/java/ui/tmlcp/TMLCPJoin.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPJunction.java b/src/main/java/ui/tmlcp/TMLCPJunction.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPPanel.java b/src/main/java/ui/tmlcp/TMLCPPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPRefAD.java b/src/main/java/ui/tmlcp/TMLCPRefAD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPRefSD.java b/src/main/java/ui/tmlcp/TMLCPRefSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPStartState.java b/src/main/java/ui/tmlcp/TMLCPStartState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPStopState.java b/src/main/java/ui/tmlcp/TMLCPStopState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlcp/TMLCPToolBar.java b/src/main/java/ui/tmlcp/TMLCPToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiArtifact.java b/src/main/java/ui/tmldd/TMLArchiArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiBUSNode.java b/src/main/java/ui/tmldd/TMLArchiBUSNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiBridgeNode.java b/src/main/java/ui/tmldd/TMLArchiBridgeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiCAMSNode.java b/src/main/java/ui/tmldd/TMLArchiCAMSNode.java deleted file mode 100755 index 2362ba7287abde997f99b69ab3a7cf2b3976bd7c..0000000000000000000000000000000000000000 --- a/src/main/java/ui/tmldd/TMLArchiCAMSNode.java +++ /dev/null @@ -1,404 +0,0 @@ -/* 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.tmldd; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import tmltranslator.HwCPU; -import ui.*; -import ui.het.*; -import ui.util.IconManager; - -import javax.swing.*; -import java.awt.*; -import java.util.Vector; - -/** - * Class TMLArchiCAMSNode - * System C-AMS Node. To be used in TML architecture diagrams. - * Creation: 06/09/2017 - * @version 1.0 06/09/2017 - * @author Côme DEMARIGNY - */ -public class TMLArchiCAMSNode extends TMLArchiNode implements SwallowTGComponent, WithAttributes { - private int textY1 = 15; - private int textY2 = 30; - private int derivationx = 2; - private int derivationy = 3; - private String stereotype = "CAMS"; - - private int byteDataSize = HwCPU.DEFAULT_BYTE_DATA_SIZE; - private int execiTime = HwCPU.DEFAULT_EXECI_TIME; - - private CAMSBlockDiagramPanel cbdp; - - - public TMLArchiCAMSNode(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); - - width = 200; - height = 200; - minWidth = 100; - minHeight = 100; - - nbConnectingPoint = 16; - connectingPoint = new TGConnectingPoint[16]; - - connectingPoint[0] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.0, 0.0); - connectingPoint[1] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.5, 0.0); - connectingPoint[2] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 1.0, 0.0); - connectingPoint[3] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.0, 0.5); - connectingPoint[4] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 1.0, 0.5); - connectingPoint[5] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.0, 1.0); - connectingPoint[6] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.5, 1.0); - connectingPoint[7] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 1.0, 1.0); - - connectingPoint[8] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.25, 0.0); - connectingPoint[9] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.75, 0.0); - connectingPoint[10] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.0, 0.25); - connectingPoint[11] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 1.0, 0.25); - connectingPoint[12] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.0, 0.75); - connectingPoint[13] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 1.0, 0.75); - connectingPoint[14] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.25, 1.0); - connectingPoint[15] = new TMLArchiConnectingPoint(this, 0, 0, false, true, 0.75, 1.0); - - addTGConnectingPointsComment(); - - nbInternalTGComponent = 0; - - moveable = true; - editable = true; - removable = true; - userResizable = true; - - name = tdp.findNodeName("CAMS"); - value = "name"; - - myImageIcon = IconManager.imgic700; - } - - public void internalDrawing(Graphics g) { - Color c = g.getColor(); - g.draw3DRect(x, y, width, height, true); - - - // Top lines - g.drawLine(x, y, x + derivationx, y - derivationy); - g.drawLine(x + width, y, x + width + derivationx, y - derivationy); - g.drawLine(x + derivationx, y - derivationy, x + width + derivationx, y - derivationy); - - // Right lines - g.drawLine(x + width, y + height, x + width + derivationx, y - derivationy + height); - g.drawLine(x + derivationx + width, y - derivationy, x + width + derivationx, y - derivationy + height); - - // Filling color - g.setColor(ColorManager.HWA_BOX); - g.fill3DRect(x+1, y+1, width-1, height-1, true); - g.setColor(c); - - // Strings - String ster = "<<" + stereotype + ">>"; - int w = g.getFontMetrics().stringWidth(ster); - Font f = g.getFont(); - g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY1); - g.setFont(f); - w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + textY2); - - // Icon - g.drawImage(IconManager.imgic1106.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); - } - - public TGComponent isOnOnlyMe(int x1, int y1) { - - Polygon pol = new Polygon(); - pol.addPoint(x, y); - pol.addPoint(x + derivationx, y - derivationy); - pol.addPoint(x + derivationx + width, y - derivationy); - pol.addPoint(x + derivationx + width, y + height - derivationy); - pol.addPoint(x + width, y + height); - pol.addPoint(x, y + height); - if (pol.contains(x1, y1)) { - return this; - } - - return null; - } - - public String getStereotype() { - return stereotype; - - } - - public String getNodeName() { - return name; - } - - public boolean editOndoubleClick(JFrame frame) { - if ( cbdp == null){ - MainGUI mgui = tdp.getMainGUI(); - cbdp = mgui.addSystemCAMSPanel("System C-AMS Deployment of DIPLODOCUS Node", -1, this); - cbdp.setVisible(true); - cbdp.initFromDiplodocus(); - - } - return true; - } - - // boolean error = false; - // String errors = ""; - // int tmp; - // String tmpName; - - // JDialogHwANode dialog = new JDialogHwANode(frame, "Setting HWA attributes", this); - // // dialog.setSize(500, 450); - // GraphicLib.centerOnParent(dialog, 500, 450); - // dialog.setVisible( true ); // blocked until dialog has been closed - - // if (!dialog.isRegularClose()) { - // return false; - // } - - // if (dialog.getNodeName().length() != 0) { - // tmpName = dialog.getNodeName(); - // tmpName = tmpName.trim(); - // if (!TAttribute.isAValidId(tmpName, false, false)) { - // error = true; - // errors += "Name of the node "; - // } else { - // name = tmpName; - // } - // } - - // if (dialog.getByteDataSize().length() != 0) { - // try { - // tmp = byteDataSize; - // byteDataSize = Integer.decode(dialog.getByteDataSize()).intValue(); - // if (byteDataSize <= 0) { - // byteDataSize = tmp; - // error = true; - // errors += "Data size "; - // } - // } catch (Exception e) { - // error = true; - // errors += "Data size "; - // } - // } - - // if (dialog.getExeciTime().length() != 0) { - // try { - // tmp = execiTime; - // execiTime = Integer.decode(dialog.getExeciTime()).intValue(); - // if (execiTime < 0) { - // execiTime = tmp; - // error = true; - // errors += "execi time "; - // } - // } catch (Exception e) { - // error = true; - // errors += "execi time "; - // } - // } - - // if (dialog.getClockRatio().length() != 0) { - // try { - // tmp = clockRatio; - // clockRatio = Integer.decode(dialog.getClockRatio()).intValue(); - // if (clockRatio <= 0) { - // clockRatio = tmp; - // error = true; - // errors += "Clock divider "; - // } - // } catch (Exception e) { - // error = true; - // errors += "Clock divider "; - // } - // } - - // if (error) { - // JOptionPane.showMessageDialog(frame, - // "Invalid value for the following attributes: " + errors, - // "Error", - // JOptionPane.INFORMATION_MESSAGE); - // return false; - // } - - // return true; - // } - - - public int getType() { - return TGComponentManager.TMLARCHI_CAMSNODE; - } - - public boolean acceptSwallowedTGComponent(TGComponent tgc) { - return (tgc instanceof TMLArchiArtifact) && (nbInternalTGComponent == 0); - - } - - public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { - if ((tgc instanceof TMLArchiArtifact) && (nbInternalTGComponent == 0)){ - tgc.setFather(this); - tgc.setDrawingZone(true); - tgc.resizeWithFather(); - addInternalComponent(tgc, 0); - return true; - } - - return false; - } - - public void removeSwallowedTGComponent(TGComponent tgc) { - removeInternalComponent(tgc); - } - - - public Vector<TMLArchiArtifact> getArtifactList() { - Vector<TMLArchiArtifact> v = new Vector<TMLArchiArtifact>(); - for(int i=0; i<nbInternalTGComponent; i++) { - if (tgcomponent[i] instanceof TMLArchiArtifact) { - v.add( (TMLArchiArtifact) tgcomponent[i]); - } - } - - return v; - } - - public void hasBeenResized() { - for(int i=0; i<nbInternalTGComponent; i++) { - if (tgcomponent[i] instanceof TMLArchiArtifact) { - tgcomponent[i].resizeWithFather(); - } - } - - } - - protected String translateExtraParam() { - StringBuffer sb = new StringBuffer("<extraparam>\n"); - sb.append("<info stereotype=\"" + stereotype + "\" nodeName=\"" + name); - sb.append("\" />\n"); - sb.append("<attributes byteDataSize=\"" + byteDataSize + "\" "); - sb.append(" execiTime=\"" + execiTime + "\" "); - sb.append(" clockRatio=\"" + clockRatio + "\" "); - sb.append("/>\n"); - sb.append("</extraparam>\n"); - return new String(sb); - } - - @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ - //System.out.println("*** load extra synchro ***"); - try { - - NodeList nli; - Node n1, n2; - Element elt; - // int t1id; - String sstereotype = null, snodeName = null; - - for(int i=0; i<nl.getLength(); i++) { - n1 = nl.item(i); - //System.out.println(n1); - if (n1.getNodeType() == Node.ELEMENT_NODE) { - nli = n1.getChildNodes(); - for(int j=0; j<nli.getLength(); j++) { - n2 = nli.item(j); - //System.out.println(n2); - if (n2.getNodeType() == Node.ELEMENT_NODE) { - elt = (Element) n2; - if (elt.getTagName().equals("info")) { - sstereotype = elt.getAttribute("stereotype"); - snodeName = elt.getAttribute("nodeName"); - } - if (sstereotype != null) { - stereotype = sstereotype; - } - if (snodeName != null){ - name = snodeName; - } - - if (elt.getTagName().equals("attributes")) { - byteDataSize = Integer.decode(elt.getAttribute("byteDataSize")).intValue(); - execiTime = Integer.decode(elt.getAttribute("execiTime")).intValue(); - if ((elt.getAttribute("clockRatio") != null) && (elt.getAttribute("clockRatio").length() > 0)){ - clockRatio = Integer.decode(elt.getAttribute("clockRatio")).intValue(); - } - } - } - } - } - } - - } catch (Exception e) { - throw new MalformedModelingException(); - } - } - - public int getDefaultConnector() { - return TGComponentManager.CONNECTOR_NODE_TMLARCHI; - } - - public int getByteDataSize(){ - return byteDataSize; - } - - public int getExeciTime(){ - return execiTime; - } - - - public String getAttributes() { - String attr = ""; - attr += "Data size (in byte) = " + byteDataSize + "\n"; - attr += "Execi execution time (in cycle) = " + execiTime + "\n"; - attr += "Clock divider = " + clockRatio + "\n"; - return attr; - } - - public int getComponentType() { - return CONTROLLER; - } - -} diff --git a/src/main/java/ui/tmldd/TMLArchiCPInterface.java b/src/main/java/ui/tmldd/TMLArchiCPInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiCPNode.java b/src/main/java/ui/tmldd/TMLArchiCPNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiCPUNode.java b/src/main/java/ui/tmldd/TMLArchiCPUNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiChannelInterface.java b/src/main/java/ui/tmldd/TMLArchiChannelInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiCommunicationArtifact.java b/src/main/java/ui/tmldd/TMLArchiCommunicationArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiCommunicationNode.java b/src/main/java/ui/tmldd/TMLArchiCommunicationNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiConnectingPoint.java b/src/main/java/ui/tmldd/TMLArchiConnectingPoint.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiConnectorNode.java b/src/main/java/ui/tmldd/TMLArchiConnectorNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiCrossbarNode.java b/src/main/java/ui/tmldd/TMLArchiCrossbarNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiDMANode.java b/src/main/java/ui/tmldd/TMLArchiDMANode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiDiagramPanel.java b/src/main/java/ui/tmldd/TMLArchiDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiDiagramToolBar.java b/src/main/java/ui/tmldd/TMLArchiDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiElementInterface.java b/src/main/java/ui/tmldd/TMLArchiElementInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiEventArtifact.java b/src/main/java/ui/tmldd/TMLArchiEventArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiFPGANode.java b/src/main/java/ui/tmldd/TMLArchiFPGANode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiHWANode.java b/src/main/java/ui/tmldd/TMLArchiHWANode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiKey.java b/src/main/java/ui/tmldd/TMLArchiKey.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiMemoryNode.java b/src/main/java/ui/tmldd/TMLArchiMemoryNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiNode.java b/src/main/java/ui/tmldd/TMLArchiNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiPortInterface.java b/src/main/java/ui/tmldd/TMLArchiPortInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiSecurityInterface.java b/src/main/java/ui/tmldd/TMLArchiSecurityInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiTaskInterface.java b/src/main/java/ui/tmldd/TMLArchiTaskInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmldd/TMLArchiVGMNNode.java b/src/main/java/ui/tmldd/TMLArchiVGMNNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java b/src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TGConnectorMessageAsyncTMLSD.java b/src/main/java/ui/tmlsd/TGConnectorMessageAsyncTMLSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TGConnectorMessageTMLSD.java b/src/main/java/ui/tmlsd/TGConnectorMessageTMLSD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDActionState.java b/src/main/java/ui/tmlsd/TMLSDActionState.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDControllerInstance.java b/src/main/java/ui/tmlsd/TMLSDControllerInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDInstance.java b/src/main/java/ui/tmlsd/TMLSDInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDPanel.java b/src/main/java/ui/tmlsd/TMLSDPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDStorageInstance.java b/src/main/java/ui/tmlsd/TMLSDStorageInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDToolBar.java b/src/main/java/ui/tmlsd/TMLSDToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tmlsd/TMLSDTransferInstance.java b/src/main/java/ui/tmlsd/TMLSDTransferInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/CorrespondanceValidationDataTree.java b/src/main/java/ui/tree/CorrespondanceValidationDataTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/DiagramTreeModel.java b/src/main/java/ui/tree/DiagramTreeModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/DiagramTreeRenderer.java b/src/main/java/ui/tree/DiagramTreeRenderer.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/GraphTree.java b/src/main/java/ui/tree/GraphTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/InvariantDataTree.java b/src/main/java/ui/tree/InvariantDataTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/JDiagramTree.java b/src/main/java/ui/tree/JDiagramTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/SearchTree.java b/src/main/java/ui/tree/SearchTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/SyntaxAnalysisErrorTree.java b/src/main/java/ui/tree/SyntaxAnalysisErrorTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/SyntaxAnalysisTree.java b/src/main/java/ui/tree/SyntaxAnalysisTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/SyntaxAnalysisWarningTree.java b/src/main/java/ui/tree/SyntaxAnalysisWarningTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/TClassesValidationDataTree.java b/src/main/java/ui/tree/TClassesValidationDataTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/tree/ValidationDataTree.java b/src/main/java/ui/tree/ValidationDataTree.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectingPointActorUCD.java b/src/main/java/ui/ucd/TGConnectingPointActorUCD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectingPointUCD.java b/src/main/java/ui/ucd/TGConnectingPointUCD.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectorExtend.java b/src/main/java/ui/ucd/TGConnectorExtend.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectorInclude.java b/src/main/java/ui/ucd/TGConnectorInclude.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectorSpecialization.java b/src/main/java/ui/ucd/TGConnectorSpecialization.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectorUC.java b/src/main/java/ui/ucd/TGConnectorUC.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/TGConnectorUseCase.java b/src/main/java/ui/ucd/TGConnectorUseCase.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/UCDActor.java b/src/main/java/ui/ucd/UCDActor.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/UCDActorBox.java b/src/main/java/ui/ucd/UCDActorBox.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/UCDBorder.java b/src/main/java/ui/ucd/UCDBorder.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/UCDUseCase.java b/src/main/java/ui/ucd/UCDUseCase.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/UseCaseDiagramPanel.java b/src/main/java/ui/ucd/UseCaseDiagramPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/ucd/UseCaseDiagramToolBar.java b/src/main/java/ui/ucd/UseCaseDiagramToolBar.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/util/DefaultText.java b/src/main/java/ui/util/DefaultText.java old mode 100755 new mode 100644 index d03fbc5c2c4fe53fe0537710a099130c0f836922..207bc585b567080f5dbb25014410925c487a6440 --- a/src/main/java/ui/util/DefaultText.java +++ b/src/main/java/ui/util/DefaultText.java @@ -50,8 +50,8 @@ package ui.util; */ public class DefaultText { - public static String BUILD = "12664"; - public static String DATE = "2018/05/14 02:01:36 CET"; + public static String BUILD = "12622"; + public static String DATE = "2018/04/14 02:01:34 CET"; public static StringBuffer sbAbout = makeAbout(); diff --git a/src/main/java/ui/util/IconManager.java b/src/main/java/ui/util/IconManager.java old mode 100755 new mode 100644 index 626cd74f099251a542d3bb694667fb11bb0c94e8..13cf51e3fb1e0bb90e6baa2a6a45a3669492097f --- a/src/main/java/ui/util/IconManager.java +++ b/src/main/java/ui/util/IconManager.java @@ -182,6 +182,8 @@ public class IconManager { // Image of the help button for the ports (Solange) public static ImageIcon imgic2111; //New icon created by Solange + // SystemC-AMS + public static ImageIcon imgic8000, imgic8001, imgic8002, imgic8003, imgic8004, imgic8005; //private static String icon7 = "turtle_large.gif"; private static String icon8 = "turtle_16.gif"; @@ -654,8 +656,13 @@ public class IconManager { private static String icon7008 = "attacker.gif"; private static String icon7009 = "uppaal.gif"; - // - + // SystemC-AMS + private static String icon8000 = "camstdfport.gif"; + private static String icon8001 = "camsdeport.gif"; + private static String icon8002 = "camsconverterportW.gif"; + private static String icon8003 = "camsconverterportE.gif"; + private static String icon8004 = "camsconverterportN.gif"; + private static String icon8005 = "camsconverterportS.gif"; public IconManager() { @@ -1134,6 +1141,13 @@ public class IconManager { imgic7007 = getIcon(icon7007); imgic7008 = getIcon(icon7008); imgic7009 = getIcon(icon7009); + + imgic8000 = getIcon(icon8000); + imgic8001 = getIcon(icon8001); + imgic8002 = getIcon(icon8002); + imgic8003 = getIcon(icon8003); + imgic8004 = getIcon(icon8004); + imgic8005 = getIcon(icon8005); } } // Class diff --git a/src/main/java/ui/window/DeadlockItem.java b/src/main/java/ui/window/DeadlockItem.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/DeadlockTableModel.java b/src/main/java/ui/window/DeadlockTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/EquipmentsNCTableModel.java b/src/main/java/ui/window/EquipmentsNCTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/GateSimulationTrace.java b/src/main/java/ui/window/GateSimulationTrace.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/GeneralInfoNCTableModel.java b/src/main/java/ui/window/GeneralInfoNCTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JBirdPanel.java b/src/main/java/ui/window/JBirdPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADConnector.java b/src/main/java/ui/window/JDialogADConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDBusNode.java b/src/main/java/ui/window/JDialogADDBusNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDCPUNode.java b/src/main/java/ui/window/JDialogADDCPUNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDCoproMWMRNode.java b/src/main/java/ui/window/JDialogADDCoproMWMRNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDCrossbarNode.java b/src/main/java/ui/window/JDialogADDCrossbarNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDICUNode.java b/src/main/java/ui/window/JDialogADDICUNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDMemoryNode.java b/src/main/java/ui/window/JDialogADDMemoryNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDTTYNode.java b/src/main/java/ui/window/JDialogADDTTYNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDTimerNode.java b/src/main/java/ui/window/JDialogADDTimerNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogADDVgmnNode.java b/src/main/java/ui/window/JDialogADDVgmnNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogArrayGet.java b/src/main/java/ui/window/JDialogArrayGet.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogArraySet.java b/src/main/java/ui/window/JDialogArraySet.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogArtifact.java b/src/main/java/ui/window/JDialogArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAssumption.java b/src/main/java/ui/window/JDialogAssumption.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAttack.java b/src/main/java/ui/window/JDialogAttack.java old mode 100755 new mode 100644 index bffac7ea29eb633236947f64428650aac7acf0e6..7ea131e33fc64705c5343fb5d40e820bf72ca0cf --- a/src/main/java/ui/window/JDialogAttack.java +++ b/src/main/java/ui/window/JDialogAttack.java @@ -134,7 +134,6 @@ public class JDialogAttack extends JDialogBase implements ActionListener { c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; c.add(panel2, c0); c0.gridwidth = 1; diff --git a/src/main/java/ui/window/JDialogAttribute.java b/src/main/java/ui/window/JDialogAttribute.java old mode 100755 new mode 100644 index e0382e66f0867cdb6ff39a86cf834c013aa7e87c..efa65052dceb3add9d2b6f597ff0aefd0ab4fd60 --- a/src/main/java/ui/window/JDialogAttribute.java +++ b/src/main/java/ui/window/JDialogAttribute.java @@ -239,7 +239,6 @@ public class JDialogAttribute extends JDialogBase implements ActionListener, Lis c0.gridheight = 10; c0.weighty = 1.0; c0.weightx = 1.0; - c0.fill = GridBagConstraints.BOTH; c.add(panel1, c0); c0.gridwidth = GridBagConstraints.REMAINDER; //end row diff --git a/src/main/java/ui/window/JDialogAvatarBlock.java b/src/main/java/ui/window/JDialogAvatarBlock.java old mode 100755 new mode 100644 index c88bf555b3794555328d6fec5dec90d63449b02e..84de5ed00ab9154d7d5183844d9e5e3b3329274f --- a/src/main/java/ui/window/JDialogAvatarBlock.java +++ b/src/main/java/ui/window/JDialogAvatarBlock.java @@ -579,7 +579,7 @@ public class JDialogAvatarBlock extends JDialogBase implements ActionListener, L c8.gridheight = 10; c8.weighty = 1.0; c8.weightx = 1.0; - c8.fill = GridBagConstraints.BOTH; + c8.fill = GridBagConstraints.HORIZONTAL; panelAttr.add(panel1, c8); c8.gridwidth = GridBagConstraints.REMAINDER; //end row //c.add(tabbedPane, c0); @@ -597,7 +597,7 @@ public class JDialogAvatarBlock extends JDialogBase implements ActionListener, L c9.gridheight = 10; c9.weighty = 1.0; c9.weightx = 1.0; - c9.fill = GridBagConstraints.BOTH; + c9.fill = GridBagConstraints.HORIZONTAL; panelMethod.add(panel3, c9); c9.gridwidth = GridBagConstraints.REMAINDER; //end row //c.add(tabbedPane, c0); @@ -615,7 +615,7 @@ public class JDialogAvatarBlock extends JDialogBase implements ActionListener, L c10.gridheight = 10; c10.weighty = 1.0; c10.weightx = 1.0; - c10.fill = GridBagConstraints.BOTH; + c10.fill = GridBagConstraints.HORIZONTAL; panelSignal.add(panel5, c10); c10.gridwidth = GridBagConstraints.REMAINDER; //end row //c.add(tabbedPane, c0); diff --git a/src/main/java/ui/window/JDialogAvatarBlockArtifact.java b/src/main/java/ui/window/JDialogAvatarBlockArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAvatarChannelArtifact.java b/src/main/java/ui/window/JDialogAvatarChannelArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAvatarLibraryFunction.java b/src/main/java/ui/window/JDialogAvatarLibraryFunction.java old mode 100755 new mode 100644 index 37a3229131bf380627a2639bcb63248c80514734..ab94df970fae5493f31aef33fb5b20abcbbd2342 --- a/src/main/java/ui/window/JDialogAvatarLibraryFunction.java +++ b/src/main/java/ui/window/JDialogAvatarLibraryFunction.java @@ -1,26 +1,26 @@ /* 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, @@ -31,17 +31,20 @@ * 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.window; import myutil.GraphicLib; import ui.AvatarMethod; import ui.AvatarSignal; +import ui.util.IconManager; import ui.TAttribute; import ui.avatarbd.AvatarBDLibraryFunction; @@ -59,9 +62,8 @@ import java.util.LinkedList; /** * Dialog for managing parameters, return values, attributes, methods and signals of Avatar Library Functions - * - * @author Florian Lugou * @version 1.0 04.11.2016 + * @author Florian Lugou */ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionListener, ListSelectionListener { private AvatarBDLibraryFunction bdElement; @@ -76,7 +78,7 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL private JButton modifyButtons[]; private JButton upButtons[]; private JButton downButtons[]; - private HashMap<Integer, JList<Object>> listAttribute; + private HashMap<Integer,JList<Object>> listAttribute; private ArrayList<LinkedList<Object>> attributes; // Parameters Tab @@ -105,74 +107,64 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL private JTextField methodText; - public JDialogAvatarLibraryFunction(AvatarBDLibraryFunction bdElement, JFrame frame, String title, String attrib) { - super(frame, title, true); + public JDialogAvatarLibraryFunction (AvatarBDLibraryFunction bdElement, JFrame frame, String title, String attrib) { + super (frame, title, true); this.bdElement = bdElement; this.checkKeyword = true; this.checkJavaKeyword = true; - this.removeButtons = new JButton[5]; - this.modifyButtons = new JButton[5]; - this.upButtons = new JButton[5]; - this.downButtons = new JButton[5]; + this.removeButtons = new JButton [5]; + this.modifyButtons = new JButton [5]; + this.upButtons = new JButton [5]; + this.downButtons = new JButton [5]; this.listAttribute = new HashMap<>(); this.attributes = new ArrayList<>(); - LinkedList<Object> l = new LinkedList<>(); - for (TAttribute attr : this.bdElement.getParameters()) - l.add(attr.makeClone()); + LinkedList<Object> l = new LinkedList<> (); + for (TAttribute attr: this.bdElement.getParameters ()) + l.add (attr.makeClone ()); this.attributes.add(l); - l = new LinkedList<>(); - for (AvatarSignal signal : this.bdElement.getSignals()) - l.add(signal.makeClone()); + l = new LinkedList<> (); + for (AvatarSignal signal: this.bdElement.getSignals ()) + l.add (signal.makeClone ()); this.attributes.add(l); - l = new LinkedList<>(); - for (TAttribute attr : this.bdElement.getReturnAttributes()) - l.add(attr.makeClone()); + l = new LinkedList<> (); + for (TAttribute attr: this.bdElement.getReturnAttributes ()) + l.add (attr.makeClone ()); this.attributes.add(l); - l = new LinkedList<>(); - for (TAttribute attr : this.bdElement.getAttributes()) - l.add(attr.makeClone()); + l = new LinkedList<> (); + for (TAttribute attr: this.bdElement.getAttributes ()) + l.add (attr.makeClone ()); this.attributes.add(l); - l = new LinkedList<>(); - for (AvatarMethod meth : this.bdElement.getMethods()) - l.add(meth.makeClone()); + l = new LinkedList<> (); + for (AvatarMethod meth: this.bdElement.getMethods ()) + l.add (meth.makeClone ()); this.attributes.add(l); - this.initComponents(); + this.initComponents (); this.addAccess(TAttribute.getStringAccess(TAttribute.PRIVATE)); this.addType(TAttribute.getStringAvatarType(TAttribute.BOOLEAN)); this.addType(TAttribute.getStringAvatarType(TAttribute.INTEGER)); this.addType(TAttribute.getStringType(TAttribute.TIMER)); - for (String s : this.bdElement.getDiagramPanel().getAllDataTypes()) + for(String s: this.bdElement.getDiagramPanel ().getAllDataTypes()) this.addType(s); /* pack(); */ } - private void fillGenericAttributesTab(JPanel tab, int tabIndex, String tabTitle, JComboBox<String> accessBox, JTextField identifierText, JTextField initialValue, JComboBox<String> typeBox) { + private void fillGenericAttributesTab (JPanel tab, int tabIndex, String tabTitle, JComboBox<String> accessBox, JTextField identifierText, JTextField initialValue, JComboBox<String> typeBox) { // West Panel - - GridBagConstraints c0 = new GridBagConstraints(); - - - c0.gridwidth = 1; - c0.gridheight = 1; - c0.weighty = 1.0; - c0.weightx = 1.0; - c0.fill = GridBagConstraints.BOTH; - - JPanel panelWest = new JPanel(); - tab.add(panelWest, c0); - panelWest.setLayout(new GridBagLayout()); - panelWest.setBorder(new javax.swing.border.TitledBorder("Adding " + tabTitle + "s")); + JPanel panelWest = new JPanel (); + tab.add(panelWest, BorderLayout.WEST); + panelWest.setLayout (new GridBagLayout ()); + panelWest.setBorder (new javax.swing.border.TitledBorder ("Adding " + tabTitle + "s")); panelWest.setPreferredSize(new Dimension(300, 450)); // first line of west panel (field titles) @@ -230,27 +222,26 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL gridConstraints.fill = GridBagConstraints.HORIZONTAL; gridConstraints.weightx = 1.0; gridConstraints.gridwidth = 3; - this.modifyButtons[tabIndex] = new JButton("Modify " + tabTitle); + this.modifyButtons[tabIndex] = new JButton ("Modify " + tabTitle); this.modifyButtons[tabIndex].addActionListener(this); - this.modifyButtons[tabIndex].setEnabled(false); + this.modifyButtons[tabIndex].setEnabled (false); panelWest.add(this.modifyButtons[tabIndex], gridConstraints); gridConstraints.gridwidth = GridBagConstraints.REMAINDER; //end row - JButton addButton = new JButton("Add " + tabTitle); + JButton addButton = new JButton ("Add " + tabTitle); addButton.addActionListener(this); panelWest.add(addButton, gridConstraints); // East Panel - c0.gridwidth = GridBagConstraints.REMAINDER; - JPanel panelEast = new JPanel(); - tab.add(panelEast, c0); - panelEast.setLayout(new GridBagLayout()); - panelEast.setBorder(new javax.swing.border.TitledBorder("Managing " + tabTitle + "s")); - panelEast.setPreferredSize(new Dimension(300, 450)); + JPanel panelEast = new JPanel (); + tab.add(panelEast, BorderLayout.EAST); + panelEast.setLayout (new GridBagLayout ()); + panelEast.setBorder (new javax.swing.border.TitledBorder("Managing " + tabTitle + "s")); + panelEast.setPreferredSize (new Dimension (300, 450)); // first line east panel - this.listAttribute.put(tabIndex, new JList<>(this.attributes.get(tabIndex).toArray())); + this.listAttribute.put(tabIndex, new JList <> (this.attributes.get(tabIndex).toArray ())); this.listAttribute.get(tabIndex).setSelectionMode(ListSelectionModel.SINGLE_SELECTION); this.listAttribute.get(tabIndex).addListSelectionListener(this); JScrollPane scrollPane = new JScrollPane(this.listAttribute.get(tabIndex)); @@ -289,15 +280,14 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL panelEast.add(this.removeButtons[tabIndex], gridConstraints); } - private JPanel initParametersTab() { - GridBagLayout gridbag0 = new GridBagLayout(); - JPanel panelParameters = new JPanel(gridbag0); - this.parametersAccessBox = new JComboBox<String>(); - this.parametersIdentifierText = new JTextField(); - this.parametersInitialValue = new JTextField(); - this.parametersTypeBox = new JComboBox<String>(); + private JPanel initParametersTab () { + JPanel panelParameters = new JPanel(new BorderLayout()); + this.parametersAccessBox = new JComboBox<String> (); + this.parametersIdentifierText = new JTextField (); + this.parametersInitialValue = new JTextField (); + this.parametersTypeBox = new JComboBox<String> (); - this.fillGenericAttributesTab( + this.fillGenericAttributesTab ( panelParameters, 0, "Parameter", @@ -309,21 +299,13 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL return panelParameters; } - private JPanel initSignalsTab() { - GridBagLayout gridbag0 = new GridBagLayout(); - GridBagConstraints c0 = new GridBagConstraints(); - JPanel panelSignals = new JPanel(gridbag0); - - c0.gridwidth = 1; - c0.gridheight = 1; - c0.weighty = 1.0; - c0.weightx = 1.0; - c0.fill = GridBagConstraints.BOTH; + private JPanel initSignalsTab () { + JPanel panelSignals = new JPanel(new BorderLayout()); // West Panel JPanel panelWest = new JPanel(); - panelSignals.add(panelWest, c0); - panelWest.setLayout(new GridBagLayout()); + panelSignals.add (panelWest, BorderLayout.WEST); + panelWest.setLayout(new GridBagLayout ()); panelWest.setBorder(new javax.swing.border.TitledBorder("Adding Signals")); panelWest.setPreferredSize(new Dimension(300, 250)); @@ -343,8 +325,8 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL // second line west panel gridConstraints.gridwidth = 1; gridConstraints.fill = GridBagConstraints.HORIZONTAL; - this.signalInOutBox = new JComboBox<String>(new String[]{"in", "out"}); - panelWest.add(this.signalInOutBox, gridConstraints); + this.signalInOutBox = new JComboBox<String> (new String[] {"in", "out"}); + panelWest.add (this.signalInOutBox, gridConstraints); this.signalText = new JTextField(); this.signalText.setColumns(50); @@ -361,9 +343,9 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL gridConstraints.gridheight = 1; gridConstraints.fill = GridBagConstraints.HORIZONTAL; gridConstraints.gridwidth = 1; - this.modifyButtons[1] = new JButton("Modify Signal"); + this.modifyButtons[1] = new JButton ("Modify Signal"); this.modifyButtons[1].addActionListener(this); - this.modifyButtons[1].setEnabled(false); + this.modifyButtons[1].setEnabled (false); panelWest.add(this.modifyButtons[1], gridConstraints); gridConstraints.gridwidth = GridBagConstraints.REMAINDER; //end row @@ -372,15 +354,14 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL panelWest.add(addSignalButton, gridConstraints); // East Panel - c0.gridwidth = GridBagConstraints.REMAINDER; JPanel panelEast = new JPanel(); - panelSignals.add(panelEast, c0); - panelEast.setLayout(new GridBagLayout()); + panelSignals.add(panelEast, BorderLayout.EAST); + panelEast.setLayout(new GridBagLayout ()); panelEast.setBorder(new javax.swing.border.TitledBorder("Managing Signals")); panelEast.setPreferredSize(new Dimension(300, 250)); // first line east panel - this.listAttribute.put(1, new JList<>(this.attributes.get(1).toArray())); + this.listAttribute.put(1, new JList<> (this.attributes.get(1).toArray ())); this.listAttribute.get(1).setSelectionMode(ListSelectionModel.SINGLE_SELECTION); this.listAttribute.get(1).addListSelectionListener(this); JScrollPane scrollPane = new JScrollPane(this.listAttribute.get(1)); @@ -402,32 +383,31 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL // third line east panel gridConstraints.fill = GridBagConstraints.HORIZONTAL; this.upButtons[1] = new JButton("Up"); - this.upButtons[1].setEnabled(false); + this.upButtons[1].setEnabled (false); this.upButtons[1].addActionListener(this); panelEast.add(this.upButtons[1], gridConstraints); this.downButtons[1] = new JButton("Down"); - this.downButtons[1].setEnabled(false); + this.downButtons[1].setEnabled (false); this.downButtons[1].addActionListener(this); panelEast.add(this.downButtons[1], gridConstraints); this.removeButtons[1] = new JButton("Remove Signal"); - this.removeButtons[1].setEnabled(false); + this.removeButtons[1].setEnabled (false); this.removeButtons[1].addActionListener(this); panelEast.add(this.removeButtons[1], gridConstraints); return panelSignals; } - private JPanel initReturnAttributesTab() { - GridBagLayout gridbag0 = new GridBagLayout(); - JPanel panelReturnAttributes = new JPanel(gridbag0); - this.returnAttributesAccessBox = new JComboBox<String>(); - this.returnAttributesIdentifierText = new JTextField(); - this.returnAttributesInitialValue = new JTextField(); - this.returnAttributesTypeBox = new JComboBox<String>(); + private JPanel initReturnAttributesTab () { + JPanel panelReturnAttributes = new JPanel(new BorderLayout()); + this.returnAttributesAccessBox = new JComboBox<String> (); + this.returnAttributesIdentifierText = new JTextField (); + this.returnAttributesInitialValue = new JTextField (); + this.returnAttributesTypeBox = new JComboBox<String> (); - this.fillGenericAttributesTab( + this.fillGenericAttributesTab ( panelReturnAttributes, 2, "Return Value", @@ -439,15 +419,14 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL return panelReturnAttributes; } - private JPanel initAttributesTab() { - GridBagLayout gridbag0 = new GridBagLayout(); - JPanel panelAttributes = new JPanel(gridbag0); - this.attributesAccessBox = new JComboBox<String>(); - this.attributesIdentifierText = new JTextField(); - this.attributesInitialValue = new JTextField(); - this.attributesTypeBox = new JComboBox<String>(); + private JPanel initAttributesTab () { + JPanel panelAttributes = new JPanel(new BorderLayout()); + this.attributesAccessBox = new JComboBox<String> (); + this.attributesIdentifierText = new JTextField (); + this.attributesInitialValue = new JTextField (); + this.attributesTypeBox = new JComboBox<String> (); - this.fillGenericAttributesTab( + this.fillGenericAttributesTab ( panelAttributes, 3, "Local Attribute", @@ -459,23 +438,15 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL return panelAttributes; } - private JPanel initMethodsTab() { - GridBagLayout gridbag0 = new GridBagLayout(); - GridBagConstraints c0 = new GridBagConstraints(); - JPanel panelMethods = new JPanel(gridbag0); - - c0.gridwidth = 1; - c0.gridheight = 1; - c0.weighty = 1.0; - c0.weightx = 1.0; - c0.fill = GridBagConstraints.BOTH; + private JPanel initMethodsTab () { + JPanel panelMethods = new JPanel(new BorderLayout()); // Panel West JPanel panelWest = new JPanel(); - panelMethods.add(panelWest, c0); - panelWest.setLayout(new GridBagLayout()); + panelMethods.add(panelWest, BorderLayout.WEST); + panelWest.setLayout(new GridBagLayout ()); panelWest.setBorder(new javax.swing.border.TitledBorder("Adding Methods")); - //panelWest.setPreferredSize(new Dimension(300, 250)); + panelWest.setPreferredSize(new Dimension(300, 250)); // first line west panel GridBagConstraints gridConstraints = new GridBagConstraints(); @@ -506,9 +477,9 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL gridConstraints.gridheight = 1; gridConstraints.fill = GridBagConstraints.HORIZONTAL; gridConstraints.gridwidth = 1; - this.modifyButtons[4] = new JButton("Modify Method"); + this.modifyButtons[4] = new JButton ("Modify Method"); this.modifyButtons[4].addActionListener(this); - this.modifyButtons[4].setEnabled(false); + this.modifyButtons[4].setEnabled (false); panelWest.add(this.modifyButtons[4], gridConstraints); gridConstraints.gridwidth = GridBagConstraints.REMAINDER; //end row @@ -518,15 +489,14 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL // Panel East - c0.gridwidth = GridBagConstraints.REMAINDER; //end row JPanel panelEast = new JPanel(); - panelMethods.add(panelEast, c0); - panelEast.setLayout(new GridBagLayout()); + panelMethods.add(panelEast, BorderLayout.EAST); + panelEast.setLayout(new GridBagLayout ()); panelEast.setBorder(new javax.swing.border.TitledBorder("Managing Methods")); - //panelEast.setPreferredSize(new Dimension(300, 250)); + panelEast.setPreferredSize(new Dimension(300, 250)); // first line east panel - this.listAttribute.put(4, new JList<>(this.attributes.get(4).toArray())); + this.listAttribute.put(4, new JList<> (this.attributes.get(4).toArray ())); this.listAttribute.get(4).setSelectionMode(ListSelectionModel.SINGLE_SELECTION); this.listAttribute.get(4).addListSelectionListener(this); JScrollPane scrollPane = new JScrollPane(this.listAttribute.get(4)); @@ -550,17 +520,17 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL gridConstraints.gridwidth = GridBagConstraints.REMAINDER; //end row gridConstraints.fill = GridBagConstraints.HORIZONTAL; this.upButtons[4] = new JButton("Up"); - this.upButtons[4].setEnabled(false); + this.upButtons[4].setEnabled (false); this.upButtons[4].addActionListener(this); panelEast.add(this.upButtons[4], gridConstraints); this.downButtons[4] = new JButton("Down"); - this.downButtons[4].setEnabled(false); + this.downButtons[4].setEnabled (false); this.downButtons[4].addActionListener(this); panelEast.add(this.downButtons[4], gridConstraints); this.removeButtons[4] = new JButton("Remove Method"); - this.removeButtons[4].setEnabled(false); + this.removeButtons[4].setEnabled (false); this.removeButtons[4].addActionListener(this); panelEast.add(this.removeButtons[4], gridConstraints); @@ -569,48 +539,43 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL private void initComponents() { // Get container - Container c = this.getContentPane(); - c.setLayout(new GridBagLayout()); - c.setLayout(new BorderLayout()); + Container c = this.getContentPane (); + c.setLayout (new GridBagLayout ()); - this.setFont(new Font("Helvetica", Font.PLAIN, 14)); - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.setFont (new Font("Helvetica", Font.PLAIN, 14)); + this.setDefaultCloseOperation (JFrame.DISPOSE_ON_CLOSE); // Add the tabs panel // Issue #41 Ordering of tabbed panes this.tabbedPane = GraphicLib.createTabbedPane();//new JTabbedPane(); - tabbedPane.addTab("Parameters", this.initParametersTab()); // Parameters Tab - tabbedPane.addTab("Signals", this.initSignalsTab()); // Signals Tab - tabbedPane.addTab("Return Values", this.initReturnAttributesTab()); // Return Attributes Tab - tabbedPane.addTab("Attributes", this.initAttributesTab()); // Attributes Tab - tabbedPane.addTab("Methods", this.initMethodsTab()); // Methods Tab + tabbedPane.addTab ("Parameters", this.initParametersTab ()); // Parameters Tab + tabbedPane.addTab ("Signals", this.initSignalsTab ()); // Signals Tab + tabbedPane.addTab ("Return Values", this.initReturnAttributesTab ()); // Return Attributes Tab + tabbedPane.addTab ("Attributes", this.initAttributesTab ()); // Attributes Tab + tabbedPane.addTab ("Methods", this.initMethodsTab ()); // Methods Tab GridBagConstraints gridConstraints = new GridBagConstraints(); gridConstraints.gridwidth = 1; - gridConstraints.gridheight = 20; + gridConstraints.gridheight = 10; gridConstraints.weighty = 1.0; gridConstraints.weightx = 1.0; gridConstraints.gridwidth = GridBagConstraints.REMAINDER; //end row - gridConstraints.fill = GridBagConstraints.BOTH; //end row - //c.add(tabbedPane, gridConstraints); - c.add(tabbedPane, BorderLayout.CENTER); + c.add(tabbedPane, gridConstraints); // Add Save & Close button gridConstraints.gridwidth = 1; gridConstraints.gridheight = 1; gridConstraints.fill = GridBagConstraints.HORIZONTAL; - - c.add(initBasicButtons(this), BorderLayout.SOUTH); - - + + initButtons(gridConstraints, c, this); } - public void selectTabIndex(int tab) { + public void selectTabIndex (int tab) { this.tabbedPane.setSelectedIndex(tab); } - private void highlightField(final JTextField textField) { + private void highlightField (final JTextField textField) { /* (new Thread () { public void run () { @@ -631,30 +596,30 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL */ } - public void actionPerformed(ActionEvent evt) { - Object source = evt.getSource(); + public void actionPerformed (ActionEvent evt) { + Object source = evt.getSource (); if (source == this.closeButton) { - this.save(); - this.dispose(); + this.save (); + this.dispose (); } else if (source == this.cancelButton) - this.dispose(); + this.dispose (); else if (source instanceof JButton) { - String label = ((JButton) source).getText().split(" ", 2)[0]; + String label = ((JButton) source).getText ().split (" ", 2)[0]; switch (label) { case "Add": - this.handleAdd(); + this.handleAdd (); break; case "Modify": - this.handleModify(); + this.handleModify (); break; case "Up": - this.handleUp(); + this.handleUp (); break; case "Down": - this.handleDown(); + this.handleDown (); break; case "Remove": - this.handleRemove(); + this.handleRemove (); break; default: // Should not arrive here @@ -668,108 +633,108 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL } */ } - - private void save() { - this.bdElement.resetParameters(); - for (Object o : this.attributes.get(0)) - this.bdElement.addParameter((TAttribute) o); - this.bdElement.resetSignals(); - for (Object o : this.attributes.get(1)) - this.bdElement.addSignal((AvatarSignal) o); - this.bdElement.resetReturnAttributes(); - for (Object o : this.attributes.get(2)) - this.bdElement.addReturnAttribute((TAttribute) o); - this.bdElement.resetAttributes(); - for (Object o : this.attributes.get(3)) - this.bdElement.addAttribute((TAttribute) o); - this.bdElement.resetMethods(); - for (Object o : this.attributes.get(4)) - this.bdElement.addMethod((AvatarMethod) o); + + private void save () { + this.bdElement.resetParameters (); + for (Object o: this.attributes.get(0)) + this.bdElement.addParameter ((TAttribute) o); + this.bdElement.resetSignals (); + for (Object o: this.attributes.get(1)) + this.bdElement.addSignal ((AvatarSignal) o); + this.bdElement.resetReturnAttributes (); + for (Object o: this.attributes.get(2)) + this.bdElement.addReturnAttribute ((TAttribute) o); + this.bdElement.resetAttributes (); + for (Object o: this.attributes.get(3)) + this.bdElement.addAttribute ((TAttribute) o); + this.bdElement.resetMethods (); + for (Object o: this.attributes.get(4)) + this.bdElement.addMethod ((AvatarMethod) o); } - private void handleAdd() { - int selectedTab = this.tabbedPane.getSelectedIndex(); + private void handleAdd () { + int selectedTab = this.tabbedPane.getSelectedIndex (); switch (selectedTab) { case 0: - this.addAttribute(0, this.parametersAccessBox, this.parametersIdentifierText, this.parametersInitialValue, this.parametersTypeBox, false); + this.addAttribute (0, this.parametersAccessBox, this.parametersIdentifierText, this.parametersInitialValue, this.parametersTypeBox, false); break; case 1: - this.addSignal(false); + this.addSignal (false); break; case 2: - this.addAttribute(2, this.returnAttributesAccessBox, this.returnAttributesIdentifierText, this.returnAttributesInitialValue, this.returnAttributesTypeBox, false); + this.addAttribute (2, this.returnAttributesAccessBox, this.returnAttributesIdentifierText, this.returnAttributesInitialValue, this.returnAttributesTypeBox, false); break; case 3: - this.addAttribute(3, this.attributesAccessBox, this.attributesIdentifierText, this.attributesInitialValue, this.attributesTypeBox, false); + this.addAttribute (3, this.attributesAccessBox, this.attributesIdentifierText, this.attributesInitialValue, this.attributesTypeBox, false); break; case 4: - this.addMethod(false); + this.addMethod (false); break; default: // Should not arrive here } } - private void addAttribute(int tabIndex, JComboBox<String> accessBox, JTextField identifierText, JTextField initialValue, JComboBox<String> typeBox, boolean modify) { - String identifier = identifierText.getText(); - if (identifier.isEmpty()) { + private void addAttribute (int tabIndex, JComboBox<String> accessBox, JTextField identifierText, JTextField initialValue, JComboBox<String> typeBox, boolean modify) { + String identifier = identifierText.getText (); + if (identifier.isEmpty ()) { // Identifier is empty - this.highlightField(identifierText); - identifierText.requestFocus(); + this.highlightField (identifierText); + identifierText.requestFocus (); return; } - if (!TAttribute.isAValidId(identifier, this.checkKeyword, this.checkJavaKeyword)) { + if (!TAttribute.isAValidId (identifier, this.checkKeyword, this.checkJavaKeyword)) { // Identifier should not be used - JOptionPane.showMessageDialog(this, - "Bad identifier '" + identifier + "': invalid identifier", - "Error", - JOptionPane.ERROR_MESSAGE); - identifierText.requestFocus(); + JOptionPane.showMessageDialog (this, + "Bad identifier '" + identifier + "': invalid identifier", + "Error", + JOptionPane.ERROR_MESSAGE); + identifierText.requestFocus (); return; } - int accessIndex = TAttribute.getAccess((String) accessBox.getSelectedItem()); + int accessIndex = TAttribute.getAccess ((String) accessBox.getSelectedItem ()); if (accessIndex < 0) { // Unknown access modifier - JOptionPane.showMessageDialog(this, - "Bad access modifier", - "Error", - JOptionPane.ERROR_MESSAGE); - accessBox.requestFocus(); + JOptionPane.showMessageDialog (this, + "Bad access modifier", + "Error", + JOptionPane.ERROR_MESSAGE); + accessBox.requestFocus (); return; } - int typeIndex = TAttribute.getAvatarType((String) typeBox.getSelectedItem()); + int typeIndex = TAttribute.getAvatarType ((String) typeBox.getSelectedItem ()); if (typeIndex < 0) { // Unknown type - JOptionPane.showMessageDialog(this, - "Bad type", - "Error", - JOptionPane.ERROR_MESSAGE); - typeBox.requestFocus(); + JOptionPane.showMessageDialog (this, + "Bad type", + "Error", + JOptionPane.ERROR_MESSAGE); + typeBox.requestFocus (); return; } - String value = initialValue.getText().trim(); - if (typeIndex == TAttribute.ARRAY_NAT && value.isEmpty()) + String value = initialValue.getText().trim (); + if (typeIndex == TAttribute.ARRAY_NAT && value.isEmpty ()) value = "2"; - if (!initialValue.isEnabled()) + if (!initialValue.isEnabled ()) value = ""; if (!TAttribute.isAValidInitialValue(typeIndex, value)) { // Bad initial value - JOptionPane.showMessageDialog(this, - "The initial value is not valid", - "Error", - JOptionPane.ERROR_MESSAGE); - initialValue.requestFocus(); + JOptionPane.showMessageDialog (this, + "The initial value is not valid", + "Error", + JOptionPane.ERROR_MESSAGE); + initialValue.requestFocus (); return; } TAttribute a; if (typeIndex == TAttribute.OTHER) - a = new TAttribute(accessIndex, identifier, value, (String) typeBox.getSelectedItem()); + a = new TAttribute(accessIndex, identifier, value, (String) typeBox.getSelectedItem ()); else a = new TAttribute(accessIndex, identifier, value, typeIndex); a.isAvatar = true; @@ -777,44 +742,44 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL int index; Object old = null; if (modify) { - index = this.listAttribute.get(tabIndex).getSelectedIndex(); - old = this.attributes.get(tabIndex).remove(index); + index = this.listAttribute.get(tabIndex).getSelectedIndex (); + old = this.attributes.get(tabIndex).remove (index); } else - index = this.attributes.get(tabIndex).size(); + index = this.attributes.get(tabIndex).size (); //checks whether an attribute with this identifier already belongs to the list - if (this.attributes.get(0).contains(a) || this.attributes.get(2).contains(a) || this.attributes.get(3).contains(a)) { + if (this.attributes.get(0).contains (a) || this.attributes.get(2).contains (a) || this.attributes.get(3).contains (a)) { if (modify) - this.attributes.get(tabIndex).add(index, old); - JOptionPane.showMessageDialog(this, - "Bad Identifier: another attribute or parameter already has the same name.", - "Error", - JOptionPane.ERROR_MESSAGE); - identifierText.requestFocus(); + this.attributes.get(tabIndex).add (index, old); + JOptionPane.showMessageDialog (this, + "Bad Identifier: another attribute or parameter already has the same name.", + "Error", + JOptionPane.ERROR_MESSAGE); + identifierText.requestFocus (); return; } - this.attributes.get(tabIndex).add(index, a); - this.listAttribute.get(tabIndex).setListData(this.attributes.get(tabIndex).toArray()); + this.attributes.get(tabIndex).add (index, a); + this.listAttribute.get(tabIndex).setListData (this.attributes.get(tabIndex).toArray ()); this.listAttribute.get(tabIndex).setSelectedIndex(index); - this.listAttribute.get(tabIndex).requestFocus(); + this.listAttribute.get(tabIndex).requestFocus (); } - private void addMethod(boolean modify) { - String s = this.methodText.getText().trim(); - if (s.isEmpty()) { - this.methodText.requestFocus(); + private void addMethod (boolean modify) { + String s = this.methodText.getText().trim (); + if (s.isEmpty ()) { + this.methodText.requestFocus (); return; } AvatarMethod am = AvatarMethod.isAValidMethod(s); if (am == null) { - JOptionPane.showMessageDialog(this, - "Badly formatted method declaration", - "Error", - JOptionPane.ERROR_MESSAGE); - this.methodText.requestFocus(); + JOptionPane.showMessageDialog (this, + "Badly formatted method declaration", + "Error", + JOptionPane.ERROR_MESSAGE); + this.methodText.requestFocus (); return; } @@ -823,188 +788,188 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL int index; Object old = null; if (modify) { - index = this.listAttribute.get(4).getSelectedIndex(); - old = this.attributes.get(4).remove(index); + index = this.listAttribute.get(4).getSelectedIndex (); + old = this.attributes.get(4).remove (index); } else - index = this.attributes.get(4).size(); + index = this.attributes.get(4).size (); // Checks whether the same method already belongs to the list - if (this.attributes.get(4).contains(am)) { + if (this.attributes.get(4).contains (am)) { if (modify) - this.attributes.get(4).add(index, old); - JOptionPane.showMessageDialog(this, - "This method already exists", - "Error", - JOptionPane.ERROR_MESSAGE); - this.methodText.requestFocus(); + this.attributes.get(4).add (index, old); + JOptionPane.showMessageDialog (this, + "This method already exists", + "Error", + JOptionPane.ERROR_MESSAGE); + this.methodText.requestFocus (); return; } - this.attributes.get(4).add(index, am); - this.listAttribute.get(4).setListData(this.attributes.get(4).toArray()); + this.attributes.get(4).add (index, am); + this.listAttribute.get(4).setListData (this.attributes.get(4).toArray ()); this.listAttribute.get(4).setSelectedIndex(index); - this.listAttribute.get(4).requestFocus(); + this.listAttribute.get(4).requestFocus (); } - private void addSignal(boolean modify) { - String s = this.signalText.getText().trim(); - if (s.isEmpty()) { - this.signalText.requestFocus(); + private void addSignal (boolean modify) { + String s = this.signalText.getText().trim (); + if (s.isEmpty ()) { + this.signalText.requestFocus (); return; } - AvatarSignal as = AvatarSignal.isAValidSignal(this.signalInOutBox.getSelectedIndex(), s); + AvatarSignal as = AvatarSignal.isAValidSignal (this.signalInOutBox.getSelectedIndex(), s); if (as == null) { - JOptionPane.showMessageDialog(this, - "Badly formatted signal declaration", - "Error", - JOptionPane.ERROR_MESSAGE); - this.signalText.requestFocus(); + JOptionPane.showMessageDialog (this, + "Badly formatted signal declaration", + "Error", + JOptionPane.ERROR_MESSAGE); + this.signalText.requestFocus (); return; } int index; Object old = null; if (modify) { - index = this.listAttribute.get(1).getSelectedIndex(); - old = this.attributes.get(1).remove(index); + index = this.listAttribute.get(1).getSelectedIndex (); + old = this.attributes.get(1).remove (index); } else - index = this.attributes.get(1).size(); + index = this.attributes.get(1).size (); // Checks whether the same signal already belongs to the list - if (this.attributes.get(1).contains(as)) { + if (this.attributes.get(1).contains (as)) { if (modify) - this.attributes.get(1).add(index, old); - JOptionPane.showMessageDialog(this, - "This signal already exists", - "Error", - JOptionPane.ERROR_MESSAGE); - this.signalText.requestFocus(); + this.attributes.get(1).add (index, old); + JOptionPane.showMessageDialog (this, + "This signal already exists", + "Error", + JOptionPane.ERROR_MESSAGE); + this.signalText.requestFocus (); return; } - this.attributes.get(1).add(index, as); - this.listAttribute.get(1).setListData(this.attributes.get(1).toArray()); + this.attributes.get(1).add (index, as); + this.listAttribute.get(1).setListData (this.attributes.get(1).toArray ()); this.listAttribute.get(1).setSelectedIndex(index); - this.listAttribute.get(1).requestFocus(); + this.listAttribute.get(1).requestFocus (); } - private void handleModify() { - int selectedTab = this.tabbedPane.getSelectedIndex(); + private void handleModify () { + int selectedTab = this.tabbedPane.getSelectedIndex (); switch (selectedTab) { case 0: - this.addAttribute(0, this.parametersAccessBox, this.parametersIdentifierText, this.parametersInitialValue, this.parametersTypeBox, true); + this.addAttribute (0, this.parametersAccessBox, this.parametersIdentifierText, this.parametersInitialValue, this.parametersTypeBox, true); break; case 1: - this.addSignal(true); + this.addSignal (true); break; case 2: - this.addAttribute(2, this.returnAttributesAccessBox, this.returnAttributesIdentifierText, this.returnAttributesInitialValue, this.returnAttributesTypeBox, true); + this.addAttribute (2, this.returnAttributesAccessBox, this.returnAttributesIdentifierText, this.returnAttributesInitialValue, this.returnAttributesTypeBox, true); break; case 3: - this.addAttribute(3, this.attributesAccessBox, this.attributesIdentifierText, this.attributesInitialValue, this.attributesTypeBox, true); + this.addAttribute (3, this.attributesAccessBox, this.attributesIdentifierText, this.attributesInitialValue, this.attributesTypeBox, true); break; case 4: - this.addMethod(true); + this.addMethod (true); break; default: // Should not arrive here } } - private void handleUp() { - int selectedTab = this.tabbedPane.getSelectedIndex(); + private void handleUp () { + int selectedTab = this.tabbedPane.getSelectedIndex (); int i = this.listAttribute.get(selectedTab).getSelectedIndex(); if (i != -1 && i != 0) { - Collections.swap(this.attributes.get(selectedTab), i, i - 1); - this.listAttribute.get(selectedTab).setListData(this.attributes.get(selectedTab).toArray()); - this.listAttribute.get(selectedTab).setSelectedIndex(i - 1); + Collections.swap (this.attributes.get(selectedTab), i, i-1); + this.listAttribute.get(selectedTab).setListData(this.attributes.get(selectedTab).toArray ()); + this.listAttribute.get(selectedTab).setSelectedIndex(i-1); } } - private void handleDown() { - int selectedTab = this.tabbedPane.getSelectedIndex(); + private void handleDown () { + int selectedTab = this.tabbedPane.getSelectedIndex (); int i = this.listAttribute.get(selectedTab).getSelectedIndex(); if (i != -1 && i != this.attributes.get(selectedTab).size() - 1) { - Collections.swap(this.attributes.get(selectedTab), i, i + 1); - this.listAttribute.get(selectedTab).setListData(this.attributes.get(selectedTab).toArray()); - this.listAttribute.get(selectedTab).setSelectedIndex(i + 1); + Collections.swap (this.attributes.get(selectedTab), i, i+1); + this.listAttribute.get(selectedTab).setListData(this.attributes.get(selectedTab).toArray ()); + this.listAttribute.get(selectedTab).setSelectedIndex(i+1); } } - private void handleRemove() { - int selectedTab = this.tabbedPane.getSelectedIndex(); + private void handleRemove () { + int selectedTab = this.tabbedPane.getSelectedIndex (); switch (selectedTab) { case 0: - this.removeAttribute(0); + this.removeAttribute (0); break; case 1: - this.removeSignal(); + this.removeSignal (); break; case 2: - this.removeAttribute(2); + this.removeAttribute (2); break; case 3: - this.removeAttribute(3); + this.removeAttribute (3); break; case 4: - this.removeMethod(); + this.removeMethod (); break; default: // Should not arrive here } } - private void removeAttribute(int tabIndex) { - int i = this.listAttribute.get(tabIndex).getSelectedIndex(); + private void removeAttribute (int tabIndex) { + int i = this.listAttribute.get(tabIndex).getSelectedIndex (); if (i != -1) { - ((TAttribute) this.attributes.get(tabIndex).get(i)).setAccess(-1); - this.attributes.get(tabIndex).remove(i); - this.listAttribute.get(tabIndex).setListData(this.attributes.get(tabIndex).toArray()); + ((TAttribute) this.attributes.get(tabIndex).get (i)).setAccess (-1); + this.attributes.get(tabIndex).remove (i); + this.listAttribute.get(tabIndex).setListData (this.attributes.get(tabIndex).toArray ()); } } - private void removeSignal() { - int i = this.listAttribute.get(1).getSelectedIndex(); + private void removeSignal () { + int i = this.listAttribute.get(1).getSelectedIndex (); if (i != -1) { - this.attributes.get(1).remove(i); - this.listAttribute.get(1).setListData(this.attributes.get(1).toArray()); + this.attributes.get(1).remove (i); + this.listAttribute.get(1).setListData(this.attributes.get(1).toArray ()); } } - private void removeMethod() { + private void removeMethod () { int i = this.listAttribute.get(4).getSelectedIndex(); - if (i != -1) { - this.attributes.get(4).remove(i); - this.listAttribute.get(4).setListData(this.attributes.get(4).toArray()); + if (i!= -1) { + this.attributes.get(4).remove (i); + this.listAttribute.get(4).setListData (this.attributes.get(4).toArray ()); } } - public void valueChanged(ListSelectionEvent e) { - int selectedTab = this.tabbedPane.getSelectedIndex(); - int i = this.listAttribute.get(selectedTab).getSelectedIndex(); + public void valueChanged (ListSelectionEvent e) { + int selectedTab = this.tabbedPane.getSelectedIndex (); + int i = this.listAttribute.get(selectedTab).getSelectedIndex() ; this.removeButtons[selectedTab].setEnabled(i != -1); this.modifyButtons[selectedTab].setEnabled(i != -1); this.upButtons[selectedTab].setEnabled(i > 0); - this.downButtons[selectedTab].setEnabled(i != -1 && i < this.attributes.get(selectedTab).size() - 1); + this.downButtons[selectedTab].setEnabled(i != -1 && i < this.attributes.get(selectedTab).size ()-1); if (selectedTab == 1) { // Signals if (i == -1) - this.signalText.setText(""); + this.signalText.setText (""); else { - AvatarSignal as = (AvatarSignal) (this.attributes.get(1).get(i)); - this.signalText.setText(as.toBasicString()); - this.signalInOutBox.setSelectedIndex(as.getInOut()); + AvatarSignal as = (AvatarSignal) (this.attributes.get(1).get (i)); + this.signalText.setText (as.toBasicString()); + this.signalInOutBox.setSelectedIndex (as.getInOut()); } } else if (selectedTab == 4) { // Methods if (i == -1) - this.methodText.setText(""); + this.methodText.setText (""); else { - AvatarMethod am = (AvatarMethod) (this.attributes.get(4).get(i)); - this.methodText.setText(am.toString()); + AvatarMethod am = (AvatarMethod) (this.attributes.get(4).get (i)); + this.methodText.setText (am.toString()); } } else { // Attributes JTextField textField, initialValue; @@ -1028,39 +993,39 @@ public class JDialogAvatarLibraryFunction extends JDialogBase implements ActionL } if (i == -1) { - textField.setText(""); - initialValue.setText(""); + textField.setText (""); + initialValue.setText (""); accessBox.setSelectedIndex(0); typeBox.setSelectedIndex(0); } else { - TAttribute a = (TAttribute) (this.attributes.get(selectedTab).get(i)); - textField.setText(a.getId()); + TAttribute a = (TAttribute) (this.attributes.get(selectedTab).get (i)); + textField.setText (a.getId ()); initialValue.setText(a.getInitialValue()); - this.select(accessBox, TAttribute.getStringAccess(a.getAccess())); + this.select (accessBox, TAttribute.getStringAccess(a.getAccess())); if (a.getType() == TAttribute.OTHER) - this.select(typeBox, a.getTypeOther()); + this.select (typeBox, a.getTypeOther()); else - this.select(typeBox, TAttribute.getStringAvatarType(a.getType())); + this.select (typeBox, TAttribute.getStringAvatarType(a.getType())); } } } public void addAccess(String s) { - this.parametersAccessBox.addItem(s); - this.attributesAccessBox.addItem(s); - this.returnAttributesAccessBox.addItem(s); + this.parametersAccessBox.addItem (s); + this.attributesAccessBox.addItem (s); + this.returnAttributesAccessBox.addItem (s); } public void addType(String s) { - this.parametersTypeBox.addItem(s); - this.attributesTypeBox.addItem(s); - this.returnAttributesTypeBox.addItem(s); + this.parametersTypeBox.addItem (s); + this.attributesTypeBox.addItem (s); + this.returnAttributesTypeBox.addItem (s); } - public void select(JComboBox<String> jcb, String text) { - for (int i = 0; i < jcb.getItemCount(); i++) { + public void select (JComboBox<String> jcb, String text) { + for (int i=0; i < jcb.getItemCount(); i++) { String s = jcb.getItemAt(i); - if (s.equals(text)) { + if (s.equals (text)) { jcb.setSelectedIndex(i); return; } diff --git a/src/main/java/ui/window/JDialogAvatarProperty.java b/src/main/java/ui/window/JDialogAvatarProperty.java old mode 100755 new mode 100644 index 2fc830f1e9c2c68fd20901e08507d4a6166f0e16..fc1259647fab20b8d2daa3f2ff4156b1b15d54c1 --- a/src/main/java/ui/window/JDialogAvatarProperty.java +++ b/src/main/java/ui/window/JDialogAvatarProperty.java @@ -162,7 +162,6 @@ public class JDialogAvatarProperty extends JDialogBase implements ActionListener c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; c.add(panel1, c0); diff --git a/src/main/java/ui/window/JDialogAvatarPropertyConnector.java b/src/main/java/ui/window/JDialogAvatarPropertyConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAvatarSignal.java b/src/main/java/ui/window/JDialogAvatarSignal.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAvatarState.java b/src/main/java/ui/window/JDialogAvatarState.java old mode 100755 new mode 100644 index 9f5ada18d7b921f709fc8746f518ec4064a62eb0..807e052e7a93997107d18c3a887ce9777364b196 --- a/src/main/java/ui/window/JDialogAvatarState.java +++ b/src/main/java/ui/window/JDialogAvatarState.java @@ -201,7 +201,6 @@ public class JDialogAvatarState extends JDialogBase implements ActionListener { jtp.setPreferredSize( new Dimension( 400, 450 ) ); jtp.add("General", panel11); jtp.add("Prototyping", panel2); - c0.fill = GridBagConstraints.BOTH; c.add(jtp, c0); c0.gridwidth = 1; diff --git a/src/main/java/ui/window/JDialogAvatarTimer.java b/src/main/java/ui/window/JDialogAvatarTimer.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAvatarTransition.java b/src/main/java/ui/window/JDialogAvatarTransition.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogAvatarddExecutableCodeGeneration.java b/src/main/java/ui/window/JDialogAvatarddExecutableCodeGeneration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogBUSNode.java b/src/main/java/ui/window/JDialogBUSNode.java old mode 100755 new mode 100644 index 9e543572a95e76a4c460bf6aae411878e6529910..ec0afcf71653ef737f02465eb33c8fd276740094 --- a/src/main/java/ui/window/JDialogBUSNode.java +++ b/src/main/java/ui/window/JDialogBUSNode.java @@ -102,7 +102,7 @@ public class JDialogBUSNode extends JDialogBase implements ActionListener { JPanel panel2 = new JPanel(); panel2.setLayout(gridbag2); - panel2.setBorder(new javax.swing.border.TitledBorder("Bus attributes")); + panel2.setBorder(new javax.swing.border.TitledBorder("BUS attributes")); panel2.setPreferredSize(new Dimension(400, 200)); c1.gridwidth = 1; @@ -110,7 +110,7 @@ public class JDialogBUSNode extends JDialogBase implements ActionListener { c1.weighty = 1.0; c1.weightx = 1.0; c1.fill = GridBagConstraints.HORIZONTAL; - panel2.add(new JLabel("Bus name:"), c2); + panel2.add(new JLabel("BUS name:"), c2); c1.gridwidth = GridBagConstraints.REMAINDER; //end row nodeName = new JTextField(node.getNodeName(), 30); nodeName.setEditable(true); @@ -177,7 +177,6 @@ public class JDialogBUSNode extends JDialogBase implements ActionListener { c0.gridheight = 10; c0.weighty = 1.0; c0.weightx = 1.0; - c0.fill = GridBagConstraints.HORIZONTAL; c0.gridwidth = GridBagConstraints.REMAINDER; //end row c.add(panel2, c0); diff --git a/src/main/java/ui/window/JDialogBase.java b/src/main/java/ui/window/JDialogBase.java index b3aacf69d60f5a52ea07162aca16015f7c7329aa..2d39b04d287c20e830c82a10c4b1b33290c03992 100644 --- a/src/main/java/ui/window/JDialogBase.java +++ b/src/main/java/ui/window/JDialogBase.java @@ -46,59 +46,20 @@ public class JDialogBase extends JDialog { protected void initButtons(GridBagConstraints c0, Container c, ActionListener al) { - initMainButtons(c0, c, al, false, "Save and Close", "Cancel"); - } - - protected void initMainButtons(GridBagConstraints c0, Container c, - ActionListener al, boolean isInverse, String closeButtonStr, String cancelButtonStr) { //Close Button - if (isInverse) { - closeButton = new JButton(closeButtonStr, IconManager.imgic25); - closeButton.addActionListener(al); - c.add(closeButton, c0); - - c0.gridwidth = GridBagConstraints.REMAINDER; //end row - - //Cancel Button - cancelButton = new JButton(cancelButtonStr, IconManager.imgic27); - cancelButton.addActionListener(al); - c.add(cancelButton, c0); - } else { - cancelButton = new JButton(cancelButtonStr, IconManager.imgic27); - cancelButton.addActionListener(al); - c.add(cancelButton, c0); - - c0.gridwidth = GridBagConstraints.REMAINDER; //end row - - closeButton = new JButton(closeButtonStr, IconManager.imgic25); - closeButton.addActionListener(al); - c.add(closeButton, c0); - } - - //Add closeButton's behaviour on Enter key - this.getRootPane().setDefaultButton(closeButton); - } - - protected JPanel initBasicButtons(ActionListener al) { - JPanel buttonPanel = new JPanel(new GridBagLayout()); - GridBagConstraints gridConstraints = new GridBagConstraints(); - gridConstraints.gridwidth = 1; - gridConstraints.gridheight = 1; - gridConstraints.weighty = 1.0; - gridConstraints.weightx = 1.0; - gridConstraints.fill = GridBagConstraints.BOTH; //end row - - cancelButton = new JButton("Cancel", IconManager.imgic27); - cancelButton.addActionListener(al); - buttonPanel.add(cancelButton, gridConstraints); - - gridConstraints.gridwidth = GridBagConstraints.REMAINDER; //end row - - closeButton = new JButton("Save and close", IconManager.imgic25); - closeButton.addActionListener(al); - buttonPanel.add(closeButton, gridConstraints); - - return buttonPanel; + closeButton = new JButton("Save and Close", IconManager.imgic25); + closeButton.addActionListener(al); + c.add(closeButton, c0); + + c0.gridwidth = GridBagConstraints.REMAINDER; //end row + + //Cancel Button + cancelButton = new JButton("Cancel", IconManager.imgic27); + cancelButton.addActionListener(al); + c.add(cancelButton, c0); + + //Add closeButton's behaviour on Enter key + this.getRootPane().setDefaultButton(closeButton); } diff --git a/src/main/java/ui/window/JDialogBisimulation.java b/src/main/java/ui/window/JDialogBisimulation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogBisimulationBisimulator.java b/src/main/java/ui/window/JDialogBisimulationBisimulator.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogBridgeNode.java b/src/main/java/ui/window/JDialogBridgeNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogCAMSBlocks.java b/src/main/java/ui/window/JDialogCAMSBlocks.java deleted file mode 100755 index d5f72aa864d0efb715221d1e76700c53337cfbd4..0000000000000000000000000000000000000000 --- a/src/main/java/ui/window/JDialogCAMSBlocks.java +++ /dev/null @@ -1,846 +0,0 @@ -/* 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.window; - -import myutil.Conversion; -import myutil.GraphicLib; -import ui.util.IconManager; -import ui.TGComponent; -import ui.het.CAMSBlock; -import heterogeneoustranslator.systemCAMStranslator.CAMSSignal; -import ui.TAttribute; -import ui.TDiagramPanel; - -import javax.swing.*; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Vector; -import java.util.LinkedList; - - -/** - * Class JDialogCAMSBlocks - * Dialog for managing nodes to be validated - * Creation: 23/06/2017 - * @version 0.1 23/06/2017 - * @author Côme DEMARIGNY - */ - -public class JDialogCAMSBlocks extends JDialog implements ActionListener, ListSelectionListener { - - private LinkedList<TAttribute> attributes, attributesPar, forbidden; - private LinkedList<Boolean> initValues; - private LinkedList<CAMSSignal> signals, signalsPar; - private boolean checkKeyword, checkJavaKeyword; - - private boolean cancelled = true; - private boolean regularClose; - - protected String [] processCode; - protected JTextArea jtaProcessCode; - protected boolean hasProcessCode; - - private JPanel panel1, panel2; - - private TDiagramPanel tdp; - private Frame frame; - private int tab; - private String defaultName; - private String previousName; - - private String attrib; // "Attributes", "Gates", etc. - - // Panel1 - private JComboBox<String> accessBox, typeBox; - private JTextField identifierText; - private JTextField initialValue; - private JTextField blockName; - private JButton addButton; - - //Panel2 - private JList<TAttribute> listAttribute; - private JTextField nbOfIn, nbOfOut; - private CAMSBlock block; - private JButton upButton; - private JButton downButton; - private JButton removeButton; - - - // Signals - private boolean hasSignals = true; - private JPanel panel5, panel6; - private JComboBox<String> signalInOutBox; - private JTextField signalText; - private JButton addSignalButton; - private JList<CAMSSignal> listSignal; - private JButton upSignalButton; - private JButton downSignalButton; - private JButton removeSignalButton; - - // Main Panel - private JButton closeButton; - private JButton cancelButton; - - /** Creates new form */ - public JDialogCAMSBlocks(LinkedList<TAttribute> _attributes, LinkedList<CAMSSignal> _signals, LinkedList<TAttribute> _forbidden, Frame _frame, String _title, String _attrib, CAMSBlock _block, String []_processCode, boolean _hasProcessCode) { - super(_frame, _title, true); - frame = _frame; - block = _block; - attributesPar = _attributes; - signalsPar = _signals; - processCode = _processCode; - attrib = _attrib; - - if (signalsPar == null) { - signalsPar = new LinkedList<CAMSSignal> (); - hasSignals = false; - } - - hasProcessCode = _hasProcessCode; - if (processCode == null) { - processCode = new String[1]; - processCode[0] = ""; - } - - - forbidden = _forbidden; - initValues = new LinkedList<Boolean> (); - this.attrib = attrib; - - attributes = new LinkedList<TAttribute> (); - signals = new LinkedList<CAMSSignal> (); - - for(TAttribute attr: this.attributesPar) - this.attributes.add (attr.makeClone()); - - // for(CAMSSignal sig: this.signalsPar) - // this.signals.add (sig.makeClone()); - pack(); - initComponents(); - myInitComponents(); - pack(); - } - - - private void myInitComponents() { - removeButton.setEnabled(false); - upButton.setEnabled(false); - downButton.setEnabled(false); - } - - private void initComponents() { - - // Issue #41 Ordering of tabbed panes - JTabbedPane tabbedPane = GraphicLib.createTabbedPane();//new JTabbedPane(); - Container c = getContentPane(); - - JPanel panelAttr = new JPanel(new BorderLayout()); - JPanel panelSignal = new JPanel(new BorderLayout()); - JPanel panelCode; - GridBagLayout gridbag0 = new GridBagLayout(); - GridBagLayout gridbag1 = new GridBagLayout(); - GridBagLayout gridbag2 = new GridBagLayout(); - // GridBagLayout gridbag3 = new GridBagLayout(); - // GridBagLayout gridbag4 = new GridBagLayout(); - GridBagLayout gridbag5 = new GridBagLayout(); - GridBagLayout gridbag6 = new GridBagLayout(); - GridBagLayout gridbag7 = new GridBagLayout(); - GridBagConstraints c0 = new GridBagConstraints(); - GridBagConstraints c1 = new GridBagConstraints(); - GridBagConstraints c2 = new GridBagConstraints(); - // GridBagConstraints c3 = new GridBagConstraints(); - // GridBagConstraints c4 = new GridBagConstraints(); - GridBagConstraints c5 = new GridBagConstraints(); - GridBagConstraints c6 = new GridBagConstraints(); - GridBagConstraints c7 = new GridBagConstraints(); - - setFont(new Font("Helvetica", Font.PLAIN, 14)); - c.setLayout(gridbag0); - - setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - - panel1 = new JPanel(); - panel1.setLayout(gridbag1); - panel1.setBorder(new javax.swing.border.TitledBorder("Adding " + attrib)); - panel1.setPreferredSize(new Dimension(500, 500)); - panel1.setMinimumSize(new Dimension(500, 500)); - - panel2 = new JPanel(); - panel2.setLayout(gridbag2); - panel2.setBorder(new javax.swing.border.TitledBorder("Managing " + attrib)); - panel2.setPreferredSize(new Dimension(500, 500)); - panel2.setMinimumSize(new Dimension(500, 500)); - - // first line panel1 - c1.gridwidth = 1; - c1.gridheight = 1; - c1.weighty = 1.0; - c1.weightx = 1.0; - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - c1.fill = GridBagConstraints.BOTH; - c1.gridheight = 3; - panel1.add(new JLabel("Block Name: "), c1); - blockName = new JTextField(); - blockName.setColumns(5); - blockName.setEditable(true); - panel1.add(blockName, c1); - - c1.gridwidth = 1; - c1.gridheight = 1; - c1.weighty = 1.0; - c1.weightx = 1.0; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("access"), c1); - panel1.add(new JLabel("identifier"), c1); - if (attrib.equals("Attribute") || attrib.equals("Variable")) { - panel1.add(new JLabel(" "), c1); - panel1.add(new JLabel("initial value"), c1); - } - panel1.add(new JLabel(" "), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - panel1.add(new JLabel("type"), c1); - - // second line panel1 - c1.gridwidth = 2; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - accessBox = new JComboBox<String>(); - panel1.add(accessBox, c1); - identifierText = new JTextField(); - identifierText.setColumns(15); - identifierText.setEditable(true); - panel1.add(identifierText, c1); - - initialValue = new JTextField(); - initialValue.setColumns(5); - initialValue.setEditable(true); - - if (attrib.equals("Attribute") || attrib.equals("Variable")) { - panel1.add(new JLabel(" = "), c1); - panel1.add(initialValue, c1); - } - - panel1.add(new JLabel(" : "), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - typeBox = new JComboBox<String>(); - typeBox.addActionListener(this); - panel1.add(typeBox, c1); - - // third line panel1 - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - c1.fill = GridBagConstraints.BOTH; - c1.gridheight = 3; - panel1.add(new JLabel(" "), c1); - - // fourth line panel1 - c1.gridheight = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - addButton = new JButton("Add / Modify " + attrib); - addButton.addActionListener(this); - panel1.add(addButton, c1); - - // 1st line panel2 - listAttribute = new JList<TAttribute> (this.attributes.toArray (new TAttribute[0])); - listAttribute.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listAttribute.addListSelectionListener(this); //fixme - JScrollPane scrollPane = new JScrollPane(listAttribute); - scrollPane.setSize(500, 500); - c2.gridwidth = 2; //end row - c2.fill = GridBagConstraints.BOTH; - c2.gridheight = 5; - c2.weighty = 10.0; - c2.weightx = 10.0; - panel2.add(scrollPane, c2); - - // 2nd line panel2 - c2.weighty = 1.0; - c2.weightx = 1.0; - c2.fill = GridBagConstraints.BOTH; - c2.gridheight = 1; - panel2.add(new JLabel(""), c2); - - // third line panel2 - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - c2.fill = GridBagConstraints.HORIZONTAL; - upButton = new JButton(" Up "); - upButton.addActionListener(this); - panel2.add(upButton, c2); - - downButton = new JButton("Down"); - downButton.addActionListener(this); - panel2.add(downButton, c2); - - removeButton = new JButton("Remove " + attrib); - removeButton.addActionListener(this); - panel2.add(removeButton, c2); - - // Signals - panel5 = new JPanel(); - panel5.setLayout(gridbag5); - panel5.setBorder(new javax.swing.border.TitledBorder("Adding signals")); - panel5.setPreferredSize(new Dimension(500, 500)); - - panel6 = new JPanel(); - panel6.setLayout(gridbag6); - panel6.setBorder(new javax.swing.border.TitledBorder("Managing signals")); - panel6.setPreferredSize(new Dimension(500, 500)); - - // first line panel5 - c5.gridwidth = 1; - c5.gridheight = 1; - c5.weighty = 1.0; - c5.weightx = 1.0; - c5.gridwidth = GridBagConstraints.REMAINDER; //end row - c5.fill = GridBagConstraints.BOTH; - c5.gridheight = 3; - panel5.add(new JLabel(" "), c5); - - c5.gridwidth = 1; - c5.gridheight = 1; - c5.weighty = 1.0; - c5.weightx = 1.0; - c5.anchor = GridBagConstraints.CENTER; - c5.gridwidth = GridBagConstraints.REMAINDER; //end row - panel5.add(new JLabel("signal:"), c5); - - // second line panel5 - c5.gridwidth = 1; - c5.fill = GridBagConstraints.HORIZONTAL; - String[] v = new String[4]; - v[0] = "in"; - v[1] = "out"; - v[2] = "hybrid in"; - v[3] = "hybrid out"; - signalInOutBox = new JComboBox<String>(v); - panel5.add(signalInOutBox, c5); - signalText = new JTextField(); - signalText.setColumns(50); - signalText.setEditable(true); - panel5.add(signalText, c5); - - // third line panel5 - c5.gridwidth = GridBagConstraints.REMAINDER; //end row - c5.fill = GridBagConstraints.BOTH; - c5.gridheight = 3; - panel5.add(new JLabel(" "), c5); - - // fourth line panel5 - c5.gridheight = 1; - c5.fill = GridBagConstraints.HORIZONTAL; - addSignalButton = new JButton("Add signal"); - addSignalButton.addActionListener(this); - panel5.add(addSignalButton, c5); - - // 1st line panel6 - listSignal = new JList<CAMSSignal> (this.signals.toArray (new CAMSSignal[0])); - listSignal.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSignal.addListSelectionListener(this); - scrollPane = new JScrollPane(listSignal); - scrollPane.setSize(500, 500); - c6.gridwidth = GridBagConstraints.REMAINDER; //end row - c6.fill = GridBagConstraints.BOTH; - c6.gridheight = 5; - c6.weighty = 10.0; - c6.weightx = 10.0; - panel6.add(scrollPane, c6); - - // 2nd line panel4 - c6.weighty = 1.0; - c6.weightx = 1.0; - c6.fill = GridBagConstraints.BOTH; - c6.gridheight = 1; - panel6.add(new JLabel(""), c6); - - // third line panel4 - c6.gridwidth = GridBagConstraints.REMAINDER; //end row - c6.fill = GridBagConstraints.HORIZONTAL; - upSignalButton = new JButton("Up"); - upSignalButton.addActionListener(this); - panel6.add(upSignalButton, c6); - - downSignalButton = new JButton("Down"); - downSignalButton.addActionListener(this); - panel6.add(downSignalButton, c6); - - removeSignalButton = new JButton("Remove signal"); - removeSignalButton.addActionListener(this); - panel6.add(removeSignalButton, c6); - - // Prototyping - panelCode = new JPanel(); - panelCode.setLayout(gridbag7); - - panelCode.setBorder(new javax.swing.border.TitledBorder("Process code")); - // guard - c7.weighty = 1.0; - c7.weightx = 1.0; - c7.gridwidth = 1; - c7.gridheight = 1; - c7.fill = GridBagConstraints.BOTH; - c7.gridwidth = GridBagConstraints.REMAINDER; - c7.gridheight = 1; - - - panelCode.add(new JLabel("Process code of block:"), c7); - //panelCode.add(new JLabel("To implement a method m of block B: \"userImplemented_B_m(...){...}\""), c7); - jtaProcessCode = new JTextArea(); - jtaProcessCode.setEditable(true); - jtaProcessCode.setMargin(new Insets(10, 10, 10, 10)); - jtaProcessCode.setTabSize(3); - String files = ""; - if (processCode != null) { - for(int i=0; i<processCode.length; i++) { - files += processCode[i] + "\n"; - } - } - jtaProcessCode.append(files); - jtaProcessCode.setFont(new Font("times", Font.PLAIN, 12)); - JScrollPane jsp = new JScrollPane(jtaProcessCode, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); - jsp.setPreferredSize(new Dimension(500, 500)); - panelCode.add(jsp, c7); - - - // main panel; - panelAttr.add(panel1, BorderLayout.WEST); - panelAttr.add(panel2, BorderLayout.EAST); - tabbedPane.addTab("Attributes", panelAttr); - - if (hasSignals) { - panelSignal.add(panel5, BorderLayout.WEST); - panelSignal.add(panel6, BorderLayout.EAST); - tabbedPane.addTab("Signals", panelSignal); - } - - if (hasProcessCode) { - tabbedPane.addTab("Process", panelCode); - } - - tabbedPane.setSelectedIndex(tab); - - //c.add(panel1, c0); - //c.add(panel2, c0); - - c0.gridwidth = 1; - c0.gridheight = 10; - c0.weighty = 1.0; - c0.weightx = 1.0; - c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.HORIZONTAL; - c.add(tabbedPane, c0); - - c0.gridwidth = 1; - c0.gridheight = 1; - c0.fill = GridBagConstraints.HORIZONTAL; - - closeButton = new JButton("Save and Close", IconManager.imgic25); - //closeButton.setPreferredSize(new Dimension(600, 50)); - closeButton.addActionListener(this); - c.add(closeButton, c0); - c0.gridwidth = GridBagConstraints.REMAINDER; //end row - cancelButton = new JButton("Cancel", IconManager.imgic27); - cancelButton.addActionListener(this); - c.add(cancelButton, c0); - } - - public void actionPerformed(ActionEvent evt) { - if (evt.getSource() == typeBox) { - boolean b = initValues.get (typeBox.getSelectedIndex()).booleanValue(); - initialValue.setEnabled(b); - return; - } - - - //String command = evt.getActionCommand(); - - // Compare the action command to the known actions. - if (evt.getSource() == closeButton) { - closeDialog(); - } else if (evt.getSource() == addButton) { - addAttribute(); - } else if (evt.getSource() == cancelButton) { - cancelDialog(); - } else if (evt.getSource() == removeButton) { - removeAttribute(); - } else if (evt.getSource() == downButton) { - downAttribute(); - } else if (evt.getSource() == upButton) { - upAttribute(); - } else if (evt.getSource() == downSignalButton) { - downSignal(); - } else if (evt.getSource() == upSignalButton) { - upSignal(); - } else if (evt.getSource() == removeSignalButton) { - removeSignal(); - } else if (evt.getSource() == addSignalButton) { - addSignal(); - } - } - - public void addAccess(String s) { - accessBox.addItem(s); - } - - public void addType(String s) { - initValues.add(new Boolean(true)); - typeBox.addItem(s); - } - - public void addType(String s, boolean b) { - initValues.add(new Boolean(b)); - typeBox.addItem(s); - } - - public void enableInitialValue(boolean b) { - initialValue.setEnabled(b); - } - - public void enableRTLOTOSKeyword(boolean b) { - checkKeyword = !b; - } - - public void enableJavaKeyword(boolean b) { - checkJavaKeyword = !b; - } - - - - public void addAttribute() { - Object o1 = accessBox.getSelectedItem(); - Object o2 = typeBox.getSelectedItem(); - String s = identifierText.getText(); - String value = initialValue.getText(); - TAttribute a; - - if (s.length()>0) { - if ((TAttribute.isAValidId(s, checkKeyword, checkJavaKeyword)) && (TAttribute.notIn(s, forbidden))){ - int i = TAttribute.getAccess(o1.toString()); - int j = TAttribute.getCAMSType(o2.toString()); - if ((j == TAttribute.ARRAY_NAT) && (value.length() < 1)) { - value = "2"; - } - - if ((i != -1) && (j!= -1)) { - - if ((value.length() < 1) || (initialValue.isEnabled() == false)){ - - value = ""; - } else { - if (!TAttribute.isAValidInitialValue(j, value)) { - JOptionPane.showMessageDialog(frame, - "The initial value is not valid", - "Error", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } - if (j == TAttribute.OTHER) { - a = new TAttribute(i, s, value, o2.toString()); - a.isCAMS = true; - //System.out.println("New attribute: " + o2.toString()); - } else { - a = new TAttribute(i, s, value, j); - a.isCAMS = true; - } - //checks whether the same attribute already belongs to the list - int index = attributes.size(); - if (attributes.contains(a)) { - index = attributes.indexOf(a); - a = attributes.get (index); - a.setAccess(i); - if (j == TAttribute.OTHER) { - a.setTypeOther(o2.toString()); - } - a.setType(j); - a.setInitialValue(value); - } else { - attributes.add(index, a); - } - listAttribute.setListData(attributes.toArray (new TAttribute[0])); - identifierText.setText(""); - } else { - JOptionPane.showMessageDialog(frame, - "Bad access / type", - "Error", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } else { - JOptionPane.showMessageDialog(frame, - "Bad identifier: identifier already in use, or invalid identifier", - "Error", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } else { - JOptionPane.showMessageDialog(frame, - "Bad identifier", - "Error", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } - - - public void addSignal() { - String s = signalText.getText(); - CAMSSignal cs = CAMSSignal.isAValidSignal(s, signalInOutBox.getSelectedIndex()); - CAMSSignal cstmp; - int inout; - - if (cs != null) { - // Checks whether the same signal already belongs to the list - int index = -1; - for(int i=0; i<signals.size(); i++) { - cstmp = signals.get(i); - // Same id? - if (cstmp.equals(cs)) { - index = i; - break; - } - } - if(signalInOutBox.getSelectedIndex()==0){ - inout=0; - }else if(signalInOutBox.getSelectedIndex()==1){ - inout=1; - }else if(signalInOutBox.getSelectedIndex()==2){ - inout=2; - }else if(signalInOutBox.getSelectedIndex()==3){ - inout=3; - }else{ - inout=-1; - } - cs = new CAMSSignal(s,inout); - if (index == -1) { - signals.add(cs); - } else { - signals.remove (index); - signals.add (index, cs); - } - listSignal.setListData(signals.toArray (new CAMSSignal[0])); - signalText.setText(""); - - } else { - JOptionPane.showMessageDialog(frame, - "Badly formatted signal declaration", - "Error", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } - - public void removeAttribute() { - int i = listAttribute.getSelectedIndex() ; - if (i!= -1) { - TAttribute a = attributes.get (i); - a.setAccess(-1); - attributes.remove (i); - listAttribute.setListData(attributes.toArray (new TAttribute[0])); - } - } - - public void downAttribute() { - int i = listAttribute.getSelectedIndex(); - if ((i!= -1) && (i != attributes.size() - 1)) { - TAttribute o = attributes.get (i); - attributes.remove (i); - attributes.add (i+1, o); - listAttribute.setListData(attributes.toArray (new TAttribute[0])); - listAttribute.setSelectedIndex(i+1); - } - } - - public void upAttribute() { - int i = listAttribute.getSelectedIndex(); - if (i > 0) { - TAttribute o = attributes.get (i); - attributes.remove (i); - attributes.add (i-1, o); - listAttribute.setListData(attributes.toArray (new TAttribute[0])); - listAttribute.setSelectedIndex(i-1); - } - } - - public void removeSignal() { - int i = listSignal.getSelectedIndex() ; - if (i!= -1) { - signals.remove (i); - listSignal.setListData(signals.toArray (new CAMSSignal [0])); - } - } - - public void upSignal() { - int i = listSignal.getSelectedIndex(); - if (i > 0) { - CAMSSignal o = signals.get (i); - signals.remove (i); - signals.add (i-1, o); - listSignal.setListData(signals.toArray (new CAMSSignal [0])); - listSignal.setSelectedIndex(i-1); - } - } - - public void downSignal() { - int i = listSignal.getSelectedIndex(); - if ((i!= -1) && (i != signals.size() - 1)) { - CAMSSignal o = signals.get (i); - signals.remove(i); - signals.add (i+1, o); - listSignal.setListData(signals.toArray (new CAMSSignal [0])); - listSignal.setSelectedIndex(i+1); - } - } - - - public void closeDialog() { - cancelled = false; - attributesPar.clear (); - for(TAttribute attr: this.attributes) - attributesPar.add (attr); - - signalsPar.clear (); - for(CAMSSignal sig: this.signals) - signalsPar.add (sig); - - processCode = Conversion.wrapText(jtaProcessCode.getText()); - dispose(); - } - - public boolean hasBeenCancelled() { - return cancelled; - } - - public boolean isRegularClose() { - return regularClose; - } - - public void cancelDialog() { - dispose(); - } - - public void valueChanged(ListSelectionEvent e) { - int i = listAttribute.getSelectedIndex() ; - if (i == -1) { - removeButton.setEnabled(false); - upButton.setEnabled(false); - downButton.setEnabled(false); - identifierText.setText(""); - //initialValue.setText(""); - } else { - TAttribute a = attributes.get (i); - identifierText.setText(a.getId()); - initialValue.setText(a.getInitialValue()); - select(accessBox, TAttribute.getStringAccess(a.getAccess())); - if (a.getType() == TAttribute.OTHER) { - select(typeBox, a.getTypeOther()); - } else { - //select(typeBox, TAttribute.getStringCAMSType(a.getType())); //fixme - } - removeButton.setEnabled(true); - if (i > 0) { - upButton.setEnabled(true); - } else { - upButton.setEnabled(false); - } - if (i != attributes.size() - 1) { - downButton.setEnabled(true); - } else { - downButton.setEnabled(false); - } - } - - i = listSignal.getSelectedIndex() ; - if (i == -1) { - removeSignalButton.setEnabled(false); - upSignalButton.setEnabled(false); - downSignalButton.setEnabled(false); - signalText.setText(""); - //initialValue.setText(""); - } else { - CAMSSignal as = signals.get (i); - //signalText.setText(as.toBasicString()); //fixme - // signalInOutBox.setSelectedIndex(as.getInOut()); - removeSignalButton.setEnabled(true); - if (i > 0) { - upSignalButton.setEnabled(true); - } else { - upSignalButton.setEnabled(false); - } - if (i != signals.size() - 1) { - downSignalButton.setEnabled(true); - } else { - downSignalButton.setEnabled(false); - } - } - } - - public void select(JComboBox<String> jcb, String text) { - String s; - for(int i=0; i<jcb.getItemCount(); i++) { - s = jcb.getItemAt(i); - if (s.equals(text)) { - jcb.setSelectedIndex(i); - return; - } - } - } - - - public String getBlockName() { - if(blockName.getText() == null || blockName.getText() == "" || blockName.getText() == " ") { - return "Block0"; - } else { - return blockName.getText(); - } - } - - public LinkedList<CAMSSignal> getSignals(){ - return signals; - } - - public String[] getProcessCode() { - return processCode; - } - -} diff --git a/src/main/java/ui/window/JDialogCAMSConnectingPoint.java b/src/main/java/ui/window/JDialogCAMSConnectingPoint.java deleted file mode 100755 index ec5a9c91cf53fc03f3215e5c9da42d149a4ef8e2..0000000000000000000000000000000000000000 --- a/src/main/java/ui/window/JDialogCAMSConnectingPoint.java +++ /dev/null @@ -1,201 +0,0 @@ -/* 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.window; - -import ui.util.IconManager; -import ui.het.*; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -//import javax.swing.event.*; -//import java.util.*; - - -/** -* Class JDialogADDCPUNode -* Dialog for managing attributes of cpu nodes in ADD -* Creation: 02/07/2014 -* @version 1.0 02/07/2014 -* @author Ludovic APVRILLE - */ -public class JDialogCAMSConnectingPoint extends JDialogBase implements ActionListener { - - private boolean regularClose; - - private JPanel panel2; - private Frame frame; - public CAMSConnectingPoint ccp; - - protected JComboBox<String> tracemode; - private static int selectedTracemode = 0; - - - // Panel1 - protected JTextField ccpName; - - // Panel2 - protected JTextField type, rate; - - /** Creates new form */ - public JDialogCAMSConnectingPoint(Frame _frame, String _title, CAMSConnectingPoint _ccp) { - super(_frame, _title, true); - frame = _frame; - ccp = _ccp; - - initComponents(); - myInitComponents(); - pack(); - } - - private void myInitComponents() { - } - - private void initComponents() { - Container c = getContentPane(); - GridBagLayout gridbag0 = new GridBagLayout(); - GridBagLayout gridbag1 = new GridBagLayout(); - GridBagLayout gridbag2 = new GridBagLayout(); - GridBagConstraints c0 = new GridBagConstraints(); - //GridBagConstraints c1 = new GridBagConstraints(); - GridBagConstraints c2 = new GridBagConstraints(); - - setFont(new Font("Helvetica", Font.PLAIN, 14)); - c.setLayout(gridbag0); - - setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - - - panel2 = new JPanel(); - panel2.setLayout(gridbag2); - panel2.setBorder(new javax.swing.border.TitledBorder("Connecting Point attributes")); - panel2.setPreferredSize(new Dimension(400, 300)); - - c2.gridwidth = 1; - c2.gridheight = 1; - c2.weighty = 1.0; - c2.weightx = 1.0; - c2.fill = GridBagConstraints.HORIZONTAL; - panel2.add(new JLabel("Connecting Point name:"), c2); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - ccpName = new JTextField(ccp.getccpName(), 30); - ccpName.setEditable(true); - ccpName.setFont(new Font("times", Font.PLAIN, 12)); - panel2.add(ccpName, c2); - - c2.gridwidth = 1; - c2.gridheight = 1; - c2.weighty = 1.0; - c2.weightx = 1.0; - c2.fill = GridBagConstraints.HORIZONTAL; - - - c2.gridwidth = 1; - panel2.add(new JLabel("Type :"), c2); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - type = new JTextField(""+ccp.getPointType(), 15); - panel2.add(type, c2); - - c2.gridwidth = 1; - panel2.add(new JLabel("Rate:"), c2); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - rate = new JTextField(""+ccp.getRate(), 15); - panel2.add(rate, c2); - - // main panel; - c0.gridheight = 10; - c0.weighty = 1.0; - c0.weightx = 1.0; - c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c.add(panel2, c0); - - c0.gridwidth = 1; - c0.gridheight = 1; - c0.fill = GridBagConstraints.HORIZONTAL; - - initButtons(c0, c, this); - } - - public void actionPerformed(ActionEvent evt) { - - if (evt.getSource() == tracemode) { - selectedTracemode = tracemode.getSelectedIndex(); - } - - String command = evt.getActionCommand(); - - // Compare the action command to the known actions. - if (command.equals("Save and Close")) { - closeDialog(); - } else if (command.equals("Cancel")) { - cancelDialog(); - } - } - - public void closeDialog() { - regularClose = true; - dispose(); - } - - public void cancelDialog() { - dispose(); - } - - public boolean isRegularClose() { - return regularClose; - } - - public String getccpName() { - return ccpName.getText(); - } - - public String getPointType() { - return type.getText(); - } - - public String getRate() { - return rate.getText(); - } - -}//class \ No newline at end of file diff --git a/src/main/java/ui/window/JDialogCCodeGeneration.java b/src/main/java/ui/window/JDialogCCodeGeneration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogCPUNode.java b/src/main/java/ui/window/JDialogCPUNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogCancel.java b/src/main/java/ui/window/JDialogCancel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogChannel.java b/src/main/java/ui/window/JDialogChannel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogCode.java b/src/main/java/ui/window/JDialogCode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogCommunicationArtifact.java b/src/main/java/ui/window/JDialogCommunicationArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogConstraint.java b/src/main/java/ui/window/JDialogConstraint.java old mode 100755 new mode 100644 index 32408717b1829bd180cd3a2be390542c0af38cab..f4e8428a5dd4f7e4cd7d9b971abafd424cff3522 --- a/src/main/java/ui/window/JDialogConstraint.java +++ b/src/main/java/ui/window/JDialogConstraint.java @@ -125,7 +125,6 @@ public class JDialogConstraint extends JDialogBase implements ActionListener { c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; c.add(panel2, c0); c0.gridwidth = 1; diff --git a/src/main/java/ui/window/JDialogConstraintText.java b/src/main/java/ui/window/JDialogConstraintText.java old mode 100755 new mode 100644 index d58e9a9c300d340d70b5116d5ea4b2590552d53f..52def0b2f771bc6aa84e8ea17ca90a07b9c03e7c --- a/src/main/java/ui/window/JDialogConstraintText.java +++ b/src/main/java/ui/window/JDialogConstraintText.java @@ -134,7 +134,6 @@ public class JDialogConstraintText extends JDialogBase implements ActionListener c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; c.add(panel2, c0); c0.gridwidth = 1; diff --git a/src/main/java/ui/window/JDialogCountermeasure.java b/src/main/java/ui/window/JDialogCountermeasure.java old mode 100755 new mode 100644 index 2b36507d22b3aaa5fa117b85047eabc47bdf82ee..f03d2c3a214c21cfc24e5e6190048942f2163f3e --- a/src/main/java/ui/window/JDialogCountermeasure.java +++ b/src/main/java/ui/window/JDialogCountermeasure.java @@ -143,7 +143,6 @@ public class JDialogCountermeasure extends JDialogBase implements ActionListener c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; c.add(panel2, c0); c0.gridwidth = 1; diff --git a/src/main/java/ui/window/JDialogCrossbarNode.java b/src/main/java/ui/window/JDialogCrossbarNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogEventArtifact.java b/src/main/java/ui/window/JDialogEventArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogFPGANode.java b/src/main/java/ui/window/JDialogFPGANode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogFault.java b/src/main/java/ui/window/JDialogFault.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogFaultCountermeasure.java b/src/main/java/ui/window/JDialogFaultCountermeasure.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogFormalValidation.java b/src/main/java/ui/window/JDialogFormalValidation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogGenAUT.java b/src/main/java/ui/window/JDialogGenAUT.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogGenAUTS.java b/src/main/java/ui/window/JDialogGenAUTS.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogGraphModification.java b/src/main/java/ui/window/JDialogGraphModification.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogHwANode.java b/src/main/java/ui/window/JDialogHwANode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogJavaGeneration.java b/src/main/java/ui/window/JDialogJavaGeneration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogJavaSimulation.java b/src/main/java/ui/window/JDialogJavaSimulation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogLOTOSAnalysis.java b/src/main/java/ui/window/JDialogLOTOSAnalysis.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogLOTOSValidation.java b/src/main/java/ui/window/JDialogLOTOSValidation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogLinkNCNode.java b/src/main/java/ui/window/JDialogLinkNCNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogLinkNode.java b/src/main/java/ui/window/JDialogLinkNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogManageListOfString.java b/src/main/java/ui/window/JDialogManageListOfString.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogMemoryNode.java b/src/main/java/ui/window/JDialogMemoryNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogModelChecking.java b/src/main/java/ui/window/JDialogModelChecking.java old mode 100755 new mode 100644 index aa649c5d59a452e017f0a640072dac7d1f3f6c95..aaf1595a5588d71e03c276c4053bb8032ecb2de9 --- a/src/main/java/ui/window/JDialogModelChecking.java +++ b/src/main/java/ui/window/JDialogModelChecking.java @@ -37,11 +37,13 @@ */ + + package ui.window; +import ui.util.IconManager; import ui.TClassInterface; import ui.TGComponent; -import ui.util.IconManager; import javax.swing.*; import javax.swing.event.ListSelectionEvent; @@ -53,14 +55,13 @@ import java.util.Iterator; import java.util.LinkedList; /** - * Class JDialogModelChecking - * Dialog for managing Tclasses to be validated - * Creation: 13/12/2003 - * - * @author Ludovic APVRILLE - * @version 1.0 13/12/2003 + * Class JDialogModelChecking + * Dialog for managing Tclasses to be validated + * Creation: 13/12/2003 + * @version 1.0 13/12/2003 + * @author Ludovic APVRILLE */ -public class JDialogModelChecking extends JDialogBase implements ActionListener, ListSelectionListener { +public class JDialogModelChecking extends JDialogBase implements ActionListener, ListSelectionListener { public static java.util.List<TClassInterface> validated, ignored; private static boolean overideSyntaxChecking = false; @@ -76,9 +77,7 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, private JButton allIgnored; protected JCheckBox syntax; - /** - * Creates new form - */ + /** Creates new form */ public JDialogModelChecking(Frame f, LinkedList<TClassInterface> _back, java.util.List<TGComponent> componentList, String title) { super(f, title, true); @@ -87,7 +86,7 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, if ((validated == null) || (ignored == null)) { val = makeNewVal(componentList); //System.out.println("Val size: " + val.size() + "component list:" + componentList.size()); - ign = new LinkedList<TClassInterface>(); + ign = new LinkedList<TClassInterface> (); } else { val = validated; ign = ignored; @@ -102,28 +101,28 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, } private java.util.List<TClassInterface> makeNewVal(java.util.List<TGComponent> list) { - java.util.List<TClassInterface> v = new LinkedList<TClassInterface>(); + java.util.List<TClassInterface> v = new LinkedList<TClassInterface> (); - for (TGComponent tgc : list) + for (TGComponent tgc: list) if (tgc instanceof TClassInterface) - v.add((TClassInterface) tgc); + v.add ((TClassInterface) tgc); return v; } private void checkTClasses(java.util.List<TClassInterface> tobeChecked, java.util.List<TGComponent> source) { - Iterator<TClassInterface> iter = tobeChecked.iterator(); - while (iter.hasNext()) { - TClassInterface t = iter.next(); + Iterator<TClassInterface> iter = tobeChecked.iterator (); + while (iter.hasNext ()) { + TClassInterface t = iter.next (); if (!source.contains(t)) - iter.remove(); + iter.remove (); } } public void addNewTclasses(java.util.List<TClassInterface> added, java.util.List<TGComponent> source, java.util.List<TClassInterface> notSource) { - for (TGComponent tgc : source) + for (TGComponent tgc: source) if ((tgc instanceof TClassInterface) && (!added.contains(tgc)) && (!notSource.contains(tgc))) - added.add((TClassInterface) tgc); + added.add ((TClassInterface) tgc); } private void myInitComponents() { @@ -134,39 +133,35 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, Container c = getContentPane(); GridBagLayout gridbag1 = new GridBagLayout(); GridBagConstraints c1 = new GridBagConstraints(); - GridBagLayout gridbag0 = new GridBagLayout(); - GridBagConstraints c0 = new GridBagConstraints(); setFont(new Font("Helvetica", Font.PLAIN, 14)); - //c.setLayout(new BorderLayout()); - c.setLayout(gridbag0); - JPanel mainPanel = new JPanel(new BorderLayout()); + c.setLayout(new BorderLayout()); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); // ignored list panel1 = new JPanel(); panel1.setLayout(new BorderLayout()); panel1.setBorder(new javax.swing.border.TitledBorder("Ignored")); - listIgnored = new JList<TClassInterface>(ign.toArray(new TClassInterface[0])); + listIgnored = new JList<TClassInterface> (ign.toArray (new TClassInterface[0])); //listIgnored.setPreferredSize(new Dimension(200, 250)); - listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listIgnored.addListSelectionListener(this); JScrollPane scrollPane1 = new JScrollPane(listIgnored); panel1.add(scrollPane1, BorderLayout.CENTER); panel1.setPreferredSize(new Dimension(200, 250)); - mainPanel.add(panel1, BorderLayout.WEST); + c.add(panel1, BorderLayout.WEST); // validated list panel2 = new JPanel(); panel2.setLayout(new BorderLayout()); panel2.setBorder(new javax.swing.border.TitledBorder("Taken into account")); - listValidated = new JList<TClassInterface>(val.toArray(new TClassInterface[0])); + listValidated = new JList<TClassInterface> (val.toArray (new TClassInterface[0])); //listValidated.setPreferredSize(new Dimension(200, 250)); - listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listValidated.addListSelectionListener(this); JScrollPane scrollPane2 = new JScrollPane(listValidated); panel2.add(scrollPane2, BorderLayout.CENTER); panel2.setPreferredSize(new Dimension(200, 250)); - mainPanel.add(panel2, BorderLayout.EAST); + c.add(panel2, BorderLayout.EAST); // central buttons panel3 = new JPanel(); @@ -204,15 +199,9 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, allIgnored.setActionCommand("allIgnored"); panel3.add(allIgnored, c1); - mainPanel.add(panel3, BorderLayout.CENTER); + c.add(panel3, BorderLayout.CENTER); // main panel; - c0.gridwidth = 1; - c0.gridheight = 10; - c0.weighty = 1.0; - c0.weightx = 1.0; - c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; panel6 = new JPanel(); panel6.setLayout(new BorderLayout()); @@ -240,20 +229,19 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, panel6.add(panel5, BorderLayout.NORTH); panel6.add(panel4, BorderLayout.SOUTH); - c.add(mainPanel, c0); - c.add(panel6, c0); + c.add(panel6, BorderLayout.SOUTH); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); // Compare the action command to the known actions. - if (command.equals("Start Syntax Analysis")) { + if (command.equals("Start Syntax Analysis")) { closeDialog(); } else if (command.equals("Cancel")) { cancelDialog(); - } else if (command.equals("addOneIgnored")) { + } else if (command.equals("addOneIgnored")) { addOneIgnored(); } else if (command.equals("addOneValidated")) { addOneValidated(); @@ -266,48 +254,48 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, private void addOneIgnored() { - for (TClassInterface c : this.listValidated.getSelectedValuesList()) { - ign.add(c); - val.remove(c); + for (TClassInterface c: this.listValidated.getSelectedValuesList ()) { + ign.add (c); + val.remove (c); } - listIgnored.setListData(ign.toArray(new TClassInterface[0])); - listValidated.setListData(val.toArray(new TClassInterface[0])); + listIgnored.setListData(ign.toArray (new TClassInterface [0])); + listValidated.setListData(val.toArray (new TClassInterface [0])); this.setButtons(); } private void addOneValidated() { - for (TClassInterface c : this.listIgnored.getSelectedValuesList()) { - ign.remove(c); - val.add(c); + for (TClassInterface c: this.listIgnored.getSelectedValuesList ()) { + ign.remove (c); + val.add (c); } - listIgnored.setListData(ign.toArray(new TClassInterface[0])); - listValidated.setListData(val.toArray(new TClassInterface[0])); + listIgnored.setListData(ign.toArray (new TClassInterface [0])); + listValidated.setListData(val.toArray (new TClassInterface [0])); setButtons(); } private void allValidated() { - val.addAll(ign); - ign.clear(); - listIgnored.setListData(ign.toArray(new TClassInterface[0])); - listValidated.setListData(val.toArray(new TClassInterface[0])); + val.addAll (ign); + ign.clear (); + listIgnored.setListData(ign.toArray (new TClassInterface[0])); + listValidated.setListData(val.toArray (new TClassInterface[0])); this.setButtons(); } private void allIgnored() { ign.addAll(val); - val.clear(); - listIgnored.setListData(ign.toArray(new TClassInterface[0])); - listValidated.setListData(val.toArray(new TClassInterface[0])); + val.clear (); + listIgnored.setListData(ign.toArray (new TClassInterface[0])); + listValidated.setListData(val.toArray (new TClassInterface[0])); setButtons(); } public void closeDialog() { - back.clear(); - for (int i = 0; i < val.size(); i++) { - back.add(val.get(i)); + back.clear (); + for(int i=0; i<val.size(); i++) { + back.add (val.get (i)); } validated = val; ignored = ign; @@ -337,13 +325,13 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, //listIgnored.clearSelection(); } - if (ign.size() == 0) { + if (ign.size() ==0) { allValidated.setEnabled(false); } else { allValidated.setEnabled(true); } - if (val.size() == 0) { + if (val.size() ==0) { allIgnored.setEnabled(false); closeButton.setEnabled(false); } else { @@ -358,9 +346,9 @@ public class JDialogModelChecking extends JDialogBase implements ActionListener, public int nbStart() { int cpt = 0; - for (TClassInterface t : val) + for (TClassInterface t: val) if (t.isStart()) - cpt++; + cpt ++; return cpt; } diff --git a/src/main/java/ui/window/JDialogMultiString.java b/src/main/java/ui/window/JDialogMultiString.java old mode 100755 new mode 100644 index 102f2ca04785379cbba524979335d39bb13f71e8..5b15a85594fec594c72fac5a5fd62c4de2900458 --- a/src/main/java/ui/window/JDialogMultiString.java +++ b/src/main/java/ui/window/JDialogMultiString.java @@ -37,8 +37,12 @@ */ + + package ui.window; +import ui.util.IconManager; + import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; @@ -47,17 +51,16 @@ import java.util.ArrayList; import java.util.HashMap; /** - * Class JDialogMultiString - * Dialog for managing several string components - * Creation: 18/11/2005 - * - * @author Ludovic APVRILLE - * @version 1.0 18/11/2005 + * Class JDialogMultiString + * Dialog for managing several string components + * Creation: 18/11/2005 + * @version 1.0 18/11/2005 + * @author Ludovic APVRILLE */ -public class JDialogMultiString extends JDialogBase implements ActionListener { +public class JDialogMultiString extends JDialogBase implements ActionListener { - private String[] labels; - private String[] values; + private String [] labels; + private String [] values; private int nbString; @@ -66,16 +69,14 @@ public class JDialogMultiString extends JDialogBase implements ActionListener { private JPanel panel1; // Panel1 - private JTextField[] texts; + private JTextField [] texts; private JButton inserts[]; private HashMap<Integer, JComboBox<String>> helps; private ArrayList<String[]> possibleValues = null; - /** - * Creates new form - */ + /** Creates new form */ // arrayDelay: [0] -> minDelay ; [1] -> maxDelay public JDialogMultiString(Frame f, String title, int _nbString, String[] _labels, String[] _values) { @@ -86,6 +87,7 @@ public class JDialogMultiString extends JDialogBase implements ActionListener { values = _values; + texts = new JTextField[nbString]; initComponents(); @@ -114,8 +116,8 @@ public class JDialogMultiString extends JDialogBase implements ActionListener { } private void initComponents() { - inserts = new JButton[labels.length]; - helps = new HashMap<>(); + inserts = new JButton[labels.length]; + helps = new HashMap<>(); Container c = getContentPane(); GridBagLayout gridbag0 = new GridBagLayout(); @@ -153,24 +155,24 @@ public class JDialogMultiString extends JDialogBase implements ActionListener { c1.anchor = GridBagConstraints.CENTER; // String1 - for (int i = 0; i < nbString; i++) { - c1.gridwidth = 1; + for(int i=0; i<nbString; i++) { + c1.gridwidth = 1; panel1.add(new JLabel(labels[i] + " = "), c1); - + if (possibleValues != null) { if (i < possibleValues.size()) { - String[] tmp = possibleValues.get(i); + String [] tmp = possibleValues.get(i); if (tmp != null) { helps.put(i, new JComboBox<>(tmp)); panel1.add(helps.get(i), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - inserts[i] = new JButton("Use"); - inserts[i].addActionListener(this); - panel1.add(inserts[i], c1); + c1.gridwidth = GridBagConstraints.REMAINDER; //end row + inserts[i] = new JButton("Use"); + inserts[i].addActionListener(this); + panel1.add(inserts[i], c1); } } } - c1.gridwidth = GridBagConstraints.REMAINDER; //end row + c1.gridwidth = GridBagConstraints.REMAINDER; //end row texts[i] = new JTextField(values[i], 15); panel1.add(texts[i], c1); } @@ -182,31 +184,31 @@ public class JDialogMultiString extends JDialogBase implements ActionListener { c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; + c.add(panel1, c0); c0.gridwidth = 1; c0.gridheight = 1; c0.fill = GridBagConstraints.HORIZONTAL; - + initButtons(c0, c, this); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); // Compare the action command to the known actions. - if (command.equals("Save and Close")) { + if (command.equals("Save and Close")) { closeDialog(); } else if (command.equals("Cancel")) { cancelDialog(); } else if (inserts != null) { - for (int i = 0; i < inserts.length; i++) { - if (evt.getSource() == inserts[i]) { - texts[i].setText(helps.get(i).getSelectedItem().toString()); - } - } - } + for(int i=0; i<inserts.length; i++) { + if (evt.getSource() == inserts[i]) { + texts[i].setText(helps.get(i).getSelectedItem().toString()); + } + } + } } diff --git a/src/main/java/ui/window/JDialogMultiStringCP.java b/src/main/java/ui/window/JDialogMultiStringCP.java old mode 100755 new mode 100644 index a1f6c7427ae16811bd79c52684f3186b0eeaccaa..b65c0f225720f6edb54f45ee5e280626da557e77 --- a/src/main/java/ui/window/JDialogMultiStringCP.java +++ b/src/main/java/ui/window/JDialogMultiStringCP.java @@ -37,8 +37,12 @@ */ + + package ui.window; +import ui.util.IconManager; + import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; @@ -48,66 +52,63 @@ import java.awt.event.ActionListener; * Class JDialogMultiStringCP * Dialog for managing several string components * Creation: 18/11/2005 - * - * @author Ludovic APVRILLE * @version 1.0 18/11/2005 + * @author Ludovic APVRILLE */ -public class JDialogMultiStringCP extends JDialogBase implements ActionListener { - - private String[] labels; - private String[] values; - +public class JDialogMultiStringCP extends JDialogBase implements ActionListener { + + private String [] labels; + private String [] values; + private int nbString; - + private boolean set = false; - + private JPanel panel1; - + // Panel1 - private JTextField[] texts; - - /** - * Creates new form - */ + private JTextField [] texts; + + /** Creates new form */ // arrayDelay: [0] -> minDelay ; [1] -> maxDelay public JDialogMultiStringCP(Frame f, String title, int _nbString, String[] _labels, String[] _values) { - + super(f, title, true); - + nbString = _nbString; labels = _labels; values = _values; - + texts = new JTextField[nbString]; - + initComponents(); myInitComponents(); pack(); } - - + + private void myInitComponents() { } - + private void initComponents() { Container c = getContentPane(); GridBagLayout gridbag0 = new GridBagLayout(); GridBagLayout gridbag1 = new GridBagLayout(); GridBagConstraints c0 = new GridBagConstraints(); GridBagConstraints c1 = new GridBagConstraints(); - + setFont(new Font("Helvetica", Font.PLAIN, 14)); c.setLayout(gridbag0); - + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - + panel1 = new JPanel(); panel1.setLayout(gridbag1); - + panel1.setBorder(new javax.swing.border.TitledBorder("Properties")); - + panel1.setPreferredSize(new Dimension(300, 200)); - + // first line panel1 c1.weighty = 1.0; c1.weightx = 1.0; @@ -115,7 +116,7 @@ public class JDialogMultiStringCP extends JDialogBase implements ActionListener c1.fill = GridBagConstraints.BOTH; c1.gridheight = 1; panel1.add(new JLabel(" "), c1); - + // second line panel1 c1.gridwidth = 1; c1.gridheight = 1; @@ -124,63 +125,62 @@ public class JDialogMultiStringCP extends JDialogBase implements ActionListener c1.anchor = GridBagConstraints.CENTER; c1.fill = GridBagConstraints.HORIZONTAL; c1.anchor = GridBagConstraints.CENTER; - + // String1 - for (int i = 0; i < nbString; i++) { + for(int i=0; i<nbString; i++) { panel1.add(new JLabel(labels[i] + " = "), c1); c1.gridwidth = GridBagConstraints.REMAINDER; //end row texts[i] = new JTextField(values[i], 15); panel1.add(texts[i], c1); } - - + + // main panel; c0.gridwidth = 1; c0.gridheight = 10; c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; - + c.add(panel1, c0); - + c0.gridwidth = 1; c0.gridheight = 1; c0.fill = GridBagConstraints.HORIZONTAL; - + initButtons(c0, c, this); } - - public void actionPerformed(ActionEvent evt) { + + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - + // Compare the action command to the known actions. - if (command.equals("Save and Close")) { + if (command.equals("Save and Close")) { closeDialog(); } else if (command.equals("Cancel")) { cancelDialog(); } } - - + + public void closeDialog() { set = true; dispose(); } - + public String getString(int i) { return texts[i].getText(); } - - public boolean hasValidString(int i) { + + public boolean hasValidString(int i) { return texts[i].getText().length() > 0; } - - + + public boolean hasBeenSet() { return set; } - + public void cancelDialog() { dispose(); } diff --git a/src/main/java/ui/window/JDialogNCEqNode.java b/src/main/java/ui/window/JDialogNCEqNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogNCRoute.java b/src/main/java/ui/window/JDialogNCRoute.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogNCSwitchNode.java b/src/main/java/ui/window/JDialogNCSwitchNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogNCTraffic.java b/src/main/java/ui/window/JDialogNCTraffic.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogNote.java b/src/main/java/ui/window/JDialogNote.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogObserver.java b/src/main/java/ui/window/JDialogObserver.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogParam.java b/src/main/java/ui/window/JDialogParam.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogParamFIFO.java b/src/main/java/ui/window/JDialogParamFIFO.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogPerformancePragma.java b/src/main/java/ui/window/JDialogPerformancePragma.java index ab990ef7b29119639f6a49adc47bab2a43b86b98..d4e0979e3a6eca6ee3b355dd569ea2d4078eae59 100644 --- a/src/main/java/ui/window/JDialogPerformancePragma.java +++ b/src/main/java/ui/window/JDialogPerformancePragma.java @@ -37,6 +37,8 @@ */ + + package ui.window; import ui.util.IconManager; @@ -52,9 +54,8 @@ import java.util.HashMap; * Class JDialogPragma * Dialog for entering a note * Creation: 06/12/2003 - * - * @author Ludovic APVRILLE, Letitia LI * @version 1.0 06/12/2003 + * @author Ludovic APVRILLE, Letitia LI */ public class JDialogPerformancePragma extends JDialogBase implements ActionListener { @@ -68,10 +69,7 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe protected JMenu help; protected JPopupMenu helpPopup; public HashMap<String, java.util.List<String>> blockAttributeMap = new HashMap<String, java.util.List<String>>(); - - /** - * Creates new form - */ + /** Creates new form */ public JDialogPerformancePragma(Frame f, String title, String _text) { super(f, title, true); text = _text; @@ -98,9 +96,9 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe popupMenu.setOpaque(false); popupMenu.setBorder(null); - popupMenu.add(list = createSuggestionList(linePosition, position, subWord), BorderLayout.CENTER); + popupMenu.add(list = createSuggestionList(linePosition ,position, subWord), BorderLayout.CENTER); //Show popupMenu only if there are matching suggestions - if (list.getModel().getSize() > 0) { + if (list.getModel().getSize() >0){ popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + location.y); } } @@ -114,20 +112,23 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe private JList createSuggestionList(int linePosition, final int position, final String subWord) { ArrayList<String> matches = new ArrayList<String>(); - if (linePosition < 6) { + if (linePosition<6){ matches.add("Latency("); - } else if (!subWord.contains(".")) { - for (String block : blockAttributeMap.keySet()) { - if (block.startsWith(subWord)) { + } + + else if (!subWord.contains(".")){ + for (String block: blockAttributeMap.keySet()){ + if (block.startsWith(subWord)){ matches.add(block); } } - } else { + } + else { String block = subWord.split("\\.")[0]; - if (blockAttributeMap.containsKey(block)) { - for (String attr : blockAttributeMap.get(block)) { - if (attr.startsWith(subWord.split("\\.")[1])) { - matches.add(block + "." + attr); + if (blockAttributeMap.containsKey(block)){ + for (String attr: blockAttributeMap.get(block)){ + if (attr.startsWith(subWord.split("\\.")[1])){ + matches.add(block+"."+attr); } } } @@ -139,13 +140,13 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.setSelectedIndex(0); list.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2) { - insertSelection(); + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + insertSelection(); + } } - } - }); + }); return list; } @@ -153,7 +154,7 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe public boolean insertSelection() { //Note that it will not add if the selection will not fit on the current line - if (!popupMenu.isVisible()) { + if (!popupMenu.isVisible()){ return false; } if (list.getSelectedValue() != null) { @@ -183,24 +184,22 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe final int position = textarea.getCaretPosition(); list.setSelectedIndex(index); SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - textarea.setCaretPosition(position); - } - }); + @Override + public void run() { + textarea.setCaretPosition(position); + } + }); } } - private SuggestionPanel suggestion; - protected void showSuggestionLater() { SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - showSuggestion(); - } + @Override + public void run() { + showSuggestion(); + } - }); + }); } protected void showSuggestion() { @@ -216,7 +215,7 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe String text = textarea.getText(); int start = Math.max(0, position - 1); while (start > 0) { - if (!text.substring(start, start + 1).equals("(") && !text.substring(start, start + 1).equals(")") && !text.substring(start, start + 1).equals(",")) { + if (!text.substring(start,start+1).equals("(") && !text.substring(start,start+1).equals(")") && !text.substring(start,start+1).equals(",") ) { start--; } else { start++; @@ -232,22 +231,23 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe if (subWord.length() < 1) { return; } - start = Math.max(0, position - 1); - while (start > 0) { + start=Math.max(0,position-1); + while (start>0){ //Find previous new line position - if (!String.valueOf(text.charAt(start)).matches(".")) { + if (!String.valueOf(text.charAt(start)).matches(".")){ break; - } else { + } + else { start--; } } - suggestion = new SuggestionPanel(textarea, position, subWord, location, position - start - 1); + suggestion = new SuggestionPanel(textarea, position, subWord, location, position-start-1); SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - textarea.requestFocusInWindow(); - } - }); + @Override + public void run() { + textarea.requestFocusInWindow(); + } + }); } private void hideSuggestion() { @@ -263,40 +263,40 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe setFont(f); c.setLayout(new BorderLayout()); //setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - + helpPopup = new JPopupMenu(); - //JTextArea jft = new JTextArea("UPPAAL pragmas"); - //helpPopup.add(jft); - JLabel t = new JLabel(""); - JLabel header = new JLabel(" Performance Pragma"); - Font headerFont = new Font(t.getFont().getName(), Font.BOLD, t.getFont().getSize() + 2); - header.setFont(headerFont); - helpPopup.add(header); - //Text - helpPopup.add(new JLabel(" Performance Pragma allow us to query and record ")); - helpPopup.add(new JLabel(" the latency (in cycles) between two events after simulation")); - helpPopup.add(new JLabel(" Depending on the format of the pragma, results can be the")); - helpPopup.add(new JLabel(" numeric average latency value or a verified true/false result")); - - JLabel example = new JLabel(" Examples:"); - example.setFont(headerFont); - helpPopup.add(example); - - Font exFont = new Font(t.getFont().getName(), Font.ITALIC, t.getFont().getSize()); - JLabel t1 = new JLabel(" Latency(block1.state1, block2.s)<10:"); - t1.setFont(exFont); - helpPopup.add(t1); - helpPopup.add(new JLabel(" Will be marked with a green check mark or ")); - helpPopup.add(new JLabel(" red cross depending on simulation results")); - - JLabel t2 = new JLabel(" Latency(block1.state1, block2.s)?:"); - t2.setFont(exFont); - helpPopup.add(t2); - - helpPopup.add(new JLabel(" Will be marked with the average latency")); - helpPopup.add(new JLabel(" time after simulation")); - helpPopup.setPreferredSize(new Dimension(600, 250)); - + //JTextArea jft = new JTextArea("UPPAAL pragmas"); + //helpPopup.add(jft); + JLabel t = new JLabel(""); + JLabel header= new JLabel(" Performance Pragma"); + Font headerFont=new Font(t.getFont().getName(),Font.BOLD,t.getFont().getSize()+2); + header.setFont(headerFont); + helpPopup.add(header); + //Text + helpPopup.add(new JLabel(" Performance Pragma allow us to query and record ")); + helpPopup.add(new JLabel(" the latency (in cycles) between two events after simulation")); + helpPopup.add(new JLabel(" Depending on the format of the pragma, results can be the")); + helpPopup.add(new JLabel(" numeric average latency value or a verified true/false result")); + + JLabel example =new JLabel(" Examples:"); + example.setFont(headerFont); + helpPopup.add(example); + + Font exFont=new Font(t.getFont().getName(),Font.ITALIC,t.getFont().getSize()); + JLabel t1 = new JLabel(" Latency(block1.state1, block2.s)<10:"); + t1.setFont(exFont); + helpPopup.add(t1); + helpPopup.add(new JLabel(" Will be marked with a green check mark or ")); + helpPopup.add(new JLabel(" red cross depending on simulation results")); + + JLabel t2 = new JLabel(" Latency(block1.state1, block2.s)?:"); + t2.setFont(exFont); + helpPopup.add(t2); + + helpPopup.add(new JLabel(" Will be marked with the average latency")); + helpPopup.add(new JLabel(" time after simulation")); + helpPopup.setPreferredSize(new Dimension(600,250)); + textarea = new JTextArea(); textarea.setEditable(true); @@ -310,50 +310,52 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe menuBar.add(help); setJMenuBar(menuBar); textarea.addKeyListener(new KeyListener() { - @Override - public void keyTyped(KeyEvent e) { - if (e.getKeyChar() == KeyEvent.VK_ENTER || e.getKeyChar() == KeyEvent.VK_TAB) { - if (suggestion != null) { - if (suggestion.insertSelection()) { - e.consume(); - final int position = textarea.getCaretPosition(); - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - try { - textarea.getDocument().remove(position - 1, 1); - } catch (BadLocationException e) { - e.printStackTrace(); - } - } - }); + @Override + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() == KeyEvent.VK_ENTER || e.getKeyChar() == KeyEvent.VK_TAB) { + if (suggestion != null) { + if (suggestion.insertSelection()) { + e.consume(); + final int position = textarea.getCaretPosition(); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + try { + textarea.getDocument().remove(position - 1, 1); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + }); + } } } } - } - @Override - public void keyReleased(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { - suggestion.moveDown(); - } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { - suggestion.moveUp(); - } else if (Character.isWhitespace(e.getKeyChar())) { - hideSuggestion(); - } else if (Character.isLetter(e.getKeyChar())) { - showSuggestionLater(); + @Override + public void keyReleased(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { + suggestion.moveDown(); + } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { + suggestion.moveUp(); + } else if (Character.isWhitespace(e.getKeyChar())) { + hideSuggestion(); + } + else if (Character.isLetter(e.getKeyChar())){ + showSuggestionLater(); + } } - } - @Override - public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { - e.consume(); - } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { - e.consume(); + @Override + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { + e.consume(); + } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { + e.consume(); + } } - } - }); + }); + JScrollPane jsp = new JScrollPane(textarea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); @@ -361,10 +363,11 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe c.add(jsp, BorderLayout.CENTER); + close = new JButton("Ok", IconManager.imgic25); cancel = new JButton("Cancel", IconManager.imgic27); - help.setPreferredSize(new Dimension(30, 30)); + help.setPreferredSize(new Dimension(30,30)); close.setPreferredSize(new Dimension(150, 30)); cancel.setPreferredSize(new Dimension(150, 30)); @@ -372,24 +375,24 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe close.addActionListener(this); cancel.addActionListener(this); help.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - help(); - } - }); + @Override + public void mousePressed(MouseEvent e) { + help(); + } + }); JPanel jp = new JPanel(); - jp.add(cancel); jp.add(close); + jp.add(cancel); c.add(jp, BorderLayout.SOUTH); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { //String command = evt.getActionCommand(); // Compare the action command to the known actions. - if (evt.getSource() == cancel) { + if (evt.getSource() == cancel) { cancel(); } else if (evt.getSource() == close) { close(); @@ -405,11 +408,11 @@ public class JDialogPerformancePragma extends JDialogBase implements ActionListe text = textarea.getText(); dispose(); } - - public void help() { - if (!helpPopup.isVisible()) { + public void help(){ + if (!helpPopup.isVisible()){ helpPopup.show(help, 20, 20); - } else { + } + else { helpPopup.setVisible(false); } } diff --git a/src/main/java/ui/window/JDialogPragma.java b/src/main/java/ui/window/JDialogPragma.java old mode 100755 new mode 100644 index b9918ad98d08d9b96524b2d39571c68958e77e25..6127890ef51539367aaef8de3a06bd1082a45180 --- a/src/main/java/ui/window/JDialogPragma.java +++ b/src/main/java/ui/window/JDialogPragma.java @@ -381,8 +381,8 @@ public class JDialogPragma extends JDialogBase implements ActionListener { } }); JPanel jp = new JPanel(); - jp.add(cancel); jp.add(close); + jp.add(cancel); c.add(jp, BorderLayout.SOUTH); diff --git a/src/main/java/ui/window/JDialogProjection.java b/src/main/java/ui/window/JDialogProjection.java old mode 100755 new mode 100644 index 732b6de43b99b0152f07f180f92c5eef86644377..2392b1fa40ad6641d5d0ac1d1f72dc4ea2ca5818 --- a/src/main/java/ui/window/JDialogProjection.java +++ b/src/main/java/ui/window/JDialogProjection.java @@ -1,26 +1,26 @@ /* 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, @@ -31,12 +31,14 @@ * 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.window; import launcher.LauncherException; @@ -63,11 +65,10 @@ import java.util.Vector; * Class JDialogProjection * Dialog for managing Tclasses to be validated * Creation: 30/06/2004 - * - * @author Ludovic APVRILLE * @version 1.0 30/06/2004 + * @author Ludovic APVRILLE */ -public class JDialogProjection extends JDialog implements ActionListener, ListSelectionListener, Runnable { +public class JDialogProjection extends JDialog implements ActionListener, ListSelectionListener, Runnable { private static boolean isAldebaranSelected = false; private static boolean isOminSelected = false; private static boolean isStrongSelected = true; @@ -75,28 +76,28 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe private LinkedList<TClassAndGateDS> gatesIgnored; private LinkedList<TClassAndGateDS> gatesProjected; - + private MainGUI mgui; - + private String aldebaranHost; private String aldebaranPath; private String bcgioPath; private String bcgminPath; - + private String inputData; private String fileName; - - + + // mode and thred management protected int mode; protected RshClient rshc; protected Thread t; - + protected final static int NO_OPTIONS = 0; protected final static int NOT_STARTED = 1; protected final static int STARTED = 2; protected final static int STOPPED = 3; - + //subpanels private JPanel panel1, panel2, panel3, panel4; private JList<TClassAndGateDS> listIgnored; @@ -106,88 +107,86 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe private JButton addOneIgnored; private JButton allIgnored; protected JTextArea jta; - + private JRadioButton omin, imin; private JRadioButton aldebaran, bcgmin; private JRadioButton strong, branching; - + // Main Panel private JButton start, stop, close; - - /** - * Creates new form - */ + + /** Creates new form */ public JDialogProjection(Frame f, MainGUI _mgui, TClassDiagramPanel tcd, TURTLEModeling tm, String _aldebaranHost, String _aldebaranPath, String _bcgminPath, String _bcgioPath, String _inputData, String _fileName, String title) { super(f, title, true); - + mgui = _mgui; - + aldebaranHost = _aldebaranHost; aldebaranPath = _aldebaranPath; bcgioPath = _bcgioPath; bcgminPath = _bcgminPath; inputData = _inputData; fileName = _fileName; - + if (tcd != null) { initGates(tcd); } - + if (tm != null) { initGates(tm); } - + initComponents(); myInitComponents(); pack(); - + //getGlassPane().addMouseListener( new MouseAdapter() {}); getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } - + private void initGates(TClassDiagramPanel tcd) { - gatesIgnored = new LinkedList<TClassAndGateDS>(); - gatesProjected = new LinkedList<TClassAndGateDS>(); - + gatesIgnored = new LinkedList<TClassAndGateDS> (); + gatesProjected = new LinkedList<TClassAndGateDS> (); + java.util.List<TGComponent> list = tcd.getComponentList(); - for (TGComponent tgc : list) + for (TGComponent tgc: list) if (tgc instanceof TClassInterface) { - TClassInterface tci = (TClassInterface) tgc; + TClassInterface tci = (TClassInterface)tgc; java.util.List<TAttribute> gates = tci.getGates(); - for (TAttribute ta : gates) { + for (TAttribute ta: gates) { TClassAndGateDS tcg = new TClassAndGateDS(tci, ta); - gatesIgnored.add(tcg); + gatesIgnored.add (tcg); } } - + Collections.sort(gatesIgnored); } - + private void initGates(TURTLEModeling tm) { //System.out.println("*** init gates tm ***"); - gatesIgnored = new LinkedList<TClassAndGateDS>(); - gatesProjected = new LinkedList<TClassAndGateDS>(); - - for (int i = 0; i < tm.classNb(); i++) { + gatesIgnored = new LinkedList<TClassAndGateDS> (); + gatesProjected = new LinkedList<TClassAndGateDS> (); + + for(int i=0; i<tm.classNb(); i++) { TClass t = tm.getTClassAtIndex(i); Vector<Gate> gateList = t.getGateList(); - for (int j = 0; j < gateList.size(); j++) { + for(int j=0; j<gateList.size(); j++) { Gate g = gateList.elementAt(j); TClassAndGateDS tcg = new TClassAndGateDS(t, g); - gatesIgnored.add(tcg); + gatesIgnored.add (tcg); } - + } - + Collections.sort(gatesIgnored); } - - + + private void myInitComponents() { mode = NO_OPTIONS; setButtons(); } - + private void initComponents() { Container c = getContentPane(); GridBagLayout gridbag1 = new GridBagLayout(); @@ -197,37 +196,37 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe setFont(new Font("Helvetica", Font.PLAIN, 14)); c.setLayout(new BorderLayout()); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - + // ignored list - + JPanel panelTop = new JPanel(); panelTop.setLayout(new BorderLayout()); - + panel1 = new JPanel(); panel1.setLayout(new BorderLayout()); panel1.setBorder(new javax.swing.border.TitledBorder("Gates ignored")); - listIgnored = new JList<TClassAndGateDS>(gatesIgnored.toArray(new TClassAndGateDS[0])); + listIgnored = new JList<TClassAndGateDS> (gatesIgnored.toArray (new TClassAndGateDS[0])); //listIgnored.setPreferredSize(new Dimension(200, 250)); - listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listIgnored.addListSelectionListener(this); JScrollPane scrollPane1 = new JScrollPane(listIgnored); panel1.add(scrollPane1, BorderLayout.CENTER); panel1.setPreferredSize(new Dimension(400, 250)); panelTop.add(panel1, BorderLayout.WEST); - + // validated list panel2 = new JPanel(); panel2.setLayout(new BorderLayout()); panel2.setBorder(new javax.swing.border.TitledBorder("Gates taken into account")); - listProjected = new JList<TClassAndGateDS>(gatesProjected.toArray(new TClassAndGateDS[0])); + listProjected = new JList<TClassAndGateDS> (gatesProjected.toArray (new TClassAndGateDS[0])); //listProjected.setPreferredSize(new Dimension(200, 250)); - listProjected.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listProjected.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listProjected.addListSelectionListener(this); JScrollPane scrollPane2 = new JScrollPane(listProjected); panel2.add(scrollPane2, BorderLayout.CENTER); panel2.setPreferredSize(new Dimension(400, 250)); panelTop.add(panel2, BorderLayout.EAST); - + // radio buttons panel4 = new JPanel(); panel4.setLayout(gridbag4); @@ -286,59 +285,59 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe panelTop.add(panel4, BorderLayout.SOUTH); activeAldebaran(isAldebaranSelected); - + ButtonGroup bg = new ButtonGroup(); bg.add(aldebaran); bg.add(bcgmin); - + bg = new ButtonGroup(); bg.add(omin); bg.add(imin); - + bg = new ButtonGroup(); bg.add(strong); bg.add(branching); - + // central buttons panel3 = new JPanel(); panel3.setLayout(gridbag1); - + c1.weighty = 1.0; c1.weightx = 1.0; c1.gridwidth = GridBagConstraints.REMAINDER; //end row c1.fill = GridBagConstraints.HORIZONTAL; c1.gridheight = 1; - + allProjected = new JButton(IconManager.imgic50); allProjected.setPreferredSize(new Dimension(50, 25)); allProjected.addActionListener(this); allProjected.setActionCommand("allProjected"); panel3.add(allProjected, c1); - + addOneProjected = new JButton(IconManager.imgic48); addOneProjected.setPreferredSize(new Dimension(50, 25)); addOneProjected.addActionListener(this); addOneProjected.setActionCommand("addOneProjected"); panel3.add(addOneProjected, c1); - + panel3.add(new JLabel(" "), c1); - + addOneIgnored = new JButton(IconManager.imgic46); addOneIgnored.addActionListener(this); addOneIgnored.setPreferredSize(new Dimension(50, 25)); addOneIgnored.setActionCommand("addOneIgnored"); panel3.add(addOneIgnored, c1); - + allIgnored = new JButton(IconManager.imgic44); allIgnored.addActionListener(this); allIgnored.setPreferredSize(new Dimension(50, 25)); allIgnored.setActionCommand("allIgnored"); panel3.add(allIgnored, c1); - + panelTop.add(panel3, BorderLayout.CENTER); - + c.add(panelTop, BorderLayout.NORTH); - + // textarea panel jta = new ScrolledJTextArea(); jta.setEditable(false); @@ -348,40 +347,40 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe Font f = new Font("Courrier", Font.BOLD, 12); jta.setFont(f); JScrollPane jsp = new JScrollPane(jta, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); - + c.add(jsp, BorderLayout.CENTER); - - + + // Button panel; start = new JButton("Start", IconManager.imgic53); stop = new JButton("Stop", IconManager.imgic55); close = new JButton("Close", IconManager.imgic27); - + start.setPreferredSize(new Dimension(100, 30)); stop.setPreferredSize(new Dimension(100, 30)); close.setPreferredSize(new Dimension(100, 30)); - + start.addActionListener(this); stop.addActionListener(this); close.addActionListener(this); - + JPanel jp2 = new JPanel(); jp2.add(start); jp2.add(stop); jp2.add(close); - + c.add(jp2, BorderLayout.SOUTH); } - - public void actionPerformed(ActionEvent evt) { + + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - + // Compare the action command to the known actions. if (evt.getSource() == aldebaran) { - activeAldebaran(true); + activeAldebaran(true); } else if (evt.getSource() == bcgmin) { - activeAldebaran(false); - } else if (command.equals("Start")) { + activeAldebaran(false); + } else if (command.equals("Start")) { startProcess(); } else if (command.equals("Stop")) { stopProcess(); @@ -399,92 +398,92 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe } public void activeAldebaran(boolean b) { - omin.setEnabled(b); - imin.setEnabled(b); - strong.setEnabled(!b); - branching.setEnabled(!b); + omin.setEnabled(b); + imin.setEnabled(b); + strong.setEnabled(!b); + branching.setEnabled(!b); } - - + + private void addOneIgnored() { - int[] list = listProjected.getSelectedIndices(); - LinkedList<TClassAndGateDS> v = new LinkedList<TClassAndGateDS>(); - for (int i = 0; i < list.length; i++) { - TClassAndGateDS o = gatesProjected.get(list[i]); - gatesIgnored.add(o); - v.add(o); + int [] list = listProjected.getSelectedIndices(); + LinkedList<TClassAndGateDS> v = new LinkedList<TClassAndGateDS> (); + for (int i=0; i<list.length; i++){ + TClassAndGateDS o = gatesProjected.get (list[i]); + gatesIgnored.add (o); + v.add (o); } - + gatesProjected.removeAll(v); moveSynchronizedGatesAsWell(gatesIgnored, gatesProjected); Collections.sort(gatesIgnored); - listIgnored.setListData(gatesIgnored.toArray(new TClassAndGateDS[0])); - listProjected.setListData(gatesProjected.toArray(new TClassAndGateDS[0])); + listIgnored.setListData(gatesIgnored.toArray (new TClassAndGateDS[0])); + listProjected.setListData(gatesProjected.toArray (new TClassAndGateDS[0])); checkMode(); setButtons(); } - + private void addOneProjected() { - int[] list = listIgnored.getSelectedIndices(); - LinkedList<TClassAndGateDS> v = new LinkedList<TClassAndGateDS>(); - for (int i = 0; i < list.length; i++) { - TClassAndGateDS o = gatesIgnored.get(list[i]); - gatesProjected.add(o); - v.add(o); + int [] list = listIgnored.getSelectedIndices(); + LinkedList<TClassAndGateDS> v = new LinkedList<TClassAndGateDS> (); + for (int i=0; i<list.length; i++){ + TClassAndGateDS o = gatesIgnored.get (list[i]); + gatesProjected.add (o); + v.add (o); } - + gatesIgnored.removeAll(v); moveSynchronizedGatesAsWell(gatesProjected, gatesIgnored); Collections.sort(gatesProjected); - listIgnored.setListData(gatesIgnored.toArray(new TClassAndGateDS[0])); - listProjected.setListData(gatesProjected.toArray(new TClassAndGateDS[0])); + listIgnored.setListData(gatesIgnored.toArray (new TClassAndGateDS[0])); + listProjected.setListData(gatesProjected.toArray (new TClassAndGateDS[0])); checkMode(); setButtons(); } - + private void allProjected() { gatesProjected.addAll(gatesIgnored); Collections.sort(gatesProjected); - gatesIgnored.clear(); - listIgnored.setListData(gatesIgnored.toArray(new TClassAndGateDS[0])); - listProjected.setListData(gatesProjected.toArray(new TClassAndGateDS[0])); + gatesIgnored.clear (); + listIgnored.setListData(gatesIgnored.toArray (new TClassAndGateDS[0])); + listProjected.setListData(gatesProjected.toArray (new TClassAndGateDS[0])); checkMode(); setButtons(); } - + private void allIgnored() { gatesIgnored.addAll(gatesProjected); Collections.sort(gatesIgnored); - gatesProjected.clear(); - listIgnored.setListData(gatesIgnored.toArray(new TClassAndGateDS[0])); - listProjected.setListData(gatesProjected.toArray(new TClassAndGateDS[0])); + gatesProjected.clear (); + listIgnored.setListData(gatesIgnored.toArray (new TClassAndGateDS[0])); + listProjected.setListData(gatesProjected.toArray (new TClassAndGateDS[0])); checkMode(); setButtons(); } - + private void moveSynchronizedGatesAsWell(LinkedList<TClassAndGateDS> toCheck, LinkedList<TClassAndGateDS> toPickup) { TClassAndGateDS tcg1; MasterGateManager mgm = mgui.gtm.getNewMasterGateManager(); //Gate g; GroupOfGates gog, gog1; + - - for (TClassAndGateDS tcg : toCheck) { + for (TClassAndGateDS tcg: toCheck) { gog = mgm.groupOf(tcg.getTClassName(), tcg.getGateName()); if (gog != null) { - for (int j = 0; j < toPickup.size(); j++) { - tcg1 = toPickup.get(j); + for(int j=0; j<toPickup.size(); j++) { + tcg1 = toPickup.get (j); gog1 = mgm.groupOf(tcg1.getTClassName(), tcg1.getGateName()); if (gog1 == gog) { - toCheck.add(tcg1); - toPickup.remove(j); + toCheck.add (tcg1); + toPickup.remove (j); j--; } } } } } - + public void checkMode() { if (gatesProjected.size() > 0) { mode = NOT_STARTED; @@ -492,9 +491,9 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe mode = NO_OPTIONS; } } - + private void setButtons() { - switch (mode) { + switch(mode) { case NO_OPTIONS: listProjected.setEnabled(true); listIgnored.setEnabled(true); @@ -540,37 +539,37 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe break; } } - + private void unsetButtonsList() { addOneProjected.setEnabled(false); addOneIgnored.setEnabled(false); allProjected.setEnabled(false); allIgnored.setEnabled(false); } - + private void setButtonsList() { int i1 = listIgnored.getSelectedIndex(); int i2 = listProjected.getSelectedIndex(); - + if (i1 == -1) { addOneProjected.setEnabled(false); } else { addOneProjected.setEnabled(true); } - + if (i2 == -1) { addOneIgnored.setEnabled(false); } else { addOneIgnored.setEnabled(true); } - - if (gatesIgnored.size() == 0) { + + if (gatesIgnored.size() ==0) { allProjected.setEnabled(false); } else { allProjected.setEnabled(true); } - - if (gatesProjected.size() == 0) { + + if (gatesProjected.size() ==0) { allIgnored.setEnabled(false); //closeButton.setEnabled(false); //closeButton.setEnabled(false); @@ -579,224 +578,218 @@ public class JDialogProjection extends JDialog implements ActionListener, ListSe //closeButton.setEnabled(true); } } - + public void valueChanged(ListSelectionEvent e) { setButtons(); } - + public void closeDialog() { if (mode == STARTED) { stopProcess(); } dispose(); } - + public void stopProcess() { if (rshc != null) { try { rshc.stopCommand(); } catch (LauncherException le) { - + } rshc = null; } - mode = STOPPED; + mode = STOPPED; setButtons(); } - + public void startProcess() { t = new Thread(this); mode = STARTED; setButtons(); t.start(); } - + public void run() { String cmd1 = ""; String autproj; String autprojdot; - // String data; + // String data; int id = 0; String filenamebcg; Point p; - - RshClient rshctmp = null; - + + RshClient rshctmp = null; + try { - // saving current options - isAldebaranSelected = aldebaran.isSelected(); - isOminSelected = omin.isSelected(); - isStrongSelected = strong.isSelected(); + // saving current options + isAldebaranSelected = aldebaran.isSelected(); + isOminSelected = omin.isSelected(); + isStrongSelected = strong.isSelected(); mgui.gtm.reinitRGAUTPROJDOT(); jta.append("Modifying original RG\n"); //System.out.println("Input data = " + inputData); - + autproj = mgui.gtm.performProjection(inputData, gatesProjected); - + if (autproj == null) { jta.append("\nError: the RG could not be prepared for minimization\n"); } else { - jta.append("\nRemoving ignored gates\n"); + jta.append("\nRemoving ignored gates\n"); if (isAldebaranSelected) { - //System.out.println("Output data = " + autproj); - - //jta.append(autproj); - - //mgui.gtm.setRGAUTPROJ(autproj); - //mgui.saveRGAutProj(); - - if ((aldebaranHost == null) || (aldebaranHost.length() == 0)) { - jta.append("No Aldebaran installed -> cannot performed minimization\n"); - mgui.gtm.setRGAUTPROJ(autproj); - mgui.saveRGAutProj(); + //System.out.println("Output data = " + autproj); + + //jta.append(autproj); + + //mgui.gtm.setRGAUTPROJ(autproj); + //mgui.saveRGAutProj(); + + if ((aldebaranHost == null) || (aldebaranHost.length() == 0)) { + jta.append("No Aldebaran installed -> cannot performed minimization\n"); + mgui.gtm.setRGAUTPROJ(autproj); + mgui.saveRGAutProj(); + } else { + jta.append("Minimization with Aldebaran\n"); + rshc = new RshClient(aldebaranHost); + rshctmp = rshc; + id = rshc.getId(); + fileName = FileUtils.addBeforeFileExtension(fileName, "_" + id); + jta.append("Session id on launcher="+id + " ; working on " + fileName + "\n"); + + rshc.deleteFile(fileName); + jta.append("Sending data\n"); + rshc.sendFileData(fileName, autproj); + cmd1 = aldebaranPath; + if (omin.isSelected()) { + cmd1 += " -omin "; } else { - jta.append("Minimization with Aldebaran\n"); - rshc = new RshClient(aldebaranHost); - rshctmp = rshc; - id = rshc.getId(); - fileName = FileUtils.addBeforeFileExtension(fileName, "_" + id); - jta.append("Session id on launcher=" + id + " ; working on " + fileName + "\n"); - - rshc.deleteFile(fileName); - jta.append("Sending data\n"); - rshc.sendFileData(fileName, autproj); - cmd1 = aldebaranPath; - if (omin.isSelected()) { - cmd1 += " -omin "; - } else { - cmd1 += " -imin "; - } - cmd1 += fileName; - jta.append("Performing minimization\n"); - autproj = processCmd(cmd1); - - // Print info on minimized graph - p = FormatManager.nbStateTransitionRGAldebaran(autproj); - jta.append("\n" + p.x + " state(s), " + p.y + " transition(s)\n\n"); + cmd1 += " -imin "; + } + cmd1 += fileName; + jta.append("Performing minimization\n"); + autproj = processCmd(cmd1); - mgui.gtm.setRGAUTPROJ(autproj); - mgui.saveRGAutProj(); - jta.append("Minimization done\n"); - //jta.append(autproj); + // Print info on minimized graph + p = FormatManager.nbStateTransitionRGAldebaran(autproj); + jta.append("\n" + p.x + " state(s), " + p.y + " transition(s)\n\n"); - // AUT proj dot - jta.append("\nConverting to dotty format\n"); - rshc.sendFileData(fileName, autproj); - cmd1 = bcgioPath + " -aldebaran " + fileName + " -graphviz " + fileName + ".dot"; - autproj = processCmd(cmd1); - autprojdot = rshc.getFileData(fileName + ".dot"); - mgui.gtm.setRGAUTPROJDOT(autprojdot); - mgui.saveRGAutProjDOT(); - rshc.deleteFile(fileName); - rshc.deleteFile(fileName + ".dot"); - rshc.freeId(id); - } + mgui.gtm.setRGAUTPROJ(autproj); + mgui.saveRGAutProj(); + jta.append("Minimization done\n"); + //jta.append(autproj); + + // AUT proj dot + jta.append("\nConverting to dotty format\n"); + rshc.sendFileData(fileName, autproj); + cmd1 = bcgioPath + " -aldebaran " + fileName + " -graphviz " + fileName + ".dot"; + autproj = processCmd(cmd1); + autprojdot = rshc.getFileData(fileName + ".dot"); + mgui.gtm.setRGAUTPROJDOT(autprojdot); + mgui.saveRGAutProjDOT(); + rshc.deleteFile(fileName); + rshc.deleteFile(fileName + ".dot"); + rshc.freeId(id); + } + } else { + // BCGMIN + if ((aldebaranHost == null) || (aldebaranHost.length() == 0) ||(bcgminPath.length() == 0)) { + jta.append("No bcgmin installed -> cannot performed minimization\n"); + mgui.gtm.setRGAUTPROJ(autproj); + mgui.saveRGAutProj(); } else { - // BCGMIN - if ((aldebaranHost == null) || (aldebaranHost.length() == 0) || (bcgminPath.length() == 0)) { - jta.append("No bcgmin installed -> cannot performed minimization\n"); - mgui.gtm.setRGAUTPROJ(autproj); - mgui.saveRGAutProj(); + jta.append("Minimization with bcgmin\n"); + rshc = new RshClient(aldebaranHost); + id = rshc.getId(); + rshctmp = rshc; + fileName = FileUtils.addBeforeFileExtension(fileName, "_" + id); + filenamebcg = FileUtils.changeFileExtension(fileName, "bcg"); + jta.append("Session id on launcher="+id + " ; working on " + fileName + "\n"); + + jta.append("Sending data\n"); + rshc.sendFileData(fileName, autproj); + + // Converting to bcg format + jta.append("Converting data to bcg format\n"); + cmd1 = bcgioPath + " -aldebaran " + fileName + " -bcg " + filenamebcg; + /*data =*/ processCmd(cmd1); + + cmd1 = bcgminPath; + if (isStrongSelected) { + cmd1 += " -strong "; } else { - jta.append("Minimization with bcgmin\n"); - rshc = new RshClient(aldebaranHost); - id = rshc.getId(); - rshctmp = rshc; - fileName = FileUtils.addBeforeFileExtension(fileName, "_" + id); - filenamebcg = FileUtils.changeFileExtension(fileName, "bcg"); - jta.append("Session id on launcher=" + id + " ; working on " + fileName + "\n"); - - jta.append("Sending data\n"); - rshc.sendFileData(fileName, autproj); - - // Converting to bcg format - jta.append("Converting data to bcg format\n"); - cmd1 = bcgioPath + " -aldebaran " + fileName + " -bcg " + filenamebcg; - /*data =*/ - processCmd(cmd1); - - cmd1 = bcgminPath; - if (isStrongSelected) { - cmd1 += " -strong "; - } else { - cmd1 += " -branching "; - } - cmd1 += filenamebcg + " " + filenamebcg; - jta.append("Performing minimization\n"); - /*data =*/ - processCmd(cmd1); - jta.append("Minimization done\n"); - - jta.append("Converting data to aut format\n"); - cmd1 = bcgioPath + " -bcg " + filenamebcg + " -aldebaran " + fileName; - /*data = */ - processCmd(cmd1); - - jta.append("Getting aut data\n"); - autproj = rshc.getFileData(fileName); - - // Print info on minimized graph - p = FormatManager.nbStateTransitionRGAldebaran(autproj); - jta.append("\n" + p.x + " state(s), " + p.y + " transition(s)\n\n"); - - mgui.gtm.setRGAUTPROJ(autproj); - mgui.saveRGAutProj(); - //jta.append(autproj); - - // AUT proj dot - jta.append("\nConverting to dotty format\n"); - rshc.sendFileData(fileName, autproj); - cmd1 = bcgioPath + " -bcg " + filenamebcg + " -graphviz " + fileName + ".dot"; - /*data =*/ - processCmd(cmd1); - jta.append("Getting dot data\n"); - autprojdot = rshc.getFileData(fileName + ".dot"); - mgui.gtm.setRGAUTPROJDOT(autprojdot); - mgui.saveRGAutProjDOT(); - - fileName = FileUtils.removeFileExtension(fileName); - rshc.deleteFile(fileName + ".aut"); - rshc.deleteFile(fileName + ".bcg"); - rshc.deleteFile(fileName + ".aut.dot"); - rshc.deleteFile(fileName + ".o"); - rshc.deleteFile(fileName + "@1.o"); - rshc.freeId(id); + cmd1 += " -branching "; } + cmd1 += filenamebcg+ " " + filenamebcg; + jta.append("Performing minimization\n"); + /*data =*/ processCmd(cmd1); + jta.append("Minimization done\n"); + + jta.append("Converting data to aut format\n"); + cmd1 = bcgioPath + " -bcg " + filenamebcg+ " -aldebaran " + fileName; + /*data = */processCmd(cmd1); + + jta.append("Getting aut data\n"); + autproj = rshc.getFileData(fileName); + + // Print info on minimized graph + p = FormatManager.nbStateTransitionRGAldebaran(autproj); + jta.append("\n" + p.x + " state(s), " + p.y + " transition(s)\n\n"); + + mgui.gtm.setRGAUTPROJ(autproj); + mgui.saveRGAutProj(); + //jta.append(autproj); + + // AUT proj dot + jta.append("\nConverting to dotty format\n"); + rshc.sendFileData(fileName, autproj); + cmd1 = bcgioPath + " -bcg " + filenamebcg + " -graphviz " + fileName + ".dot"; + /*data =*/ processCmd(cmd1); + jta.append("Getting dot data\n"); + autprojdot = rshc.getFileData(fileName + ".dot"); + mgui.gtm.setRGAUTPROJDOT(autprojdot); + mgui.saveRGAutProjDOT(); + + fileName = FileUtils.removeFileExtension(fileName); + rshc.deleteFile(fileName + ".aut"); + rshc.deleteFile(fileName + ".bcg"); + rshc.deleteFile(fileName + ".aut.dot"); + rshc.deleteFile(fileName + ".o"); + rshc.deleteFile(fileName + "@1.o"); + rshc.freeId(id); + } } } jta.append("Done\n"); - + } catch (LauncherException le) { jta.append("Error:" + le.getMessage() + "\n"); - try { - if (rshctmp != null) { - rshctmp.freeId(id); - } - } catch (LauncherException leb) { - } + try{ + if (rshctmp != null) { + rshctmp.freeId(id); + } + } catch (LauncherException leb) {} mode = STOPPED; setButtons(); return; } catch (Exception e) { mode = STOPPED; - try { - if (rshctmp != null) { - rshctmp.freeId(id); - } - } catch (LauncherException leb) { - } + try{ + if (rshctmp != null) { + rshctmp.freeId(id); + } + } catch (LauncherException leb) {} setButtons(); return; } - + mode = STOPPED; setButtons(); } - + protected String processCmd(String cmd) throws LauncherException { rshc.setCmd(cmd); String s = null; diff --git a/src/main/java/ui/window/JDialogReducedAttribute.java b/src/main/java/ui/window/JDialogReducedAttribute.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogRequirement.java b/src/main/java/ui/window/JDialogRequirement.java old mode 100755 new mode 100644 index d9dc61a6c53cfeeb985151d8704b7478eec9df85..8501fc651cec0de3be43b5e4f2409aa5dcb4604a --- a/src/main/java/ui/window/JDialogRequirement.java +++ b/src/main/java/ui/window/JDialogRequirement.java @@ -157,7 +157,6 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { c1.gridheight = 1; c1.weighty = 1.0; c1.weightx = 1.0; - c1.fill = GridBagConstraints.BOTH; jta = new JTextArea(); jta.setEditable(true); jta.setMargin(new Insets(10, 10, 10, 10)); @@ -166,8 +165,8 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { jta.setFont(new Font("times", Font.PLAIN, 12)); JScrollPane jsp = new JScrollPane(jta, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); - //jsp.setPreferredSize(new Dimension(300, 200)); - panel1.add(jsp, c1); + jsp.setPreferredSize(new Dimension(300, 200)); + panel1.add(jsp); //} // Panel2 @@ -283,7 +282,6 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { c0.gridheight = 10; c0.weighty = 1.0; c0.weightx = 1.0; - c0.fill = GridBagConstraints.BOTH; c.add(panel1, c0); c0.gridwidth = GridBagConstraints.REMAINDER; //end row diff --git a/src/main/java/ui/window/JDialogRequirementTable.java b/src/main/java/ui/window/JDialogRequirementTable.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSafetyPragma.java b/src/main/java/ui/window/JDialogSafetyPragma.java index 8e8f0fb24216dfe185da47962f87a0d704e152e9..e44f1c6ec902b98e062b6f2edfe8f62fab31d007 100644 --- a/src/main/java/ui/window/JDialogSafetyPragma.java +++ b/src/main/java/ui/window/JDialogSafetyPragma.java @@ -1,26 +1,26 @@ /* 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, @@ -31,12 +31,14 @@ * 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.window; import ui.util.IconManager; @@ -52,14 +54,13 @@ import java.util.HashMap; * Class JDialogPragma * Dialog for entering a note * Creation: 06/12/2003 - * - * @author Ludovic APVRILLE, Letitia LI * @version 1.0 06/12/2003 + * @author Ludovic APVRILLE, Letitia LI */ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { - + protected String text; - + //components protected JTextArea textarea; protected JButton close; @@ -67,25 +68,22 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { protected JMenuBar menuBar; protected JMenu help; protected JPopupMenu helpPopup; - public HashMap<String, java.util.List<String>> blockAttributeMap = new HashMap<String, java.util.List<String>>(); - - /** - * Creates new form - */ + public HashMap<String, java.util.List<String>> blockAttributeMap = new HashMap<String, java.util.List<String>>(); + /** Creates new form */ public JDialogSafetyPragma(Frame f, String title, String _text) { super(f, title, true); text = _text; - + initComponents(); pack(); } //Suggestion Panel code from: http://stackoverflow.com/questions/10873748/how-to-show-autocomplete-as-i-type-in-jtextarea public class SuggestionPanel { - private final String[] pragma = {"A[]", "E<>", "A<>", "E[]", "min(", "max("}; - //Form list of all blocks - //For each block, create a list of all attribute strings and states - + private final String[] pragma = {"A[]", "E<>", "A<>", "E[]", "min(", "max("}; + //Form list of all blocks + //For each block, create a list of all attribute strings and states + private JList list; private JPopupMenu popupMenu; private String subWord; @@ -98,12 +96,12 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { popupMenu.removeAll(); popupMenu.setOpaque(false); popupMenu.setBorder(null); - - popupMenu.add(list = createSuggestionList(linePosition, position, subWord), BorderLayout.CENTER); - //Show popupMenu only if there are matching suggestions - if (list.getModel().getSize() > 0) { + + popupMenu.add(list = createSuggestionList(linePosition ,position, subWord), BorderLayout.CENTER); + //Show popupMenu only if there are matching suggestions + if (list.getModel().getSize() >0){ popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + location.y); - } + } } public void hide() { @@ -113,33 +111,34 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { } } - private JList createSuggestionList(int linePosition, final int position, final String subWord) { - ArrayList<String> matches = new ArrayList<String>(); - if (linePosition < 3) { - for (String p : pragma) { - if (p.startsWith(subWord)) { - matches.add(p); - } - } - } - - if (!subWord.contains(".")) { - for (String block : blockAttributeMap.keySet()) { - if (block.startsWith(subWord)) { - matches.add(block); - } - } - } else { - String block = subWord.split("\\.")[0]; - if (blockAttributeMap.containsKey(block)) { - for (String attr : blockAttributeMap.get(block)) { - if (attr.startsWith(subWord.split("\\.")[1])) { - matches.add(block + "." + attr); - } - } - } - } - String[] data = new String[matches.size()]; + private JList createSuggestionList(int linePosition, final int position, final String subWord) { + ArrayList<String> matches = new ArrayList<String>(); + if (linePosition<3){ + for (String p: pragma) { + if (p.startsWith(subWord)){ + matches.add(p); + } + } + } + + if (!subWord.contains(".")){ + for (String block: blockAttributeMap.keySet()){ + if (block.startsWith(subWord)){ + matches.add(block); + } + } + } + else { + String block = subWord.split("\\.")[0]; + if (blockAttributeMap.containsKey(block)){ + for (String attr: blockAttributeMap.get(block)){ + if (attr.startsWith(subWord.split("\\.")[1])){ + matches.add(block+"."+attr); + } + } + } + } + String[] data = new String[matches.size()]; data = matches.toArray(data); JList<String> list = new JList<>(data); list.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1)); @@ -153,16 +152,16 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { } } }); - + return list; } - + public boolean insertSelection() { - //Note that it will not add if the selection will not fit on the current line - if (!popupMenu.isVisible()) { - return false; - } + //Note that it will not add if the selection will not fit on the current line + if (!popupMenu.isVisible()){ + return false; + } if (list.getSelectedValue() != null) { try { final String selectedSuggestion = ((String) list.getSelectedValue()).substring(subWord.length()); @@ -197,10 +196,8 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { }); } } - - private SuggestionPanel suggestion; - - protected void showSuggestionLater() { + private SuggestionPanel suggestion; + protected void showSuggestionLater() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { @@ -239,16 +236,17 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { if (subWord.length() < 1) { return; } - start = Math.max(0, position - 1); - while (start > 0) { - //Find previous new line position - if (!String.valueOf(text.charAt(start)).matches(".")) { - break; - } else { - start--; - } - } - suggestion = new SuggestionPanel(textarea, position, subWord, location, position - start - 1); + start=Math.max(0,position-1); + while (start>0){ + //Find previous new line position + if (!String.valueOf(text.charAt(start)).matches(".")){ + break; + } + else { + start--; + } + } + suggestion = new SuggestionPanel(textarea, position, subWord, location, position-start-1); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { @@ -264,7 +262,7 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { } protected void initComponents() { - + Container c = getContentPane(); Font f = new Font("Helvetica", Font.PLAIN, 14); @@ -273,10 +271,10 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { //setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); helpPopup = new JPopupMenu(); - - helpPopup.add(new JLabel(IconManager.imgic7009)); - - helpPopup.setPreferredSize(new Dimension(600, 900)); + + helpPopup.add(new JLabel(IconManager.imgic7009)); + + helpPopup.setPreferredSize(new Dimension(600,900)); textarea = new JTextArea(); textarea.setEditable(true); @@ -284,12 +282,12 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { textarea.setTabSize(3); textarea.append(text); textarea.setFont(new Font("times", Font.PLAIN, 12)); - JMenuBar menuBar = new JMenuBar(); - menuBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); - help = new JMenu("?"); - menuBar.add(help); - setJMenuBar(menuBar); - textarea.addKeyListener(new KeyListener() { + JMenuBar menuBar = new JMenuBar(); + menuBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); + help = new JMenu("?"); + menuBar.add(help); + setJMenuBar(menuBar); + textarea.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ENTER || e.getKeyChar() == KeyEvent.VK_TAB) { @@ -320,82 +318,85 @@ public class JDialogSafetyPragma extends JDialogBase implements ActionListener { suggestion.moveUp(); } else if (Character.isWhitespace(e.getKeyChar())) { hideSuggestion(); - } else if (Character.isLetter(e.getKeyChar())) { + } + else if (Character.isLetter(e.getKeyChar())){ showSuggestionLater(); } } @Override public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { - e.consume(); + if (e.getKeyCode() == KeyEvent.VK_DOWN && suggestion != null) { + e.consume(); } else if (e.getKeyCode() == KeyEvent.VK_UP && suggestion != null) { e.consume(); - } + } } }); + JScrollPane jsp = new JScrollPane(textarea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); jsp.setPreferredSize(new Dimension(300, 300)); c.add(jsp, BorderLayout.CENTER); + close = new JButton("Ok", IconManager.imgic25); cancel = new JButton("Cancel", IconManager.imgic27); - - help.setPreferredSize(new Dimension(30, 30)); + + help.setPreferredSize(new Dimension(30,30)); close.setPreferredSize(new Dimension(150, 30)); cancel.setPreferredSize(new Dimension(150, 30)); - + close.addActionListener(this); cancel.addActionListener(this); help.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - help(); - } - }); + @Override + public void mousePressed(MouseEvent e) { + help(); + } + }); JPanel jp = new JPanel(); - jp.add(cancel); jp.add(close); - + jp.add(cancel); + c.add(jp, BorderLayout.SOUTH); + } - - public void actionPerformed(ActionEvent evt) { + + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - + // Compare the action command to the known actions. - if (command.equals("Cancel")) { + if (command.equals("Cancel")) { cancel(); } else if (command.equals("Ok")) { close(); } - + } - + public void cancel() { dispose(); } - + public void close() { text = textarea.getText(); dispose(); } - - public void help() { - if (!helpPopup.isVisible()) { - helpPopup.show(help, 20, 20); - } else { - helpPopup.setVisible(false); - } + public void help(){ + if (!helpPopup.isVisible()){ + helpPopup.show(help, 20, 20); + } + else { + helpPopup.setVisible(false); + } } - public String getText() { return text; } - - + + } diff --git a/src/main/java/ui/window/JDialogScheduling.java b/src/main/java/ui/window/JDialogScheduling.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSelectAvatarBlock.java b/src/main/java/ui/window/JDialogSelectAvatarBlock.java old mode 100755 new mode 100644 index 98cb245ad0c2c9b4160466aa957dd07d45fa0e4b..03e65caa0c61fa05e45db739feec837cc3b3c485 --- a/src/main/java/ui/window/JDialogSelectAvatarBlock.java +++ b/src/main/java/ui/window/JDialogSelectAvatarBlock.java @@ -37,10 +37,12 @@ */ + + package ui.window; -import ui.avatarbd.AvatarBDStateMachineOwner; import ui.util.IconManager; +import ui.avatarbd.AvatarBDStateMachineOwner; import javax.swing.*; import javax.swing.event.ListSelectionEvent; @@ -56,11 +58,10 @@ import java.util.LinkedList; * Class JDialogSelectAvatarBlock * Dialog for managing blocks to be validated * Creation: 18/05/2010 - * - * @author Ludovic APVRILLE * @version 1.0 18/05/2010 + * @author Ludovic APVRILLE */ -public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListener, ListSelectionListener { +public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListener, ListSelectionListener { public LinkedList<AvatarBDStateMachineOwner> validated, ignored; private boolean optimized = true; @@ -76,10 +77,8 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe private boolean hasBeenCancelled = true; - /** - * Creates new form - */ - public JDialogSelectAvatarBlock(Frame f, LinkedList<AvatarBDStateMachineOwner> _back, LinkedList<AvatarBDStateMachineOwner> componentList, String title, LinkedList<AvatarBDStateMachineOwner> _validated, LinkedList<AvatarBDStateMachineOwner> _ignored, boolean _optimized) { + /** Creates new form */ + public JDialogSelectAvatarBlock(Frame f, LinkedList<AvatarBDStateMachineOwner> _back, LinkedList<AvatarBDStateMachineOwner> componentList, String title, LinkedList <AvatarBDStateMachineOwner> _validated, LinkedList <AvatarBDStateMachineOwner> _ignored, boolean _optimized) { super(f, title, true); back = _back; @@ -89,7 +88,7 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe if ((validated == null) || (ignored == null)) { val = new LinkedList<>(componentList); - ign = new LinkedList<>(); + ign = new LinkedList<> (); } else { val = validated; ign = ignored; @@ -104,19 +103,19 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe } private void checkTask(LinkedList<AvatarBDStateMachineOwner> tobeChecked, LinkedList<AvatarBDStateMachineOwner> source) { - Iterator<AvatarBDStateMachineOwner> iterator = tobeChecked.iterator(); - - while (iterator.hasNext()) { - AvatarBDStateMachineOwner t = iterator.next(); + Iterator<AvatarBDStateMachineOwner> iterator = tobeChecked.iterator (); + + while (iterator.hasNext ()) { + AvatarBDStateMachineOwner t = iterator.next (); if (!source.contains(t)) - iterator.remove(); + iterator.remove (); } } private void addNewTask(LinkedList<AvatarBDStateMachineOwner> added, LinkedList<AvatarBDStateMachineOwner> source, LinkedList<AvatarBDStateMachineOwner> notSource) { - for (AvatarBDStateMachineOwner tgc : source) + for (AvatarBDStateMachineOwner tgc: source) if (!added.contains(tgc) && !notSource.contains(tgc)) - added.add(tgc); + added.add (tgc); } private void myInitComponents() { @@ -127,33 +126,33 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe Container c = getContentPane(); GridBagLayout gridbag1 = new GridBagLayout(); GridBagConstraints c1 = new GridBagConstraints(); - GridBagLayout gridbag2 = new GridBagLayout(); + GridBagLayout gridbag2 = new GridBagLayout(); GridBagConstraints c2 = new GridBagConstraints(); setFont(new Font("Helvetica", Font.PLAIN, 14)); //c.setLayout(new BorderLayout()); - c.setLayout(gridbag2); + c.setLayout(gridbag2); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - c2.weighty = 1.0; + c2.weighty = 1.0; c2.weightx = 1.0; - c2.gridwidth = 1; - c2.fill = GridBagConstraints.BOTH; + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; c2.gridheight = 1; // ignored list JPanel panel1 = new JPanel(); panel1.setLayout(new BorderLayout()); panel1.setBorder(new javax.swing.border.TitledBorder("Blocks ignored")); - listIgnored = new JList<>(ign.toArray(new AvatarBDStateMachineOwner[0])); + listIgnored = new JList<> (ign.toArray (new AvatarBDStateMachineOwner [0])); //listIgnored.setPreferredSize(new Dimension(200, 250)); - listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listIgnored.addListSelectionListener(this); JScrollPane scrollPane1 = new JScrollPane(listIgnored); panel1.add(scrollPane1, BorderLayout.CENTER); panel1.setPreferredSize(new Dimension(200, 250)); c.add(panel1, c2); - + // central buttons JPanel panel3 = new JPanel(); panel3.setLayout(gridbag1); @@ -193,45 +192,23 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe c.add(panel3, c2); - // validated list + // validated list JPanel panel2 = new JPanel(); panel2.setLayout(new BorderLayout()); panel2.setBorder(new javax.swing.border.TitledBorder("Blocks taken into account")); - listValidated = new JList<>(val.toArray(new AvatarBDStateMachineOwner[0])); + listValidated = new JList<> (val.toArray (new AvatarBDStateMachineOwner [0])); //listValidated.setPreferredSize(new Dimension(200, 250)); - listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listValidated.addListSelectionListener(this); JScrollPane scrollPane2 = new JScrollPane(listValidated); panel2.add(scrollPane2, BorderLayout.CENTER); panel2.setPreferredSize(new Dimension(200, 250)); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = GridBagConstraints.REMAINDER; //end row c.add(panel2, c2); - optimize = new JCheckBox("Optimize specification"); - optimize.setSelected(optimized); - c.add(optimize, c2); - c2.fill = GridBagConstraints.HORIZONTAL; - c2.gridwidth = 1; //end row - initMainButtons(c2, c, this, false, "Check syntax", "Cancel"); - - /*closeButton = new JButton("Start Syntax Analysis", IconManager.imgic37); - //closeButton.setPreferredSize(new Dimension(600, 50)); - closeButton.addActionListener(this); - closeButton.setPreferredSize(new Dimension(200, 30)); - - JPanel panel4 = new JPanel(); - panel4.setLayout(new FlowLayout()); - JButton cancelButton = new JButton("Cancel", IconManager.imgic27); - cancelButton.addActionListener(this); - cancelButton.setPreferredSize(new Dimension(200, 30)); - panel4.add(cancelButton); - panel4.add(closeButton); - c.add(panel4, c2);*/ - - // main panel; - /*JPanel panel6 = new JPanel(); + JPanel panel6 = new JPanel(); panel6.setLayout(new BorderLayout()); JPanel panel5 = new JPanel(); @@ -258,25 +235,21 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe panel6.add(panel5, BorderLayout.NORTH); panel6.add(panel4, BorderLayout.SOUTH); - c.add(panel6, c2);*/ + c.add(panel6, c2); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - if (evt.getSource() == closeButton) { - closeDialog(); - return; - } else if (evt.getSource() == cancelButton) { - cancelDialog(); - return; - } - - - // Compare the action command to the known actions. switch (command) { + case "Start Syntax Analysis": + closeDialog(); + break; + case "Cancel": + cancelDialog(); + break; case "addOneIgnored": addOneIgnored(); break; @@ -294,45 +267,45 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe private void addOneIgnored() { - for (AvatarBDStateMachineOwner o : this.listValidated.getSelectedValuesList()) { - ign.add(o); - val.remove(o); + for (AvatarBDStateMachineOwner o: this.listValidated.getSelectedValuesList ()) { + ign.add (o); + val.remove (o); } - listIgnored.setListData(ign.toArray(new AvatarBDStateMachineOwner[0])); - listValidated.setListData(val.toArray(new AvatarBDStateMachineOwner[0])); + listIgnored.setListData(ign.toArray (new AvatarBDStateMachineOwner[0])); + listValidated.setListData(val.toArray (new AvatarBDStateMachineOwner[0])); setButtons(); } private void addOneValidated() { - for (AvatarBDStateMachineOwner o : this.listIgnored.getSelectedValuesList()) { - val.add(o); - ign.remove(o); + for (AvatarBDStateMachineOwner o: this.listIgnored.getSelectedValuesList ()) { + val.add (o); + ign.remove (o); } - listIgnored.setListData(ign.toArray(new AvatarBDStateMachineOwner[0])); - listValidated.setListData(val.toArray(new AvatarBDStateMachineOwner[0])); + listIgnored.setListData(ign.toArray (new AvatarBDStateMachineOwner [0])); + listValidated.setListData(val.toArray (new AvatarBDStateMachineOwner [0])); setButtons(); } private void allValidated() { val.addAll(ign); - ign.clear(); - listIgnored.setListData(ign.toArray(new AvatarBDStateMachineOwner[0])); - listValidated.setListData(val.toArray(new AvatarBDStateMachineOwner[0])); + ign.clear (); + listIgnored.setListData(ign.toArray (new AvatarBDStateMachineOwner [0])); + listValidated.setListData(val.toArray (new AvatarBDStateMachineOwner [0])); setButtons(); } private void allIgnored() { ign.addAll(val); val.clear(); - listIgnored.setListData(ign.toArray(new AvatarBDStateMachineOwner[0])); - listValidated.setListData(val.toArray(new AvatarBDStateMachineOwner[0])); + listIgnored.setListData(ign.toArray (new AvatarBDStateMachineOwner [0])); + listValidated.setListData(val.toArray (new AvatarBDStateMachineOwner [0])); setButtons(); } public void closeDialog() { - back.clear(); + back.clear (); back.addAll(val); validated = val; @@ -365,13 +338,13 @@ public class JDialogSelectAvatarBlock extends JDialogBase implements ActionListe //listIgnored.clearSelection(); } - if (ign.size() == 0) { + if (ign.size() ==0) { allValidated.setEnabled(false); } else { allValidated.setEnabled(true); } - if (val.size() == 0) { + if (val.size() ==0) { allIgnored.setEnabled(false); closeButton.setEnabled(false); } else { diff --git a/src/main/java/ui/window/JDialogSelectCPDiagrams.java b/src/main/java/ui/window/JDialogSelectCPDiagrams.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSelectRequirements.java b/src/main/java/ui/window/JDialogSelectRequirements.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSelectSystemCAMSBlock.java b/src/main/java/ui/window/JDialogSelectSysCAMSComponent.java old mode 100755 new mode 100644 similarity index 64% rename from src/main/java/ui/window/JDialogSelectSystemCAMSBlock.java rename to src/main/java/ui/window/JDialogSelectSysCAMSComponent.java index 093e21dd964de36b208f18cef09aaa9a4fed2618..eada7f27cb8ad8dc4d80c9e3540db4da03a566ce --- a/src/main/java/ui/window/JDialogSelectSystemCAMSBlock.java +++ b/src/main/java/ui/window/JDialogSelectSysCAMSComponent.java @@ -1,420 +1,414 @@ -/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici - * - * ludovic.apvrille AT telecom-paristech.fr - * andrea.enrici AT telecom-paristech.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.window; - -import myutil.TraceManager; -import ui.util.IconManager; -import ui.TGComponent; -import ui.het.*; - -import javax.swing.*; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Arrays; -import java.util.List; -import java.util.Vector; - - -/** - * Class JDialogSelectSystemCAMSBlock - * Dialog for selecting systemC-AMS blocks - * Creation: 04/07/2017 - * @version 1.0 04/07/2017 - * @author Côme Demarigny - */ -public class JDialogSelectSystemCAMSBlock extends JDialogBase implements ActionListener, ListSelectionListener { - - public static Vector<TGComponent> validated, ignored; - private static boolean optimized = true; - - private Vector<TGComponent> val, ign, back; //val for validated, ign for ignored - - //subpanels - private JPanel panel1, panel2, panel3, panel4, panel5, panel6; - private JList<TGComponent> listIgnored; - private JList<TGComponent> listValidated; - private JButton allValidated; - private JButton addOneValidated; - private JButton addOneIgnored; - private JButton allIgnored; - protected JCheckBox optimize; - // protected JTextField clockField; - - /* Creates new form */ - public JDialogSelectSystemCAMSBlock( Frame f, Vector<TGComponent> _back, List<TGComponent> componentList, String title ) { - super(f, title, true); - - TraceManager.addDev( "Printing list of components: " + Arrays.toString( componentList.toArray()) ); - - back = _back; - if( ( validated == null ) || ( ignored == null ) ) { - val = makeNewVal( componentList ); //componentList must already contain something. - //originally contained in componentList - ign = new Vector<TGComponent>(); //empty - //val and ign are the lists that are printed in the Syntax Analysis window - } - else { - val = validated; //validated and ignored, the public vectors come from the instance of SystemCAMSPanel - ign = ignored; - checkBlock( val, componentList ); - checkBlock( ign, componentList ); - addNewBlock( val, componentList, ign ); - } - - initComponents(); - myInitComponents(); - pack(); - } - - //From componentList, filter out all the elements which are not TMLArchiNode - private Vector<TGComponent> makeNewVal( List<TGComponent> list ) { - - Vector<TGComponent> v = new Vector<TGComponent>(); - TGComponent tgc; - - for( int i = 0; i < list.size(); i++ ) { - tgc = list.get(i); - // System.out.println(tgc); - if (tgc instanceof CAMSBlock) { - v.addElement( tgc ); - } - } - return v; - } - - private void checkBlock( Vector<TGComponent> tobeChecked, List<TGComponent> source ) { - - CAMSBlock block; - - for(int i = 0; i < tobeChecked.size(); i++ ) { - if( tobeChecked.elementAt(i) instanceof CAMSBlock ){ - block = (CAMSBlock) tobeChecked.elementAt(i); - if( !source.contains(block) ) { - tobeChecked.removeElementAt(i); - i--; - } - } - } - } - - public void addNewBlock( Vector<TGComponent> added, List<TGComponent> source, Vector<TGComponent> notSource ) { - - TGComponent tgc; - - for( int i = 0; i < source.size(); i++ ) { - tgc = source.get(i); - if( ( tgc instanceof CAMSBlock ) && ( !added.contains(tgc) ) && ( !notSource.contains(tgc) ) ) { - added.addElement( tgc ); - System.out.println("New element"); - } - } - } - - private void myInitComponents() { - setButtons(); - } - - private void initComponents() { - - Container c = getContentPane(); - GridBagLayout gridbag1 = new GridBagLayout(); - GridBagConstraints c1 = new GridBagConstraints(); - GridBagLayout gridbag2 = new GridBagLayout(); - GridBagConstraints c2 = new GridBagConstraints(); - setFont( new Font( "Helvetica", Font.PLAIN, 14) ); - c.setLayout( new BorderLayout() ); - setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); - - c.setLayout(gridbag2); - c2.weighty = 1.0; - c2.weightx = 1.0; - c2.gridwidth = 1; - c2.fill = GridBagConstraints.HORIZONTAL; - c2.gridheight = 1; - - // ignored list - panel1 = new JPanel(); - panel1.setLayout( new BorderLayout() ); - panel1.setBorder( new javax.swing.border.TitledBorder( "Diagrams ignored" ) ); - listIgnored = new JList<TGComponent>( ign ); - //listIgnored.setPreferredSize(new Dimension(200, 250)); - listIgnored.setSelectionMode( ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); - listIgnored.addListSelectionListener( this ); - JScrollPane scrollPane1 = new JScrollPane( listIgnored ); - panel1.add( scrollPane1, BorderLayout.CENTER ); - panel1.setPreferredSize( new Dimension( 200, 250) ); - c.add( panel1, c2); - - - - // central buttons - panel3 = new JPanel(); - panel3.setLayout(gridbag1); - - c1.weighty = 1.0; - c1.weightx = 1.0; - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - c1.fill = GridBagConstraints.HORIZONTAL; - c1.gridheight = 1; - - allValidated = new JButton(IconManager.imgic50); - allValidated.setPreferredSize(new Dimension(50, 25)); - allValidated.addActionListener(this); - allValidated.setActionCommand("allValidated"); - panel3.add(allValidated, c1); - - addOneValidated = new JButton(IconManager.imgic48); - addOneValidated.setPreferredSize(new Dimension(50, 25)); - addOneValidated.addActionListener(this); - addOneValidated.setActionCommand("addOneValidated"); - panel3.add(addOneValidated, c1); - - panel3.add(new JLabel(" "), c1); - - addOneIgnored = new JButton(IconManager.imgic46); - addOneIgnored.addActionListener(this); - addOneIgnored.setPreferredSize(new Dimension(50, 25)); - addOneIgnored.setActionCommand("addOneIgnored"); - panel3.add(addOneIgnored, c1); - - allIgnored = new JButton(IconManager.imgic44); - allIgnored.addActionListener(this); - allIgnored.setPreferredSize(new Dimension(50, 25)); - allIgnored.setActionCommand("allIgnored"); - panel3.add(allIgnored, c1); - - c.add(panel3, c2); - - // validated list - panel2 = new JPanel(); - panel2.setLayout( new BorderLayout() ); - panel2.setBorder( new javax.swing.border.TitledBorder( "Diagrams taken into account" ) ); - listValidated = new JList<TGComponent>( val ); - //listValidated.setPreferredSize(new Dimension(200, 250)); - listValidated.setSelectionMode( ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); - listValidated.addListSelectionListener( this ); - JScrollPane scrollPane2 = new JScrollPane( listValidated ); - panel2.add( scrollPane2, BorderLayout.CENTER ); - panel2.setPreferredSize( new Dimension(200, 250) ); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - c.add( panel2, c2 ); - - // main panel; - panel6 = new JPanel(); - panel6.setLayout(new BorderLayout()); - - panel5 = new JPanel(); - /*GridBagLayout gridbag3 = new GridBagLayout(); - GridBagConstraints c3 = new GridBagConstraints(); - panel5.setLayout(gridbag3); - - c3.weighty = 1.0; - c3.weightx = 1.0; - c3.fill = GridBagConstraints.HORIZONTAL; - c3.gridheight = 1; - - c3.gridwidth = GridBagConstraints.REMAINDER; //end row - // optimize = new JCheckBox("Optimize TML specification"); - // optimize.setSelected(optimized); - // panel5.add(optimize, c2); - - c3.gridwidth = 1; //end row - // panel5.add(new JLabel("Master clock (in MHz)"), c2); - // c2.gridwidth = GridBagConstraints.REMAINDER; //end row - // clockField = new JTextField("" + clock); - // panel5.add(clockField, c2);*/ - - panel4 = new JPanel(); - panel4.setLayout(new FlowLayout()); - - closeButton = new JButton("Start Syntax Analysis", IconManager.imgic37); - //closeButton.setPreferredSize(new Dimension(600, 50)); - closeButton.addActionListener(this); - closeButton.setPreferredSize(new Dimension(200, 30)); - - cancelButton = new JButton("Cancel", IconManager.imgic27); - cancelButton.addActionListener(this); - cancelButton.setPreferredSize(new Dimension(200, 30)); - panel4.add(cancelButton); - panel4.add(closeButton); - - panel6.add(panel5, BorderLayout.NORTH); - panel6.add(panel4, BorderLayout.SOUTH); - - c.add(panel6, c2); - - } - - public void actionPerformed( ActionEvent evt ) { - String command = evt.getActionCommand(); - - if (evt.getSource() == closeButton) { - closeDialog(); - return; - } else if (evt.getSource() == cancelButton) { - cancelDialog(); - return; - } - // Compare the action command to the known actions. - if (command.equals("addOneIgnored")) { - addOneIgnored(); - } else if (command.equals("addOneValidated")) { - addOneValidated(); - } else if (command.equals("allValidated")) { - allValidated(); - } else if (command.equals("allIgnored")) { - allIgnored(); - } - } - - - private void addOneIgnored() { - int [] list = listValidated.getSelectedIndices(); - Vector<TGComponent> v = new Vector<TGComponent>(); - TGComponent o; - for (int i=0; i<list.length; i++){ - o = val.elementAt(list[i]); - ign.addElement(o); - v.addElement(o); - } - - val.removeAll(v); - listIgnored.setListData(ign); - listValidated.setListData(val); - setButtons(); - } - - private void addOneValidated() { - int [] list = listIgnored.getSelectedIndices(); - Vector<TGComponent> v = new Vector<TGComponent>(); - TGComponent o; - - for (int i=0; i<list.length; i++){ - o = ign.elementAt(list[i]); - val.addElement(o); - v.addElement(o); - } - - ign.removeAll(v); - listIgnored.setListData(ign); - listValidated.setListData(val); - setButtons(); - } - - private void allValidated() { - val.addAll(ign); - ign.removeAllElements(); - listIgnored.setListData(ign); - listValidated.setListData(val); - setButtons(); - } - - private void allIgnored() { - ign.addAll(val); - val.removeAllElements(); - listIgnored.setListData(ign); - listValidated.setListData(val); - setButtons(); - } - - - public void closeDialog() { - - back.removeAllElements(); - - for( int i = 0; i < val.size(); i++ ) { - back.addElement( val.elementAt(i) ); - } - validated = val; - ignored = ign; - dispose(); - } - - public void cancelDialog() { - dispose(); - } - - private void setButtons() { - int i1 = listIgnored.getSelectedIndex(); - int i2 = listValidated.getSelectedIndex(); - - if (i1 == -1) { - addOneValidated.setEnabled(false); - } else { - addOneValidated.setEnabled(true); - //listValidated.clearSelection(); - } - - if (i2 == -1) { - addOneIgnored.setEnabled(false); - } else { - addOneIgnored.setEnabled(true); - //listIgnored.clearSelection(); - } - - if (ign.size() ==0) { - allValidated.setEnabled(false); - } else { - allValidated.setEnabled(true); - } - - if (val.size() ==0) { - allIgnored.setEnabled(false); - closeButton.setEnabled(false); - } else { - allIgnored.setEnabled(true); - closeButton.setEnabled(true); - } - } - - public void valueChanged(ListSelectionEvent e) { - setButtons(); - } - - public boolean getOptimize() { - return optimized; - } -} +/* 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.window; + +import ui.util.IconManager; +import ui.TGComponent; +import ui.syscams.SysCAMSCompositeComponent; +import ui.syscams.SysCAMSPrimitiveComponent; +import ui.syscams.SysCAMSRemoteCompositeComponent; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.LinkedList; +import java.util.List; +import java.util.Vector; + +/** + * Class JDialogSelectSysCAMSComponent + * Dialog for managing primitive components to be validated + * Creation: 27/04/2018 + * @version 1.0 27/04/2018 + * @author Irina Kit Yan LEE + */ + +@SuppressWarnings("serial") + +public class JDialogSelectSysCAMSComponent extends JDialogBase implements ActionListener, ListSelectionListener { + public static Vector<TGComponent> validated, ignored; + private static boolean optimized = true; + + private Vector<TGComponent> val; + private Vector<TGComponent> ign, back; + + //subpanels + private JPanel panel1, panel2, panel3, panel4, panel5, panel6; + private JList<TGComponent> listIgnored; + private JList<TGComponent> listValidated; + private JButton allValidated; + private JButton addOneValidated; + private JButton addOneIgnored; + private JButton allIgnored; + protected JCheckBox optimize; + + /** Creates new form */ + public JDialogSelectSysCAMSComponent(Frame f, Vector<TGComponent> _back, List<TGComponent> componentList, String title) { + super(f, title, true); + + back = _back; + + List<TGComponent> pcl = new LinkedList<TGComponent>(); + makeComponentList(pcl, componentList); + + if ((validated == null) || (ignored == null)) { + val = makeNewVal(pcl); + ign = new Vector<TGComponent>(); + } else { + val = validated; + ign = ignored; + checkTask(val, pcl); + checkTask(ign, pcl); + addNewTask(val, pcl, ign); + } + + initComponents(); + myInitComponents(); + pack(); + } + + private void makeComponentList(List<TGComponent> cs, List<TGComponent> lcs) { + TGComponent tgc; + SysCAMSCompositeComponent ccomp; + + for(int i=0; i<lcs.size(); i++) { + tgc = lcs.get(i); + if (tgc instanceof SysCAMSCompositeComponent) { + ccomp = (SysCAMSCompositeComponent)tgc; + cs.addAll(ccomp.getAllPrimitiveComponents()); + } + if (tgc instanceof SysCAMSPrimitiveComponent) { + cs.add(tgc); + } + + if (tgc instanceof SysCAMSRemoteCompositeComponent) { + cs.addAll(((SysCAMSRemoteCompositeComponent)tgc).getAllPrimitiveComponents()); + } + } + } + + private Vector<TGComponent> makeNewVal( List<TGComponent> list) { + Vector<TGComponent> v = new Vector<TGComponent>(); + TGComponent tgc; + + for(int i=0; i<list.size(); i++) { + tgc = list.get(i); + //System.out.println(tgc); + if (tgc instanceof SysCAMSPrimitiveComponent) { + v.addElement(tgc); + } + } + return v; + } + + private void checkTask(Vector<? extends TGComponent> tobeChecked, List<TGComponent> source) { + TGComponent t; + + for(int i=0; i<tobeChecked.size(); i++) { + t = tobeChecked.elementAt(i); + + if (!source.contains(t)) { + tobeChecked.removeElementAt(i); + i--; + } + } + } + + public void addNewTask(Vector<TGComponent> added, List<TGComponent> source, Vector<TGComponent> notSource) { + TGComponent tgc; + + for(int i=0; i<source.size(); i++) { + tgc = source.get(i); + + if ((tgc instanceof SysCAMSPrimitiveComponent) && (!added.contains(tgc)) && (!notSource.contains(tgc))){ + added.addElement( tgc ) ; + //System.out.println("New element"); + } + } + } + + private void myInitComponents() { + setButtons(); + } + + private void initComponents() { + Container c = getContentPane(); + GridBagLayout gridbag1 = new GridBagLayout(); + GridBagConstraints c1 = new GridBagConstraints(); + GridBagLayout gridbag2 = new GridBagLayout(); + GridBagConstraints c2 = new GridBagConstraints(); + setFont(new Font("Helvetica", Font.PLAIN, 14)); + + c.setLayout(gridbag2); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + c2.weighty = 1.0; + c2.weightx = 1.0; + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.gridheight = 1; + + // ignored list + panel1 = new JPanel(); + panel1.setLayout(new BorderLayout()); + panel1.setBorder(new javax.swing.border.TitledBorder("Ignored components")); + listIgnored = new JList<TGComponent>(ign); + //listIgnored.setPreferredSize(new Dimension(200, 250)); + listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); + listIgnored.addListSelectionListener(this); + JScrollPane scrollPane1 = new JScrollPane(listIgnored); + panel1.add(scrollPane1, BorderLayout.CENTER); + panel1.setPreferredSize(new Dimension(200, 250)); + c.add(panel1, c2); + + + + // central buttons + panel3 = new JPanel(); + panel3.setLayout(gridbag1); + + c1.weighty = 1.0; + c1.weightx = 1.0; + c1.gridwidth = GridBagConstraints.REMAINDER; //end row + c1.fill = GridBagConstraints.HORIZONTAL; + c1.gridheight = 1; + + allValidated = new JButton(IconManager.imgic50); + allValidated.setPreferredSize(new Dimension(50, 25)); + allValidated.addActionListener(this); + allValidated.setActionCommand("allValidated"); + panel3.add(allValidated, c1); + + addOneValidated = new JButton(IconManager.imgic48); + addOneValidated.setPreferredSize(new Dimension(50, 25)); + addOneValidated.addActionListener(this); + addOneValidated.setActionCommand("addOneValidated"); + panel3.add(addOneValidated, c1); + + panel3.add(new JLabel(" "), c1); + + addOneIgnored = new JButton(IconManager.imgic46); + addOneIgnored.addActionListener(this); + addOneIgnored.setPreferredSize(new Dimension(50, 25)); + addOneIgnored.setActionCommand("addOneIgnored"); + panel3.add(addOneIgnored, c1); + + allIgnored = new JButton(IconManager.imgic44); + allIgnored.addActionListener(this); + allIgnored.setPreferredSize(new Dimension(50, 25)); + allIgnored.setActionCommand("allIgnored"); + panel3.add(allIgnored, c1); + + c.add(panel3, c2); + + // validated list + panel2 = new JPanel(); + panel2.setLayout(new BorderLayout()); + panel2.setBorder(new javax.swing.border.TitledBorder("Used components")); + listValidated = new JList<TGComponent>(val); + //listValidated.setPreferredSize(new Dimension(200, 250)); + listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); + listValidated.addListSelectionListener(this); + JScrollPane scrollPane2 = new JScrollPane(listValidated); + panel2.add(scrollPane2, BorderLayout.CENTER); + panel2.setPreferredSize(new Dimension(200, 250)); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + c.add(panel2, c2); + + // main panel; + panel6 = new JPanel(); + panel6.setLayout(new BorderLayout()); + + panel5 = new JPanel(); + panel5.setLayout(new FlowLayout()); + + optimize = new JCheckBox("Optimize TML specification"); + optimize.setSelected(optimized); + panel5.add(optimize); + + panel4 = new JPanel(); + panel4.setLayout(new FlowLayout()); + + closeButton = new JButton("Start Syntax Analysis", IconManager.imgic37); + //closeButton.setPreferredSize(new Dimension(600, 50)); + closeButton.addActionListener(this); + closeButton.setPreferredSize(new Dimension(200, 30)); + + cancelButton = new JButton("Cancel", IconManager.imgic27); + cancelButton.addActionListener(this); + cancelButton.setPreferredSize(new Dimension(200, 30)); + panel4.add(cancelButton); + panel4.add(closeButton); + + panel6.add(panel5, BorderLayout.NORTH); + panel6.add(panel4, BorderLayout.SOUTH); + + c.add(panel6, c2); + + } + + public void actionPerformed(ActionEvent evt) { + String command = evt.getActionCommand(); + + // Compare the action command to the known actions. + if (command.equals("Start Syntax Analysis")) { + closeDialog(); + } else if (command.equals("Cancel")) { + cancelDialog(); + } else if (command.equals("addOneIgnored")) { + addOneIgnored(); + } else if (command.equals("addOneValidated")) { + addOneValidated(); + } else if (command.equals("allValidated")) { + allValidated(); + } else if (command.equals("allIgnored")) { + allIgnored(); + } + } + + + private void addOneIgnored() { + int [] list = listValidated.getSelectedIndices(); + Vector<TGComponent> v = new Vector<TGComponent>(); + TGComponent o; + for (int i=0; i<list.length; i++){ + o = val.elementAt(list[i]); + ign.addElement(o); + v.addElement(o); + } + + val.removeAll(v); + listIgnored.setListData(ign); + listValidated.setListData(val); + setButtons(); + } + + private void addOneValidated() { + int [] list = listIgnored.getSelectedIndices(); + Vector<TGComponent> v = new Vector<TGComponent>(); + TGComponent o; + for (int i=0; i<list.length; i++){ + o = ign.elementAt(list[i]); + val.addElement(o); + v.addElement(o); + } + + ign.removeAll(v); + listIgnored.setListData(ign); + listValidated.setListData(val); + setButtons(); + } + + private void allValidated() { + val.addAll(ign); + ign.removeAllElements(); + listIgnored.setListData(ign); + listValidated.setListData(val); + setButtons(); + } + + private void allIgnored() { + ign.addAll(val); + val.removeAllElements(); + listIgnored.setListData(ign); + listValidated.setListData(val); + setButtons(); + } + + + public void closeDialog() { + back.removeAllElements(); + for(int i=0; i<val.size(); i++) { + back.addElement(val.elementAt(i)); + } + validated = val; + ignored = ign; + optimized = optimize.isSelected(); + dispose(); + } + + public void cancelDialog() { + dispose(); + } + + private void setButtons() { + int i1 = listIgnored.getSelectedIndex(); + int i2 = listValidated.getSelectedIndex(); + + if (i1 == -1) { + addOneValidated.setEnabled(false); + } else { + addOneValidated.setEnabled(true); + //listValidated.clearSelection(); + } + + if (i2 == -1) { + addOneIgnored.setEnabled(false); + } else { + addOneIgnored.setEnabled(true); + //listIgnored.clearSelection(); + } + + if (ign.size() ==0) { + allValidated.setEnabled(false); + } else { + allValidated.setEnabled(true); + } + + if (val.size() ==0) { + allIgnored.setEnabled(false); + closeButton.setEnabled(false); + } else { + allIgnored.setEnabled(true); + closeButton.setEnabled(true); + } + } + + + public void valueChanged(ListSelectionEvent e) { + setButtons(); + } + + public boolean getOptimize() { + return optimized; + } +} diff --git a/src/main/java/ui/window/JDialogSelectTMLComponent.java b/src/main/java/ui/window/JDialogSelectTMLComponent.java old mode 100755 new mode 100644 index 52117c43b071cd1e593dba399313d56eca4e43e9..d3c5252b81ecb1d1a44059d3c0e63c798d48dd04 --- a/src/main/java/ui/window/JDialogSelectTMLComponent.java +++ b/src/main/java/ui/window/JDialogSelectTMLComponent.java @@ -37,13 +37,15 @@ */ + + package ui.window; +import ui.util.IconManager; import ui.TGComponent; import ui.tmlcompd.TMLCCompositeComponent; import ui.tmlcompd.TMLCPrimitiveComponent; import ui.tmlcompd.TMLCRemoteCompositeComponent; -import ui.util.IconManager; import javax.swing.*; import javax.swing.event.ListSelectionEvent; @@ -57,14 +59,13 @@ import java.util.Vector; /** - * Class JDialogSelectTMLComponent - * Dialog for managing primitive components to be validated - * Creation: 28/03/2008 - * - * @author Ludovic APVRILLE - * @version 1.0 28/03/2008 + * Class JDialogSelectTMLComponent + * Dialog for managing primitive components to be validated + * Creation: 28/03/2008 + * @version 1.0 28/03/2008 + * @author Ludovic APVRILLE */ -public class JDialogSelectTMLComponent extends JDialogBase implements ActionListener, ListSelectionListener { +public class JDialogSelectTMLComponent extends JDialogBase implements ActionListener, ListSelectionListener { public static Vector<TGComponent> validated, ignored; private static boolean optimized = true; @@ -81,9 +82,7 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList private JButton allIgnored; protected JCheckBox optimize; - /** - * Creates new form - */ + /** Creates new form */ public JDialogSelectTMLComponent(Frame f, Vector<TGComponent> _back, List<TGComponent> componentList, String title) { super(f, title, true); @@ -112,10 +111,10 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList TGComponent tgc; TMLCCompositeComponent ccomp; - for (int i = 0; i < lcs.size(); i++) { + for(int i=0; i<lcs.size(); i++) { tgc = lcs.get(i); if (tgc instanceof TMLCCompositeComponent) { - ccomp = (TMLCCompositeComponent) tgc; + ccomp = (TMLCCompositeComponent)tgc; cs.addAll(ccomp.getAllPrimitiveComponents()); } if (tgc instanceof TMLCPrimitiveComponent) { @@ -123,16 +122,16 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList } if (tgc instanceof TMLCRemoteCompositeComponent) { - cs.addAll(((TMLCRemoteCompositeComponent) tgc).getAllPrimitiveComponents()); + cs.addAll(((TMLCRemoteCompositeComponent)tgc).getAllPrimitiveComponents()); } } } - private Vector<TGComponent> makeNewVal(List<TGComponent> list) { + private Vector<TGComponent> makeNewVal( List<TGComponent> list) { Vector<TGComponent> v = new Vector<TGComponent>(); TGComponent tgc; - for (int i = 0; i < list.size(); i++) { + for(int i=0; i<list.size(); i++) { tgc = list.get(i); //System.out.println(tgc); if (tgc instanceof TMLCPrimitiveComponent) { @@ -143,11 +142,11 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList } private void checkTask(Vector<? extends TGComponent> tobeChecked, List<TGComponent> source) { - TGComponent t; + TGComponent t; - for (int i = 0; i < tobeChecked.size(); i++) { + for(int i=0; i<tobeChecked.size(); i++) { t = tobeChecked.elementAt(i); - + if (!source.contains(t)) { tobeChecked.removeElementAt(i); i--; @@ -158,11 +157,11 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList public void addNewTask(Vector<TGComponent> added, List<TGComponent> source, Vector<TGComponent> notSource) { TGComponent tgc; - for (int i = 0; i < source.size(); i++) { + for(int i=0; i<source.size(); i++) { tgc = source.get(i); - - if ((tgc instanceof TMLCPrimitiveComponent) && (!added.contains(tgc)) && (!notSource.contains(tgc))) { - added.addElement(tgc); + + if ((tgc instanceof TMLCPrimitiveComponent) && (!added.contains(tgc)) && (!notSource.contains(tgc))){ + added.addElement( tgc ) ; //System.out.println("New element"); } } @@ -176,17 +175,17 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList Container c = getContentPane(); GridBagLayout gridbag1 = new GridBagLayout(); GridBagConstraints c1 = new GridBagConstraints(); - GridBagLayout gridbag2 = new GridBagLayout(); + GridBagLayout gridbag2 = new GridBagLayout(); GridBagConstraints c2 = new GridBagConstraints(); setFont(new Font("Helvetica", Font.PLAIN, 14)); - c.setLayout(gridbag2); + c.setLayout(gridbag2); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - c2.weighty = 1.0; + c2.weighty = 1.0; c2.weightx = 1.0; - c2.gridwidth = 1; - c2.fill = GridBagConstraints.BOTH; + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; c2.gridheight = 1; // ignored list @@ -195,7 +194,7 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList panel1.setBorder(new javax.swing.border.TitledBorder("Ignored components")); listIgnored = new JList<TGComponent>(ign); //listIgnored.setPreferredSize(new Dimension(200, 250)); - listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listIgnored.addListSelectionListener(this); JScrollPane scrollPane1 = new JScrollPane(listIgnored); panel1.add(scrollPane1, BorderLayout.CENTER); @@ -203,6 +202,7 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList c.add(panel1, c2); + // central buttons panel3 = new JPanel(); panel3.setLayout(gridbag1); @@ -238,33 +238,25 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList allIgnored.setPreferredSize(new Dimension(50, 25)); allIgnored.setActionCommand("allIgnored"); panel3.add(allIgnored, c1); - + c.add(panel3, c2); - // validated list + // validated list panel2 = new JPanel(); panel2.setLayout(new BorderLayout()); panel2.setBorder(new javax.swing.border.TitledBorder("Used components")); listValidated = new JList<TGComponent>(val); //listValidated.setPreferredSize(new Dimension(200, 250)); - listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listValidated.addListSelectionListener(this); JScrollPane scrollPane2 = new JScrollPane(listValidated); panel2.add(scrollPane2, BorderLayout.CENTER); panel2.setPreferredSize(new Dimension(200, 250)); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = GridBagConstraints.REMAINDER; //end row c.add(panel2, c2); - optimize = new JCheckBox("Optimize TML specification"); - optimize.setSelected(optimized); - c.add(optimize, c2); - c2.fill = GridBagConstraints.HORIZONTAL; - c2.gridwidth = 1; //end row - initMainButtons(c2, c, this, false, "Check syntax", "Cancel"); - - // main panel; - /*panel6 = new JPanel(); + panel6 = new JPanel(); panel6.setLayout(new BorderLayout()); panel5 = new JPanel(); @@ -291,23 +283,19 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList panel6.add(panel5, BorderLayout.NORTH); panel6.add(panel4, BorderLayout.SOUTH); - c.add(panel6, c2);*/ + c.add(panel6, c2); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - if (evt.getSource() == closeButton) { + // Compare the action command to the known actions. + if (command.equals("Start Syntax Analysis")) { closeDialog(); - return; - } else if (evt.getSource() == cancelButton) { + } else if (command.equals("Cancel")) { cancelDialog(); - return; - } - - // Compare the action command to the known actions. - if (command.equals("addOneIgnored")) { + } else if (command.equals("addOneIgnored")) { addOneIgnored(); } else if (command.equals("addOneValidated")) { addOneValidated(); @@ -320,10 +308,10 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList private void addOneIgnored() { - int[] list = listValidated.getSelectedIndices(); + int [] list = listValidated.getSelectedIndices(); Vector<TGComponent> v = new Vector<TGComponent>(); TGComponent o; - for (int i = 0; i < list.length; i++) { + for (int i=0; i<list.length; i++){ o = val.elementAt(list[i]); ign.addElement(o); v.addElement(o); @@ -336,10 +324,10 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList } private void addOneValidated() { - int[] list = listIgnored.getSelectedIndices(); + int [] list = listIgnored.getSelectedIndices(); Vector<TGComponent> v = new Vector<TGComponent>(); TGComponent o; - for (int i = 0; i < list.length; i++) { + for (int i=0; i<list.length; i++){ o = ign.elementAt(list[i]); val.addElement(o); v.addElement(o); @@ -370,7 +358,7 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList public void closeDialog() { back.removeAllElements(); - for (int i = 0; i < val.size(); i++) { + for(int i=0; i<val.size(); i++) { back.addElement(val.elementAt(i)); } validated = val; @@ -401,13 +389,13 @@ public class JDialogSelectTMLComponent extends JDialogBase implements ActionList //listIgnored.clearSelection(); } - if (ign.size() == 0) { + if (ign.size() ==0) { allValidated.setEnabled(false); } else { allValidated.setEnabled(true); } - if (val.size() == 0) { + if (val.size() ==0) { allIgnored.setEnabled(false); closeButton.setEnabled(false); } else { diff --git a/src/main/java/ui/window/JDialogSelectTMLNodes.java b/src/main/java/ui/window/JDialogSelectTMLNodes.java old mode 100755 new mode 100644 index 7d03fa5439b69e5df421be062ef604cefe282838..30da97e51497df29f46261d04b1a344e4eff952c --- a/src/main/java/ui/window/JDialogSelectTMLNodes.java +++ b/src/main/java/ui/window/JDialogSelectTMLNodes.java @@ -37,12 +37,13 @@ */ + + package ui.window; -import ui.TGComponent; -import ui.TGComponentPlugin; -import ui.tmldd.TMLArchiNode; +import ui.*; import ui.util.IconManager; +import ui.tmldd.TMLArchiNode; import javax.swing.*; import javax.swing.event.ListSelectionEvent; @@ -54,14 +55,13 @@ import java.util.Vector; /** - * Class JDialogSelectTMLNodes - * Dialog for managing nodes to be validated - * Creation: 19/09/2007 - * - * @author Ludovic APVRILLE - * @version 1.0 19/09/2007 + * Class JDialogSelectTMLNodes + * Dialog for managing nodes to be validated + * Creation: 19/09/2007 + * @version 1.0 19/09/2007 + * @author Ludovic APVRILLE */ -public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener, ListSelectionListener { +public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener, ListSelectionListener { public static Vector<TGComponent> validated, ignored; private static boolean optimized = true; @@ -80,9 +80,7 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener protected JCheckBox optimize; protected JTextField clockField; - /** - * Creates new form - */ + /** Creates new form */ public JDialogSelectTMLNodes(Frame f, Vector<TGComponent> _back, java.util.List<TGComponent> componentList, String title, int _clock) { super(f, title, true); @@ -106,30 +104,30 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener pack(); } - private Vector<TGComponent> makeNewVal(java.util.List<TGComponent> list) { + private Vector<TGComponent> makeNewVal( java.util.List<TGComponent> list) { Vector<TGComponent> v = new Vector<TGComponent>(); TGComponent tgc; - for (int i = 0; i < list.size(); i++) { + for(int i=0; i<list.size(); i++) { tgc = list.get(i); //System.out.println(tgc); if (tgc instanceof TMLArchiNode) { v.addElement(tgc); } - if (tgc instanceof TGComponentPlugin) { - v.addElement(tgc); - } + if (tgc instanceof TGComponentPlugin) { + v.addElement(tgc); + } } - + return v; } private void checkNode(Vector<TGComponent> tobeChecked, java.util.List<TGComponent> source) { - TGComponent t; + TGComponent t; - for (int i = 0; i < tobeChecked.size(); i++) { + for(int i=0; i<tobeChecked.size(); i++) { t = tobeChecked.elementAt(i); - + if (!source.contains(t)) { tobeChecked.removeElementAt(i); i--; @@ -140,10 +138,10 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener public void addNewNode(Vector<TGComponent> added, java.util.List<TGComponent> source, Vector<TGComponent> notSource) { TGComponent tgc; - for (int i = 0; i < source.size(); i++) { + for(int i=0; i<source.size(); i++) { tgc = source.get(i); - - if (((tgc instanceof TMLArchiNode) || (tgc instanceof TGComponentPlugin)) && (!added.contains(tgc)) && (!notSource.contains(tgc))) { + + if (((tgc instanceof TMLArchiNode) || (tgc instanceof TGComponentPlugin)) && (!added.contains(tgc)) && (!notSource.contains(tgc))){ added.addElement(tgc); //System.out.println("New element"); } @@ -158,16 +156,16 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener Container c = getContentPane(); GridBagLayout gridbag1 = new GridBagLayout(); GridBagConstraints c1 = new GridBagConstraints(); - GridBagLayout gridbag2 = new GridBagLayout(); + GridBagLayout gridbag2 = new GridBagLayout(); GridBagConstraints c2 = new GridBagConstraints(); setFont(new Font("Helvetica", Font.PLAIN, 14)); c.setLayout(gridbag2); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - - c2.weighty = 1.0; + + c2.weighty = 1.0; c2.weightx = 1.0; - c2.gridwidth = 1; - c2.fill = GridBagConstraints.BOTH; + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; c2.gridheight = 1; // ignored list @@ -176,7 +174,7 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener panel1.setBorder(new javax.swing.border.TitledBorder("Nodes ignored")); listIgnored = new JList<TGComponent>(ign); //listIgnored.setPreferredSize(new Dimension(200, 250)); - listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listIgnored.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listIgnored.addListSelectionListener(this); JScrollPane scrollPane1 = new JScrollPane(listIgnored); panel1.add(scrollPane1, BorderLayout.CENTER); @@ -184,6 +182,7 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener c.add(panel1, c2); + // central buttons panel3 = new JPanel(); panel3.setLayout(gridbag1); @@ -222,37 +221,22 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener c.add(panel3, c2); - // validated list + // validated list panel2 = new JPanel(); panel2.setLayout(new BorderLayout()); panel2.setBorder(new javax.swing.border.TitledBorder("Nodes taken into account")); listValidated = new JList<TGComponent>(val); //listValidated.setPreferredSize(new Dimension(200, 250)); - listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + listValidated.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); listValidated.addListSelectionListener(this); JScrollPane scrollPane2 = new JScrollPane(listValidated); panel2.add(scrollPane2, BorderLayout.CENTER); panel2.setPreferredSize(new Dimension(200, 250)); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = GridBagConstraints.REMAINDER; //end row c.add(panel2, c2); - - optimize = new JCheckBox("Optimize TML specification"); - optimize.setSelected(optimized); - c.add(optimize, c2); - c2.gridwidth = 1; //end row - c.add(new JLabel("Master clock (in MHz)"), c2); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - clockField = new JTextField("" + clock); - c.add(clockField, c2); - - c2.fill = GridBagConstraints.HORIZONTAL; - c2.gridwidth = 1; //end row - initMainButtons(c2, c, this, false, "Check syntax", "Cancel"); - - // main panel; - /*panel6 = new JPanel(); + panel6 = new JPanel(); panel6.setLayout(new BorderLayout()); panel5 = new JPanel(); @@ -293,23 +277,19 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener panel6.add(panel5, BorderLayout.NORTH); panel6.add(panel4, BorderLayout.SOUTH); - c.add(panel6, c2);*/ + c.add(panel6, c2); } - public void actionPerformed(ActionEvent evt) { + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - if (evt.getSource() == closeButton) { + // Compare the action command to the known actions. + if (command.equals("Start Syntax Analysis")) { closeDialog(); - return; - } else if (evt.getSource() == cancelButton) { + } else if (command.equals("Cancel")) { cancelDialog(); - return; - } - - // Compare the action command to the known actions. - if (command.equals("addOneIgnored")) { + } else if (command.equals("addOneIgnored")) { addOneIgnored(); } else if (command.equals("addOneValidated")) { addOneValidated(); @@ -322,10 +302,10 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener private void addOneIgnored() { - int[] list = listValidated.getSelectedIndices(); + int [] list = listValidated.getSelectedIndices(); Vector<TGComponent> v = new Vector<TGComponent>(); TGComponent o; - for (int i = 0; i < list.length; i++) { + for (int i=0; i<list.length; i++){ o = val.elementAt(list[i]); ign.addElement(o); v.addElement(o); @@ -338,11 +318,11 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener } private void addOneValidated() { - int[] list = listIgnored.getSelectedIndices(); + int [] list = listIgnored.getSelectedIndices(); Vector<TGComponent> v = new Vector<TGComponent>(); TGComponent o; - - for (int i = 0; i < list.length; i++) { + + for (int i=0; i<list.length; i++){ o = ign.elementAt(list[i]); val.addElement(o); v.addElement(o); @@ -373,7 +353,7 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener public void closeDialog() { back.removeAllElements(); - for (int i = 0; i < val.size(); i++) { + for(int i=0; i<val.size(); i++) { back.addElement(val.elementAt(i)); } validated = val; @@ -403,13 +383,13 @@ public class JDialogSelectTMLNodes extends JDialogBase implements ActionListener //listIgnored.clearSelection(); } - if (ign.size() == 0) { + if (ign.size() ==0) { allValidated.setEnabled(false); } else { allValidated.setEnabled(true); } - if (val.size() == 0) { + if (val.size() ==0) { allIgnored.setEnabled(false); closeButton.setEnabled(false); } else { diff --git a/src/main/java/ui/window/JDialogSelectTMLTask.java b/src/main/java/ui/window/JDialogSelectTMLTask.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSimulation.java b/src/main/java/ui/window/JDialogSimulation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSynchro.java b/src/main/java/ui/window/JDialogSynchro.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogSysCAMSBlockDE.java b/src/main/java/ui/window/JDialogSysCAMSBlockDE.java new file mode 100644 index 0000000000000000000000000000000000000000..3fd9d549add127f1457a6a3972e1b5554e9d6963 --- /dev/null +++ b/src/main/java/ui/window/JDialogSysCAMSBlockDE.java @@ -0,0 +1,184 @@ +/* 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.window; + +import ui.syscams.*; +import ui.util.IconManager; + +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + +/** + * Class JDialogSystemCAMSBlockDE + * Dialog for managing of SystemC-AMS DE Block + * Creation: 26/04/2018 + * @version 1.0 26/04/2018 + * @author Irina Kit Yan LEE +*/ + +@SuppressWarnings("serial") + +public class JDialogSysCAMSBlockDE extends JDialog implements ActionListener { + + /** Access to ActionPerformed **/ + private JTextField nameTextField; + private JTextField periodTextField; + + /** Parameters **/ + private SysCAMSBlockDE block; + + /** Constructor **/ + public JDialogSysCAMSBlockDE(SysCAMSBlockDE block) { + /** Set JDialog **/ + this.setTitle("Setting TDF Block Attributes"); + this.setSize(500, 168); + this.setLocationRelativeTo(null); + this.setVisible(true); + this.setAlwaysOnTop(true); + this.setResizable(false); + + /** Parameters **/ + this.block = block; + + dialog(); + } + + public void dialog() { + /** JPanel **/ + JPanel mainPanel = new JPanel(new BorderLayout()); + this.add(mainPanel); + + /** JTabbedPane **/ + JPanel attributesMainPanel = new JPanel(); + mainPanel.add(attributesMainPanel, BorderLayout.NORTH); // add tab to main panel + + // --- Attributes GridLayout ---// + attributesMainPanel.setLayout(new BorderLayout()); + + // Box for Attributes + Box attributesBox = Box.createVerticalBox(); + attributesBox.setBorder(BorderFactory.createTitledBorder("Setting DE block attributes")); + + // BorderLayout for Adding Attributes + JPanel attributesBoxPanel = new JPanel(new GridLayout(2, 2, 0, 10)); + + // GridLayout for name + JLabel nameLabel = new JLabel("Name : "); + attributesBoxPanel.add(nameLabel); + if (block.getValue().toString().equals("")) { // name empty + nameTextField = new JTextField(10); + } else { + nameTextField = new JTextField(block.getValue().toString(), 10); // name not empty + } + attributesBoxPanel.add(nameTextField); + + // GridLayout for period + JLabel periodLabel = new JLabel("Period Tm : "); + attributesBoxPanel.add(periodLabel); + if (block.getPeriod() == -1) { + periodTextField = new JTextField(10); + } else { + periodTextField = new JTextField(Integer.toString(block.getPeriod()), 10); + } + attributesBoxPanel.add(periodTextField); + attributesBox.add(attributesBoxPanel); // add border to box + + attributesMainPanel.add(attributesBox, BorderLayout.NORTH); // add box to grid + + // Down Side + JPanel downPanel = new JPanel(new GridLayout(1, 2)); + + JButton saveCloseButton = new JButton("Save and close"); + saveCloseButton.setIcon(IconManager.imgic25); + saveCloseButton.setActionCommand("Save_Close"); + saveCloseButton.addActionListener(this); + downPanel.add(saveCloseButton); + + JButton cancelButton = new JButton("Cancel"); + cancelButton.setIcon(IconManager.imgic27); + cancelButton.setActionCommand("Cancel"); + cancelButton.addActionListener(this); + downPanel.add(cancelButton); + + mainPanel.add(downPanel, BorderLayout.CENTER); + } + + public void actionPerformed(ActionEvent e) { + if ("Save_Close".equals(e.getActionCommand())) { + /** Save the name of the block into listNameTDF **/ + block.setValue(new String(nameTextField.getText())); + + /** Save the period of the block into listPeriodTmTDF **/ + if (!(periodTextField.getText().isEmpty())) { + Boolean periodValueInteger = false; + try { + Integer.parseInt(periodTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Period Tm is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + periodValueInteger = true; + } + if (periodValueInteger == false) { + block.setPeriod(Integer.parseInt(periodTextField.getText())); + } + } else { + block.setPeriod(-1); + } + + this.dispose(); + } + + if ("Cancel".equals(e.getActionCommand())) { + this.dispose(); + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/window/JDialogSysCAMSBlockTDF.java b/src/main/java/ui/window/JDialogSysCAMSBlockTDF.java new file mode 100644 index 0000000000000000000000000000000000000000..91f88174769da2834f8d3de4a5ae875d52d7520d --- /dev/null +++ b/src/main/java/ui/window/JDialogSysCAMSBlockTDF.java @@ -0,0 +1,226 @@ +/* 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.window; + +import ui.syscams.*; +import ui.util.IconManager; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; + +/** + * Class JDialogSystemCAMSBlockTDF + * Dialog for managing of SystemC-AMS TDF Block + * Creation: 26/04/2018 + * @version 1.0 26/04/2018 + * @author Irina Kit Yan LEE +*/ + +@SuppressWarnings("serial") + +public class JDialogSysCAMSBlockTDF extends JDialog implements ActionListener { + + /** Access to ActionPerformed **/ + private JTextField nameTextField; + private JTextField periodTextField; + private JTextArea processCodeTextArea; + + /** Parameters **/ + private SysCAMSBlockTDF block; + + /** Constructor **/ + public JDialogSysCAMSBlockTDF(SysCAMSBlockTDF block) { + /** Set JDialog **/ + this.setTitle("Setting TDF Block Attributes"); + this.setSize(500, 310); + this.setLocationRelativeTo(null); + this.setVisible(true); + this.setAlwaysOnTop(true); + this.setResizable(false); + + /** Parameters **/ + this.block = block; + + dialog(); + } + + public void dialog() { + /** JPanel **/ + JPanel mainPanel = new JPanel(new BorderLayout()); + this.add(mainPanel); + + /** JTabbedPane **/ + JTabbedPane tabbedPane = new JTabbedPane(); + JPanel attributesMainPanel = new JPanel(); + JPanel processMainPanel = new JPanel(); + tabbedPane.add("Attributes", attributesMainPanel); + tabbedPane.add("Process Code", processMainPanel); + + mainPanel.add(tabbedPane, BorderLayout.NORTH); // add tab to main panel + + // --- Attributes GridLayout ---// + attributesMainPanel.setLayout(new BorderLayout()); + + // Box for Attributes + Box attributesBox = Box.createVerticalBox(); + attributesBox.setBorder(BorderFactory.createTitledBorder("Setting TDF block attributes")); + + // BorderLayout for Adding Attributes + JPanel attributesBoxPanel = new JPanel(new GridLayout(2, 2, 0, 10)); + + // GridLayout for name + JLabel nameLabel = new JLabel("Name : "); + attributesBoxPanel.add(nameLabel); + if (block.getValue().toString().equals("")) { // name empty + nameTextField = new JTextField(10); + } else { + nameTextField = new JTextField(block.getValue().toString(), 10); // name not empty + } + attributesBoxPanel.add(nameTextField); + + // GridLayout for period + JLabel periodLabel = new JLabel("Period Tm : "); + attributesBoxPanel.add(periodLabel); + if (block.getPeriod() == -1) { + periodTextField = new JTextField(10); + } else { + periodTextField = new JTextField(Integer.toString(block.getPeriod()), 10); + } + attributesBoxPanel.add(periodTextField); + attributesBox.add(attributesBoxPanel); // add border to box + + attributesMainPanel.add(attributesBox, BorderLayout.NORTH); // add box to grid + + // Down Side + JPanel downPanel = new JPanel(new GridLayout(1, 2)); + + JButton saveCloseButton = new JButton("Save and close"); + saveCloseButton.setIcon(IconManager.imgic25); + saveCloseButton.setActionCommand("Save_Close"); + saveCloseButton.addActionListener(this); + downPanel.add(saveCloseButton); + + JButton cancelButton = new JButton("Cancel"); + cancelButton.setIcon(IconManager.imgic27); + cancelButton.setActionCommand("Cancel"); + cancelButton.addActionListener(this); + downPanel.add(cancelButton); + + mainPanel.add(downPanel, BorderLayout.CENTER); + + // --- ProcessCode BorderLayout ---// + processMainPanel.setLayout(new BorderLayout()); + + Box codeBox = Box.createVerticalBox(); + codeBox.setBorder(BorderFactory.createTitledBorder("Generating code")); + + JPanel codeBoxPanel = new JPanel(new BorderLayout()); + + codeBoxPanel.add(new JLabel("Behavior function of TDF block : "), BorderLayout.NORTH); + + processCodeTextArea = new JTextArea(block.getProcessCode()); + processCodeTextArea.setSize(100, 100); + processCodeTextArea.setTabSize(2); + + processCodeTextArea.setFont(new Font("Arial", Font.PLAIN, 16)); + processCodeTextArea.setLineWrap(true); + processCodeTextArea.setWrapStyleWord(true); + + JScrollPane processScrollPane = new JScrollPane(processCodeTextArea); + processScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + processScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + processScrollPane.setPreferredSize(new Dimension(200, 150)); + + codeBoxPanel.add(processScrollPane, BorderLayout.SOUTH); + + codeBox.add(codeBoxPanel); + processMainPanel.add(codeBox, BorderLayout.PAGE_START); + } + + public void actionPerformed(ActionEvent e) { + if ("Save_Close".equals(e.getActionCommand())) { + /** Save the name of the block into listNameTDF **/ + block.setValue(new String(nameTextField.getText())); + + /** Save the period of the block into listPeriodTmTDF **/ + if (!(periodTextField.getText().isEmpty())) { + Boolean periodValueInteger = false; + try { + Integer.parseInt(periodTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Period Tm is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + periodValueInteger = true; + } + if (periodValueInteger == false) { + block.setPeriod(Integer.parseInt(periodTextField.getText())); + } + } else { + block.setPeriod(-1); + } + + /** Save the process code into listProcessCodeTDF **/ + block.setProcessCode(processCodeTextArea.getText()); + + this.dispose(); + } + + if ("Cancel".equals(e.getActionCommand())) { + this.dispose(); + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/window/JDialogSysCAMSPortConverter.java b/src/main/java/ui/window/JDialogSysCAMSPortConverter.java new file mode 100644 index 0000000000000000000000000000000000000000..9b2ff29199fa7a68f48fc5e63201f278fc22e7b0 --- /dev/null +++ b/src/main/java/ui/window/JDialogSysCAMSPortConverter.java @@ -0,0 +1,280 @@ +/* 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.window; + +import ui.syscams.*; +import ui.util.IconManager; + +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + +/** + * Class JDialogSystemCAMSPortConverterIn + * Dialog for managing of SystemC-AMS Converter Input Port + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +@SuppressWarnings("serial") + +public class JDialogSysCAMSPortConverter extends JDialog implements ActionListener { + + /** Access to ActionPerformed **/ + private JTextField nameTextField; + private JTextField periodTextField; + private JTextField rateTextField; + private JTextField delayTextField; + private String listTypeString[]; + private JComboBox<String> typeComboBoxString; + private String listOriginString[]; + private JComboBox<String> originComboBoxString; + + /** Parameters **/ + private SysCAMSPortConverter port; + + /** Constructor **/ + public JDialogSysCAMSPortConverter(SysCAMSPortConverter port) { + /** Set JDialog **/ + this.setTitle("Setting Converter Input Ports"); + this.setSize(500, 318); + this.setLocationRelativeTo(null); + this.setVisible(true); + this.setAlwaysOnTop(true); + this.setResizable(false); + + /** Parameters **/ + this.port = port; + this.dialog(); + } + + public void dialog() { + /** JPanel **/ + JPanel mainPanel = new JPanel(new BorderLayout()); + this.add(mainPanel); + + JPanel attributesMainPanel = new JPanel(new GridLayout()); + mainPanel.add(attributesMainPanel, BorderLayout.NORTH); + + // Left Side + Box box = Box.createVerticalBox(); + box.setBorder(BorderFactory.createTitledBorder("Setting converter input port attributes")); + + JPanel boxPanel = new JPanel(new GridLayout(6, 2, 0, 10)); + + JLabel labelName = new JLabel("Name : "); + boxPanel.add(labelName); + + if (port.getPortName().toString().equals("")) { // name empty + nameTextField = new JTextField(10); + } else { + nameTextField = new JTextField(port.getPortName().toString(), 10); // name not empty + } + + boxPanel.add(nameTextField); + + // Period + JLabel periodLabel = new JLabel("Period Tp : "); + boxPanel.add(periodLabel); // add label to box + if (port.getPeriod() == -1) { // name empty // port.getName().toString().equals("") || + periodTextField = new JTextField(10); + } else { + periodTextField = new JTextField("" + port.getPeriod(), 10); // name not empty + } + boxPanel.add(periodTextField); // add text to box + + // Rate + JLabel rateLabel = new JLabel("Rate : "); + boxPanel.add(rateLabel); // add label to box + + if (port.getRate() == -1) { // name empty // port.getName().toString().equals("") || + rateTextField = new JTextField(10); + } else { + rateTextField = new JTextField("" + port.getRate(), 10); // name not empty + } + boxPanel.add(rateTextField); // add text to box + + // Delay + JLabel delayLabel = new JLabel("Delay : "); + boxPanel.add(delayLabel); // add label to box + if (port.getDelay() == -1) { // name empty // port.getName().toString().equals("") || + delayTextField = new JTextField(10); + } else { + delayTextField = new JTextField("" + port.getDelay(), 10); // name not empty + } + boxPanel.add(delayTextField); // add text to box + + // Type + JLabel typeLabel = new JLabel("Type : "); + boxPanel.add(typeLabel); // add label to box + listTypeString = new String[3]; + listTypeString[0] = "Integer"; + listTypeString[1] = "Boolean"; + listTypeString[2] = "Float"; + typeComboBoxString = new JComboBox<String>(listTypeString); + if (port.getConvType().equals("") || port.getConvType().equals("Integer")) { + typeComboBoxString.setSelectedIndex(0); + } + if (port.getConvType().equals("Boolean")) { + typeComboBoxString.setSelectedIndex(1); + } + if (port.getConvType().equals("Float")) { + typeComboBoxString.setSelectedIndex(2); + } + typeComboBoxString.setActionCommand("type"); + typeComboBoxString.addActionListener(this); + boxPanel.add(typeComboBoxString); // add combo to box + + // Origin + JLabel orginLabel = new JLabel("Origin : "); + boxPanel.add(orginLabel); // add label to box + listOriginString = new String[2]; + listOriginString[0] = "Input"; + listOriginString[1] = "Output"; + originComboBoxString = new JComboBox<String>(listOriginString); + if (port.getOrigin().equals("") || port.getOrigin().equals("Input")) { + originComboBoxString.setSelectedIndex(0); + } + if (port.getOrigin().equals("Output")) { + originComboBoxString.setSelectedIndex(1); + } + originComboBoxString.setActionCommand("origin"); + originComboBoxString.addActionListener(this); + boxPanel.add(originComboBoxString); // add combo to box + + box.add(boxPanel); // add border to box + attributesMainPanel.add(box); // add grid to grid + + // Down Side + JPanel downPanel = new JPanel(new GridLayout(1, 2)); + + JButton saveCloseButton = new JButton("Save and close"); + saveCloseButton.setIcon(IconManager.imgic25); + saveCloseButton.setActionCommand("Save_Close"); + saveCloseButton.addActionListener(this); + downPanel.add(saveCloseButton); + + JButton cancelButton = new JButton("Cancel"); + cancelButton.setIcon(IconManager.imgic27); + cancelButton.setActionCommand("Cancel"); + cancelButton.addActionListener(this); + downPanel.add(cancelButton); + + mainPanel.add(downPanel, BorderLayout.CENTER); + } + + public void actionPerformed(ActionEvent e) { + if ("Save_Close".equals(e.getActionCommand())) { + port.setPortName(new String(nameTextField.getText())); + + if (!(periodTextField.getText().isEmpty())) { + Boolean periodValueInteger = false; + try { + Integer.parseInt(periodTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Period is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + periodValueInteger = true; + } + if (periodValueInteger == false) { + port.setPeriod(Integer.parseInt(periodTextField.getText())); + } + } else { + port.setPeriod(-1); + } + if (!(rateTextField.getText().isEmpty())) { + Boolean rateValueInteger = false; + try { + Integer.parseInt(rateTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Rate is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + rateValueInteger = true; + } + if (rateValueInteger == false) { + port.setRate(Integer.parseInt(rateTextField.getText())); + } + } else { + port.setRate(-1); + } + + if (!(delayTextField.getText().isEmpty())) { + Boolean delayValueInteger = false; + try { + Integer.parseInt(delayTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Delay is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + delayValueInteger = true; + } + if (delayValueInteger == false) { + port.setDelay(Integer.parseInt(delayTextField.getText())); + } + } else { + port.setDelay(-1); + } + port.setConvType((String) typeComboBoxString.getSelectedItem()); + port.setOrigin((String) originComboBoxString.getSelectedItem()); + + this.dispose(); + } + + if ("Cancel".equals(e.getActionCommand())) { + this.dispose(); + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/window/JDialogSysCAMSPortDE.java b/src/main/java/ui/window/JDialogSysCAMSPortDE.java new file mode 100644 index 0000000000000000000000000000000000000000..a3b0e7aa3e16fedce7c32d096549eaf95502ccf0 --- /dev/null +++ b/src/main/java/ui/window/JDialogSysCAMSPortDE.java @@ -0,0 +1,280 @@ +/* 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.window; + +import ui.syscams.*; +import ui.util.IconManager; + +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + +/** + * Class JDialogSystemCAMSPortDE + * Dialog for managing of SystemC-AMS DE Port + * Creation: 07/05/2018 + * @version 1.0 07/05/2018 + * @author Irina Kit Yan LEE +*/ + +@SuppressWarnings("serial") + +public class JDialogSysCAMSPortDE extends JDialog implements ActionListener { + + /** Access to ActionPerformed **/ + private JTextField nameTextField; + private JTextField periodTextField; + private JTextField rateTextField; + private JTextField delayTextField; + private String listTypeString[]; + private JComboBox<String> typeComboBoxString; + private String listOriginString[]; + private JComboBox<String> originComboBoxString; + + /** Parameters **/ + private SysCAMSPortDE port; + + /** Constructor **/ + public JDialogSysCAMSPortDE(SysCAMSPortDE port) { + /** Set JDialog **/ + this.setTitle("Setting DE Ports"); + this.setSize(500, 318); + this.setLocationRelativeTo(null); + this.setVisible(true); + this.setAlwaysOnTop(true); + this.setResizable(false); + + /** Parameters **/ + this.port = port; + this.dialog(); + } + + public void dialog() { + /** JPanel **/ + JPanel mainPanel = new JPanel(new BorderLayout()); + this.add(mainPanel); + + JPanel attributesMainPanel = new JPanel(new GridLayout()); + mainPanel.add(attributesMainPanel, BorderLayout.NORTH); + + // Left Side + Box box = Box.createVerticalBox(); + box.setBorder(BorderFactory.createTitledBorder("Setting DE port attributes")); + + JPanel boxPanel = new JPanel(new GridLayout(6, 2, 0, 10)); + + JLabel labelName = new JLabel("Name : "); + boxPanel.add(labelName); + + if (port.getPortName().toString().equals("")) { // name empty + nameTextField = new JTextField(10); + } else { + nameTextField = new JTextField(port.getPortName().toString(), 10); // name not empty + } + + boxPanel.add(nameTextField); + + // Period + JLabel periodLabel = new JLabel("Period Tp : "); + boxPanel.add(periodLabel); // add label to box + if (port.getPeriod() == -1) { // name empty // port.getName().toString().equals("") || + periodTextField = new JTextField(10); + } else { + periodTextField = new JTextField("" + port.getPeriod(), 10); // name not empty + } + boxPanel.add(periodTextField); // add text to box + + // Rate + JLabel rateLabel = new JLabel("Rate : "); + boxPanel.add(rateLabel); // add label to box + + if (port.getRate() == -1) { // name empty // port.getName().toString().equals("") || + rateTextField = new JTextField(10); + } else { + rateTextField = new JTextField("" + port.getRate(), 10); // name not empty + } + boxPanel.add(rateTextField); // add text to box + + // Delay + JLabel delayLabel = new JLabel("Delay : "); + boxPanel.add(delayLabel); // add label to box + if (port.getDelay() == -1) { // name empty // port.getName().toString().equals("") || + delayTextField = new JTextField(10); + } else { + delayTextField = new JTextField("" + port.getDelay(), 10); // name not empty + } + boxPanel.add(delayTextField); // add text to box + + // Type + JLabel typeLabel = new JLabel("Type : "); + boxPanel.add(typeLabel); // add label to box + listTypeString = new String[3]; + listTypeString[0] = "Integer"; + listTypeString[1] = "Boolean"; + listTypeString[2] = "Float"; + typeComboBoxString = new JComboBox<String>(listTypeString); + if (port.getDEType().equals("") || port.getDEType().equals("Integer")) { + typeComboBoxString.setSelectedIndex(0); + } + if (port.getDEType().equals("Boolean")) { + typeComboBoxString.setSelectedIndex(1); + } + if (port.getDEType().equals("Float")) { + typeComboBoxString.setSelectedIndex(2); + } + typeComboBoxString.setActionCommand("type"); + typeComboBoxString.addActionListener(this); + boxPanel.add(typeComboBoxString); // add combo to box + + // Origin + JLabel orginLabel = new JLabel("Origin : "); + boxPanel.add(orginLabel); // add label to box + listOriginString = new String[2]; + listOriginString[0] = "Input"; + listOriginString[1] = "Output"; + originComboBoxString = new JComboBox<String>(listOriginString); + if (port.getOrigin().equals("") || port.getOrigin().equals("Input")) { + originComboBoxString.setSelectedIndex(0); + } + if (port.getOrigin().equals("Output")) { + originComboBoxString.setSelectedIndex(1); + } + originComboBoxString.setActionCommand("origin"); + originComboBoxString.addActionListener(this); + boxPanel.add(originComboBoxString); // add combo to box + + box.add(boxPanel); // add border to box + attributesMainPanel.add(box); // add grid to grid + + // Down Side + JPanel downPanel = new JPanel(new GridLayout(1, 2)); + + JButton saveCloseButton = new JButton("Save and close"); + saveCloseButton.setIcon(IconManager.imgic25); + saveCloseButton.setActionCommand("Save_Close"); + saveCloseButton.addActionListener(this); + downPanel.add(saveCloseButton); + + JButton cancelButton = new JButton("Cancel"); + cancelButton.setIcon(IconManager.imgic27); + cancelButton.setActionCommand("Cancel"); + cancelButton.addActionListener(this); + downPanel.add(cancelButton); + + mainPanel.add(downPanel, BorderLayout.CENTER); + } + + public void actionPerformed(ActionEvent e) { + if ("Save_Close".equals(e.getActionCommand())) { + port.setPortName(new String(nameTextField.getText())); + + if (!(periodTextField.getText().isEmpty())) { + Boolean periodValueInteger = false; + try { + Integer.parseInt(periodTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Period is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + periodValueInteger = true; + } + if (periodValueInteger == false) { + port.setPeriod(Integer.parseInt(periodTextField.getText())); + } + } else { + port.setPeriod(-1); + } + if (!(rateTextField.getText().isEmpty())) { + Boolean rateValueInteger = false; + try { + Integer.parseInt(rateTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Rate is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + rateValueInteger = true; + } + if (rateValueInteger == false) { + port.setRate(Integer.parseInt(rateTextField.getText())); + } + } else { + port.setRate(-1); + } + + if (!(delayTextField.getText().isEmpty())) { + Boolean delayValueInteger = false; + try { + Integer.parseInt(delayTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Delay is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + delayValueInteger = true; + } + if (delayValueInteger == false) { + port.setDelay(Integer.parseInt(delayTextField.getText())); + } + } else { + port.setDelay(-1); + } + port.setDEType((String) typeComboBoxString.getSelectedItem()); + port.setOrigin((String) originComboBoxString.getSelectedItem()); + + this.dispose(); + } + + if ("Cancel".equals(e.getActionCommand())) { + this.dispose(); + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/window/JDialogSysCAMSPortTDF.java b/src/main/java/ui/window/JDialogSysCAMSPortTDF.java new file mode 100644 index 0000000000000000000000000000000000000000..556d0c54b0b363c95e0f3452e4a0fa2834bf9d7d --- /dev/null +++ b/src/main/java/ui/window/JDialogSysCAMSPortTDF.java @@ -0,0 +1,280 @@ +/* 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.window; + +import ui.syscams.*; +import ui.util.IconManager; + +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + +/** + * Class JDialogSystemCAMSPortTDF + * Dialog for managing of SystemC-AMS TDF Port + * Creation: 26/04/2018 + * @version 1.0 26/04/2018 + * @author Irina Kit Yan LEE +*/ + +@SuppressWarnings("serial") + +public class JDialogSysCAMSPortTDF extends JDialog implements ActionListener { + + /** Access to ActionPerformed **/ + private JTextField nameTextField; + private JTextField periodTextField; + private JTextField rateTextField; + private JTextField delayTextField; + private String listTypeString[]; + private JComboBox<String> typeComboBoxString; + private String listOriginString[]; + private JComboBox<String> originComboBoxString; + + /** Parameters **/ + private SysCAMSPortTDF port; + + /** Constructor **/ + public JDialogSysCAMSPortTDF(SysCAMSPortTDF port) { + /** Set JDialog **/ + this.setTitle("Setting TDF Ports"); + this.setSize(500, 318); + this.setLocationRelativeTo(null); + this.setVisible(true); + this.setAlwaysOnTop(true); + this.setResizable(false); + + /** Parameters **/ + this.port = port; + this.dialog(); + } + + public void dialog() { + /** JPanel **/ + JPanel mainPanel = new JPanel(new BorderLayout()); + this.add(mainPanel); + + JPanel attributesMainPanel = new JPanel(new GridLayout()); + mainPanel.add(attributesMainPanel, BorderLayout.NORTH); + + // Left Side + Box box = Box.createVerticalBox(); + box.setBorder(BorderFactory.createTitledBorder("Setting TDF port attributes")); + + JPanel boxPanel = new JPanel(new GridLayout(6, 2, 0, 10)); + + JLabel labelName = new JLabel("Name : "); + boxPanel.add(labelName); + + if (port.getPortName().toString().equals("")) { // name empty + nameTextField = new JTextField(10); + } else { + nameTextField = new JTextField(port.getPortName().toString(), 10); // name not empty + } + + boxPanel.add(nameTextField); + + // Period + JLabel periodLabel = new JLabel("Period Tp : "); + boxPanel.add(periodLabel); // add label to box + if (port.getPeriod() == -1) { // name empty // port.getName().toString().equals("") || + periodTextField = new JTextField(10); + } else { + periodTextField = new JTextField("" + port.getPeriod(), 10); // name not empty + } + boxPanel.add(periodTextField); // add text to box + + // Rate + JLabel rateLabel = new JLabel("Rate : "); + boxPanel.add(rateLabel); // add label to box + + if (port.getRate() == -1) { // name empty // port.getName().toString().equals("") || + rateTextField = new JTextField(10); + } else { + rateTextField = new JTextField("" + port.getRate(), 10); // name not empty + } + boxPanel.add(rateTextField); // add text to box + + // Delay + JLabel delayLabel = new JLabel("Delay : "); + boxPanel.add(delayLabel); // add label to box + if (port.getDelay() == -1) { // name empty // port.getName().toString().equals("") || + delayTextField = new JTextField(10); + } else { + delayTextField = new JTextField("" + port.getDelay(), 10); // name not empty + } + boxPanel.add(delayTextField); // add text to box + + // Type + JLabel typeLabel = new JLabel("Type : "); + boxPanel.add(typeLabel); // add label to box + listTypeString = new String[3]; + listTypeString[0] = "Integer"; + listTypeString[1] = "Boolean"; + listTypeString[2] = "Float"; + typeComboBoxString = new JComboBox<String>(listTypeString); + if (port.getTDFType().equals("") || port.getTDFType().equals("Integer")) { + typeComboBoxString.setSelectedIndex(0); + } + if (port.getTDFType().equals("Boolean")) { + typeComboBoxString.setSelectedIndex(1); + } + if (port.getTDFType().equals("Float")) { + typeComboBoxString.setSelectedIndex(2); + } + typeComboBoxString.setActionCommand("type"); + typeComboBoxString.addActionListener(this); + boxPanel.add(typeComboBoxString); // add combo to box + + // Origin + JLabel orginLabel = new JLabel("Origin : "); + boxPanel.add(orginLabel); // add label to box + listOriginString = new String[3]; + listOriginString[0] = "Input"; + listOriginString[1] = "Output"; + originComboBoxString = new JComboBox<String>(listOriginString); + if (port.getOrigin().equals("") || port.getOrigin().equals("Input")) { + originComboBoxString.setSelectedIndex(0); + } + if (port.getOrigin().equals("Output")) { + originComboBoxString.setSelectedIndex(1); + } + originComboBoxString.setActionCommand("origin"); + originComboBoxString.addActionListener(this); + boxPanel.add(originComboBoxString); // add combo to box + + box.add(boxPanel); // add border to box + attributesMainPanel.add(box); // add grid to grid + + // Down Side + JPanel downPanel = new JPanel(new GridLayout(1, 2)); + + JButton saveCloseButton = new JButton("Save and close"); + saveCloseButton.setIcon(IconManager.imgic25); + saveCloseButton.setActionCommand("Save_Close"); + saveCloseButton.addActionListener(this); + downPanel.add(saveCloseButton); + + JButton cancelButton = new JButton("Cancel"); + cancelButton.setIcon(IconManager.imgic27); + cancelButton.setActionCommand("Cancel"); + cancelButton.addActionListener(this); + downPanel.add(cancelButton); + + mainPanel.add(downPanel, BorderLayout.CENTER); + } + + public void actionPerformed(ActionEvent e) { + if ("Save_Close".equals(e.getActionCommand())) { + port.setPortName(new String(nameTextField.getText())); + + if (!(periodTextField.getText().isEmpty())) { + Boolean periodValueInteger = false; + try { + Integer.parseInt(periodTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Period is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + periodValueInteger = true; + } + if (periodValueInteger == false) { + port.setPeriod(Integer.parseInt(periodTextField.getText())); + } + } else { + port.setPeriod(-1); + } + if (!(rateTextField.getText().isEmpty())) { + Boolean rateValueInteger = false; + try { + Integer.parseInt(rateTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Rate is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + rateValueInteger = true; + } + if (rateValueInteger == false) { + port.setRate(Integer.parseInt(rateTextField.getText())); + } + } else { + port.setRate(-1); + } + + if (!(delayTextField.getText().isEmpty())) { + Boolean delayValueInteger = false; + try { + Integer.parseInt(delayTextField.getText()); + } catch (NumberFormatException e1) { + JDialog msg = new JDialog(this); + msg.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(msg, "Delay is not a Integer", "Warning !", + JOptionPane.WARNING_MESSAGE); + delayValueInteger = true; + } + if (delayValueInteger == false) { + port.setDelay(Integer.parseInt(delayTextField.getText())); + } + } else { + port.setDelay(-1); + } + port.setTDFType((String) typeComboBoxString.getSelectedItem()); + port.setOrigin((String) originComboBoxString.getSelectedItem()); + + this.dispose(); + } + + if ("Cancel".equals(e.getActionCommand())) { + this.dispose(); + } + } +} \ No newline at end of file diff --git a/src/main/java/ui/window/JDialogSystemCGeneration.java b/src/main/java/ui/window/JDialogSystemCGeneration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLADRandom.java b/src/main/java/ui/window/JDialogTMLADRandom.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLCPControllerInstance.java b/src/main/java/ui/window/JDialogTMLCPControllerInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLCPStorageInstance.java b/src/main/java/ui/window/JDialogTMLCPStorageInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLCPTransferInstance.java b/src/main/java/ui/window/JDialogTMLCPTransferInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLCompositePort.java b/src/main/java/ui/window/JDialogTMLCompositePort.java old mode 100755 new mode 100644 index 717a0ef3b7cb597e58477da3addac0dee5419c3c..ffd54ac87a753409cb11cb86915177cc8a0d6f88 --- a/src/main/java/ui/window/JDialogTMLCompositePort.java +++ b/src/main/java/ui/window/JDialogTMLCompositePort.java @@ -95,14 +95,7 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen private JTextField lossPercentageText, maxNbOfLossText; - public JDialogTMLCompositePort(String _name, int _portIndex, TType _type1, TType _type2, TType _type3, TType _type4, - TType _type5, boolean _isOrigin, boolean _isFinite, boolean _isBlocking, - String _maxInFIFO, String _widthSamples, boolean _isLossy, - int _lossPercentage, int _maxNbOfLoss, Frame f, - String title, Vector<String> _types, - String _dataFlowType, String _associatedEvent, boolean _isPrex, - boolean _isPostex, boolean _checkConf, - boolean _checkAuth, TGComponent _reference, Vector<TGComponent> _refs) { + public JDialogTMLCompositePort(String _name, int _portIndex, TType _type1, TType _type2, TType _type3, TType _type4, TType _type5, boolean _isOrigin, boolean _isFinite, boolean _isBlocking, String _maxInFIFO, String _widthSamples, boolean _isLossy, int _lossPercentage, int _maxNbOfLoss, Frame f, String title, Vector<String> _types, String _dataFlowType, String _associatedEvent, boolean _isPrex, boolean _isPostex, boolean _checkConf, boolean _checkAuth, TGComponent _reference, Vector<TGComponent> _refs) { super(f, title, true); frame = f; @@ -224,7 +217,7 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen JPanel panel1 = new JPanel(); panel1.setLayout(gridbag1); - panel1.setBorder(new javax.swing.border.TitledBorder("Name, type and parameters")); + panel1.setBorder(new javax.swing.border.TitledBorder("Name and type ")); panel1.setPreferredSize(new Dimension(300, 150)); // First line panel1 @@ -272,11 +265,49 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen origin.addActionListener(this); panel1.add(origin, c1); - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Type #1"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row + + // parameters + JPanel panel2 = new JPanel(); + panel2.setLayout(gridbag2); + panel2.setBorder(new javax.swing.border.TitledBorder("Formal Verification & Simulation Parameters ")); + panel2.setPreferredSize(new Dimension(300, 300)); + c2.gridwidth = 1; + c2.gridheight = 1; + c2.weighty = 1.0; + c2.weightx = 1.0; + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.fill = GridBagConstraints.BOTH; + c2.gridheight = 3; + panel2.add(new JLabel(" "), c2); + + //Security Properties to check + confCheckBox = new JCheckBox("Check Confidentiality"); + panel2.add(confCheckBox, c2); + confCheckBox.addActionListener(this); + confCheckBox.setSelected(checkConf); + authCheckBox = new JCheckBox("Check Authenticity"); + authCheckBox.addActionListener(this); + panel2.add(authCheckBox, c2); + authCheckBox.setSelected(checkAuth); + + + //If related to security requirement, allow reference to the requirement + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Reference Requirement"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + refReq = new JComboBox<>(refs); + panel2.add(refReq, c2); + if (reference != null) { + refReq.setSelectedItem(reference); + } + + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Type #1"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList1 = new JComboBox<>(types1); //TraceManager.addDev("type1= " + type1); if (type1.getType() < TType.OTHER) { @@ -291,13 +322,13 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen } } } - panel1.add(typeList1, c1); + panel2.add(typeList1, c2); - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Type #2"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Type #2"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList2 = new JComboBox<>(types2); if (type2.getType() < TType.OTHER) { typeList2.setSelectedIndex(type2.getType()); @@ -311,13 +342,13 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen } } } - panel1.add(typeList2, c1); + panel2.add(typeList2, c2); - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Type: #3"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Type: #3"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList3 = new JComboBox<>(types3); if (type3.getType() < TType.OTHER) { typeList3.setSelectedIndex(type3.getType()); @@ -331,13 +362,13 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen } } } - panel1.add(typeList3, c1); + panel2.add(typeList3, c2); - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Type: #4"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Type: #4"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList4 = new JComboBox<>(types4); if (type4.getType() < TType.OTHER) { typeList4.setSelectedIndex(type4.getType()); @@ -351,14 +382,14 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen } } } - panel1.add(typeList4, c1); + panel2.add(typeList4, c2); - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Type: #5"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Type: #5"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList5 = new JComboBox<>(types5); if (type5.getType() < TType.OTHER) { typeList5.setSelectedIndex(type5.getType()); @@ -372,91 +403,7 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen } } } - panel1.add(typeList5, c1); - - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Blocking?"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - blocking = new JComboBox<>(blockings); - if (isBlocking) { - blocking.setSelectedIndex(0); - } else { - blocking.setSelectedIndex(1); - } - blocking.addActionListener(this); - panel1.add(blocking, c1); - - c1.gridwidth = 1; - c1.fill = GridBagConstraints.HORIZONTAL; - c1.anchor = GridBagConstraints.CENTER; - panel1.add(new JLabel("Finite?"), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - finite = new JComboBox<>(finites); - if (isFinite) { - finite.setSelectedIndex(0); - } else { - finite.setSelectedIndex(1); - } - finite.addActionListener(this); - panel1.add(finite, c1); - - c1.gridwidth = 1; - panel1.add(new JLabel("Width (in Byte)="), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - widthText = new JTextField(widthSamples); - panel1.add(widthText, c1); - - c1.gridwidth = 1; - panel1.add(new JLabel("Capacity="), c1); - c1.gridwidth = GridBagConstraints.REMAINDER; //end row - maxText = new JTextField(maxInFIFO); - panel1.add(maxText, c1); - - - - JPanel panel2 = new JPanel(); - panel2.setLayout(gridbag2); - panel2.setBorder(new javax.swing.border.TitledBorder("Properties and Verification ")); - panel2.setPreferredSize(new Dimension(300, 300)); - - //If related to security requirement, allow reference to the requirement - c2.gridwidth = 1; - c2.fill = GridBagConstraints.HORIZONTAL; - c2.anchor = GridBagConstraints.CENTER; - panel2.add(new JLabel("Reference Requirement"), c2); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - refReq = new JComboBox<>(refs); - panel2.add(refReq, c2); - if (reference != null) { - refReq.setSelectedItem(reference); - } - - - c2.gridwidth = 1; - c2.gridheight = 1; - c2.weighty = 1.0; - c2.weightx = 1.0; - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - c2.fill = GridBagConstraints.BOTH; - c2.gridheight = 3; - panel2.add(new JLabel(" "), c2); - - //Security Properties to check - confCheckBox = new JCheckBox("Check Confidentiality"); - panel2.add(confCheckBox, c2); - confCheckBox.addActionListener(this); - confCheckBox.setSelected(checkConf); - authCheckBox = new JCheckBox("Check Authenticity"); - authCheckBox.addActionListener(this); - panel2.add(authCheckBox, c2); - authCheckBox.setSelected(checkAuth); - - - - - + panel2.add(typeList5, c2); // Code generation JPanel panel4 = new JPanel(); @@ -507,7 +454,45 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen isPostexCB.setSelected(isPostex); panel4.add(isPostexCB, c4); + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Blocking?"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + blocking = new JComboBox<>(blockings); + if (isBlocking) { + blocking.setSelectedIndex(0); + } else { + blocking.setSelectedIndex(1); + } + blocking.addActionListener(this); + panel2.add(blocking, c2); + + c2.gridwidth = 1; + c2.fill = GridBagConstraints.HORIZONTAL; + c2.anchor = GridBagConstraints.CENTER; + panel2.add(new JLabel("Finite?"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + finite = new JComboBox<>(finites); + if (isFinite) { + finite.setSelectedIndex(0); + } else { + finite.setSelectedIndex(1); + } + finite.addActionListener(this); + panel2.add(finite, c2); + c2.gridwidth = 1; + panel2.add(new JLabel("Width (in Byte)="), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + widthText = new JTextField(widthSamples); + panel2.add(widthText, c2); + + c2.gridwidth = 1; + panel2.add(new JLabel("Capacity="), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + maxText = new JTextField(maxInFIFO); + panel2.add(maxText, c2); /*c2.gridwidth = GridBagConstraints.REMAINDER; //end row c2.fill = GridBagConstraints.HORIZONTAL; diff --git a/src/main/java/ui/window/JDialogTMLConnectorNode.java b/src/main/java/ui/window/JDialogTMLConnectorNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLRemoteCompositeComponent.java b/src/main/java/ui/window/JDialogTMLRemoteCompositeComponent.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLSDInstance.java b/src/main/java/ui/window/JDialogTMLSDInstance.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMLTaskArtifact.java b/src/main/java/ui/window/JDialogTMLTaskArtifact.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTMatrixManagement.java b/src/main/java/ui/window/JDialogTMatrixManagement.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTOSClass.java b/src/main/java/ui/window/JDialogTOSClass.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTObjectName.java b/src/main/java/ui/window/JDialogTObjectName.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTPNValidation.java b/src/main/java/ui/window/JDialogTPNValidation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTextProcess.java b/src/main/java/ui/window/JDialogTextProcess.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTimeInterval.java b/src/main/java/ui/window/JDialogTimeInterval.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTimeIntervalUnit.java b/src/main/java/ui/window/JDialogTimeIntervalUnit.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogTwoString.java b/src/main/java/ui/window/JDialogTwoString.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogUPPAALGeneration.java b/src/main/java/ui/window/JDialogUPPAALGeneration.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogUPPAALValidation.java b/src/main/java/ui/window/JDialogUPPAALValidation.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogUseCase.java b/src/main/java/ui/window/JDialogUseCase.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogVGMNNode.java b/src/main/java/ui/window/JDialogVGMNNode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JDialogVersioningConnector.java b/src/main/java/ui/window/JDialogVersioningConnector.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameBasicText.java b/src/main/java/ui/window/JFrameBasicText.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameBird.java b/src/main/java/ui/window/JFrameBird.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameCode.java b/src/main/java/ui/window/JFrameCode.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameDeadlock.java b/src/main/java/ui/window/JFrameDeadlock.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameMinimize.java b/src/main/java/ui/window/JFrameMinimize.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameNC.java b/src/main/java/ui/window/JFrameNC.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFramePowerManagementAnalysis.java b/src/main/java/ui/window/JFramePowerManagementAnalysis.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameRefusalGraph.java b/src/main/java/ui/window/JFrameRefusalGraph.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameRequirementTable.java b/src/main/java/ui/window/JFrameRequirementTable.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameSimulationTrace.java b/src/main/java/ui/window/JFrameSimulationTrace.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameStatistics.java b/src/main/java/ui/window/JFrameStatistics.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JFrameText.java b/src/main/java/ui/window/JFrameText.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JSimulationPanel.java b/src/main/java/ui/window/JSimulationPanel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JSimulationPanelChrono.java b/src/main/java/ui/window/JSimulationPanelChrono.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JSimulationPanelInterface.java b/src/main/java/ui/window/JSimulationPanelInterface.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/JStartingWindow.java b/src/main/java/ui/window/JStartingWindow.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/LinksNCTableModel.java b/src/main/java/ui/window/LinksNCTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/PathsNCTableModel.java b/src/main/java/ui/window/PathsNCTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/RequirementsTableModel.java b/src/main/java/ui/window/RequirementsTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/StatisticsItem.java b/src/main/java/ui/window/StatisticsItem.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/StatisticsTableModel.java b/src/main/java/ui/window/StatisticsTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/SwitchesNCTableModel.java b/src/main/java/ui/window/SwitchesNCTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/TMatrixTableModel.java b/src/main/java/ui/window/TMatrixTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/TraceData.java b/src/main/java/ui/window/TraceData.java old mode 100755 new mode 100644 diff --git a/src/main/java/ui/window/TrafficsNCTableModel.java b/src/main/java/ui/window/TrafficsNCTableModel.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALFiniteFIFOTemplate.java b/src/main/java/uppaaldesc/UPPAALFiniteFIFOTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALFiniteFIFOTemplateLoss.java b/src/main/java/uppaaldesc/UPPAALFiniteFIFOTemplateLoss.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALInfiniteFIFOTemplate.java b/src/main/java/uppaaldesc/UPPAALInfiniteFIFOTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALInfiniteFIFOTemplateLoss.java b/src/main/java/uppaaldesc/UPPAALInfiniteFIFOTemplateLoss.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALLocation.java b/src/main/java/uppaaldesc/UPPAALLocation.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALMemoryTemplate.java b/src/main/java/uppaaldesc/UPPAALMemoryTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALMemoryTemplateLoss.java b/src/main/java/uppaaldesc/UPPAALMemoryTemplateLoss.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALSpec.java b/src/main/java/uppaaldesc/UPPAALSpec.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALTemplate.java b/src/main/java/uppaaldesc/UPPAALTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/UPPAALTransition.java b/src/main/java/uppaaldesc/UPPAALTransition.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/tmltouppaal/UPPAALEventTemplate.java b/src/main/java/uppaaldesc/tmltouppaal/UPPAALEventTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/tmltouppaal/UPPAALRequestTemplate.java b/src/main/java/uppaaldesc/tmltouppaal/UPPAALRequestTemplate.java old mode 100755 new mode 100644 diff --git a/src/main/java/uppaaldesc/tmltouppaal/UPPAALRequestTemplateWithLoss.java b/src/main/java/uppaaldesc/tmltouppaal/UPPAALRequestTemplateWithLoss.java old mode 100755 new mode 100644 diff --git a/src/main/java/vcd/VCDContent.java b/src/main/java/vcd/VCDContent.java old mode 100755 new mode 100644 diff --git a/src/main/java/vcd/VCDTimeChange.java b/src/main/java/vcd/VCDTimeChange.java old mode 100755 new mode 100644 diff --git a/src/main/java/vcd/VCDVariable.java b/src/main/java/vcd/VCDVariable.java old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/New16.gif b/src/main/resources/ui/util/New16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/New24.gif b/src/main/resources/ui/util/New24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/NewP16.gif b/src/main/resources/ui/util/NewP16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/NewP24.gif b/src/main/resources/ui/util/NewP24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/Open16.gif b/src/main/resources/ui/util/Open16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/Open24.gif b/src/main/resources/ui/util/Open24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/OpenN16.gif b/src/main/resources/ui/util/OpenN16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/OpenN24.gif b/src/main/resources/ui/util/OpenN24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/OpenP16.gif b/src/main/resources/ui/util/OpenP16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/OpenP24.gif b/src/main/resources/ui/util/OpenP24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/actionstate.gif b/src/main/resources/ui/util/actionstate.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/activitydiagram.gif b/src/main/resources/ui/util/activitydiagram.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adchoice.gif b/src/main/resources/ui/util/adchoice.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adconnector.gif b/src/main/resources/ui/util/adconnector.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adddelay.gif b/src/main/resources/ui/util/adddelay.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adjunction.gif b/src/main/resources/ui/util/adjunction.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adnddelay.gif b/src/main/resources/ui/util/adnddelay.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adparallel.gif b/src/main/resources/ui/util/adparallel.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adpreemption.gif b/src/main/resources/ui/util/adpreemption.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adsequence.gif b/src/main/resources/ui/util/adsequence.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adstart.gif b/src/main/resources/ui/util/adstart.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adstop.gif b/src/main/resources/ui/util/adstop.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adtimeinterval.gif b/src/main/resources/ui/util/adtimeinterval.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adtloffer.gif b/src/main/resources/ui/util/adtloffer.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/adtlofferwl.gif b/src/main/resources/ui/util/adtlofferwl.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/arrayget.gif b/src/main/resources/ui/util/arrayget.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/arrayset.gif b/src/main/resources/ui/util/arrayset.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/atdiag.gif b/src/main/resources/ui/util/atdiag.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/attacker.gif b/src/main/resources/ui/util/attacker.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/avatarmadaspt.gif b/src/main/resources/ui/util/avatarmadaspt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/avatarmadversioning.gif b/src/main/resources/ui/util/avatarmadversioning.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/avatarmethodo.gif b/src/main/resources/ui/util/avatarmethodo.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/avatarrdreq.gif b/src/main/resources/ui/util/avatarrdreq.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/camsconverterportE.gif b/src/main/resources/ui/util/camsconverterportE.gif new file mode 100644 index 0000000000000000000000000000000000000000..a0b9f06cb96c24c74b40065d8985c6abaa6025e7 Binary files /dev/null and b/src/main/resources/ui/util/camsconverterportE.gif differ diff --git a/src/main/resources/ui/util/camsconverterportN.gif b/src/main/resources/ui/util/camsconverterportN.gif new file mode 100644 index 0000000000000000000000000000000000000000..72165975e4f0239b3f58dc7a26ea0e7e4c3bccb3 Binary files /dev/null and b/src/main/resources/ui/util/camsconverterportN.gif differ diff --git a/src/main/resources/ui/util/camsconverterportS.gif b/src/main/resources/ui/util/camsconverterportS.gif new file mode 100644 index 0000000000000000000000000000000000000000..e2ce184b7136bfa6f1763032dc78fb93442a7d7e Binary files /dev/null and b/src/main/resources/ui/util/camsconverterportS.gif differ diff --git a/src/main/resources/ui/util/camsconverterportW.gif b/src/main/resources/ui/util/camsconverterportW.gif new file mode 100644 index 0000000000000000000000000000000000000000..fd2af4f477d57323015b6249ba4d5b70ff66265e Binary files /dev/null and b/src/main/resources/ui/util/camsconverterportW.gif differ diff --git a/src/main/resources/ui/util/camsdeport.gif b/src/main/resources/ui/util/camsdeport.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d8c64d4df64153abf70d51fd6dbfb8d3a98f2e0 Binary files /dev/null and b/src/main/resources/ui/util/camsdeport.gif differ diff --git a/src/main/resources/ui/util/camstdfport.gif b/src/main/resources/ui/util/camstdfport.gif new file mode 100644 index 0000000000000000000000000000000000000000..105d5cbc715f18610dba65e9cb98f654ba602aa0 Binary files /dev/null and b/src/main/resources/ui/util/camstdfport.gif differ diff --git a/src/main/resources/ui/util/cdactivity.gif b/src/main/resources/ui/util/cdactivity.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdassociation.gif b/src/main/resources/ui/util/cdassociation.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdassonav.gif b/src/main/resources/ui/util/cdassonav.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdattribute.gif b/src/main/resources/ui/util/cdattribute.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdgates.gif b/src/main/resources/ui/util/cdgates.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdinvocation.gif b/src/main/resources/ui/util/cdinvocation.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdnatural.gif b/src/main/resources/ui/util/cdnatural.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdoperation.gif b/src/main/resources/ui/util/cdoperation.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdparallel.gif b/src/main/resources/ui/util/cdparallel.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdpreemption.gif b/src/main/resources/ui/util/cdpreemption.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdsequence.gif b/src/main/resources/ui/util/cdsequence.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdsynchro.gif b/src/main/resources/ui/util/cdsynchro.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdtclass.gif b/src/main/resources/ui/util/cdtclass.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdtdata.gif b/src/main/resources/ui/util/cdtdata.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdtobject.gif b/src/main/resources/ui/util/cdtobject.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/cdtoggleatt.gif b/src/main/resources/ui/util/cdtoggleatt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/checkmodel.gif b/src/main/resources/ui/util/checkmodel.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/classdiagram.gif b/src/main/resources/ui/util/classdiagram.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/concomment.gif b/src/main/resources/ui/util/concomment.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/dd.gif b/src/main/resources/ui/util/dd.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ddartifact.gif b/src/main/resources/ui/util/ddartifact.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ddnode.gif b/src/main/resources/ui/util/ddnode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/diplomethodo.gif b/src/main/resources/ui/util/diplomethodo.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/dta.gif b/src/main/resources/ui/util/dta.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ebrdd.gif b/src/main/resources/ui/util/ebrdd.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ebrdderb.gif b/src/main/resources/ui/util/ebrdderb.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ebrdderc.gif b/src/main/resources/ui/util/ebrdderc.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ebrddeso.gif b/src/main/resources/ui/util/ebrddeso.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ebrddobs.gif b/src/main/resources/ui/util/ebrddobs.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ebrddvar.gif b/src/main/resources/ui/util/ebrddvar.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/enterprise_logo.gif b/src/main/resources/ui/util/enterprise_logo.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ercconnector.gif b/src/main/resources/ui/util/ercconnector.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/formalvalidation.gif b/src/main/resources/ui/util/formalvalidation.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/genaut.gif b/src/main/resources/ui/util/genaut.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/gendesign.gif b/src/main/resources/ui/util/gendesign.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/genjava.gif b/src/main/resources/ui/util/genjava.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/genrtlotos.gif b/src/main/resources/ui/util/genrtlotos.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/gensystc.gif b/src/main/resources/ui/util/gensystc.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/gentmlc.gif b/src/main/resources/ui/util/gentmlc.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/gentmltxt.gif b/src/main/resources/ui/util/gentmltxt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/iod.gif b/src/main/resources/ui/util/iod.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/iodpreemption.gif b/src/main/resources/ui/util/iodpreemption.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/nc.gif b/src/main/resources/ui/util/nc.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/oneformalvalidation.gif b/src/main/resources/ui/util/oneformalvalidation.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/point.gif b/src/main/resources/ui/util/point.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/procsdcomponent.gif b/src/main/resources/ui/util/procsdcomponent.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/prosmdgetmsg.gif b/src/main/resources/ui/util/prosmdgetmsg.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/prosmdsendmsg.gif b/src/main/resources/ui/util/prosmdsendmsg.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/receivesignal.gif b/src/main/resources/ui/util/receivesignal.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/referencetosd.gif b/src/main/resources/ui/util/referencetosd.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqcomp.gif b/src/main/resources/ui/util/reqcomp.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqcopy.gif b/src/main/resources/ui/util/reqcopy.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqder.gif b/src/main/resources/ui/util/reqder.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqdiag.gif b/src/main/resources/ui/util/reqdiag.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqobs.gif b/src/main/resources/ui/util/reqobs.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqreq.gif b/src/main/resources/ui/util/reqreq.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqsatisfy.gif b/src/main/resources/ui/util/reqsatisfy.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/reqver.gif b/src/main/resources/ui/util/reqver.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/rg.gif b/src/main/resources/ui/util/rg.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/runexplo.gif b/src/main/resources/ui/util/runexplo.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/savehtml24.gif b/src/main/resources/ui/util/savehtml24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/savesvg24.gif b/src/main/resources/ui/util/savesvg24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/savetxt24.gif b/src/main/resources/ui/util/savetxt24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/savevcd24.gif b/src/main/resources/ui/util/savevcd24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sd.gif b/src/main/resources/ui/util/sd.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdabsolutetc.gif b/src/main/resources/ui/util/sdabsolutetc.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdaligninstances.gif b/src/main/resources/ui/util/sdaligninstances.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdasynchronous.gif b/src/main/resources/ui/util/sdasynchronous.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdcoregion.gif b/src/main/resources/ui/util/sdcoregion.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdguard.gif b/src/main/resources/ui/util/sdguard.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdinstance.gif b/src/main/resources/ui/util/sdinstance.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdrelativetc1.gif b/src/main/resources/ui/util/sdrelativetc1.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdrelativetc2.gif b/src/main/resources/ui/util/sdrelativetc2.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdsynchronous.gif b/src/main/resources/ui/util/sdsynchronous.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdtimercancel.gif b/src/main/resources/ui/util/sdtimercancel.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdtimerexpire.gif b/src/main/resources/ui/util/sdtimerexpire.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sdtimersetting.gif b/src/main/resources/ui/util/sdtimersetting.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/sendsignal.gif b/src/main/resources/ui/util/sendsignal.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/simulation.gif b/src/main/resources/ui/util/simulation.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/starting.gif b/src/main/resources/ui/util/starting.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/starting_logo.gif b/src/main/resources/ui/util/starting_logo.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/starting_logo_enterprise.gif b/src/main/resources/ui/util/starting_logo_enterprise.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/starting_logo_original.gif b/src/main/resources/ui/util/starting_logo_original.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/std_starting_logo.gif b/src/main/resources/ui/util/std_starting_logo.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/stepforward24.gif b/src/main/resources/ui/util/stepforward24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/stepforwardtobreakpoint24.gif b/src/main/resources/ui/util/stepforwardtobreakpoint24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/stepforwardx24.gif b/src/main/resources/ui/util/stepforwardx24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/stepforwardxcommands24.gif b/src/main/resources/ui/util/stepforwardxcommands24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/stepforwardxtimeunits24.gif b/src/main/resources/ui/util/stepforwardxtimeunits24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/stepforwardxtransactions24.gif b/src/main/resources/ui/util/stepforwardxtransactions24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/steptobus.gif b/src/main/resources/ui/util/steptobus.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/text1.gif b/src/main/resources/ui/util/text1.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlactivity.gif b/src/main/resources/ui/util/tmlactivity.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladdecrypt.gif b/src/main/resources/ui/util/tmladdecrypt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladencrypt.gif b/src/main/resources/ui/util/tmladencrypt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladexecc.gif b/src/main/resources/ui/util/tmladexecc.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladexeccint.gif b/src/main/resources/ui/util/tmladexeccint.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladexeci.gif b/src/main/resources/ui/util/tmladexeci.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladexeciint.gif b/src/main/resources/ui/util/tmladexeciint.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladforeverloop.gif b/src/main/resources/ui/util/tmladforeverloop.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladforloop.gif b/src/main/resources/ui/util/tmladforloop.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladnotifiedevt.gif b/src/main/resources/ui/util/tmladnotifiedevt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladrandom.gif b/src/main/resources/ui/util/tmladrandom.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladrdch.gif b/src/main/resources/ui/util/tmladrdch.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladselectevt.gif b/src/main/resources/ui/util/tmladselectevt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladsendevt.gif b/src/main/resources/ui/util/tmladsendevt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladsendreq.gif b/src/main/resources/ui/util/tmladsendreq.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladunorderedsequence.gif b/src/main/resources/ui/util/tmladunorderedsequence.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladwaitevt.gif b/src/main/resources/ui/util/tmladwaitevt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmladwrch.gif b/src/main/resources/ui/util/tmladwrch.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlbridgenode.gif b/src/main/resources/ui/util/tmlbridgenode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlbusnode.gif b/src/main/resources/ui/util/tmlbusnode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcdcha.gif b/src/main/resources/ui/util/tmlcdcha.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcdevt.gif b/src/main/resources/ui/util/tmlcdevt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcdreq.gif b/src/main/resources/ui/util/tmlcdreq.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcfork.gif b/src/main/resources/ui/util/tmlcfork.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcompcomp.gif b/src/main/resources/ui/util/tmlcompcomp.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcompd.gif b/src/main/resources/ui/util/tmlcompd.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcompdiag.gif b/src/main/resources/ui/util/tmlcompdiag.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcompport.gif b/src/main/resources/ui/util/tmlcompport.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcpunode.gif b/src/main/resources/ui/util/tmlcpunode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlcrypto.gif b/src/main/resources/ui/util/tmlcrypto.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmldesign.gif b/src/main/resources/ui/util/tmldesign.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlfirewallnode.gif b/src/main/resources/ui/util/tmlfirewallnode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlfpganode.gif b/src/main/resources/ui/util/tmlfpganode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlhwanode.gif b/src/main/resources/ui/util/tmlhwanode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlkey.gif b/src/main/resources/ui/util/tmlkey.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlmemorynode.gif b/src/main/resources/ui/util/tmlmemorynode.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlprimcomp.gif b/src/main/resources/ui/util/tmlprimcomp.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmlprimport.gif b/src/main/resources/ui/util/tmlprimport.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmltask.gif b/src/main/resources/ui/util/tmltask.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmltogglecha.gif b/src/main/resources/ui/util/tmltogglecha.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmltoggleevt.gif b/src/main/resources/ui/util/tmltoggleevt.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/tmltogglereq.gif b/src/main/resources/ui/util/tmltogglereq.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/About16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/About16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/About24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/About24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Add16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Add16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Add24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Add24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignBottom16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignBottom16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignBottom24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignBottom24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignCenter16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignCenter16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignCenter24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignCenter24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyHorizontal16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyHorizontal16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyHorizontal24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyHorizontal24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyVertical16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyVertical16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyVertical24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignJustifyVertical24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignLeft16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignLeft16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignLeft24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignLeft24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignRight16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignRight16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignRight24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignRight24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignTop16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignTop16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignTop24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/AlignTop24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Bookmarks16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Bookmarks16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Bookmarks24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Bookmarks24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ComposeMail16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ComposeMail16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ComposeMail24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ComposeMail24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ContextualHelp16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ContextualHelp16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ContextualHelp24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ContextualHelp24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Copy16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Copy16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Copy24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Copy24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Cut16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Cut16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Cut24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Cut24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Delete16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Delete16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Delete24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Delete24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Edit16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Edit16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Edit24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Edit24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Export16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Export16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Export24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Export24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Find16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Find16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Find24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Find24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/FindAgain16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/FindAgain16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/FindAgain24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/FindAgain24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Help16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Help16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Help24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Help24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/History16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/History16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/History24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/History24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Import16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Import16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Import24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Import24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Information16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Information16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Information24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Information24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/New16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/New16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/New24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/New24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Open16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Open16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Open24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Open24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/PageSetup16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/PageSetup16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/PageSetup24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/PageSetup24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Paste16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Paste16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Paste24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Paste24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Preferences16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Preferences16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Preferences24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Preferences24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Print16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Print16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Print24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Print24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/PrintPreview16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/PrintPreview16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/PrintPreview24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/PrintPreview24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Properties16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Properties16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Properties24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Properties24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Redo16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Redo16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Redo24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Redo24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Refresh16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Refresh16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Refresh24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Refresh24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Remove16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Remove16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Remove24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Remove24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Replace16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Replace16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Replace24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Replace24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Save16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Save16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Save24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Save24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAll16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAll16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAll24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAll24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAs16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAs16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAs24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/SaveAs24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Search16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Search16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Search24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Search24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/SendMail16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/SendMail16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/SendMail24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/SendMail24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Stop16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Stop16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Stop24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Stop24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/TipOfTheDay16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/TipOfTheDay16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/TipOfTheDay24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/TipOfTheDay24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Undo16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Undo16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Undo24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Undo24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Zoom16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Zoom16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/Zoom24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/Zoom24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomIn16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomIn16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomIn24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomIn24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomOut16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomOut16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomOut24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/ZoomOut24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/performancepragma16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/performancepragma16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/performancepragma24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/performancepragma24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/pragma.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/pragma.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/pragma16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/pragma16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/pragma24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/pragma24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/safepragma16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/safepragma16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/safepragma24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/safepragma24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/general/showTrace.gif b/src/main/resources/ui/util/toolbarButtonGraphics/general/showTrace.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/FastForward16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/FastForward16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/FastForward24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/FastForward24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Movie16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Movie16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Movie24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Movie24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Pause16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Pause16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Pause24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Pause24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Play16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Play16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Play24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Play24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Rewind16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Rewind16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Rewind24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Rewind24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/StepBack16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/StepBack16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/StepBack24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/StepBack24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/StepForward16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/StepForward16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/StepForward24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/StepForward24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Stop16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Stop16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Stop24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Stop24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Volume16.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Volume16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/toolbarButtonGraphics/media/Volume24.gif b/src/main/resources/ui/util/toolbarButtonGraphics/media/Volume24.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/turtle_16.gif b/src/main/resources/ui/util/turtle_16.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/turtle_large.gif b/src/main/resources/ui/util/turtle_large.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucd.gif b/src/main/resources/ui/util/ucd.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdactor.gif b/src/main/resources/ui/util/ucdactor.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdborder.gif b/src/main/resources/ui/util/ucdborder.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdconnact.gif b/src/main/resources/ui/util/ucdconnact.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdextend.gif b/src/main/resources/ui/util/ucdextend.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdinclude.gif b/src/main/resources/ui/util/ucdinclude.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdspecia.gif b/src/main/resources/ui/util/ucdspecia.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/ucdusecase.gif b/src/main/resources/ui/util/ucdusecase.gif old mode 100755 new mode 100644 diff --git a/src/main/resources/ui/util/viewsimulation.gif b/src/main/resources/ui/util/viewsimulation.gif old mode 100755 new mode 100644 diff --git a/ttooldaniela.exe b/ttooldaniela.exe new file mode 100755 index 0000000000000000000000000000000000000000..c2b7b9ae40ddd06e3c3002b09ffb241c637659f4 --- /dev/null +++ b/ttooldaniela.exe @@ -0,0 +1,7 @@ +#!/bin/sh + +java -version +cd bin; +java -Xmx1024m -jar ttool.jar -config config.xml -experimental -debug -avatar -uppaal -launcher + +