Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:37:18 +0000
committerCamille Letavernier2014-08-21 11:37:18 +0000
commitea48a20561464c3cbb7895d430583669a9f82fcc (patch)
tree0fdf9eebacbbb301b13bafce3ca4a6952ff6e91c /extraplugins/robotml
parentf91b71175fd97557cf378cdcad845a44a6274b16 (diff)
downloadorg.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.gz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.xz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.zip
[Code style] Apply clean-up and formatter on Extra plug-ins
Diffstat (limited to 'extraplugins/robotml')
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/Activator.java10
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/ArchitectureQueries.java289
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DataTypeQueries.java106
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DeploymentQueries.java247
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/FSMQueries.java63
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/GeneralQueries.java315
-rw-r--r--extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/MMQueries.java94
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/Activator.java10
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/common/GenerateAll.java55
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoGenerateRTMapsCommandHandler.java58
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoRTMapsCodeGenerator.java16
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/GenerateRTMapsCodeCommand.java21
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/popupMenus/AcceleoGenerateRTMapsAction.java20
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Activator.java10
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java141
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/RTMapsDataTypeQueries.java90
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Activator.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/AllocUtils.java272
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/CommandSupport.java18
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Copy.java337
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepCreation.java294
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanSync.java52
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanUtils.java126
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepUtils.java131
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DialogUtils.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Log.java14
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/RunnableWithResult.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/StUtils.java201
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/TransformationException.java2
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Utils.java279
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AllocationDialog.java102
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AttributeLabelProvider.java11
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/ConfigureInstanceDialog.java217
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/Description.java27
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/InstanceLabelProvider.java9
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/AllocateHandler.java22
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CmdHandler.java47
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/ConfigureInstanceHandler.java45
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreateDepPlanHandler.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreatePlatformHandler.java27
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/listener/CopyListener.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/Activator.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/commands/CreateRobotmlModelCommand.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicies/PortNodeLabelDisplayEditPolicy.java26
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicy/provider/RobotMLDiagramsEditPolicyProvider.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/MigrateDiagramsHandler.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/RobotMLReconciler.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/utils/RobotmlSelectionTester.java48
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/Activator.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlModelWizard.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlProjectWizard.java12
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.doc/src/org/eclipse/papyrus/robotml/doc/Activator.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/Activator.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllPortsQuery.java11
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllSubSystemsQuery.java15
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetImageQuery.java13
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetOtherPropertiesQuery.java11
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/HasImageQuery.java5
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/RobotMLProfileAppliedQuery.java5
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/util/ProfileUtil.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/Activator.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/RobotmlPerspective.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.templaterepository/src/org/eclipse/papyrus/robotml/templaterepository/Activator.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/Activator.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/ValidationDelegateClientSelector.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/ConstraintsUtil.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java41
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/OnlyOneConnectionBetweenTwoPorts.java50
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortIsCorrectlyTyped.java36
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortsAreCorrectlyConnected.java154
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PropertyNameVsItsTypeName.java50
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/VerifyAlphanumericNamedElement.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/helper/RobotmlProfileHelper.java2
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Agent.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Algorithm.java50
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/AlgorithmLibrary.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Allocate.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/BlenderMorse.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CameraSystem.java90
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CompleteBonding.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CycabTK.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/DataFlowDirectionKind.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/DataFlowPort.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/DeploymentPlan.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/EngineSystem.java60
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/ExternalLibrary.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/GPSSystem.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Joint.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/LidarSystem.java120
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/LocomotionSystem.java3
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/MobileRobot.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/MobileRobotKind.java98
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/OnPort.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/OnProperty.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/PhysicalObject.java36
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Platform.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Port.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Robot.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/RobotMLFactory.java83
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/RobotMLPackage.java1205
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/RoboticMiddleware.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/RoboticMiddlewareKind.java78
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/RoboticSystem.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/SensorSystem.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/ServiceFlowKind.java48
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/ServicePort.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Shade.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Software.java50
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/State.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/SteeredWheelSystem.java160
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/SynchronizationKind.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/System.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Transition.java32
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/UGVKind.java48
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/WeaponSystem.java2
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ActuatedJointImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ActuatorHardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ActuatorSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/AgentImpl.java34
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/AlgorithmImpl.java169
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/AlgorithmLibraryImpl.java82
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/AllocateImpl.java48
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ArmImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/BlenderMorseImpl.java129
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/BuildingImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/CameraSystemImpl.java323
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ChassisImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ClosedLoopControlSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/CompleteBondingImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/CyberPhysicalSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/CycabTKImpl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/DataFlowPortImpl.java88
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/DeploymentPlanImpl.java88
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/EngineSystemImpl.java187
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/EnvironmentImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ExternalLibraryImpl.java111
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/FloorImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/GPSSystemImpl.java62
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/GraspingHardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/GraspingSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/GroundImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/GyroscopeImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/HardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/HumanImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ImageSensorSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/InertialMeasurementUnitSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/InertialNavigationSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/InfraRedProximetrySystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/JointImpl.java48
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/JoysticNavigationSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LandSurfaceImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LegImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LegSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LidarSystemImpl.java361
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LocalizationSensorSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LocomotionHardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/LocomotionSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ManMachineInterfaceSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ManipulatorImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/MechanicalLinkageImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/MobileRobotImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/NavigationCommandSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ObjectDetectionSensorSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ObjectTrackingSensorSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/OdometrySystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/OnPortImpl.java88
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/OnPropertyImpl.java88
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/OpenLoopControlSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PedestrianImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PhysicalObjectImpl.java137
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PilotedSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PlanetImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PlatformImpl.java74
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PortImpl.java82
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/PowerHardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RobotImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RobotMLFactoryImpl.java439
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RobotMLPackageImpl.java649
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RoboticHeadImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RoboticMiddlewareImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RoboticSimulatorImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RoboticSystemImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SensorDriverImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SensorHardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SensorSystemImpl.java71
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/ServicePortImpl.java52
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SoftwareImpl.java158
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/StairsImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/StateImpl.java88
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SteeredWheelHardwareImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SteeredWheelSystemImpl.java477
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SupportingStructureImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SurfaceImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/SystemImpl.java140
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/TransitionImpl.java128
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/WaterSurfaceImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/WeaponSystemImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/util/RobotMLAdapterFactory.java828
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/util/RobotMLResourceFactoryImpl.java5
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/util/RobotMLResourceImpl.java7
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/util/RobotMLSwitch.java2313
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/util/RobotMLXMLProcessor.java7
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/Actionlib_datatypesFactory.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/Actionlib_datatypesPackage.java92
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/GoalID.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/GoalStatus.java120
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/GoalStatusArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/impl/Actionlib_datatypesFactoryImpl.java31
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/impl/Actionlib_datatypesPackageImpl.java137
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/impl/GoalIDImpl.java71
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/impl/GoalStatusArrayImpl.java92
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/impl/GoalStatusImpl.java361
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/util/Actionlib_datatypesAdapterFactory.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/actionlib_datatypes/util/Actionlib_datatypesSwitch.java65
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/DiagnosticArray.java22
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/DiagnosticStatus.java76
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/Diagnostic_datatypesFactory.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/Diagnostic_datatypesPackage.java83
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/KeyValue.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/impl/DiagnosticArrayImpl.java122
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/impl/DiagnosticStatusImpl.java247
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/impl/Diagnostic_datatypesFactoryImpl.java31
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/impl/Diagnostic_datatypesPackageImpl.java128
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/impl/KeyValueImpl.java71
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/util/Diagnostic_datatypesAdapterFactory.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/diagnostic_datatypes/util/Diagnostic_datatypesSwitch.java65
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Geometry_datatypesFactory.java26
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Geometry_datatypesPackage.java269
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Point.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Point32.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/PointStamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Polygon.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/PolygonStamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Pose.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Pose2D.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/PoseArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/PoseStamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/PoseWithCovariance.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Quaternion.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/QuaternionStamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Transform.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Twist.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/TwistStamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/TwistWithCovariance.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Vector3.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Vector3Stamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/Wrench.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/WrenchStamped.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/Geometry_datatypesFactoryImpl.java103
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/Geometry_datatypesPackageImpl.java278
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/Point32Impl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PointImpl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PointStampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PolygonImpl.java39
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PolygonStampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/Pose2DImpl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PoseArrayImpl.java92
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PoseImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PoseStampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PoseWithCovarianceImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/PoseWithCovarianceStampedImpl.java4
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/QuaternionImpl.java129
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/QuaternionStampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/TransformImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/TwistImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/TwistStampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/TwistWithCovarianceImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/Vector3Impl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/Vector3StampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/WrenchImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/impl/WrenchStampedImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/util/Geometry_datatypesAdapterFactory.java238
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/geometry_datatypes/util/Geometry_datatypesSwitch.java353
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/GridCells.java36
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/MapMetaData.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/Nav_datatypesFactory.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/Nav_datatypesPackage.java105
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/OccupancyGrid.java26
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/Odometry.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/Path.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/GridCellsImpl.java155
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/MapMetaDataImpl.java154
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/Nav_datatypesFactoryImpl.java39
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/Nav_datatypesPackageImpl.java154
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/OccupancyGridImpl.java146
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/OdometryImpl.java202
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/impl/PathImpl.java92
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/util/Nav_datatypesAdapterFactory.java78
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/nav_datatypes/util/Nav_datatypesSwitch.java97
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/CarLikeCommand.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/ExtentedLidarScan.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/MultiLayerLidarScan.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/Oarp1_datatypesFactory.java8
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/Oarp1_datatypesPackage.java65
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/impl/CarLikeCommandImpl.java71
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/impl/ExtentedLidarScanImpl.java125
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/impl/MultiLayerLidarScanImpl.java96
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/impl/Oarp1_datatypesFactoryImpl.java31
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/impl/Oarp1_datatypesPackageImpl.java111
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/util/Oarp1_datatypesAdapterFactory.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp1_datatypes/util/Oarp1_datatypesSwitch.java65
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Angular.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Art_Set_Point.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Distance.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Metric.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Milli_Amp.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Oarp4_datatypesFactory.java21
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Oarp4_datatypesPackage.java190
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Odometer_Linear_Left_Right.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Odometer_Tics.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Odometer_Tics_Left_Right.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Op_Set_Point.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Proxi_Left_Right.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Speed_Tics.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Speed_Tics_Left_Right.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Velocity.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Velocity_Angular.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Velocity_Angular_Left_Right.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/Velocity_Linear.java10
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/AngularImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Art_Set_PointImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/DistanceImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/MetricImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Milli_AmpImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Oarp4_datatypesFactoryImpl.java83
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Oarp4_datatypesPackageImpl.java222
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Odometer_Linear_Left_RightImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Odometer_TicsImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Odometer_Tics_Left_RightImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Op_Set_PointImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Proxi_Left_RightImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Speed_TicsImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Speed_Tics_Left_RightImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/VelocityImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Velocity_AngularImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Velocity_Angular_Left_RightImpl.java115
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/impl/Velocity_LinearImpl.java42
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/util/Oarp4_datatypesAdapterFactory.java188
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/oarps_datatypes/oarp4_datatypes/util/Oarp4_datatypesSwitch.java273
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/COVARIANCE_TYPE.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/CameraInfo.java94
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/CarLikeOdometry.java60
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/ChannelFloat32.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/CompressedImage.java26
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/DifferentialOdometry.java50
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/Image.java66
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/Imu.java58
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/JointState.java24
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/Joy.java22
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/JoyFeedback.java60
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/JoyFeedbackArray.java6
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/LaserScan.java92
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/NavSatFix.java76
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/NavSatStatus.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/PointCloud.java22
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/PointCloud2.java82
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/PointField.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/Range.java80
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/RegionOfInterest.java50
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/SERVICE_TYPE.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/STATUS_TYPE.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/Sensor_datatypesFactory.java24
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/Sensor_datatypesPackage.java469
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/CameraInfoImpl.java369
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/CarLikeOdometryImpl.java212
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/ChannelFloat32Impl.java68
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/CompressedImageImpl.java122
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/DifferentialOdometryImpl.java183
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/ImageImpl.java238
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/ImuImpl.java304
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/JointStateImpl.java117
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/JoyFeedbackArrayImpl.java39
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/JoyFeedbackImpl.java187
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/JoyImpl.java119
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/LaserScanImpl.java322
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/NavSatFixImpl.java267
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/NavSatStatusImpl.java175
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/PointCloud2Impl.java297
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/PointCloudImpl.java122
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/PointFieldImpl.java129
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/RangeImpl.java270
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/RegionOfInterestImpl.java158
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/Sensor_datatypesFactoryImpl.java147
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/impl/Sensor_datatypesPackageImpl.java515
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/util/Sensor_datatypesAdapterFactory.java218
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/util/Sensor_datatypesSwitch.java321
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/ByteMultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/ColorRGBA.java40
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Float32MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Float64MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Header.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Int16MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Int32MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Int64MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Int8MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/MultiArrayDimension.java30
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/MultiArrayLayout.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Std_datatypesFactory.java20
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/Std_datatypesPackage.java254
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/UIint16MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/UInt32MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/UInt64MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/UInt8MultiArray.java16
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/ByteMultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/ColorRGBAImpl.java129
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Float32MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Float64MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/HeaderImpl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Int16MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Int32MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Int64MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Int8MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/MultiArrayDimensionImpl.java100
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/MultiArrayLayoutImpl.java73
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Std_datatypesFactoryImpl.java281
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/Std_datatypesPackageImpl.java268
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/UIint16MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/UInt32MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/UInt64MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/impl/UInt8MultiArrayImpl.java93
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/util/Std_datatypesAdapterFactory.java178
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/std_datatypes/util/Std_datatypesSwitch.java257
422 files changed, 22751 insertions, 12591 deletions
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/Activator.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/Activator.java
index 432d9c1c4ea..70c138dd5f3 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/Activator.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/Activator.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -36,9 +36,10 @@ public class Activator extends Plugin {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -46,9 +47,10 @@ public class Activator extends Plugin {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -56,7 +58,7 @@ public class Activator extends Plugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/ArchitectureQueries.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/ArchitectureQueries.java
index 4d6aac650b5..0e1b3e8ef36 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/ArchitectureQueries.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/ArchitectureQueries.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 PROTEUS Project consortium.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,9 +35,9 @@ import org.eclipse.uml2.uml.util.UMLUtil;
/**
- *
+ *
* @author scdtnsm
- *
+ *
*/
public class ArchitectureQueries {
@@ -65,19 +65,19 @@ public class ArchitectureQueries {
/**
* Retrieves the source port for a given connector
- *
+ *
* @see isDestPort and isSourcePort
*/
static private int getSourcePort(org.eclipse.uml2.uml.Connector conn, Port[] dest_port) {
- if(conn.getEnds().get(0).getRole() instanceof Port) {
- Port test_1 = (Port)conn.getEnds().get(0).getRole();
- if(isSourcePort(conn.getEnds().get(0), test_1)) {
+ if (conn.getEnds().get(0).getRole() instanceof Port) {
+ Port test_1 = (Port) conn.getEnds().get(0).getRole();
+ if (isSourcePort(conn.getEnds().get(0), test_1)) {
dest_port[0] = test_1;
return 0;
}
- Port test_2 = (Port)conn.getEnds().get(1).getRole();
- if(isSourcePort(conn.getEnds().get(1), test_2)) {
+ Port test_2 = (Port) conn.getEnds().get(1).getRole();
+ if (isSourcePort(conn.getEnds().get(1), test_2)) {
dest_port[0] = test_2;
return 1;
}
@@ -88,18 +88,18 @@ public class ArchitectureQueries {
/**
* Retrieves the destination port for a given connector
- *
+ *
* @see isDestPort and isSourcePort
*/
public static int getDestPort(org.eclipse.uml2.uml.Connector conn, Port[] dest_port) {
- if(conn.getEnds().get(0).getRole() instanceof Port) {
- Port test_1 = (Port)conn.getEnds().get(0).getRole();
- if(isDestPort(conn.getEnds().get(0), test_1)) {
+ if (conn.getEnds().get(0).getRole() instanceof Port) {
+ Port test_1 = (Port) conn.getEnds().get(0).getRole();
+ if (isDestPort(conn.getEnds().get(0), test_1)) {
dest_port[0] = test_1;
return 0;
}
- Port test_2 = (Port)conn.getEnds().get(1).getRole();
- if(isDestPort(conn.getEnds().get(1), test_2)) {
+ Port test_2 = (Port) conn.getEnds().get(1).getRole();
+ if (isDestPort(conn.getEnds().get(1), test_2)) {
dest_port[0] = test_2;
return 1;
}
@@ -115,8 +115,9 @@ public class ArchitectureQueries {
String inputName;
Port[] inputPort = new Port[1];
int index = getSourcePort(conn, inputPort);
- if(index < 0)
+ if (index < 0) {
return "Unknown";
+ }
inputName = inputPort[0].getName();
@@ -125,27 +126,29 @@ public class ArchitectureQueries {
/**
* Retrieve the model name of a component at the source of a connector.
- *
+ *
* @param conn
* @return a string or null if no component has been found at the source of a connector.
*/
static public String getSourceComponentTypeNameForConnector(org.eclipse.uml2.uml.Connector conn) {
Property prop = getSourceComponentForConnector(conn);
- if(prop == null)
+ if (prop == null) {
return null;
+ }
return prop.getType().getName();
}
/**
* Retrieve the instance name of a component at the source of a connector.
- *
+ *
* @param conn
* @return a string or null if no component has been found at the source of a connector.
*/
static public String getSourceComponentInstanceNameForConnector(org.eclipse.uml2.uml.Connector conn) {
Property prop = getSourceComponentForConnector(conn);
- if(prop == null)
+ if (prop == null) {
return null;
+ }
return prop.getName();
}
@@ -156,10 +159,11 @@ public class ArchitectureQueries {
Property input;
Port[] inputPort = new Port[1];
int index = getSourcePort(conn, inputPort);
- if((index < 0) || (conn.getEnds().get(index).getPartWithPort() == null))
+ if ((index < 0) || (conn.getEnds().get(index).getPartWithPort() == null)) {
return null;
- else
+ } else {
input = conn.getEnds().get(index).getPartWithPort();
+ }
return input;
}
@@ -170,8 +174,9 @@ public class ArchitectureQueries {
String outputName;
Port[] outputPort = new Port[1];
int index = getDestPort(conn, outputPort);
- if(index < 0)
+ if (index < 0) {
return "Unknown";
+ }
outputName = outputPort[0].getName();
@@ -185,36 +190,39 @@ public class ArchitectureQueries {
Property output;
Port[] outputPort = new Port[1];
int index = getDestPort(conn, outputPort);
- if((index < 0) || (conn.getEnds().get(index).getPartWithPort() == null))
+ if ((index < 0) || (conn.getEnds().get(index).getPartWithPort() == null)) {
return null;
- else
+ } else {
output = conn.getEnds().get(index).getPartWithPort();
+ }
return output;
}
/**
* Retrieve the model name (or type name) of a component at the destination of a connector.
- *
+ *
* @param conn
* @return a string or null if no component has been found at the destination of a connector.
*/
static public String getDestComponentTypeNameForConnector(org.eclipse.uml2.uml.Connector conn) {
Property prop = getDestComponentForConnector(conn);
- if(prop == null)
+ if (prop == null) {
return null;
+ }
return prop.getType().getName();
}
/**
* Retrieve the instance name of a component at the destination of a connector.
- *
+ *
* @param conn
* @return a string or null if no component has been found at the destination of a connector.
*/
static public String getDestComponentInstanceNameForConnector(org.eclipse.uml2.uml.Connector conn) {
Property prop = getDestComponentForConnector(conn);
- if(prop == null)
+ if (prop == null) {
return null;
+ }
return prop.getName();
}
@@ -224,8 +232,8 @@ public class ArchitectureQueries {
*/
static public List<org.eclipse.uml2.uml.Connector> getInternalConnectors(org.eclipse.uml2.uml.Class c) {
LinkedList<org.eclipse.uml2.uml.Connector> connectors = new LinkedList<org.eclipse.uml2.uml.Connector>();
- for(Connector conn : c.getOwnedConnectors()) {
- if(conn.getEnds().size() >= 2 && (conn.getEnds().get(0).getPartWithPort() != null) && (conn.getEnds().get(1).getPartWithPort() != null)) {
+ for (Connector conn : c.getOwnedConnectors()) {
+ if (conn.getEnds().size() >= 2 && (conn.getEnds().get(0).getPartWithPort() != null) && (conn.getEnds().get(1).getPartWithPort() != null)) {
connectors.add(conn);
}
}
@@ -238,12 +246,12 @@ public class ArchitectureQueries {
*/
static public List<org.eclipse.uml2.uml.Connector> getExternalInputConnectors(org.eclipse.uml2.uml.Class c) {
LinkedList<org.eclipse.uml2.uml.Connector> connectors = new LinkedList<org.eclipse.uml2.uml.Connector>();
- for(Connector conn : c.getOwnedConnectors()) {
- if(conn.getEnds().size() >= 2) {// && (conn.getEnds().get(1).getPartWithPort() != null)) {
- if(conn.getEnds().get(0).getRole() instanceof Port && conn.getEnds().get(1).getRole() instanceof Port) {
- Port port_1 = (Port)conn.getEnds().get(0).getRole();
- Port port_2 = (Port)conn.getEnds().get(1).getRole();
- if((isAnInputPort(port_1) && conn.getEnds().get(0).getPartWithPort() == null) || (isAnInputPort(port_2) && conn.getEnds().get(1).getPartWithPort() == null)) {
+ for (Connector conn : c.getOwnedConnectors()) {
+ if (conn.getEnds().size() >= 2) {// && (conn.getEnds().get(1).getPartWithPort() != null)) {
+ if (conn.getEnds().get(0).getRole() instanceof Port && conn.getEnds().get(1).getRole() instanceof Port) {
+ Port port_1 = (Port) conn.getEnds().get(0).getRole();
+ Port port_2 = (Port) conn.getEnds().get(1).getRole();
+ if ((isAnInputPort(port_1) && conn.getEnds().get(0).getPartWithPort() == null) || (isAnInputPort(port_2) && conn.getEnds().get(1).getPartWithPort() == null)) {
connectors.add(conn);
}
}
@@ -258,12 +266,12 @@ public class ArchitectureQueries {
*/
static public List<org.eclipse.uml2.uml.Connector> getExternalOutputConnectors(org.eclipse.uml2.uml.Class c) {
LinkedList<org.eclipse.uml2.uml.Connector> connectors = new LinkedList<org.eclipse.uml2.uml.Connector>();
- for(Connector conn : c.getOwnedConnectors()) {
- if(conn.getEnds().size() >= 2) {// && (conn.getEnds().get(0).getPartWithPort() != null)) {
- if(conn.getEnds().get(0).getRole() instanceof Port && conn.getEnds().get(1).getRole() instanceof Port) {
- Port port_1 = (Port)conn.getEnds().get(0).getRole();
- Port port_2 = (Port)conn.getEnds().get(1).getRole();
- if((isAnOutputPort(port_1) && conn.getEnds().get(0).getPartWithPort() == null) || (isAnOutputPort(port_2) && conn.getEnds().get(1).getPartWithPort() == null)) {
+ for (Connector conn : c.getOwnedConnectors()) {
+ if (conn.getEnds().size() >= 2) {// && (conn.getEnds().get(0).getPartWithPort() != null)) {
+ if (conn.getEnds().get(0).getRole() instanceof Port && conn.getEnds().get(1).getRole() instanceof Port) {
+ Port port_1 = (Port) conn.getEnds().get(0).getRole();
+ Port port_2 = (Port) conn.getEnds().get(1).getRole();
+ if ((isAnOutputPort(port_1) && conn.getEnds().get(0).getPartWithPort() == null) || (isAnOutputPort(port_2) && conn.getEnds().get(1).getPartWithPort() == null)) {
connectors.add(conn);
}
}
@@ -277,11 +285,11 @@ public class ArchitectureQueries {
* (a model can be contained in a model ... which is contained in a class).
*/
static public org.eclipse.uml2.uml.Class getRootClassForModel(org.eclipse.uml2.uml.Model m) {
- for(Element ne : m.getOwnedElements()) {
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- return (org.eclipse.uml2.uml.Class)ne;
- } else if(ne instanceof org.eclipse.uml2.uml.Model) {
- return getRootClassForModel((org.eclipse.uml2.uml.Model)ne);
+ for (Element ne : m.getOwnedElements()) {
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ return (org.eclipse.uml2.uml.Class) ne;
+ } else if (ne instanceof org.eclipse.uml2.uml.Model) {
+ return getRootClassForModel((org.eclipse.uml2.uml.Model) ne);
}
}
return null;
@@ -295,8 +303,8 @@ public class ArchitectureQueries {
LinkedList<org.eclipse.uml2.uml.Property> sub_components = new LinkedList<org.eclipse.uml2.uml.Property>();
List<org.eclipse.uml2.uml.Property> level_1 = getLevel1SubComponentsForComponent(c);
sub_components.addAll(level_1);
- for(Property prop : level_1) {
- List<Property> next_levels = getAllSubComponentsInClass((org.eclipse.uml2.uml.Class)prop.getType());
+ for (Property prop : level_1) {
+ List<Property> next_levels = getAllSubComponentsInClass((org.eclipse.uml2.uml.Class) prop.getType());
sub_components.addAll(next_levels);
}
return sub_components;
@@ -308,10 +316,10 @@ public class ArchitectureQueries {
*/
static public List<org.eclipse.uml2.uml.Property> getLevel1SubComponentsForComponent(org.eclipse.uml2.uml.Class c) {
LinkedList<org.eclipse.uml2.uml.Property> sub_components = new LinkedList<org.eclipse.uml2.uml.Property>();
- for(org.eclipse.uml2.uml.Property prop : c.getAllAttributes()) {
+ for (org.eclipse.uml2.uml.Property prop : c.getAllAttributes()) {
Type t = prop.getType();
- if(t instanceof org.eclipse.uml2.uml.Class) {
- if(GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class)t, org.eclipse.papyrus.RobotML.System.class)) {
+ if (t instanceof org.eclipse.uml2.uml.Class) {
+ if (GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class) t, org.eclipse.papyrus.RobotML.System.class)) {
sub_components.add(prop);
}
}
@@ -322,17 +330,18 @@ public class ArchitectureQueries {
/**
* On a given class (a RobotML system), retrieve all the contained systems.
* Not recursive. Retrieves only one level deep.
- *
+ *
* @deprecated replaced by getLevel1SubComponentsForComponent(org.eclipse.uml2.uml.Class c) which uses the RobotML API instead of stereotype
* names.
*/
+ @Deprecated
static public List<org.eclipse.uml2.uml.Property> getLevel1SubComponentsForComponentWithStereotype(org.eclipse.uml2.uml.Class c, String stereotype) {
LinkedList<org.eclipse.uml2.uml.Property> sub_components = new LinkedList<org.eclipse.uml2.uml.Property>();
- for(Property prop : c.getAllAttributes()) {
+ for (Property prop : c.getAllAttributes()) {
Type t = prop.getType();
- if(t instanceof org.eclipse.uml2.uml.Class) {
- // if(GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class) t, stereotype))
- if(GeneralQueries.inheritsFrom((org.eclipse.uml2.uml.Class)t, stereotype)) {
+ if (t instanceof org.eclipse.uml2.uml.Class) {
+ // if(GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class) t, stereotype))
+ if (GeneralQueries.inheritsFrom((org.eclipse.uml2.uml.Class) t, stereotype)) {
sub_components.add(prop);
}
}
@@ -346,10 +355,10 @@ public class ArchitectureQueries {
*/
static public List<org.eclipse.uml2.uml.Port> getOutputPortsForElement(Element elt) {
LinkedList<org.eclipse.uml2.uml.Port> found_output_ports = new LinkedList<org.eclipse.uml2.uml.Port>();
- for(Element child : elt.getOwnedElements()) {
- if(child instanceof org.eclipse.uml2.uml.Port) {
- if(isAnOutputPort((org.eclipse.uml2.uml.Port)child)) {
- found_output_ports.add((org.eclipse.uml2.uml.Port)child);
+ for (Element child : elt.getOwnedElements()) {
+ if (child instanceof org.eclipse.uml2.uml.Port) {
+ if (isAnOutputPort((org.eclipse.uml2.uml.Port) child)) {
+ found_output_ports.add((org.eclipse.uml2.uml.Port) child);
}
}
}
@@ -361,10 +370,10 @@ public class ArchitectureQueries {
*/
static public List<Port> getInputPortsForElement(Element elt) {
LinkedList<Port> found_input_ports = new LinkedList<org.eclipse.uml2.uml.Port>();
- for(Element child : elt.getOwnedElements()) {
- if(child instanceof NamedElement && child instanceof org.eclipse.uml2.uml.Port) {
- if(isAnInputPort((org.eclipse.uml2.uml.Port)child)) {
- Port found_port = (org.eclipse.uml2.uml.Port)child;
+ for (Element child : elt.getOwnedElements()) {
+ if (child instanceof NamedElement && child instanceof org.eclipse.uml2.uml.Port) {
+ if (isAnInputPort((org.eclipse.uml2.uml.Port) child)) {
+ Port found_port = (org.eclipse.uml2.uml.Port) child;
found_input_ports.add(found_port);
}
}
@@ -374,10 +383,10 @@ public class ArchitectureQueries {
static public List<org.eclipse.uml2.uml.Property> getOnPort(org.eclipse.uml2.uml.Parameter param) {
LinkedList<org.eclipse.uml2.uml.Property> result = new LinkedList<org.eclipse.uml2.uml.Property>();
- for(Stereotype st : param.getAppliedStereotypes()) {
- if(st.getName().contains("OnPort")) {
- for(Property p : st.getAttributes()) {
- result.add((Property)p);
+ for (Stereotype st : param.getAppliedStereotypes()) {
+ if (st.getName().contains("OnPort")) {
+ for (Property p : st.getAttributes()) {
+ result.add(p);
}
}
}
@@ -390,10 +399,10 @@ public class ArchitectureQueries {
*/
static public List<NamedElement> getComponentModels(Model model) {
LinkedList<NamedElement> found_elts = new LinkedList<NamedElement>();
- for(Element elt : model.allOwnedElements()) {
- if(elt instanceof org.eclipse.uml2.uml.Class) {
- if(GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class)elt, org.eclipse.papyrus.RobotML.System.class) && false == GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class)elt, org.eclipse.papyrus.RobotML.Platform.class)) {
- found_elts.add((NamedElement)elt);
+ for (Element elt : model.allOwnedElements()) {
+ if (elt instanceof org.eclipse.uml2.uml.Class) {
+ if (GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class) elt, org.eclipse.papyrus.RobotML.System.class) && false == GeneralQueries.hasStereotype((org.eclipse.uml2.uml.Class) elt, org.eclipse.papyrus.RobotML.Platform.class)) {
+ found_elts.add((NamedElement) elt);
}
}
}
@@ -402,26 +411,27 @@ public class ArchitectureQueries {
/**
* Is the elt at the root of the model hierarchy ?
- *
+ *
* @param elt
* @return
*/
static public Boolean isRootModel(Model elt) {
- if(elt == null)
+ if (elt == null) {
return false;
+ }
return (elt.getOwner() == null);
}
/**
* Does this class contain properties that are classes themselves ?
* (i.e. is this class a container of sub-classes)
- *
+ *
* @param c
* @return
*/
static public Boolean isMacroComponent(org.eclipse.uml2.uml.Class c) {
boolean result = false;
- if(getLevel1SubComponentsForComponent(c).size() > 0) {
+ if (getLevel1SubComponentsForComponent(c).size() > 0) {
result = true;
}
return result;
@@ -429,34 +439,38 @@ public class ArchitectureQueries {
static public Boolean hasNativeImplementation(org.eclipse.uml2.uml.Class c) {
org.eclipse.papyrus.RobotML.System sys = org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(c, org.eclipse.papyrus.RobotML.System.class);
- if(sys == null)
+ if (sys == null) {
return false;
+ }
return sys.isNative();
}
static public String getNativeLibraryPathForComponent(org.eclipse.uml2.uml.Class c) {
org.eclipse.papyrus.RobotML.System sys = org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(c, org.eclipse.papyrus.RobotML.System.class);
- if(sys == null)
+ if (sys == null) {
return null;
+ }
return sys.getLibraryPath();
}
static public String getNativeComponentNameForComponent(org.eclipse.uml2.uml.Class c) {
org.eclipse.papyrus.RobotML.System sys = org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(c, org.eclipse.papyrus.RobotML.System.class);
- if(sys == null)
+ if (sys == null) {
return null;
+ }
return sys.getLibraryComponentName();
}
static public int getOutputPortBufferSize(Port p) {
org.eclipse.papyrus.RobotML.DataFlowPort dfp = org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(p, org.eclipse.papyrus.RobotML.DataFlowPort.class);
- if(dfp == null)
+ if (dfp == null) {
return 0;
+ }
return dfp.getBufferSize();
}
/**
- *
+ *
*/
static public String getComponentFileName(org.eclipse.uml2.uml.Class c, String end) {
return c.getName() + end;
@@ -466,34 +480,35 @@ public class ArchitectureQueries {
* @TODO: author to add some doc.
*/
static public Boolean isPortConnected(Port p1) {
- if(p1.getEnds().size() > 0) {
- Connector conn = (Connector)p1.getEnds().get(0).getOwner();
+ if (p1.getEnds().size() > 0) {
+ Connector conn = (Connector) p1.getEnds().get(0).getOwner();
return isConnectionValid(conn);
- } else
+ } else {
return false;
+ }
}
/**
* @TODO: author to add some doc. Middleware specific?
*/
static public String getConnectionOtherSide(Port p1) {
- if(p1.getEnds().size() > 0) {
- Connector conn = (Connector)p1.getEnds().get(0).getOwner();
+ if (p1.getEnds().size() > 0) {
+ Connector conn = (Connector) p1.getEnds().get(0).getOwner();
ConnectorEnd e1 = conn.getEnds().get(0);
ConnectorEnd e2 = conn.getEnds().get(1);
Port p2 = null;
java.lang.System.out.println("p1=" + p1.getName());
Property c2 = null;
- if(e1.getRole() == p1) {
- p2 = (Port)e2.getRole();
- c2 = (Property)e2.getPartWithPort();
+ if (e1.getRole() == p1) {
+ p2 = (Port) e2.getRole();
+ c2 = e2.getPartWithPort();
java.lang.System.out.println("1 - p2=" + p2.getName() + ", c2=" + c2.getName());
- } else if(e2.getRole() == p1) {
- p2 = (Port)e1.getRole();
- c2 = (Property)e1.getPartWithPort();
+ } else if (e2.getRole() == p1) {
+ p2 = (Port) e1.getRole();
+ c2 = e1.getPartWithPort();
java.lang.System.out.println("2 - p2=" + p2.getName() + ", c2=" + c2.getName());
}
- if(c2.getName().equals(((NamedElement)conn.getOwner()).getName())) {
+ if (c2.getName().equals(((NamedElement) conn.getOwner()).getName())) {
return "@" + p2.getName();
} else {
return "@" + c2.getName() + "." + p2.getName();
@@ -505,30 +520,33 @@ public class ArchitectureQueries {
/**
* Is this property a DataFlow Port
- *
+ *
* @param port
* @return is this a DataFlow port ?
*/
static public Boolean isDataFlowPort(Port port) {
DataFlowPort dfp = UMLUtil.getStereotypeApplication(port, DataFlowPort.class);
- if(dfp == null)
+ if (dfp == null) {
return false;
+ }
return true;
}
/**
* For DataFlow ports: is it an Input Port ?
- *
+ *
* @param port
* @return false if the port is not a DataFlowPort or not an input port.
*/
static public Boolean isAnInputPort(Port port) {
try {
DataFlowPort dfp = UMLUtil.getStereotypeApplication(port, DataFlowPort.class);
- if(dfp == null)
+ if (dfp == null) {
return false;
- if(dfp.getDirection() == DataFlowDirectionKind.IN)
+ }
+ if (dfp.getDirection() == DataFlowDirectionKind.IN) {
return true;
+ }
return false;
} catch (Exception e) {
java.lang.System.out.println("EXCEPTION caught:" + e.toString());
@@ -538,17 +556,19 @@ public class ArchitectureQueries {
/**
* For DataFlow ports: is it an Output Port ?
- *
+ *
* @param port
* @return false if the port is not a DataFlowPort or not an output port.
*/
static public Boolean isAnOutputPort(Port port) {
try {
DataFlowPort dfp = UMLUtil.getStereotypeApplication(port, DataFlowPort.class);
- if(dfp == null)
+ if (dfp == null) {
return false;
- if(dfp.getDirection() == DataFlowDirectionKind.OUT)
+ }
+ if (dfp.getDirection() == DataFlowDirectionKind.OUT) {
return true;
+ }
return false;
} catch (Exception e) {
java.lang.System.out.println("EXCEPTION caught:" + e.toString());
@@ -558,17 +578,19 @@ public class ArchitectureQueries {
/**
* For RobotML ServicePorts: is the port a "Provided" port?
- *
+ *
* @param port
* @return false if the port is not a ServicePort or not a "Provided" ServicePort.
*/
static public Boolean isAProvidedPort(Port port) {
try {
ServicePort sp = UMLUtil.getStereotypeApplication(port, ServicePort.class);
- if(sp == null)
+ if (sp == null) {
return false;
- if(sp.getKind() == ServiceFlowKind.PROVIDED)
+ }
+ if (sp.getKind() == ServiceFlowKind.PROVIDED) {
return true;
+ }
return false;
} catch (Exception e) {
java.lang.System.out.println("EXCEPTION caught:" + e.toString());
@@ -578,17 +600,19 @@ public class ArchitectureQueries {
/**
* For RobotML ServicePorts: is the port a "Required" port?
- *
+ *
* @param port
* @return false if the port is not a ServicePort or not a "Required" ServicePort.
*/
static public Boolean isARequiredPort(Port port) {
try {
ServicePort sp = UMLUtil.getStereotypeApplication(port, ServicePort.class);
- if(sp == null)
+ if (sp == null) {
return false;
- if(sp.getKind() == ServiceFlowKind.REQUIRED)
+ }
+ if (sp.getKind() == ServiceFlowKind.REQUIRED) {
return true;
+ }
return false;
} catch (Exception e) {
java.lang.System.out.println("EXCEPTION caught:" + e.toString());
@@ -598,7 +622,7 @@ public class ArchitectureQueries {
/**
* Is this property a Service Port
- *
+ *
* @param port
* @return is this a service port ?
*/
@@ -618,11 +642,11 @@ public class ArchitectureQueries {
* @TODO: author to add some doc
*/
static public Boolean isConnectionValid(Connector connector) {
- if(connector.getEnds().size() != 2) {
+ if (connector.getEnds().size() != 2) {
return false;
}
- for(ConnectorEnd cend : connector.getEnds()) {
- if((cend.getRole() == null) || (cend.getPartWithPort() == null)) {
+ for (ConnectorEnd cend : connector.getEnds()) {
+ if ((cend.getRole() == null) || (cend.getPartWithPort() == null)) {
return false;
}
}
@@ -639,28 +663,29 @@ public class ArchitectureQueries {
}
static public Port getConnectedPort(Port port) {
- if(port.getEnds().size() == 0)
+ if (port.getEnds().size() == 0) {
return null;
+ }
- Connector conn = (Connector)port.getEnds().get(0).getOwner();
+ Connector conn = (Connector) port.getEnds().get(0).getOwner();
ConnectorEnd e1 = conn.getEnds().get(0);
ConnectorEnd e2 = conn.getEnds().get(1);
- return (e1.getRole() == port) ? (Port)e2.getRole() : (Port)e1.getRole();
+ return (e1.getRole() == port) ? (Port) e2.getRole() : (Port) e1.getRole();
}
/**
* Get external connectors to a port
- *
+ *
* @param port
* @return a list of connectors which are connected to the port.
*/
static public List<org.eclipse.uml2.uml.Connector> getConnectionsFromPort(Port port) {
LinkedList<org.eclipse.uml2.uml.Connector> connectors = new LinkedList<org.eclipse.uml2.uml.Connector>();
- for(ConnectorEnd connEnd : port.getEnds()) {
- Connector conn = (Connector)connEnd.getOwner();
+ for (ConnectorEnd connEnd : port.getEnds()) {
+ Connector conn = (Connector) connEnd.getOwner();
- if(conn.getEnds().size() >= 2 && conn.getEnds().get(0).getPartWithPort() != null && conn.getEnds().get(1).getPartWithPort() != null) {
+ if (conn.getEnds().size() >= 2 && conn.getEnds().get(0).getPartWithPort() != null && conn.getEnds().get(1).getPartWithPort() != null) {
connectors.add(conn);
}
}
@@ -676,7 +701,7 @@ public class ArchitectureQueries {
Stereotype pst = port.getAppliedStereotypes().get(0);
// Type du port
- if(port.getType() != null) {
+ if (port.getType() != null) {
java.lang.System.out.println("\t\t* type: " + port.getType().getName());
} else {
java.lang.System.err.println("\t\t\t* port " + port.getName() + " has no type ! ");
@@ -688,7 +713,7 @@ public class ArchitectureQueries {
// - la direction (énuméré IN ou OUT)
// - le protocole de synchronization (énuméré SYNCH ou ASYNCH ou UNDEFINED)
//
- for(Property propSt : pst.getAllAttributes()) {
+ for (Property propSt : pst.getAllAttributes()) {
java.lang.System.out.println("\t\t* port stereotype has attribute: " + propSt.getName() + " - " + port.getValue(pst, propSt.getName()));
}
@@ -702,7 +727,7 @@ public class ArchitectureQueries {
Stereotype pst = port.getAppliedStereotypes().get(0);
//
- if(port.getType() != null) {
+ if (port.getType() != null) {
java.lang.System.out.println("\t\t* type: " + port.getType().getName());
} else {
java.lang.System.err.println("\t\t\t* port " + port.getName() + " has no type ! ");
@@ -712,20 +737,20 @@ public class ArchitectureQueries {
// - le protocole de synchronization (énuméré SYNCH ou ASYNCH ou UNDEFINED)
//
- for(Property propSt : pst.getAllAttributes()) {
+ for (Property propSt : pst.getAllAttributes()) {
java.lang.System.out.println("\t\t* port stereotype has attribute: " + propSt.getName() + " - " + port.getValue(pst, propSt.getName()));
}
}
static public Boolean isAnAncestorOf(Class current_elt, Class other_elt) {
Boolean result = false;
- if(current_elt != null && other_elt != null) {
- if(current_elt == other_elt) {
+ if (current_elt != null && other_elt != null) {
+ if (current_elt == other_elt) {
result = true;
} else {
- for(Class parent : current_elt.getSuperClasses()) {
+ for (Class parent : current_elt.getSuperClasses()) {
current_elt = parent;
- if(other_elt == current_elt) {
+ if (other_elt == current_elt) {
result = true;
break;
}
@@ -738,17 +763,19 @@ public class ArchitectureQueries {
/**
* For DataFlow ports: is it an Output Port ?
- *
+ *
* @param port
* @return false if the port is not a DataFlowPort or not an input/output port.
*/
static public Boolean isAnInputOutputPort(Port port) {
try {
DataFlowPort dfp = UMLUtil.getStereotypeApplication(port, DataFlowPort.class);
- if(dfp == null)
+ if (dfp == null) {
return false;
- if(dfp.getDirection() == DataFlowDirectionKind.INOUT)
+ }
+ if (dfp.getDirection() == DataFlowDirectionKind.INOUT) {
return true;
+ }
return false;
} catch (Exception e) {
java.lang.System.out.println("EXCEPTION caught:" + e.toString());
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DataTypeQueries.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DataTypeQueries.java
index 4a3ccebd685..06c1c5a4cc6 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DataTypeQueries.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DataTypeQueries.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 PROTEUS Project consortium.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,27 +36,27 @@ public class DataTypeQueries {
public List<DataType> getMetamodelComposedDataTypes(Element rootelt) {
LinkedList<DataType> results = new LinkedList<DataType>();
- if(rootelt instanceof Model) {
- EList<Package> packages = ((Model)rootelt).getImportedPackages();
- for(Package p : packages) {
+ if (rootelt instanceof Model) {
+ EList<Package> packages = ((Model) rootelt).getImportedPackages();
+ for (Package p : packages) {
EList<Element> elts = p.getOwnedElements();
- for(Element elt : elts) {
- if(elt instanceof PrimitiveType) {
- } else if(elt instanceof DataType) {
- results.add((DataType)elt);
- } else if(elt instanceof Package) {
+ for (Element elt : elts) {
+ if (elt instanceof PrimitiveType) {
+ } else if (elt instanceof DataType) {
+ results.add((DataType) elt);
+ } else if (elt instanceof Package) {
results.addAll(getMetamodelComposedDataTypes(elt));
}
}
}
- } else if(rootelt instanceof Package) {
- Package p = (Package)rootelt;
+ } else if (rootelt instanceof Package) {
+ Package p = (Package) rootelt;
EList<Element> elts = p.getOwnedElements();
- for(Element elt : elts) {
- if(elt instanceof PrimitiveType) {
- } else if(elt instanceof DataType) {
- results.add((DataType)elt);
- } else if(elt instanceof Package) {
+ for (Element elt : elts) {
+ if (elt instanceof PrimitiveType) {
+ } else if (elt instanceof DataType) {
+ results.add((DataType) elt);
+ } else if (elt instanceof Package) {
results.addAll(getMetamodelComposedDataTypes(elt));
}
}
@@ -66,33 +66,35 @@ public class DataTypeQueries {
/**
* Is the provided DataType one of the RobotML metamodel datatypes ?
- *
+ *
* @param dt
* @return
*/
public static boolean isRobotMLDataType(Element root_model, String datatype_name) {
try {
- if(root_model instanceof Model) {
- EList<Package> packages = ((Model)root_model).getImportedPackages();
- for(Package p : packages) {
+ if (root_model instanceof Model) {
+ EList<Package> packages = ((Model) root_model).getImportedPackages();
+ for (Package p : packages) {
EList<Element> elts = p.getOwnedElements();
- for(Element elt : elts) {
- if(elt instanceof DataType && datatype_name.compareTo(((DataType)elt).getName()) == 0) {
+ for (Element elt : elts) {
+ if (elt instanceof DataType && datatype_name.compareTo(((DataType) elt).getName()) == 0) {
return true;
- } else if(elt instanceof Package) {
- if(isRobotMLDataType(elt, datatype_name))
+ } else if (elt instanceof Package) {
+ if (isRobotMLDataType(elt, datatype_name)) {
return true;
+ }
}
}
}
- } else if(root_model instanceof Package) {
- EList<Element> elts = ((Package)root_model).getOwnedElements();
- for(Element elt : elts) {
- if(elt instanceof DataType && datatype_name.compareTo(((DataType)elt).getName()) == 0) {
+ } else if (root_model instanceof Package) {
+ EList<Element> elts = ((Package) root_model).getOwnedElements();
+ for (Element elt : elts) {
+ if (elt instanceof DataType && datatype_name.compareTo(((DataType) elt).getName()) == 0) {
return true;
- } else if(elt instanceof Package) {
- if(isRobotMLDataType(elt, datatype_name))
+ } else if (elt instanceof Package) {
+ if (isRobotMLDataType(elt, datatype_name)) {
return true;
+ }
}
}
}
@@ -105,29 +107,30 @@ public class DataTypeQueries {
public String getCppClassForDatatType(DataType dt) {
try {
String s = "";
- if(dt instanceof Enumeration) {
- Enumeration en = (Enumeration)dt;
+ if (dt instanceof Enumeration) {
+ Enumeration en = (Enumeration) dt;
s = "enum " + en.getName() + " {" + newline;
EList<EnumerationLiteral> literals = en.getOwnedLiterals();
- for(EnumerationLiteral literal : literals) {
+ for (EnumerationLiteral literal : literals) {
s += "\t" + literal.getName() + "," + newline;
}
- } else if(dt instanceof EnumerationLiteral) {
- //do nothing.
+ } else if (dt instanceof EnumerationLiteral) {
+ // do nothing.
} else {
EList<Property> attributes = dt.getOwnedAttributes();
s = "class " + dt.getName() + " {" + newline + "\tpublic:" + newline;
- for(Property attribute : attributes) {
+ for (Property attribute : attributes) {
String type_name;
- if(attribute.getType() != null)
+ if (attribute.getType() != null) {
type_name = attribute.getType().getName();
- else
+ } else {
type_name = "Unknown_NULL_IN_MODEL";
- if(attribute.getUpper() < 0) {
+ }
+ if (attribute.getUpper() < 0) {
s += "\tstd::vector<" + type_name + "> " + attribute.getName() + ";" + newline;
- } else if(attribute.getUpper() <= 1) {
+ } else if (attribute.getUpper() <= 1) {
s += "\t" + type_name + " " + attribute.getName() + ";" + newline;
- } else if(attribute.getUpper() == attribute.getLower()) {
+ } else if (attribute.getUpper() == attribute.getLower()) {
s += "\t" + type_name + " " + attribute.getName() + "[" + attribute.getUpper() + "];" + newline;
} else {
s += "\tstd::vector<" + type_name + "> " + attribute.getName() + ";" + newline;
@@ -144,14 +147,14 @@ public class DataTypeQueries {
/**
* Get all user-defined datatypes.
- *
+ *
* @return A list of datatypes
*/
public List<NamedElement> getElementsDataType(Model model) {
LinkedList<NamedElement> found_elts = new LinkedList<NamedElement>();
- for(NamedElement ne : model.getOwnedMembers()) {
- if(ne instanceof org.eclipse.uml2.uml.DataType) {
- found_elts.add((NamedElement)ne);
+ for (NamedElement ne : model.getOwnedMembers()) {
+ if (ne instanceof org.eclipse.uml2.uml.DataType) {
+ found_elts.add(ne);
}
getElementsDataType(ne, found_elts);
@@ -163,9 +166,9 @@ public class DataTypeQueries {
* Recursive sub-function to browse model and get all user-defined datatypes.
*/
private void getElementsDataType(Element parent_elt, LinkedList<NamedElement> target_list) {
- for(Element ne : parent_elt.getOwnedElements()) {
- if(ne instanceof org.eclipse.uml2.uml.DataType) {
- target_list.add((NamedElement)ne);
+ for (Element ne : parent_elt.getOwnedElements()) {
+ if (ne instanceof org.eclipse.uml2.uml.DataType) {
+ target_list.add((NamedElement) ne);
}
getElementsDataType(ne, target_list);
}
@@ -174,15 +177,16 @@ public class DataTypeQueries {
public DataType getPortDataType(Port port) {
Type t = port.getType();
- if(t != null && t instanceof DataType) {
- return (DataType)t;
+ if (t != null && t instanceof DataType) {
+ return (DataType) t;
}
return null;
}
public static boolean isPrimitiveType(Element elt) {
- if(elt instanceof PrimitiveType)
+ if (elt instanceof PrimitiveType) {
return true;
+ }
return false;
}
}
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DeploymentQueries.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DeploymentQueries.java
index 35b5c5f3e46..247efdba396 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DeploymentQueries.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/DeploymentQueries.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 PROTEUS Project Consortium.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,47 +35,47 @@ public class DeploymentQueries {
/**
* Return the list of instance specifications in a model
- *
+ *
* @param model
* @return A list of InstanceSpecification of all instance specifications
*/
static public List<InstanceSpecification> getInstanceSpecificationsInModel(Model model) {
LinkedList<InstanceSpecification> found_elts = new LinkedList<InstanceSpecification>();
- for(Element ne : model.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.InstanceSpecification) {
- found_elts.add((InstanceSpecification)ne);
- //System.out.println("Instance : "+((NamedElement) ne).getName());
- } else if(ne instanceof org.eclipse.uml2.uml.Package) {
- found_elts.addAll(getInstanceSpecificationsInPackage((org.eclipse.uml2.uml.Package)ne));
+ for (Element ne : model.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.InstanceSpecification) {
+ found_elts.add((InstanceSpecification) ne);
+ // System.out.println("Instance : "+((NamedElement) ne).getName());
+ } else if (ne instanceof org.eclipse.uml2.uml.Package) {
+ found_elts.addAll(getInstanceSpecificationsInPackage((org.eclipse.uml2.uml.Package) ne));
}
- } else if(ne instanceof Model) {
- found_elts.addAll(getInstanceSpecificationsInModel((Model)ne));
+ } else if (ne instanceof Model) {
+ found_elts.addAll(getInstanceSpecificationsInModel((Model) ne));
}
}
- // if(found_elts.isEmpty()){
- // System.out.println("Instances list empty");
- // }
+ // if(found_elts.isEmpty()){
+ // System.out.println("Instances list empty");
+ // }
return found_elts;
}
/**
* Return the list of instance specifications in a package
- *
+ *
* @param pack
* @return A list of InstanceSpecification of all instance specifications
*/
static public List<InstanceSpecification> getInstanceSpecificationsInPackage(org.eclipse.uml2.uml.Package pack) {
LinkedList<InstanceSpecification> found_elts = new LinkedList<InstanceSpecification>();
- for(Element ne : pack.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.InstanceSpecification) {
- found_elts.add((InstanceSpecification)ne);
- } else if(ne instanceof org.eclipse.uml2.uml.Package) {
- found_elts.addAll(getInstanceSpecificationsInPackage((org.eclipse.uml2.uml.Package)ne));
+ for (Element ne : pack.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.InstanceSpecification) {
+ found_elts.add((InstanceSpecification) ne);
+ } else if (ne instanceof org.eclipse.uml2.uml.Package) {
+ found_elts.addAll(getInstanceSpecificationsInPackage((org.eclipse.uml2.uml.Package) ne));
}
- } else if(ne instanceof Model) {
- found_elts.addAll(getInstanceSpecificationsInModel((Model)ne));
+ } else if (ne instanceof Model) {
+ found_elts.addAll(getInstanceSpecificationsInModel((Model) ne));
}
}
return found_elts;
@@ -83,15 +83,15 @@ public class DeploymentQueries {
/**
* Return the list of instance specifications allocated to given platform
- *
+ *
* @param model
* @param
* @return A list of InstanceSpecification of all instance specifications
*/
static public List<InstanceSpecification> getInstanceSpecificationsForPlatform(org.eclipse.uml2.uml.Model model, java.lang.String pfn) {
List<InstanceSpecification> found_elts = new LinkedList<InstanceSpecification>();
- for(InstanceSpecification instanceSpecification : getInstanceSpecificationsInModel(model)) {
- if(isAllocatedTo(instanceSpecification, pfn)) {
+ for (InstanceSpecification instanceSpecification : getInstanceSpecificationsInModel(model)) {
+ if (isAllocatedTo(instanceSpecification, pfn)) {
found_elts.add(instanceSpecification);
}
}
@@ -101,16 +101,16 @@ public class DeploymentQueries {
/**
* Return the list of instance specifications allocated to given platform. Should be equivalent to getInstanceSpecificationsForPlatform, but
* different implementation.
- *
+ *
* @param model
* @param targetPlatformName
- * Name of the requested target platform type.
+ * Name of the requested target platform type.
* @return A list of InstanceSpecification of all instance specifications.
*/
- static public List<InstanceSpecification> getInstanceSpecificationsForPlatform2(org.eclipse.uml2.uml.Model model, String targetPlatformName) { //org.eclipse.papyrus.RobotML.Platform targetPlatform) {
- //The list to return in the end.
+ static public List<InstanceSpecification> getInstanceSpecificationsForPlatform2(org.eclipse.uml2.uml.Model model, String targetPlatformName) { // org.eclipse.papyrus.RobotML.Platform targetPlatform) {
+ // The list to return in the end.
List<InstanceSpecification> found_elts = new LinkedList<InstanceSpecification>();
- for(org.eclipse.uml2.uml.Package dpPck : getDeploymentPlanPackagesInModel(model)) {
+ for (org.eclipse.uml2.uml.Package dpPck : getDeploymentPlanPackagesInModel(model)) {
found_elts.addAll(getDeploymentPlanInstanceSpecsForPlatform(dpPck, targetPlatformName));
}
return found_elts;
@@ -119,7 +119,7 @@ public class DeploymentQueries {
/**
* Return the parent name of an instance
- *
+ *
* @param inst
* @return Parent name of an instance
*/
@@ -127,7 +127,7 @@ public class DeploymentQueries {
String name = inst.getName();
Integer idx = name.lastIndexOf('.');
- if(idx != -1) {
+ if (idx != -1) {
return name.substring(0, idx);
} else {
return null;
@@ -137,7 +137,7 @@ public class DeploymentQueries {
/**
* Get real instance from InstanceSpecification object
- *
+ *
* @param model
* @param instanceSpecification
* @return the instance if found, or else null
@@ -145,10 +145,10 @@ public class DeploymentQueries {
static public Property getInstance(Model model, InstanceSpecification instanceSpecification) {
List<org.eclipse.uml2.uml.Property> l = ArchitectureQueries.getAllSubComponentsInClass(ArchitectureQueries.getRootClassForModel(model));
- for(Property p : l) {
+ for (Property p : l) {
String[] str = instanceSpecification.getName().split("\\.");
- if(str.length > 0 && p.getName().equals(str[str.length - 1])) {
+ if (str.length > 0 && p.getName().equals(str[str.length - 1])) {
return p;
}
}
@@ -159,20 +159,22 @@ public class DeploymentQueries {
/**
* Function to know if the instance must be generated by the platform or not.
- *
+ *
* @param instanceSpecification
* @param platformName
* @return true if the instance is allocated to the platform which name is given in parameter
*/
static public boolean isAllocatedTo(InstanceSpecification instSpec, String platformName) {
- if(instSpec == null || platformName == null)
+ if (instSpec == null || platformName == null) {
return false;
- for(Dependency dep : instSpec.getClientDependencies()) {
- Allocate alloc = UMLUtil.getStereotypeApplication((Element)dep, Allocate.class);
- if(alloc == null)
+ }
+ for (Dependency dep : instSpec.getClientDependencies()) {
+ Allocate alloc = UMLUtil.getStereotypeApplication(dep, Allocate.class);
+ if (alloc == null) {
continue;
- for(NamedElement nelt : dep.getSuppliers()) {
- if(isPlatformInstanceSpecificationFromPlatform(nelt, platformName)) {
+ }
+ for (NamedElement nelt : dep.getSuppliers()) {
+ if (isPlatformInstanceSpecificationFromPlatform(nelt, platformName)) {
return true;
}
}
@@ -183,19 +185,20 @@ public class DeploymentQueries {
/**
* Retrieves the deployment plans defined in a given model.
- *
+ *
* @param model
* @return A list of DeploymentPlans defined in the model.
*/
static public List<DeploymentPlan> getDeploymentPlansInModel(org.eclipse.uml2.uml.Model model) {
List<DeploymentPlan> dep_plans = new LinkedList<DeploymentPlan>();
- for(Element elt : model.getOwnedElements()) {
- if(elt instanceof org.eclipse.uml2.uml.Package) {
+ for (Element elt : model.getOwnedElements()) {
+ if (elt instanceof org.eclipse.uml2.uml.Package) {
DeploymentPlan dp = UMLUtil.getStereotypeApplication(elt, DeploymentPlan.class);
- if(dp != null)
+ if (dp != null) {
dep_plans.add(dp);
- else
- dep_plans.addAll(getDeploymentPlansInPackage((org.eclipse.uml2.uml.Package)elt));
+ } else {
+ dep_plans.addAll(getDeploymentPlansInPackage((org.eclipse.uml2.uml.Package) elt));
+ }
}
}
return dep_plans;
@@ -203,19 +206,20 @@ public class DeploymentQueries {
/**
* Retrieves the deployment plans defined in a given package.
- *
+ *
* @param pck
* @return
*/
static protected List<DeploymentPlan> getDeploymentPlansInPackage(org.eclipse.uml2.uml.Package pck) {
List<DeploymentPlan> dep_plans = new LinkedList<DeploymentPlan>();
- for(Element elt : pck.getOwnedElements()) {
- if(elt instanceof org.eclipse.uml2.uml.Package) {
+ for (Element elt : pck.getOwnedElements()) {
+ if (elt instanceof org.eclipse.uml2.uml.Package) {
DeploymentPlan dp = UMLUtil.getStereotypeApplication(elt, DeploymentPlan.class);
- if(dp != null)
+ if (dp != null) {
dep_plans.add(dp);
- else
- dep_plans.addAll(getDeploymentPlansInPackage((org.eclipse.uml2.uml.Package)elt));
+ } else {
+ dep_plans.addAll(getDeploymentPlansInPackage((org.eclipse.uml2.uml.Package) elt));
+ }
}
}
return dep_plans;
@@ -223,14 +227,14 @@ public class DeploymentQueries {
/**
* Retrieves the Packages in which Deployment plans are defined in the model.
- *
+ *
* @param model
* @return
*/
static public List<org.eclipse.uml2.uml.Package> getDeploymentPlanPackagesInModel(Model model) {
List<DeploymentPlan> dps = getDeploymentPlansInModel(model);
LinkedList<org.eclipse.uml2.uml.Package> pcks = new LinkedList<org.eclipse.uml2.uml.Package>();
- for(DeploymentPlan dp : dps) {
+ for (DeploymentPlan dp : dps) {
pcks.add(dp.getBase_Package());
}
return pcks;
@@ -238,45 +242,48 @@ public class DeploymentQueries {
/**
* Retrieves the InstanceSpecficiations allocated to a given Platform within a given DeploymentPlan.
- *
+ *
* @param deploymentPlan
* @param targetPlatformName
* @return
*/
static public List<InstanceSpecification> getDeploymentPlanInstanceSpecsForPlatform(org.eclipse.uml2.uml.Package deploymentPlan, String targetPlatformName) {
- //The list to return in the end.
+ // The list to return in the end.
List<InstanceSpecification> found_elts = new LinkedList<InstanceSpecification>();
- //Is the first argument really a Deployment plan ? (a Package with a DeploymentPlan StereoType)
+ // Is the first argument really a Deployment plan ? (a Package with a DeploymentPlan StereoType)
DeploymentPlan dp = org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(deploymentPlan, org.eclipse.papyrus.RobotML.DeploymentPlan.class);
- if(dp == null)
+ if (dp == null) {
return found_elts;
+ }
- //Let's get all the Allocate elements in the DeploymentPlan, and check if the supplier (the target platform) corresponds to the second argument.
- for(Element elt : deploymentPlan.getOwnedElements()) {
- if(elt instanceof Dependency) {
- //Is it a Dependency with an "Allocate" stereotype ?
- Dependency dep = (Dependency)elt;
+ // Let's get all the Allocate elements in the DeploymentPlan, and check if the supplier (the target platform) corresponds to the second argument.
+ for (Element elt : deploymentPlan.getOwnedElements()) {
+ if (elt instanceof Dependency) {
+ // Is it a Dependency with an "Allocate" stereotype ?
+ Dependency dep = (Dependency) elt;
Allocate alloc = org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(elt, org.eclipse.papyrus.RobotML.Allocate.class);
- if(alloc == null)
+ if (alloc == null) {
continue;
+ }
- //Let's store the potential client (the component instance) of the Allocate.
- //for future addition to the list to return.
+ // Let's store the potential client (the component instance) of the Allocate.
+ // for future addition to the list to return.
InstanceSpecification client_instance_spec = null;
- for(NamedElement client_elt : dep.getClients()) {
- if(false == (client_elt instanceof InstanceSpecification)) {
+ for (NamedElement client_elt : dep.getClients()) {
+ if (false == (client_elt instanceof InstanceSpecification)) {
continue;
}
- client_instance_spec = (InstanceSpecification)client_elt;
+ client_instance_spec = (InstanceSpecification) client_elt;
break;
}
- if(client_instance_spec == null)
+ if (client_instance_spec == null) {
continue;
+ }
- //Is it allocated to the platform provided as argument ?
- for(NamedElement nelt : dep.getSuppliers()) {
- if(isPlatformInstanceSpecificationFromPlatform(nelt, targetPlatformName)) {
+ // Is it allocated to the platform provided as argument ?
+ for (NamedElement nelt : dep.getSuppliers()) {
+ if (isPlatformInstanceSpecificationFromPlatform(nelt, targetPlatformName)) {
found_elts.add(client_instance_spec);
}
}
@@ -287,15 +294,16 @@ public class DeploymentQueries {
/**
* Function to know the content of allocation string.
- *
+ *
* @param instanceSpecification
* @return the allocation string
*/
static public String getAllocationName(InstanceSpecification instanceSpecification) {
- if(instanceSpecification.getClientDependencies().size() == 0)
+ if (instanceSpecification.getClientDependencies().size() == 0) {
return new String();
+ }
- //il n'y a toujours qu'un element
+ // il n'y a toujours qu'un element
Dependency d = instanceSpecification.getClientDependencies().get(0);
return d.getName();
@@ -303,24 +311,24 @@ public class DeploymentQueries {
/**
* Function to know which class must be generated by the platform or not.
- *
+ *
* @param model
* @param platformName
* @return all classes that are instanciated for the platform "pfn"
*/
static public List<org.eclipse.uml2.uml.Class> getDefinedComponentsForPlatform(Model model, String platformName) {
- //System.out.println("getDefinedComponentsForPlatform");
+ // System.out.println("getDefinedComponentsForPlatform");
LinkedList<org.eclipse.uml2.uml.Class> found_classes = new LinkedList<org.eclipse.uml2.uml.Class>();
List<InstanceSpecification> instances = getInstanceSpecificationsForPlatform(model, platformName);
- for(InstanceSpecification instanceSpecification : instances) {
- //System.out.println("instance : " + instanceSpecification.getName());
+ for (InstanceSpecification instanceSpecification : instances) {
+ // System.out.println("instance : " + instanceSpecification.getName());
- for(org.eclipse.uml2.uml.Classifier classifier : instanceSpecification.getClassifiers()) {
+ for (org.eclipse.uml2.uml.Classifier classifier : instanceSpecification.getClassifiers()) {
found_classes.add(GeneralQueries.findClassInModel(model, classifier.getName()));
- //org.eclipse.uml2.uml.Class theClass = GeneralQueries.findClassInModel(model, classifier.getName());
- //System.out.println("\tclass : " + theClass.getName());
+ // org.eclipse.uml2.uml.Class theClass = GeneralQueries.findClassInModel(model, classifier.getName());
+ // System.out.println("\tclass : " + theClass.getName());
}
}
return found_classes;
@@ -329,22 +337,22 @@ public class DeploymentQueries {
/**
* Function to know which class must be generated by the platform or not. Should be equivalent to getDefinedComponentsForPlatform but with a
* different implementation.
- *
+ *
* @param model
* @param platformName
* @return all classes that are instanciated for the platform "pfn"
*/
- static public List<org.eclipse.uml2.uml.Class> getDefinedComponentsForPlatform2(Model model, String platformName) //Platform platform)
+ static public List<org.eclipse.uml2.uml.Class> getDefinedComponentsForPlatform2(Model model, String platformName) // Platform platform)
{
LinkedList<org.eclipse.uml2.uml.Class> found_classes = new LinkedList<org.eclipse.uml2.uml.Class>();
List<InstanceSpecification> inst_specs = getInstanceSpecificationsForPlatform2(model, platformName);
- for(InstanceSpecification inst_spec : inst_specs) {
- for(org.eclipse.uml2.uml.Classifier classifier : inst_spec.getClassifiers()) {
+ for (InstanceSpecification inst_spec : inst_specs) {
+ for (org.eclipse.uml2.uml.Classifier classifier : inst_spec.getClassifiers()) {
found_classes.add(GeneralQueries.findClassInModel(model, classifier.getName()));
}
}
- //remove duplicates
+ // remove duplicates
Set<org.eclipse.uml2.uml.Class> new_set = new HashSet<org.eclipse.uml2.uml.Class>(found_classes);
List<org.eclipse.uml2.uml.Class> found_classes_2 = new LinkedList<org.eclipse.uml2.uml.Class>(new_set);
@@ -353,40 +361,41 @@ public class DeploymentQueries {
/**
* Checks whether or not a Platform instance specification has a given platform type.
- *
+ *
* @param platformInstanceSpecification
* @param expectedPlatformName
* @return
*/
- protected static boolean isPlatformInstanceSpecificationFromPlatform(NamedElement platformInstanceSpecification, String expectedPlatformName) //Platform expectedPlatform)
+ protected static boolean isPlatformInstanceSpecificationFromPlatform(NamedElement platformInstanceSpecification, String expectedPlatformName) // Platform expectedPlatform)
{
- if(platformInstanceSpecification instanceof InstanceSpecification) {
- InstanceSpecification platformInstance = (InstanceSpecification)platformInstanceSpecification;
- for(Classifier classifier : platformInstance.getClassifiers()) {
- if(classifier.getName().toLowerCase().compareTo(expectedPlatformName) == 0)
+ if (platformInstanceSpecification instanceof InstanceSpecification) {
+ InstanceSpecification platformInstance = (InstanceSpecification) platformInstanceSpecification;
+ for (Classifier classifier : platformInstance.getClassifiers()) {
+ if (classifier.getName().toLowerCase().compareTo(expectedPlatformName) == 0) {
return true;
- /*
- * RoboticMiddleware mdw = UMLUtil.getStereotypeApplication(classifier, org.eclipse.papyrus.RobotML.RoboticMiddleware.class);
- * RoboticSimulator sim = UMLUtil.getStereotypeApplication(classifier, org.eclipse.papyrus.RobotML.RoboticSimulator.class);
- * if (mdw != null) {
- * //The target platform seems to be a middleware.
- * //Middlewares are identified by their "kind".
- * if (expectedPlatform instanceof RoboticMiddleware) {
- * if (mdw.getKind() == ((RoboticMiddleware)expectedPlatform).getKind()) {
- * //YEEEEHAAAA !!!
- * return true;
- * }
- * }
- * }
- * if (sim != null && expectedPlatform instanceof RoboticSimulator) {
- * //The target platform seems to be a simulator.
- * //Simulators are just derived classes.
- * if (sim.getClass().getName().compareTo(((RoboticSimulator)expectedPlatform).getClass().getName()) == 0) {
- * //YEEEEEHAAAAAA !!!
- * return true;
- * }
- * }
- */
+ /*
+ * RoboticMiddleware mdw = UMLUtil.getStereotypeApplication(classifier, org.eclipse.papyrus.RobotML.RoboticMiddleware.class);
+ * RoboticSimulator sim = UMLUtil.getStereotypeApplication(classifier, org.eclipse.papyrus.RobotML.RoboticSimulator.class);
+ * if (mdw != null) {
+ * //The target platform seems to be a middleware.
+ * //Middlewares are identified by their "kind".
+ * if (expectedPlatform instanceof RoboticMiddleware) {
+ * if (mdw.getKind() == ((RoboticMiddleware)expectedPlatform).getKind()) {
+ * //YEEEEHAAAA !!!
+ * return true;
+ * }
+ * }
+ * }
+ * if (sim != null && expectedPlatform instanceof RoboticSimulator) {
+ * //The target platform seems to be a simulator.
+ * //Simulators are just derived classes.
+ * if (sim.getClass().getName().compareTo(((RoboticSimulator)expectedPlatform).getClass().getName()) == 0) {
+ * //YEEEEEHAAAAAA !!!
+ * return true;
+ * }
+ * }
+ */
+ }
}
}
return false;
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/FSMQueries.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/FSMQueries.java
index f601d7e2ba6..7fd892c142e 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/FSMQueries.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/FSMQueries.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 PROTEUS Project consortium.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,7 +18,6 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.State;
import org.eclipse.uml2.uml.StateMachine;
import org.eclipse.uml2.uml.util.UMLUtil;
@@ -26,35 +25,37 @@ public class FSMQueries {
/**
* Find all states in a state machine.
- *
+ *
* @param sm
- * a state machine
+ * a state machine
* @return a list of states
* @todo a valider par Nicolas
*/
public List<org.eclipse.uml2.uml.Vertex> getStates(StateMachine sm) {
LinkedList<org.eclipse.uml2.uml.Vertex> res = new LinkedList<org.eclipse.uml2.uml.Vertex>();
- for(org.eclipse.uml2.uml.Region region : sm.getRegions())
- for(org.eclipse.uml2.uml.Vertex vertex : region.getSubvertices())
- res.add((org.eclipse.uml2.uml.Vertex)vertex);
+ for (org.eclipse.uml2.uml.Region region : sm.getRegions()) {
+ for (org.eclipse.uml2.uml.Vertex vertex : region.getSubvertices()) {
+ res.add(vertex);
+ }
+ }
return res;
}
/**
* Find all transitions in a state machine.
- *
+ *
* @param sm
- * a state machine
+ * a state machine
* @return a list of transitions
* @todo a valider par Nicolas
*/
public List<org.eclipse.papyrus.RobotML.Transition> getTransitions(StateMachine sm) {
LinkedList<org.eclipse.papyrus.RobotML.Transition> res = new LinkedList<org.eclipse.papyrus.RobotML.Transition>();
- for(org.eclipse.uml2.uml.Region region : sm.getRegions()) {
- for(org.eclipse.uml2.uml.Transition transition : region.getTransitions()) {
+ for (org.eclipse.uml2.uml.Region region : sm.getRegions()) {
+ for (org.eclipse.uml2.uml.Transition transition : region.getTransitions()) {
org.eclipse.papyrus.RobotML.Transition robotml_transition = UMLUtil.getStereotypeApplication(transition, org.eclipse.papyrus.RobotML.Transition.class);
- if(robotml_transition != null) {
+ if (robotml_transition != null) {
res.add(robotml_transition);
}
}
@@ -64,7 +65,7 @@ public class FSMQueries {
/**
* Find all state machines in a component.
- *
+ *
* @param elt
* @return a list of state machines
* @todo a valider par Nicolas
@@ -72,30 +73,32 @@ public class FSMQueries {
public List<StateMachine> getStateMachines(Element elt) {
LinkedList<StateMachine> res = new LinkedList<StateMachine>();
- for(Element child : elt.getOwnedElements())
- if(child instanceof StateMachine)
- res.add((StateMachine)child);
+ for (Element child : elt.getOwnedElements()) {
+ if (child instanceof StateMachine) {
+ res.add((StateMachine) child);
+ }
+ }
return res;
}
/**
* Generate the state operation
- *
+ *
* @param vertex
* @return
*/
- // public String generateOperationStateString(org.eclipse.uml2.uml.Vertex vertex) {
- // String result = "";
- // if(vertex instanceof State) {
- // org.eclipse.papyrus.RobotML.State state = UMLUtil.getStereotypeApplication(vertex, org.eclipse.papyrus.RobotML.State.class);
- // if(state != null) {
- // if(state.getOperation() != null) {
- // String operation = state.getOperation().getBase_Operation().getName();
- // result = operation;
- // }
- // }
- // }
- // return result;
- // }
+ // public String generateOperationStateString(org.eclipse.uml2.uml.Vertex vertex) {
+ // String result = "";
+ // if(vertex instanceof State) {
+ // org.eclipse.papyrus.RobotML.State state = UMLUtil.getStereotypeApplication(vertex, org.eclipse.papyrus.RobotML.State.class);
+ // if(state != null) {
+ // if(state.getOperation() != null) {
+ // String operation = state.getOperation().getBase_Operation().getName();
+ // result = operation;
+ // }
+ // }
+ // }
+ // return result;
+ // }
}
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/GeneralQueries.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/GeneralQueries.java
index e0f022982cc..bce7e5dbeeb 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/GeneralQueries.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/GeneralQueries.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 PROTEUS Project consortium.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,30 +38,30 @@ public class GeneralQueries {
/**
* Retrieve all sub-elements (of type Class) for a given element that have the provided stereotype.
* Basically, retrieves all the component models inside a RobotML model.
- *
+ *
* @param parent_elt
- * the root element to inspect
+ * the root element to inspect
* @param clazz
- * the stereotype class we are looking for. Usually something like ...RobotML.SensorSystem
+ * the stereotype class we are looking for. Usually something like ...RobotML.SensorSystem
* @param target_list
- * the list in which the found elements will be stored.
+ * the list in which the found elements will be stored.
*/
static protected void getElementsWithStereotype(Element parent_elt, Class clazz, LinkedList<NamedElement> target_list) {
- if(parent_elt instanceof org.eclipse.uml2.uml.Class) {
- for(EObject stereoApplication : parent_elt.getStereotypeApplications()) {
+ if (parent_elt instanceof org.eclipse.uml2.uml.Class) {
+ for (EObject stereoApplication : parent_elt.getStereotypeApplications()) {
// check whether the stereotype is an instance of the passed parameter clazz
- if(clazz.isInstance(stereoApplication)) {
- target_list.add((NamedElement)parent_elt);
+ if (clazz.isInstance(stereoApplication)) {
+ target_list.add((NamedElement) parent_elt);
}
}
}
- for(Element ne : parent_elt.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- for(EObject stereoApplication : ne.getStereotypeApplications()) {
+ for (Element ne : parent_elt.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ for (EObject stereoApplication : ne.getStereotypeApplications()) {
// check whether the stereotype is an instance of the passed parameter clazz
- if(clazz.isInstance(stereoApplication)) {
- target_list.add((NamedElement)ne);
+ if (clazz.isInstance(stereoApplication)) {
+ target_list.add((NamedElement) ne);
}
}
getElementsWithStereotype(ne, clazz, target_list);
@@ -73,25 +73,26 @@ public class GeneralQueries {
/**
* Recursive retrieve of all elements with a given stereotype in the model.
- *
+ *
* @param model
- * Model to search in.
+ * Model to search in.
* @param stereotype
- * The stereotype name (e.g. "Sensor", "Actuator", "SubSystem"...)
+ * The stereotype name (e.g. "Sensor", "Actuator", "SubSystem"...)
* @return A list of NamedElements having the specified stereotype.
* @deprecated to be replaced with calls to the RobotML API. Replaced by getElementsWithStereotype (Model model, StereotypeClass sc)
*/
+ @Deprecated
static public List<NamedElement> getElementsWithStereotype(Model model, String stereotype) {
LinkedList<NamedElement> found_elts = new LinkedList<NamedElement>();
- for(Element ne : model.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- if(hasStereotype((org.eclipse.uml2.uml.Class)ne, stereotype)) {
- found_elts.add((NamedElement)ne);
+ for (Element ne : model.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ if (hasStereotype((org.eclipse.uml2.uml.Class) ne, stereotype)) {
+ found_elts.add((NamedElement) ne);
}
}
- } else if(ne instanceof Model) {
- found_elts.addAll(getElementsWithStereotype((Model)ne, stereotype));
+ } else if (ne instanceof Model) {
+ found_elts.addAll(getElementsWithStereotype((Model) ne, stereotype));
}
getElementsWithStereotype(ne, stereotype, found_elts);
}
@@ -101,18 +102,19 @@ public class GeneralQueries {
/**
* Same as getElementsWithStereotype(Model model...) searches in an Element members, not in a Model members.
* This function is private and used by getElementsWithStereotype(Model model...)
- *
+ *
* @param parent_elt
* @param stereotype
* @param target_list
* @deprecated to be replaced with calls to the RobotML API.
*/
+ @Deprecated
static private void getElementsWithStereotype(Element parent_elt, String stereotype, LinkedList<NamedElement> target_list) {
- for(Element ne : parent_elt.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- if(hasStereotype((org.eclipse.uml2.uml.Class)ne, stereotype)) {
- target_list.add((NamedElement)ne);
+ for (Element ne : parent_elt.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ if (hasStereotype((org.eclipse.uml2.uml.Class) ne, stereotype)) {
+ target_list.add((NamedElement) ne);
}
}
getElementsWithStereotype(ne, stereotype, target_list);
@@ -123,25 +125,26 @@ public class GeneralQueries {
/**
* Recursive retrieve of all element with a given inherited stereotype in the model.
- *
+ *
* @param model
- * Model to search in.
+ * Model to search in.
* @param stereotype
- * The stereotype name (e.g. "Sensor", "Actuator", "SubSystem"...)
+ * The stereotype name (e.g. "Sensor", "Actuator", "SubSystem"...)
* @return A list of NamedElements having the specified stereotype.
* @deprecated to be replaced with calls to the RobotML API. Replaced by getElementsWithStereotype (Model model, StereotypeClass sc)
*/
+ @Deprecated
static public List<NamedElement> getElementsWithInheritedStereotype(Model model, String stereotype) {
LinkedList<NamedElement> found_elts = new LinkedList<NamedElement>();
- for(Element ne : model.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- if(inheritsFrom((org.eclipse.uml2.uml.Class)ne, stereotype)) {
- found_elts.add((NamedElement)ne);
+ for (Element ne : model.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ if (inheritsFrom((org.eclipse.uml2.uml.Class) ne, stereotype)) {
+ found_elts.add((NamedElement) ne);
}
}
- } else if(ne instanceof Model) {
- found_elts.addAll(getElementsWithInheritedStereotype((Model)ne, stereotype));
+ } else if (ne instanceof Model) {
+ found_elts.addAll(getElementsWithInheritedStereotype((Model) ne, stereotype));
}
getElementsWithInheritedStereotype(ne, stereotype, found_elts);
}
@@ -151,27 +154,28 @@ public class GeneralQueries {
/**
* Same as getElementsWithInheritedStereotype(Model model...) searches in an Element members, not in a Model members.
* This function is private and used by getElementsWithStereotype(Model model...)
- *
+ *
* @param parent_elt
* @param stereotype
* @param target_list
* @deprecated to be replaced with calls to the RobotML API.
*/
+ @Deprecated
static private void getElementsWithInheritedStereotype(Element parent_elt, String stereotype, LinkedList<NamedElement> target_list) {
- for(Element ne : parent_elt.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- //System.out.println(((NamedElement)ne).getName());
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- if(inheritsFrom((org.eclipse.uml2.uml.Class)ne, stereotype)) {
- target_list.add((NamedElement)ne);
+ for (Element ne : parent_elt.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ // System.out.println(((NamedElement)ne).getName());
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ if (inheritsFrom((org.eclipse.uml2.uml.Class) ne, stereotype)) {
+ target_list.add((NamedElement) ne);
}
- // String current_stereotype = this.getStereotype((org.eclipse.uml2.uml.Class)ne);
- // //if (stereotype != "--")
- // // System.out.println("STEREOTYPE: " + stereotype);
- // if (current_stereotype.compareTo(stereotype)==0) {
- // //System.out.println("FOUND A SENSOR: " + ((NamedElement)ne).getName());
- // target_list.add((NamedElement)ne);
- // }
+ // String current_stereotype = this.getStereotype((org.eclipse.uml2.uml.Class)ne);
+ // //if (stereotype != "--")
+ // // System.out.println("STEREOTYPE: " + stereotype);
+ // if (current_stereotype.compareTo(stereotype)==0) {
+ // //System.out.println("FOUND A SENSOR: " + ((NamedElement)ne).getName());
+ // target_list.add((NamedElement)ne);
+ // }
}
getElementsWithInheritedStereotype(ne, stereotype, target_list);
}
@@ -182,11 +186,12 @@ public class GeneralQueries {
/**
* Get the first stereotype applied to a given class.
* Warning: other stereotypes are ignored. To use with care.
- *
+ *
* @deprecated superseded by the RobotML API.
*/
+ @Deprecated
static public String getStereotype(org.eclipse.uml2.uml.Class cl) {
- if(cl.getAppliedStereotypes().size() == 1) {
+ if (cl.getAppliedStereotypes().size() == 1) {
return cl.getAppliedStereotypes().get(0).getName();
} else {
return "--";
@@ -194,11 +199,11 @@ public class GeneralQueries {
}
static public Boolean inheritsFrom(org.eclipse.uml2.uml.Class cl, String stname) {
- for(Stereotype st : cl.getAppliedStereotypes()) {
- if(st.getName().equals(stname)) {
+ for (Stereotype st : cl.getAppliedStereotypes()) {
+ if (st.getName().equals(stname)) {
return true;
} else {
- if(inheritsFrom(st, stname)) {
+ if (inheritsFrom(st, stname)) {
return true;
}
}
@@ -207,20 +212,21 @@ public class GeneralQueries {
}
static public Boolean inheritsFrom(org.eclipse.uml2.uml.Stereotype st, String stname) {
- if(st.getName().equals(stname)) {
+ if (st.getName().equals(stname)) {
return true;
} else {
- for(org.eclipse.uml2.uml.Class scl : st.getSuperClasses()) {
- if(inheritsFrom((org.eclipse.uml2.uml.Stereotype)scl, stname))
+ for (org.eclipse.uml2.uml.Class scl : st.getSuperClasses()) {
+ if (inheritsFrom((org.eclipse.uml2.uml.Stereotype) scl, stname)) {
return true;
+ }
}
}
return false;
}
static public String getStereotypeInheritedFrom(org.eclipse.uml2.uml.Class cl, String stname) {
- for(Stereotype st : cl.getAppliedStereotypes()) {
- if(inheritsFrom(st, stname)) {
+ for (Stereotype st : cl.getAppliedStereotypes()) {
+ if (inheritsFrom(st, stname)) {
return st.getName();
}
}
@@ -228,9 +234,9 @@ public class GeneralQueries {
}
static public Boolean hasStereotype(org.eclipse.uml2.uml.Class cl, Class stereotype) {
- for(EObject stereoApplication : cl.getStereotypeApplications()) {
+ for (EObject stereoApplication : cl.getStereotypeApplications()) {
// check whether the stereotype is an instance of the passed parameter clazz
- if(stereotype.isInstance(stereoApplication)) {
+ if (stereotype.isInstance(stereoApplication)) {
return true;
}
}
@@ -241,8 +247,8 @@ public class GeneralQueries {
* Return true if a given class has specified stereotype.
*/
static public Boolean hasStereotype(org.eclipse.uml2.uml.Class cl, String s) {
- for(Stereotype st : cl.getAppliedStereotypes()) {
- if(st.getName().equals(s)) {
+ for (Stereotype st : cl.getAppliedStereotypes()) {
+ if (st.getName().equals(s)) {
return true;
}
}
@@ -251,7 +257,7 @@ public class GeneralQueries {
/**
* Is this element a UML class
- *
+ *
* @param element
* @return is this a UML class ?
*/
@@ -261,31 +267,31 @@ public class GeneralQueries {
/**
* Is this element a UML DataType
- *
+ *
* @param element
* @return is this a UML DataType ?
*/
static public Boolean isDataType(Element elt) {
boolean b = (elt instanceof org.eclipse.uml2.uml.DataType);
- //System.out.println(((NamedElement)elt).getName()+" - isDataType: "+b+" "+elt.getAppliedStereotypes());
+ // System.out.println(((NamedElement)elt).getName()+" - isDataType: "+b+" "+elt.getAppliedStereotypes());
return b;
}
/**
* Is this element a UML interface
- *
+ *
* @param element
* @return is this a UML class ?
*/
static public Boolean isInterface(Element elt) {
boolean b = (elt instanceof org.eclipse.uml2.uml.Interface);
- //System.out.println(((NamedElement)elt).getName()+" - isInterface: "+b+" "+elt.getAppliedStereotypes());
+ // System.out.println(((NamedElement)elt).getName()+" - isInterface: "+b+" "+elt.getAppliedStereotypes());
return b;
}
/**
* Is this element a UML Property
- *
+ *
* @param element
* @return is this a UML Property ?
*/
@@ -295,7 +301,7 @@ public class GeneralQueries {
/**
* Is this property a Port
- *
+ *
* @param property
* @return is this a port ?
*/
@@ -305,7 +311,7 @@ public class GeneralQueries {
/**
* Is this element an instance specification
- *
+ *
* @param element
* @return is this an instance specification ?
*/
@@ -318,12 +324,13 @@ public class GeneralQueries {
*/
static public String getInstanceMultiplicity(Property p) {
try {
- if((p.getLower() == 1) && (p.getUpper() == 1)) {
+ if ((p.getLower() == 1) && (p.getUpper() == 1)) {
return "";
- } else if((p.getLower() == p.getUpper())) {
+ } else if ((p.getLower() == p.getUpper())) {
return "[" + p.getLower() + "]";
- } else
+ } else {
return "[]";
+ }
} catch (Exception e) {
java.lang.System.out.println(e);
e.printStackTrace();
@@ -335,20 +342,20 @@ public class GeneralQueries {
* Return the value of a given attribute using the given stereotype
*/
static public String getAttributeValue(org.eclipse.uml2.uml.Class cl, String attr, String stname) {
- for(Stereotype st : cl.getAppliedStereotypes()) {
- if(st.getName().equals(stname)) {
+ for (Stereotype st : cl.getAppliedStereotypes()) {
+ if (st.getName().equals(stname)) {
Object o = cl.getValue(st, attr);
- if(o != null) {
- if(o instanceof NamedElement) {
- String v = ((NamedElement)o).getName();
+ if (o != null) {
+ if (o instanceof NamedElement) {
+ String v = ((NamedElement) o).getName();
return v;
- } else if(o instanceof String) {
- return (String)o;
- } else if(o instanceof EList) {
- if(((EList<Object>)o).isEmpty()) {
+ } else if (o instanceof String) {
+ return (String) o;
+ } else if (o instanceof EList) {
+ if (((EList<Object>) o).isEmpty()) {
return null;
}
- return ((EList<Object>)o).get(0).toString();
+ return ((EList<Object>) o).get(0).toString();
} else {
return o.toString();
}
@@ -365,9 +372,9 @@ public class GeneralQueries {
static public String getAttributeValue(org.eclipse.uml2.uml.Class cl, String attr, String stname, String defaultValue) {
String result = null;
result = getAttributeValue(cl, attr, stname);
- //System.out.println("value : " + result);
+ // System.out.println("value : " + result);
- if(result == null || result.length() == 0) {
+ if (result == null || result.length() == 0) {
return defaultValue;
}
return result;
@@ -379,19 +386,19 @@ public class GeneralQueries {
*/
static public List<String> getAttributeValues(org.eclipse.uml2.uml.Class cl, String attr, String stname) {
LinkedList<String> result = new LinkedList<String>();
- for(Stereotype st : cl.getAppliedStereotypes()) {
- if(st.getName().equals(stname)) {
+ for (Stereotype st : cl.getAppliedStereotypes()) {
+ if (st.getName().equals(stname)) {
Object o = cl.getValue(st, attr);
- if(o != null) {
- if(o instanceof NamedElement) {
- result.add(((NamedElement)o).getName());
- } else if(o instanceof String) {
- result.add((String)o);
- } else if(o instanceof EList) {
- // System.out.println("Values type: " + o.getClass().getName() );
- for(int i = 0; i < ((EList<Object>)o).size(); i++) {
- result.add(((EList<Object>)o).get(i).toString());
- // System.out.println("element " + i + " : " + ((EList<Object>) o).get(i));
+ if (o != null) {
+ if (o instanceof NamedElement) {
+ result.add(((NamedElement) o).getName());
+ } else if (o instanceof String) {
+ result.add((String) o);
+ } else if (o instanceof EList) {
+ // System.out.println("Values type: " + o.getClass().getName() );
+ for (int i = 0; i < ((EList<Object>) o).size(); i++) {
+ result.add(((EList<Object>) o).get(i).toString());
+ // System.out.println("element " + i + " : " + ((EList<Object>) o).get(i));
}
} else {
result.add(o.toString());
@@ -406,20 +413,23 @@ public class GeneralQueries {
* Find a class with a given name in the model.
*/
static public org.eclipse.uml2.uml.Class findClassInModel(org.eclipse.uml2.uml.Model model, String name) {
- for(Element ne : model.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- if(((org.eclipse.uml2.uml.Class)ne).getName().equals(name))
- return (org.eclipse.uml2.uml.Class)ne;
- } else if(ne instanceof org.eclipse.uml2.uml.Package) {
- org.eclipse.uml2.uml.Class result = findClassInPackage((org.eclipse.uml2.uml.Package)ne, name);
- if(result != null)
+ for (Element ne : model.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ if (((org.eclipse.uml2.uml.Class) ne).getName().equals(name)) {
+ return (org.eclipse.uml2.uml.Class) ne;
+ }
+ } else if (ne instanceof org.eclipse.uml2.uml.Package) {
+ org.eclipse.uml2.uml.Class result = findClassInPackage((org.eclipse.uml2.uml.Package) ne, name);
+ if (result != null) {
return result;
+ }
}
- } else if(ne instanceof Model) {
- org.eclipse.uml2.uml.Class result = findClassInModel((Model)ne, name);
- if(result != null)
+ } else if (ne instanceof Model) {
+ org.eclipse.uml2.uml.Class result = findClassInModel((Model) ne, name);
+ if (result != null) {
return result;
+ }
}
}
return null;
@@ -429,21 +439,24 @@ public class GeneralQueries {
* Find a class with a given name in a package.
*/
static public org.eclipse.uml2.uml.Class findClassInPackage(org.eclipse.uml2.uml.Package pack, String name) {
- for(Element ne : pack.getOwnedElements()) {
- if(ne instanceof NamedElement) {
- //System.out.println(((NamedElement) ne).getName());
- if(ne instanceof org.eclipse.uml2.uml.Class) {
- if(((org.eclipse.uml2.uml.Class)ne).getName().equals(name))
- return (org.eclipse.uml2.uml.Class)ne;
- } else if(ne instanceof org.eclipse.uml2.uml.Package) {
- org.eclipse.uml2.uml.Class result = findClassInPackage((org.eclipse.uml2.uml.Package)ne, name);
- if(result != null)
+ for (Element ne : pack.getOwnedElements()) {
+ if (ne instanceof NamedElement) {
+ // System.out.println(((NamedElement) ne).getName());
+ if (ne instanceof org.eclipse.uml2.uml.Class) {
+ if (((org.eclipse.uml2.uml.Class) ne).getName().equals(name)) {
+ return (org.eclipse.uml2.uml.Class) ne;
+ }
+ } else if (ne instanceof org.eclipse.uml2.uml.Package) {
+ org.eclipse.uml2.uml.Class result = findClassInPackage((org.eclipse.uml2.uml.Package) ne, name);
+ if (result != null) {
return result;
+ }
}
- } else if(ne instanceof Model) {
- org.eclipse.uml2.uml.Class result = findClassInModel((Model)ne, name);
- if(result != null)
+ } else if (ne instanceof Model) {
+ org.eclipse.uml2.uml.Class result = findClassInModel((Model) ne, name);
+ if (result != null) {
return result;
+ }
}
}
return null;
@@ -465,33 +478,33 @@ public class GeneralQueries {
java.lang.System.out.println("\t* super classes: " + cl.getSuperClasses());
// stereotypes of this class
- for(Stereotype st : cl.getAppliedStereotypes()) {
+ for (Stereotype st : cl.getAppliedStereotypes()) {
java.lang.System.out.println("\t* applied stereotype: " + st.getName());
}
// properties of this class
- for(Property prop : cl.getAllAttributes()) {
+ for (Property prop : cl.getAllAttributes()) {
java.lang.System.out.println("\t* property: " + prop.getName());
// This is a Port
- if(isPort(prop)) {
- inspectPort((Port)prop);
+ if (isPort(prop)) {
+ inspectPort((Port) prop);
} else {
Type propType = prop.getType();
- if(isDataType(propType)) {
+ if (isDataType(propType)) {
java.lang.System.out.println("\t\t* property read from stereotype: " + prop.getName());
- } else if(isClass(propType)) {
+ } else if (isClass(propType)) {
java.lang.System.out.println("\t\t* class sub instance : " + propType.getName() + " - " + prop.getUpper() + " - " + prop.getLower());
} else {
java.lang.System.err.println("UNKONWN PROPERTY TYPE !");
}
}
}
- for(Connector connector : cl.getOwnedConnectors()) {
+ for (Connector connector : cl.getOwnedConnectors()) {
java.lang.System.out.println("\t* owned connector: " + connector.getName());
- for(ConnectorEnd cend : connector.getEnds()) {
- if((cend.getRole() != null) && (cend.getPartWithPort() != null)) {
+ for (ConnectorEnd cend : connector.getEnds()) {
+ if ((cend.getRole() != null) && (cend.getPartWithPort() != null)) {
java.lang.System.out.println("\t\t* from property: " + cend.getRole().getName() + " in instance " + cend.getPartWithPort().getName());
} else {
java.lang.System.err.println("\t\t* Unconnected Port !");
@@ -499,7 +512,7 @@ public class GeneralQueries {
}
}
}
- for(Operation op : cl.getAllOperations()) {
+ for (Operation op : cl.getAllOperations()) {
java.lang.System.out.println("\t* operation: " + op.getName() + " - datatype: " + op.getDatatype() + " - interface: " + op.getInterface());
}
@@ -510,9 +523,9 @@ public class GeneralQueries {
* Debug function. Prints info about a given port.
*/
static public void inspectPort(Port port) {
- if(ArchitectureQueries.isDataFlowPort(port)) {
+ if (ArchitectureQueries.isDataFlowPort(port)) {
ArchitectureQueries.inspectDataFlowPort(port);
- } else if(ArchitectureQueries.isServicePort(port)) {
+ } else if (ArchitectureQueries.isServicePort(port)) {
ArchitectureQueries.inspectServicePort(port);
} else {
java.lang.System.err.println("UNKONWN PORT !");
@@ -521,7 +534,7 @@ public class GeneralQueries {
/**
* Fonction de test pour inspecter un mod�le UML2
- *
+ *
* @param model
* @return
*/
@@ -533,31 +546,31 @@ public class GeneralQueries {
//
// Bibliothèque de DataTypes sera importée
//
- for(PackageableElement elt : model.getImportedElements()) {
+ for (PackageableElement elt : model.getImportedElements()) {
java.lang.System.out.println("* model imported packageable element: " + elt);
}
//
// Peut-être ?
//
- for(org.eclipse.uml2.uml.Package elt : model.getImportedPackages()) {
+ for (org.eclipse.uml2.uml.Package elt : model.getImportedPackages()) {
java.lang.System.out.println("* model imported package: " + elt);
}
//
- // Récupérer Package par Package si possible (cf méthodologie Outil RobotML)
+ // Récupérer Package par Package si possible (cf méthodologie Outil RobotML)
//
- for(org.eclipse.uml2.uml.Package elt : model.getNestedPackages()) {
+ for (org.eclipse.uml2.uml.Package elt : model.getNestedPackages()) {
java.lang.System.out.println("* model nested package: " + elt);
}
//
// Parcours des éléments contenus dans le modèle
//
- for(NamedElement elt : model.getMembers()) {
+ for (NamedElement elt : model.getMembers()) {
java.lang.System.out.println("* model member: " + elt.getName());
- if(isClass(elt)) {
- inspectClass((org.eclipse.uml2.uml.Class)elt);
- } else if(isDataType(elt)) {
- inspectDataType((DataType)elt);
- } else if(isInterface(elt)) {
+ if (isClass(elt)) {
+ inspectClass((org.eclipse.uml2.uml.Class) elt);
+ } else if (isDataType(elt)) {
+ inspectDataType((DataType) elt);
+ } else if (isInterface(elt)) {
java.lang.System.out.println("\t* interface definition : " + elt.getName());
} else {
@@ -576,7 +589,7 @@ public class GeneralQueries {
/**
* String manipulation function :
* remove brackets from a string
- *
+ *
* @param str
* @return
*/
diff --git a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/MMQueries.java b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/MMQueries.java
index 7b052dad1eb..a43047cfbd7 100644
--- a/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/MMQueries.java
+++ b/extraplugins/robotml/generators/org.eclipse.papyrus.robotml.generators.common/src/org/eclipse/papyrus/robotml/generators/common/mmqueries/MMQueries.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -26,21 +26,21 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* Entry point of the 'MMQueries' generation module.
- *
+ *
* @generated
*/
public class MMQueries extends AbstractAcceleoGenerator {
/**
* The name of the module.
- *
+ *
* @generated
*/
public static final String MODULE_FILE_NAME = "MMQueries";
/**
* The name of the templates that are to be generated.
- *
+ *
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "MMQueries", };
@@ -50,10 +50,9 @@ public class MMQueries extends AbstractAcceleoGenerator {
* this way cannot be used to launch generations before one of {@link #initialize(EObject, File, List)} or {@link #initialize(URI, File, List)} is
* called.
* <p>
- * The main reason for this constructor is to allow clients of this generation to call it from another Java file, as it allows for the retrieval
- * of {@link #getProperties()} and {@link #getGenerationListeners()}.
+ * The main reason for this constructor is to allow clients of this generation to call it from another Java file, as it allows for the retrieval of {@link #getProperties()} and {@link #getGenerationListeners()}.
* </p>
- *
+ *
* @generated
*/
public MMQueries() {
@@ -62,18 +61,18 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This allows clients to instantiates a generator with all required information.
- *
+ *
* @param modelURI
- * URI where the model on which this generator will be used is located.
+ * URI where the model on which this generator will be used is located.
* @param targetFolder
- * This will be used as the output folder for this generation : it will be the base path
- * against which all file block URLs will be resolved.
+ * This will be used as the output folder for this generation : it will be the base path
+ * against which all file block URLs will be resolved.
* @param arguments
- * If the template which will be called requires more than one argument taken from the model,
- * pass them here.
+ * If the template which will be called requires more than one argument taken from the model,
+ * pass them here.
* @throws IOException
- * This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
- * the model cannot be loaded.
+ * This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
+ * the model cannot be loaded.
* @generated
*/
public MMQueries(URI modelURI, File targetFolder, List<? extends Object> arguments) throws IOException {
@@ -82,18 +81,18 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This allows clients to instantiates a generator with all required information.
- *
+ *
* @param model
- * We'll iterate over the content of this element to find Objects matching the first parameter
- * of the template we need to call.
+ * We'll iterate over the content of this element to find Objects matching the first parameter
+ * of the template we need to call.
* @param targetFolder
- * This will be used as the output folder for this generation : it will be the base path
- * against which all file block URLs will be resolved.
+ * This will be used as the output folder for this generation : it will be the base path
+ * against which all file block URLs will be resolved.
* @param arguments
- * If the template which will be called requires more than one argument taken from the model,
- * pass them here.
+ * If the template which will be called requires more than one argument taken from the model,
+ * pass them here.
* @throws IOException
- * This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
+ * This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public MMQueries(EObject model, File targetFolder, List<? extends Object> arguments) throws IOException {
@@ -102,20 +101,20 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This can be used to launch the generation from a standalone application.
- *
+ *
* @param args
- * Arguments of the generation.
+ * Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
- if(args.length < 2) {
+ if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
- for(int i = 2; i < args.length; i++) {
+ for (int i = 2; i < args.length; i++) {
arguments.add(args[i]);
}
MMQueries generator = new MMQueries(modelURI, folder, arguments);
@@ -128,11 +127,11 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* Launches the generation described by this instance.
- *
+ *
* @param monitor
- * This will be used to display progress information to the user.
+ * This will be used to display progress information to the user.
* @throws IOException
- * This will be thrown if any of the output files cannot be saved to disk.
+ * This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
@@ -146,7 +145,7 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
- *
+ *
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@@ -160,23 +159,21 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
- * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates files on the fly. If you only need to
- * preview the results, return a new {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of the
- * running Eclipse and can be used standalone.
+ * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates files on the fly. If you only need to preview the results, return a new {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of
+ * these aren't aware of the running Eclipse and can be used standalone.
* </p>
* <p>
- * If you need the file generation to be aware of the workspace (A typical example is when you wanna override files that are under clear case or
- * any other VCS that could forbid the overriding), then return a new
- * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that this <b>cannot</b> be used
- * standalone.
+ * If you need the file generation to be aware of the workspace (A typical example is when you wanna override files that are under clear case or any other VCS that could forbid the overriding), then return a new
+ * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
- *
+ *
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
+ @Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
@@ -184,7 +181,7 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
- *
+ *
* @return The name of the module that is to be launched.
* @generated
*/
@@ -198,11 +195,10 @@ public class MMQueries extends AbstractAcceleoGenerator {
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
* <p>
- * Properties need to be in source folders, the path that we expect to get as a result of this call are of the form &lt;package>.&lt;properties
- * file name without extension>. For example, if you have a file named "messages.properties" in package "org.eclipse.acceleo.sample", the path
- * that needs be returned by a call to {@link #getProperties()} is "org.eclipse.acceleo.sample.messages".
+ * Properties need to be in source folders, the path that we expect to get as a result of this call are of the form &lt;package>.&lt;properties file name without extension>. For example, if you have a file named "messages.properties" in package
+ * "org.eclipse.acceleo.sample", the path that needs be returned by a call to {@link #getProperties()} is "org.eclipse.acceleo.sample.messages".
* </p>
- *
+ *
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
@@ -224,7 +220,7 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This will be used to get the list of templates that are to be launched by this launcher.
- *
+ *
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@@ -235,9 +231,9 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This can be used to update the resource set's package registry with all needed EPackages.
- *
+ *
* @param resourceSet
- * The resource set which registry has to be updated.
+ * The resource set which registry has to be updated.
* @generated
*/
@Override
@@ -250,9 +246,9 @@ public class MMQueries extends AbstractAcceleoGenerator {
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
- *
+ *
* @param resourceSet
- * The resource set which registry has to be updated.
+ * The resource set which registry has to be updated.
* @generated
*/
@Override
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/Activator.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/Activator.java
index 22c66a25e45..9a050af348c 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/Activator.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/Activator.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -39,10 +39,11 @@ public class Activator extends AbstractUIPlugin {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
* @generated
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -51,10 +52,11 @@ public class Activator extends AbstractUIPlugin {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
* @generated
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -62,7 +64,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/common/GenerateAll.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/common/GenerateAll.java
index 3c70c28f64c..08991447b86 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/common/GenerateAll.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/common/GenerateAll.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -48,15 +48,15 @@ public class GenerateAll {
/**
* Constructor.
- *
+ *
* @param modelURI
- * is the URI of the model.
+ * is the URI of the model.
* @param targetFolder
- * is the output folder
+ * is the output folder
* @param arguments
- * are the other arguments
+ * are the other arguments
* @throws IOException
- * Thrown when the output cannot be saved.
+ * Thrown when the output cannot be saved.
* @generated
*/
public GenerateAll(URI modelURI, IContainer targetFolder, List<? extends Object> arguments) {
@@ -67,29 +67,30 @@ public class GenerateAll {
/**
* Launches the generation.
- *
+ *
* @param monitor
- * This will be used to display progress information to the user.
+ * This will be used to display progress information to the user.
* @throws IOException
- * Thrown when the output cannot be saved.
+ * Thrown when the output cannot be saved.
* @generated
*/
public void doGenerate(IProgressMonitor monitor) throws IOException {
- if(!targetFolder.getLocation().toFile().exists()) {
+ if (!targetFolder.getLocation().toFile().exists()) {
targetFolder.getLocation().toFile().mkdirs();
}
// final URI template0 = getTemplateURI("org.eclipse.papyrus.robotml.generators.intempora.rtmaps", new Path("/org/eclipse/robotml/generators/acceleo/rtmaps/main/generate_rtmaps.emtl"));
// org.eclipse.papyrus.robotml.generators.intempora.rtmaps.main.Generate_rtmaps gen0 = new org.eclipse.papyrus.robotml.generators.intempora.rtmaps.main.Generate_rtmaps(modelURI, targetFolder.getLocation().toFile(), arguments) {
- // protected URI createTemplateURI(String entry) {
- // return template0;
- // }
- //};
- //gen0.doGenerate(BasicMonitor.toMonitor(monitor));
+ // protected URI createTemplateURI(String entry) {
+ // return template0;
+ // }
+ // };
+ // gen0.doGenerate(BasicMonitor.toMonitor(monitor));
monitor.subTask("Loading...");
Generate_rtmaps gen0 = new Generate_rtmaps(modelURI, targetFolder.getLocation().toFile(), arguments);
monitor.worked(1);
- String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.papyrus.robotml.generators.intempora.rtmaps", "org.eclipse.papyrus.robotml.generators.intempora.rtmaps.main.Generate_rtmaps", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
+ String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.papyrus.robotml.generators.intempora.rtmaps", "org.eclipse.papyrus.robotml.generators.intempora.rtmaps.main.Generate_rtmaps",
+ modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
gen0.setGenerationID(generationID);
gen0.doGenerate(BasicMonitor.toMonitor(monitor));
@@ -98,11 +99,11 @@ public class GenerateAll {
/**
* Finds the template in the plug-in. Returns the template plug-in URI.
- *
+ *
* @param bundleID
- * is the plug-in ID
+ * is the plug-in ID
* @param relativePath
- * is the relative path of the template in the plug-in
+ * is the relative path of the template in the plug-in
* @return the template URI
* @throws IOException
* @generated
@@ -110,34 +111,34 @@ public class GenerateAll {
@SuppressWarnings({ "unused" })
private URI getTemplateURI(String bundleID, IPath relativePath) throws IOException {
Bundle bundle = Platform.getBundle(bundleID);
- if(bundle == null) {
+ if (bundle == null) {
// no need to go any further
return URI.createPlatformResourceURI(new Path(bundleID).append(relativePath).toString(), false);
}
URL url = bundle.getEntry(relativePath.toString());
- if(url == null && relativePath.segmentCount() > 1) {
+ if (url == null && relativePath.segmentCount() > 1) {
Enumeration<URL> entries = bundle.findEntries("/", "*.emtl", true);
- if(entries != null) {
+ if (entries != null) {
String[] segmentsRelativePath = relativePath.segments();
- while(url == null && entries.hasMoreElements()) {
+ while (url == null && entries.hasMoreElements()) {
URL entry = entries.nextElement();
IPath path = new Path(entry.getPath());
- if(path.segmentCount() > relativePath.segmentCount()) {
+ if (path.segmentCount() > relativePath.segmentCount()) {
path = path.removeFirstSegments(path.segmentCount() - relativePath.segmentCount());
}
String[] segmentsPath = path.segments();
boolean equals = segmentsPath.length == segmentsRelativePath.length;
- for(int i = 0; equals && i < segmentsPath.length; i++) {
+ for (int i = 0; equals && i < segmentsPath.length; i++) {
equals = segmentsPath[i].equals(segmentsRelativePath[i]);
}
- if(equals) {
+ if (equals) {
url = bundle.getEntry(entry.getPath());
}
}
}
}
URI result;
- if(url != null) {
+ if (url != null) {
result = URI.createPlatformPluginURI(new Path(bundleID).append(new Path(url.getPath())).toString(), false);
} else {
result = URI.createPlatformResourceURI(new Path(bundleID).append(relativePath).toString(), false);
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoGenerateRTMapsCommandHandler.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoGenerateRTMapsCommandHandler.java
index 0ca4a82aaf8..2701e97c50f 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoGenerateRTMapsCommandHandler.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoGenerateRTMapsCommandHandler.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,44 +40,44 @@ public class AcceleoGenerateRTMapsCommandHandler extends AbstractHandler {
/** The rtmaps folder. */
private final String rtmapsFolder = "rtmaps-generated-files";
- // /**
- // * @see org.eclipse.papyrus.modelexplorer.handler.AbstractCommandHandler#getCommand()
- // *
- // * @return
- // */
+ // /**
+ // * @see org.eclipse.papyrus.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ // *
+ // * @return
+ // */
+ //
+ // @Override
+ // protected Command getCommand() {
+ // List<EObject> selectedObjects = getSelectedElements();
+ // EObject selectedElement = getSelectedElement();
+ // List<?> selection = getSelection();
+ // TransactionalEditingDomain editingDomain = getEditingDomain();
+ // if ((selectedObjects != null) && (selectedObjects.size()>0)){
+ // EObject selectedObject = selectedObjects.get(0);
+ // URI targetFolderURI = selectedObject.eResource().getURI();
+ // int lastindex = targetFolderURI.toPlatformString(false).lastIndexOf("/");
+ // String targetPath = targetFolderURI.toPlatformString(false).substring(0, lastindex);
+ // return new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(new GenerateRTMapsCodeCommand("Generate RTMaps code command", editingDomain, selectedObject, targetPath + rtmapsFolder));
+ // }
+ //
+ //
+ // return null;
//
- // @Override
- // protected Command getCommand() {
- // List<EObject> selectedObjects = getSelectedElements();
- // EObject selectedElement = getSelectedElement();
- // List<?> selection = getSelection();
- // TransactionalEditingDomain editingDomain = getEditingDomain();
- // if ((selectedObjects != null) && (selectedObjects.size()>0)){
- // EObject selectedObject = selectedObjects.get(0);
- // URI targetFolderURI = selectedObject.eResource().getURI();
- // int lastindex = targetFolderURI.toPlatformString(false).lastIndexOf("/");
- // String targetPath = targetFolderURI.toPlatformString(false).substring(0, lastindex);
- // return new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(new GenerateRTMapsCodeCommand("Generate RTMaps code command", editingDomain, selectedObject, targetPath + rtmapsFolder));
- // }
- //
- //
- //return null;
- //
//
- // }
+ // }
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
EObject selectedElement = EMFHelper.getEObject(structuredSelection.getFirstElement());
- if(selectedElement == null) {
+ if (selectedElement == null) {
return null;
}
URI resourceURI = selectedElement.eResource().getURI();
- //int lastSegment = resourceURI.segmentCount() - 1;
+ // int lastSegment = resourceURI.segmentCount() - 1;
URI targetFolderURI = resourceURI.trimSegments(1).appendSegment(rtmapsFolder);
try {
@@ -85,7 +85,7 @@ public class AcceleoGenerateRTMapsCommandHandler extends AbstractHandler {
ICommand generationCommand = new GenerateRTMapsCodeCommand("Generate RTMaps code command", editingDomain, selectedElement, targetFolderURI.toPlatformString(true));
- if(generationCommand.canExecute()) {
+ if (generationCommand.canExecute()) {
generationCommand.execute(new NullProgressMonitor(), null);
}
} catch (ServiceException ex) {
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoRTMapsCodeGenerator.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoRTMapsCodeGenerator.java
index fcad685a4f9..569b26c8beb 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoRTMapsCodeGenerator.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/AcceleoRTMapsCodeGenerator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,23 +47,23 @@ public class AcceleoRTMapsCodeGenerator {
/**
* Run acceleo transformation.
- *
+ *
* @param generationInputModel
- * the generation input model
+ * the generation input model
* @param rtmapsTargetFolderPath
- * the rtmaps target folder path
+ * the rtmaps target folder path
*/
public void runAcceleoTransformation(EObject generationInputModel, String rtmapsTargetFolderPath) {
this.generationInputModel = generationInputModel;
this.rtmapsTargetFolder = new File(rtmapsTargetFolderPath);
- if(this.generationInputModel != null && this.rtmapsTargetFolder != null) {
+ if (this.generationInputModel != null && this.rtmapsTargetFolder != null) {
try {
- File targetFolder = FileUtil.getWorkspaceFile(rtmapsTargetFolderPath); //$NON-NLS-1$ //$NON-NLS-2$
- if(!targetFolder.getParentFile().exists()) {
+ File targetFolder = FileUtil.getWorkspaceFile(rtmapsTargetFolderPath);
+ if (!targetFolder.getParentFile().exists()) {
targetFolder.getParentFile().mkdirs();
}
- //Instantiate a new acceleo generator
+ // Instantiate a new acceleo generator
Generate_rtmaps generate = new Generate_rtmaps(this.generationInputModel, targetFolder, Collections.EMPTY_LIST);
generate.doGenerate(null);
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/GenerateRTMapsCodeCommand.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/GenerateRTMapsCodeCommand.java
index c1a8e623cb6..d13860f9193 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/GenerateRTMapsCodeCommand.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/handler/GenerateRTMapsCodeCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,15 +44,15 @@ public class GenerateRTMapsCodeCommand extends AbstractTransactionalCommand {
/**
* Instantiates a new generate rt maps code command.
- *
+ *
* @param label
- * the label
+ * the label
* @param domain
- * the domain
+ * the domain
* @param selectedElement
- * the selected element
+ * the selected element
* @param rtmapsTargetFolderPath
- * the rtmaps target folder path
+ * the rtmaps target folder path
*/
public GenerateRTMapsCodeCommand(String label, TransactionalEditingDomain domain, EObject selectedElement, String rtmapsTargetFolderPath) {
super(domain, label, Collections.EMPTY_LIST);
@@ -63,9 +63,8 @@ public class GenerateRTMapsCodeCommand extends AbstractTransactionalCommand {
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -77,10 +76,10 @@ public class GenerateRTMapsCodeCommand extends AbstractTransactionalCommand {
// TODO Auto-generated method stub
- //System.err.println("Model Exlorer generation menu RTMaps");
+ // System.err.println("Model Exlorer generation menu RTMaps");
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- //final ProgressMonitorDialog monitordialog = new ProgressMonitorDialog(shell);
+ // final ProgressMonitorDialog monitordialog = new ProgressMonitorDialog(shell);
AcceleoRTMapsCodeGenerator codeGenerator = new AcceleoRTMapsCodeGenerator();
codeGenerator.runAcceleoTransformation(selectedElement, rtmapsTargetFolderPath);
/*
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/popupMenus/AcceleoGenerateRTMapsAction.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/popupMenus/AcceleoGenerateRTMapsAction.java
index 4214fd7c1c2..39069b6505c 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/popupMenus/AcceleoGenerateRTMapsAction.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/ui/popupMenus/AcceleoGenerateRTMapsAction.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -46,32 +46,34 @@ public class AcceleoGenerateRTMapsAction extends ActionDelegate implements IActi
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.ui.actions.ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
* @generated
*/
+ @Override
@SuppressWarnings("unchecked")
public void selectionChanged(IAction action, ISelection selection) {
- if(selection instanceof IStructuredSelection) {
- files = ((IStructuredSelection)selection).toList();
+ if (selection instanceof IStructuredSelection) {
+ files = ((IStructuredSelection) selection).toList();
}
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
* @generated
*/
+ @Override
public void run(IAction action) {
- if(files != null) {
+ if (files != null) {
IRunnableWithProgress operation = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
try {
Iterator<IFile> filesIt = files.iterator();
- while(filesIt.hasNext()) {
- IFile model = (IFile)filesIt.next();
+ while (filesIt.hasNext()) {
+ IFile model = filesIt.next();
URI modelURI = URI.createPlatformResourceURI(model.getFullPath().toString(), true);
try {
IContainer target = model.getProject().getFolder("rtmaps-generated-files");
@@ -104,7 +106,7 @@ public class AcceleoGenerateRTMapsAction extends ActionDelegate implements IActi
/**
* Computes the arguments of the generator.
- *
+ *
* @return the arguments
* @generated
*/
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Activator.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Activator.java
index 1487e38f02a..ed0330683ac 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Activator.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Activator.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -36,9 +36,10 @@ public class Activator extends Plugin {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -46,9 +47,10 @@ public class Activator extends Plugin {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -56,7 +58,7 @@ public class Activator extends Plugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java
index 677a4b3198d..855a7d7a5ac 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -29,28 +29,28 @@ import org.eclipse.uml2.uml.resource.UMLResource;
/**
* Entry point of the 'Generate_rtmaps' generation module.
- *
+ *
* @generated
*/
public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* The name of the module.
- *
+ *
* @generated
*/
public static final String MODULE_FILE_NAME = "/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/generate_rtmaps";
/**
* The name of the templates that are to be generated.
- *
+ *
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "generateRTMapsDiagram" };
/**
* The list of properties files from the launch parameters (Launch configuration).
- *
+ *
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
@@ -60,10 +60,9 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* this way cannot be used to launch generations before one of {@link #initialize(EObject, File, List)} or {@link #initialize(URI, File, List)} is
* called.
* <p>
- * The main reason for this constructor is to allow clients of this generation to call it from another Java file, as it allows for the retrieval
- * of {@link #getProperties()} and {@link #getGenerationListeners()}.
+ * The main reason for this constructor is to allow clients of this generation to call it from another Java file, as it allows for the retrieval of {@link #getProperties()} and {@link #getGenerationListeners()}.
* </p>
- *
+ *
* @generated
*/
public Generate_rtmaps() {
@@ -72,18 +71,18 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This allows clients to instantiates a generator with all required information.
- *
+ *
* @param modelURI
- * URI where the model on which this generator will be used is located.
+ * URI where the model on which this generator will be used is located.
* @param targetFolder
- * This will be used as the output folder for this generation : it will be the base path
- * against which all file block URLs will be resolved.
+ * This will be used as the output folder for this generation : it will be the base path
+ * against which all file block URLs will be resolved.
* @param arguments
- * If the template which will be called requires more than one argument taken from the model,
- * pass them here.
+ * If the template which will be called requires more than one argument taken from the model,
+ * pass them here.
* @throws IOException
- * This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
- * the model cannot be loaded.
+ * This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
+ * the model cannot be loaded.
* @generated
*/
public Generate_rtmaps(URI modelURI, File targetFolder, List<? extends Object> arguments) throws IOException {
@@ -92,18 +91,18 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This allows clients to instantiates a generator with all required information.
- *
+ *
* @param model
- * We'll iterate over the content of this element to find Objects matching the first parameter
- * of the template we need to call.
+ * We'll iterate over the content of this element to find Objects matching the first parameter
+ * of the template we need to call.
* @param targetFolder
- * This will be used as the output folder for this generation : it will be the base path
- * against which all file block URLs will be resolved.
+ * This will be used as the output folder for this generation : it will be the base path
+ * against which all file block URLs will be resolved.
* @param arguments
- * If the template which will be called requires more than one argument taken from the model,
- * pass them here.
+ * If the template which will be called requires more than one argument taken from the model,
+ * pass them here.
* @throws IOException
- * This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
+ * This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public Generate_rtmaps(EObject model, File targetFolder, List<? extends Object> arguments) throws IOException {
@@ -112,14 +111,14 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This can be used to launch the generation from a standalone application.
- *
+ *
* @param args
- * Arguments of the generation.
+ * Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
- if(args.length < 2) {
+ if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
@@ -152,7 +151,7 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* (Help -> Help Contents).
*/
- for(int i = 2; i < args.length; i++) {
+ for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
@@ -165,11 +164,11 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* Launches the generation described by this instance.
- *
+ *
* @param monitor
- * This will be used to display progress information to the user.
+ * This will be used to display progress information to the user.
* @throws IOException
- * This will be thrown if any of the output files cannot be saved to disk.
+ * This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
@@ -184,26 +183,26 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* note that those instructions may have a significant impact on the performances.
*/
- //org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
+ // org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
- //if (model != null && model.eResource() != null) {
- // List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
- // for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
- // System.err.println(diagnostic.toString());
- // }
- //}
+ // if (model != null && model.eResource() != null) {
+ // List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
+ // for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
+ // System.err.println(diagnostic.toString());
+ // }
+ // }
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
- *
+ *
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@@ -222,20 +221,17 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
- * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates files on the fly. If you only need to
- * preview the results, return a new {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of the
- * running Eclipse and can be used standalone.
+ * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates files on the fly. If you only need to preview the results, return a new {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of
+ * these aren't aware of the running Eclipse and can be used standalone.
* </p>
* <p>
- * If you need the file generation to be aware of the workspace (A typical example is when you wanna override files that are under clear case or
- * any other VCS that could forbid the overriding), then return a new
- * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that this <b>cannot</b> be used
- * standalone.
+ * If you need the file generation to be aware of the workspace (A typical example is when you wanna override files that are under clear case or any other VCS that could forbid the overriding), then return a new
+ * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
- *
+ *
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@@ -247,7 +243,7 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
- *
+ *
* @return The name of the module that is to be launched.
* @generated
*/
@@ -261,11 +257,10 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
* <p>
- * Properties need to be in source folders, the path that we expect to get as a result of this call are of the form &lt;package>.&lt;properties
- * file name without extension>. For example, if you have a file named "messages.properties" in package "org.eclipse.acceleo.sample", the path
- * that needs be returned by a call to {@link #getProperties()} is "org.eclipse.acceleo.sample.messages".
+ * Properties need to be in source folders, the path that we expect to get as a result of this call are of the form &lt;package>.&lt;properties file name without extension>. For example, if you have a file named "messages.properties" in package
+ * "org.eclipse.acceleo.sample", the path that needs be returned by a call to {@link #getProperties()} is "org.eclipse.acceleo.sample.messages".
* </p>
- *
+ *
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
@@ -311,9 +306,9 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* Adds a properties file in the list of properties files.
- *
+ *
* @param propertiesFile
- * The properties file to add.
+ * The properties file to add.
* @generated
* @since 3.1
*/
@@ -324,7 +319,7 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This will be used to get the list of templates that are to be launched by this launcher.
- *
+ *
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@@ -335,9 +330,9 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This can be used to update the resource set's package registry with all needed EPackages.
- *
+ *
* @param resourceSet
- * The resource set which registry has to be updated.
+ * The resource set which registry has to be updated.
* @generated NOT
*/
@Override
@@ -348,14 +343,14 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
//
EPackage.Registry packageRegistry = resourceSet.getPackageRegistry();
Resource.Factory.Registry factoryRegistry = resourceSet.getResourceFactoryRegistry();
- //Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
+ // Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
//
- if(!isInWorkspace(org.eclipse.uml2.uml.UMLPackage.class)) {
+ if (!isInWorkspace(org.eclipse.uml2.uml.UMLPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNsURI(), org.eclipse.uml2.uml.UMLPackage.eINSTANCE);
factoryRegistry.getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
}
- if(!isInWorkspace(org.eclipse.papyrus.RobotML.RobotMLPackage.class)) {
+ if (!isInWorkspace(org.eclipse.papyrus.RobotML.RobotMLPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.papyrus.RobotML.RobotMLPackage.eINSTANCE.getNsURI(), org.eclipse.papyrus.RobotML.RobotMLPackage.eINSTANCE);
}
@@ -380,24 +375,24 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
//
- // try {
- // URI uri = URI.createPlatformPluginURI("org.eclipse.papyrus.robotml/model/ProteusProfile.profile.uml", true);
- //
- // Resource res = resourceSet.getResource(uri, true);
- // Profile profile = (Profile)res.getContents().get(0);
- // EPackage epackage = profile.getDefinition();
- // packageRegistry.put(epackage.getNsURI(), epackage);
- // } catch (Exception e) {
- // System.out.println("---- error loading profile: " + e);
- // e.printStackTrace();
- // }
+ // try {
+ // URI uri = URI.createPlatformPluginURI("org.eclipse.papyrus.robotml/model/ProteusProfile.profile.uml", true);
+ //
+ // Resource res = resourceSet.getResource(uri, true);
+ // Profile profile = (Profile)res.getContents().get(0);
+ // EPackage epackage = profile.getDefinition();
+ // packageRegistry.put(epackage.getNsURI(), epackage);
+ // } catch (Exception e) {
+ // System.out.println("---- error loading profile: " + e);
+ // e.printStackTrace();
+ // }
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
- *
+ *
* @param resourceSet
- * The resource set which registry has to be updated.
+ * The resource set which registry has to be updated.
* @generated
*/
@Override
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/RTMapsDataTypeQueries.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/RTMapsDataTypeQueries.java
index 06bb3d63239..ea944e20224 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/RTMapsDataTypeQueries.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/RTMapsDataTypeQueries.java
@@ -3,7 +3,7 @@
*
* This software is a computer program whose purpose is to transform RobotML models
* into RTMaps diagrams and RTMaps components via source code generation techniques.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,11 +21,13 @@ import org.eclipse.papyrus.robotml.generators.common.mmqueries.ArchitectureQueri
public class RTMapsDataTypeQueries {
public String getNbElementsInVector(String type_name, String ioelt_name, String return_value_name) {
- if(type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0 || type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0 || type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0 || type_name.compareTo("Float32") == 0 || type_name.compareTo("Float64") == 0)
+ if (type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0
+ || type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0 || type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0
+ || type_name.compareTo("Duration") == 0 || type_name.compareTo("Float32") == 0 || type_name.compareTo("Float64") == 0)
{
return "int " + return_value_name + " = " + ioelt_name + "->VectorSize();";
- } else if(type_name.compareTo("String") == 0) {
+ } else if (type_name.compareTo("String") == 0) {
return "[Strings are not supported yet.]";
} else {
return "int " + return_value_name + " = " + ioelt_name + "->VectorSize() / sizeof(" + type_name + ");";
@@ -33,11 +35,13 @@ public class RTMapsDataTypeQueries {
}
public String setVectorSizeForVector(String type_name, int nb_elements, String ioelt_name) {
- if(type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0 || type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0 || type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0 || type_name.compareTo("Float32") == 0 || type_name.compareTo("Float64") == 0)
+ if (type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0
+ || type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0 || type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0
+ || type_name.compareTo("Duration") == 0 || type_name.compareTo("Float32") == 0 || type_name.compareTo("Float64") == 0)
{
return ioelt_name + "->VectorSize() = " + nb_elements + ";";
- } else if(type_name.compareTo("String") == 0) {
+ } else if (type_name.compareTo("String") == 0) {
return "[Strings are not supported yet.]";
} else {
return ioelt_name + "->VectorSize() = " + nb_elements + " * sizeof(" + type_name + ");";
@@ -45,17 +49,17 @@ public class RTMapsDataTypeQueries {
}
public String getMAPSIOEltAccessFunction(String type_name, String ioelt_name, String return_var_name) {
- if(type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
+ if (type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
return "MAPSInt32* " + return_var_name + " = &" + ioelt_name + "->Integer32();";
- } else if(type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
+ } else if (type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
return "char* " + return_var_name + " = " + ioelt_name + "->Stream8();";
- } else if(type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
+ } else if (type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
return "MAPSInt64* " + return_var_name + " = &" + ioelt_name + "->Integer64();";
- } else if(type_name.compareTo("Float32") == 0) {
+ } else if (type_name.compareTo("Float32") == 0) {
return "MAPSFloat32* " + return_var_name + " = &" + ioelt_name + "->Float32();";
- } else if(type_name.compareTo("Float64") == 0) {
+ } else if (type_name.compareTo("Float64") == 0) {
return "MAPSFloat64* " + return_var_name + " = &" + ioelt_name + "->Float64();";
- } else if(type_name.compareTo("String") == 0) {
+ } else if (type_name.compareTo("String") == 0) {
return "[Strings are not supported yet.]";
} else {
return type_name + "* " + return_var_name + " = (" + type_name + "*)" + ioelt_name + "->Data();";
@@ -63,17 +67,17 @@ public class RTMapsDataTypeQueries {
}
public String getMAPSIOEltReturnType(String type_name) {
- if(type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
+ if (type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
return "MAPSInt32*";
- } else if(type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
+ } else if (type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
return "MAPSUInt8*";
- } else if(type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
+ } else if (type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
return "MAPSInt64*";
- } else if(type_name.compareTo("Float32") == 0) {
+ } else if (type_name.compareTo("Float32") == 0) {
return "MAPSFloat32* ";
- } else if(type_name.compareTo("Float64") == 0) {
+ } else if (type_name.compareTo("Float64") == 0) {
return "MAPSFloat64*";
- } else if(type_name.compareTo("String") == 0) {
+ } else if (type_name.compareTo("String") == 0) {
return "MAPSRobotMLString*";
} else {
return type_name + "*";
@@ -83,41 +87,42 @@ public class RTMapsDataTypeQueries {
public String getRTMapsOutputDefForPrimitiveType(String output_name, String type_name, int multiplicity) {
String s = "MAPS_OUTPUT(\"" + output_name + "\",";
- if(type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
+ if (type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
s += "MAPS::Integer32";
- } else if(type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
+ } else if (type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
s += "MAPS::Stream8";
- } else if(type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
+ } else if (type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
s += "MAPS::Integer64";
- } else if(type_name.compareTo("Float32") == 0) {
+ } else if (type_name.compareTo("Float32") == 0) {
s += "MAPS::Float32";
- } else if(type_name.compareTo("Float64") == 0) {
+ } else if (type_name.compareTo("Float64") == 0) {
s += "MAPS::Float64";
- } else if(type_name.compareTo("String") == 0) {
+ } else if (type_name.compareTo("String") == 0) {
return "MAPS_OUTPUT_USER_STRUCTURE(" + output_name + ",MAPSRobotMLString)";
}
s += ",NULL,NULL,";
- if(multiplicity <= 0)
+ if (multiplicity <= 0) {
s += "DEFAULT_MAX_OUTPUT_VECTOR_SIZE";
- else
+ } else {
s += multiplicity;
+ }
s += ")";
return s;
}
public String getRTMapsInputDefForPrimitiveType(String input_name, String type_name) {
String s = "MAPS_INPUT(\"" + input_name + "\",";
- if(type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
+ if (type_name.compareTo("Bool") == 0 || type_name.compareTo("Int8") == 0 || type_name.compareTo("UInt8") == 0 || type_name.compareTo("Int16") == 0 || type_name.compareTo("UInt16") == 0 || type_name.compareTo("Int32") == 0) {
s += "MAPS::FilterInteger32";
- } else if(type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
+ } else if (type_name.compareTo("Byte") == 0 || type_name.compareTo("Char") == 0) {
s += "MAPS::FilterStream8";
- } else if(type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
+ } else if (type_name.compareTo("UInt32") == 0 || type_name.compareTo("Int64") == 0 || type_name.compareTo("UInt64") == 0 || type_name.compareTo("Time") == 0 || type_name.compareTo("Duration") == 0) {
s += "MAPS::FilterInteger64";
- } else if(type_name.compareTo("Float32") == 0) {
+ } else if (type_name.compareTo("Float32") == 0) {
s += "MAPS::FilterFloat32";
- } else if(type_name.compareTo("Float64") == 0) {
+ } else if (type_name.compareTo("Float64") == 0) {
s += "MAPS::FilterFloat64";
- } else if(type_name.compareTo("String") == 0) {
+ } else if (type_name.compareTo("String") == 0) {
s += "MAPSFilterRobotMLString";
}
s += ",MAPS::FifoReader)";
@@ -126,15 +131,16 @@ public class RTMapsDataTypeQueries {
public String getPckOutputDir(String dummy) {
String os = System.getProperty("os.name");
- if(os.toLowerCase().startsWith("linux"))
+ if (os.toLowerCase().startsWith("linux")) {
return "packages/linux_x86/";
- else
+ } else {
return "packages/";
+ }
}
public boolean hasRTMapsNativeImplementation(org.eclipse.uml2.uml.Class c) {
- if(ArchitectureQueries.hasNativeImplementation(c)) {
- if(getRTMapsNativeLibraryPathFromGenericAttribute(c) != null && getRTMapsNativeComponentNameFromGenericAttribute(c) != null) {
+ if (ArchitectureQueries.hasNativeImplementation(c)) {
+ if (getRTMapsNativeLibraryPathFromGenericAttribute(c) != null && getRTMapsNativeComponentNameFromGenericAttribute(c) != null) {
return true;
}
}
@@ -142,20 +148,22 @@ public class RTMapsDataTypeQueries {
}
public String getRTMapsNativeLibraryPathFromGenericAttribute(org.eclipse.uml2.uml.Class c) {
- if(ArchitectureQueries.hasNativeImplementation(c)) {
+ if (ArchitectureQueries.hasNativeImplementation(c)) {
String native_libs = ArchitectureQueries.getNativeLibraryPathForComponent(c);
- if(native_libs == null)
+ if (native_libs == null) {
return null;
+ }
return getRTMapsSpecificValueFromStringAttribute(native_libs);
}
return null;
}
public String getRTMapsNativeComponentNameFromGenericAttribute(org.eclipse.uml2.uml.Class c) {
- if(ArchitectureQueries.hasNativeImplementation(c)) {
+ if (ArchitectureQueries.hasNativeImplementation(c)) {
String native_comps = ArchitectureQueries.getNativeComponentNameForComponent(c);
- if(native_comps == null)
+ if (native_comps == null) {
return null;
+ }
return getRTMapsSpecificValueFromStringAttribute(native_comps);
}
return null;
@@ -163,9 +171,9 @@ public class RTMapsDataTypeQueries {
public String getRTMapsSpecificValueFromStringAttribute(String attribute) {
String[] sections = attribute.split(";");
- for(int i = 0; i < sections.length; i++) {
+ for (int i = 0; i < sections.length; i++) {
String[] key_value = sections[i].split("=");
- if(key_value[0].equalsIgnoreCase("rtmaps")) {
+ if (key_value[0].equalsIgnoreCase("rtmaps")) {
return key_value[1];
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Activator.java
index 0c3f0a47ce1..2beca0f4939 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,7 +24,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
-
+
/**
* The constructor
*/
@@ -33,8 +33,10 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -42,8 +44,10 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/AllocUtils.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/AllocUtils.java
index 1f753db9c27..6510f14044b 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/AllocUtils.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/AllocUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,13 +33,13 @@ public class AllocUtils {
/**
* Retrieve a list of nodes to which the instance is allocated to *or*
* to which one of the contained instances is allocated to (recursively)
- *
+ *
* @param instance
* @return a list of nodes
*/
public static EList<InstanceSpecification> getAllNodes(InstanceSpecification instance) {
EList<InstanceSpecification> nodeList = getNodes(instance);
- for(InstanceSpecification containedInstance : DepUtils.getContainedInstances(instance)) {
+ for (InstanceSpecification containedInstance : DepUtils.getContainedInstances(instance)) {
nodeList.addAll(getAllNodes(containedInstance));
}
return nodeList;
@@ -48,7 +48,7 @@ public class AllocUtils {
/**
* Retrieve a list of nodes to which the instance is allocated to *or*
* to which one of the containing instances is explicitly allocated
- *
+ *
* @param instance
* @return a list of nodes
*/
@@ -56,11 +56,11 @@ public class AllocUtils {
EList<InstanceSpecification> nodeList = getNodesOrThreads(instance);
Package cdp = instance.getNearestPackage();
// TODO: not very efficient: loop each time over all instance specifications
- for(NamedElement parentNE : cdp.getMembers()) {
- if(parentNE instanceof InstanceSpecification) {
+ for (NamedElement parentNE : cdp.getMembers()) {
+ if (parentNE instanceof InstanceSpecification) {
// possible parent instance specification
- InstanceSpecification parentIS = (InstanceSpecification)parentNE;
- if(DepUtils.getContainedInstances(parentIS).contains(instance)) {
+ InstanceSpecification parentIS = (InstanceSpecification) parentNE;
+ if (DepUtils.getContainedInstances(parentIS).contains(instance)) {
nodeList.addAll(getAllNodesOrThreadsParent(parentIS));
}
}
@@ -70,7 +70,7 @@ public class AllocUtils {
public static InstanceSpecification getNode(InstanceSpecification instance) {
EList<InstanceSpecification> nodeList = getNodes(instance);
- if(nodeList.size() != 0) {
+ if (nodeList.size() != 0) {
return nodeList.get(0);
}
return null;
@@ -78,7 +78,7 @@ public class AllocUtils {
public static InstanceSpecification getNodeOrThread(InstanceSpecification instanceOrThread) {
EList<InstanceSpecification> nodeList = getNodesOrThreads(instanceOrThread);
- if(nodeList.size() != 0) {
+ if (nodeList.size() != 0) {
return nodeList.get(0);
}
return null;
@@ -88,20 +88,20 @@ public class AllocUtils {
* This method returns a list of nodes when given an instance.
* It is based on MARTE Allocation (a stereotyped abstraction) which is a generic
* mechanism to deploy UML elements to nodes.
- *
+ *
* @param instanceOrThread
- * The instance that should be deployed
+ * The instance that should be deployed
* @return
*/
public static EList<InstanceSpecification> getNodesOrThreads(NamedElement instanceOrThread) {
EList<InstanceSpecification> nodeList = new UniqueEList<InstanceSpecification>();
- for(DirectedRelationship relationship : instanceOrThread.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction())) {
- Abstraction abstraction = (Abstraction)relationship;
- if(StUtils.isApplied(abstraction, Allocate.class)) {
- for(Element target : abstraction.getTargets()) {
- if(target instanceof InstanceSpecification) {
- nodeList.add((InstanceSpecification)target);
+ for (DirectedRelationship relationship : instanceOrThread.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction())) {
+ Abstraction abstraction = (Abstraction) relationship;
+ if (StUtils.isApplied(abstraction, Allocate.class)) {
+ for (Element target : abstraction.getTargets()) {
+ if (target instanceof InstanceSpecification) {
+ nodeList.add((InstanceSpecification) target);
}
}
}
@@ -113,53 +113,53 @@ public class AllocUtils {
* This method returns a list of nodes when given an instance.
* It is based on MARTE Allocation (a stereotyped abstraction) which is a generic
* mechanism to deploy UML elements to nodes.
- *
+ *
* @param instanceOrThread
- * The instance that should be deployed
+ * The instance that should be deployed
* @return
*/
public static EList<InstanceSpecification> getNodes(NamedElement instanceOrThread) {
EList<InstanceSpecification> nodeList = new UniqueEList<InstanceSpecification>();
EList<InstanceSpecification> nodeOrThreads = getNodesOrThreads(instanceOrThread);
- for(InstanceSpecification nodeOrThread : nodeOrThreads)
+ for (InstanceSpecification nodeOrThread : nodeOrThreads)
{
Classifier nodeOrThreadC = DepUtils.getClassifier(nodeOrThread);
-// if(StUtils.isApplied(nodeOrThreadC, SwSchedulableResource.class)) {
-// // tread case that instance is allocated to a thread
-// // follow allocation of Thread
-// nodeList.add(getNode(nodeOrThread));
-// }
-// else {
- nodeList.add(nodeOrThread);
-// }
+ // if(StUtils.isApplied(nodeOrThreadC, SwSchedulableResource.class)) {
+ // // tread case that instance is allocated to a thread
+ // // follow allocation of Thread
+ // nodeList.add(getNode(nodeOrThread));
+ // }
+ // else {
+ nodeList.add(nodeOrThread);
+ // }
}
return nodeList;
}
/**
* This method updates (and optionally removes) the allocations of an instance
- *
+ *
* @param instance
- * The instance that should be deployed
+ * The instance that should be deployed
* @param oldNode
- * the old node allocation
+ * the old node allocation
* @param newNode
- * the new node allocation, may be null to indicate removal
+ * the new node allocation, may be null to indicate removal
* @return
*/
public static EList<Node> updateAllocation(InstanceSpecification instance, InstanceSpecification oldNode, InstanceSpecification newNode) {
EList<Node> nodeList = new UniqueEList<Node>();
Iterator<DirectedRelationship> relShipIt =
- instance.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction()).iterator();
+ instance.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction()).iterator();
- while(relShipIt.hasNext()) {
- Abstraction abstraction = (Abstraction)relShipIt.next();
- if(StUtils.isApplied(abstraction, Allocate.class)) {
+ while (relShipIt.hasNext()) {
+ Abstraction abstraction = (Abstraction) relShipIt.next();
+ if (StUtils.isApplied(abstraction, Allocate.class)) {
EList<NamedElement> suppliers = abstraction.getSuppliers(); // use suppliers instead of targets (derived)
- for(int index = 0; index < suppliers.size(); index++) {
- if(suppliers.get(index) == oldNode) {
- if(newNode == null) {
+ for (int index = 0; index < suppliers.size(); index++) {
+ if (suppliers.get(index) == oldNode) {
+ if (newNode == null) {
// remove relationship completely, since we assume a single target
// (cannot call remove on relShipIt, since list is derived)
abstraction.destroy();
@@ -174,46 +174,46 @@ public class AllocUtils {
return nodeList;
}
-// /**
-// * Retrieve a list of nodes to which the instance is allocated to *or*
-// * to which one of the contained instances is allocated to (recursively)
-// *
-// * @param instance
-// * @param A
-// * port of the composite. Contained instances are examined only if
-// * they have a connection with this port.
-// * @return a list of nodes
-// */
-// public static EList<InstanceSpecification> getAllNodesForPort(InstanceSpecification instance, Port port) {
-// EList<InstanceSpecification> nodeList = getNodes(instance);
-// Classifier composite = DepUtils.getClassifier(instance);
-// if(composite instanceof Class) {
-// Class compositeCL = (Class)composite;
-// for(Slot slot : instance.getSlots()) {
-// Property containedProperty = (Property)slot.getDefiningFeature();
-//
-// for(Connector connection : compositeCL.getOwnedConnectors()) {
-// // is one connector end targeted at the containedProperty ?
-// ConnectorEnd end = ConnectorUtils.connEndForPart(connection, containedProperty);
-// if(end == null)
-// continue;
-//
-// // does the connector at the same connect the composite's port?
-// if(ConnectorUtils.connectsPort(connection, port)) {
-// Port containedPort = (Port)end.getRole();
-// nodeList.addAll(getAllNodesForPort(DepUtils.getInstance(slot), containedPort));
-// }
-// }
-// }
-// }
-// return nodeList;
-// }
+ // /**
+ // * Retrieve a list of nodes to which the instance is allocated to *or*
+ // * to which one of the contained instances is allocated to (recursively)
+ // *
+ // * @param instance
+ // * @param A
+ // * port of the composite. Contained instances are examined only if
+ // * they have a connection with this port.
+ // * @return a list of nodes
+ // */
+ // public static EList<InstanceSpecification> getAllNodesForPort(InstanceSpecification instance, Port port) {
+ // EList<InstanceSpecification> nodeList = getNodes(instance);
+ // Classifier composite = DepUtils.getClassifier(instance);
+ // if(composite instanceof Class) {
+ // Class compositeCL = (Class)composite;
+ // for(Slot slot : instance.getSlots()) {
+ // Property containedProperty = (Property)slot.getDefiningFeature();
+ //
+ // for(Connector connection : compositeCL.getOwnedConnectors()) {
+ // // is one connector end targeted at the containedProperty ?
+ // ConnectorEnd end = ConnectorUtils.connEndForPart(connection, containedProperty);
+ // if(end == null)
+ // continue;
+ //
+ // // does the connector at the same connect the composite's port?
+ // if(ConnectorUtils.connectsPort(connection, port)) {
+ // Port containedPort = (Port)end.getRole();
+ // nodeList.addAll(getAllNodesForPort(DepUtils.getInstance(slot), containedPort));
+ // }
+ // }
+ // }
+ // }
+ // return nodeList;
+ // }
public static boolean allocate(InstanceSpecification instance, InstanceSpecification node) {
- Package cdp = (Package)instance.getOwner();
+ Package cdp = (Package) instance.getOwner();
Abstraction allocation = (Abstraction)
- cdp.createPackagedElement("allocate to " + node.getName(), UMLPackage.eINSTANCE.getAbstraction());
- if(StUtils.apply(allocation, Allocate.class) == null) {
+ cdp.createPackagedElement("allocate to " + node.getName(), UMLPackage.eINSTANCE.getAbstraction());
+ if (StUtils.apply(allocation, Allocate.class) == null) {
// stereotype application failed
return false;
}
@@ -222,63 +222,63 @@ public class AllocUtils {
return true;
}
-// /**
-// * Assign node name to leafs
-// *
-// * @param instance
-// * @param A
-// * port of the composite. Contained instances are examined only if the
-// * have a connection with this port. If null, no sub-instances are examined
-// * @param nodes
-// * A list of nodes to which leafs are allocated
-// */
-// public static void propagateNodesViaPort(InstanceSpecification instance, Port port, EList<InstanceSpecification> nodes) {
-// if(instance == null) {
-// return;
-// }
-// EList<Slot> slots = instance.getSlots();
-// Class composite = DepUtils.getImplementation(instance);
-// /*
-// * ComponentImpl componentImpl =
-// * StUtils.getApplication(composite, ComponentImpl.class);
-// * if(!((componentImpl != null) && componentImpl.isIsAssembly())) {
-// * // do not set nodes on an assembly
-// * // how-to assure to set only leafs?
-// * for(InstanceSpecification node : nodes) {
-// * AllocUtils.allocate(instance, node);
-// * }
-// * }
-// */
-// if((composite != null) && (port != null)) {
-// Class compositeCL = (Class)composite;
-// for(Slot slot : slots) {
-// Property containedProperty = (Property)slot.getDefiningFeature();
-//
-//// FCM.Part fcmPart = StUtils.getApplication(containedProperty, FCM.Part.class);
-//// if(fcmPart != null) {
-//// EList<Port> colocateWithPort = fcmPart.getColocateWithPort();
-//// // is the port within the list?
-//// if(Utils.getNamedElementFromList(colocateWithPort, port.getName()) != null) {
-//// // compare qualified name, since containedPort (stereotype attribute)
-//// // points to a source model element
-//// propagateNodesViaPort(DepUtils.getInstance(slot), port, nodes);
-//// continue;
-//// }
-//// }
-// for(Connector connection : compositeCL.getOwnedConnectors()) {
-// if(ConnectorUtils.connectsPort(connection, port)) {
-// Log.log(Log.INFO_MSG, Log.TRAFO_CONNECTOR, "connector: " + connection.getName());
-// Log.log(Log.INFO_MSG, Log.TRAFO_CONNECTOR, "end1: " + connection.getEnds().get(0).getPartWithPort());
-// Log.log(Log.INFO_MSG, Log.TRAFO_CONNECTOR, "end2: " + connection.getEnds().get(1).getPartWithPort());
-// ConnectorEnd end = ConnectorUtils.connEndForPart(connection, containedProperty);
-// // other connector end targeted at containedProperty?
-// if(end != null) {
-// Port containedPort = (Port)end.getRole();
-// propagateNodesViaPort(DepUtils.getInstance(slot), containedPort, nodes);
-// }
-// }
-// }
-// }
-// }
-// }
+ // /**
+ // * Assign node name to leafs
+ // *
+ // * @param instance
+ // * @param A
+ // * port of the composite. Contained instances are examined only if the
+ // * have a connection with this port. If null, no sub-instances are examined
+ // * @param nodes
+ // * A list of nodes to which leafs are allocated
+ // */
+ // public static void propagateNodesViaPort(InstanceSpecification instance, Port port, EList<InstanceSpecification> nodes) {
+ // if(instance == null) {
+ // return;
+ // }
+ // EList<Slot> slots = instance.getSlots();
+ // Class composite = DepUtils.getImplementation(instance);
+ // /*
+ // * ComponentImpl componentImpl =
+ // * StUtils.getApplication(composite, ComponentImpl.class);
+ // * if(!((componentImpl != null) && componentImpl.isIsAssembly())) {
+ // * // do not set nodes on an assembly
+ // * // how-to assure to set only leafs?
+ // * for(InstanceSpecification node : nodes) {
+ // * AllocUtils.allocate(instance, node);
+ // * }
+ // * }
+ // */
+ // if((composite != null) && (port != null)) {
+ // Class compositeCL = (Class)composite;
+ // for(Slot slot : slots) {
+ // Property containedProperty = (Property)slot.getDefiningFeature();
+ //
+ // // FCM.Part fcmPart = StUtils.getApplication(containedProperty, FCM.Part.class);
+ // // if(fcmPart != null) {
+ // // EList<Port> colocateWithPort = fcmPart.getColocateWithPort();
+ // // // is the port within the list?
+ // // if(Utils.getNamedElementFromList(colocateWithPort, port.getName()) != null) {
+ // // // compare qualified name, since containedPort (stereotype attribute)
+ // // // points to a source model element
+ // // propagateNodesViaPort(DepUtils.getInstance(slot), port, nodes);
+ // // continue;
+ // // }
+ // // }
+ // for(Connector connection : compositeCL.getOwnedConnectors()) {
+ // if(ConnectorUtils.connectsPort(connection, port)) {
+ // Log.log(Log.INFO_MSG, Log.TRAFO_CONNECTOR, "connector: " + connection.getName());
+ // Log.log(Log.INFO_MSG, Log.TRAFO_CONNECTOR, "end1: " + connection.getEnds().get(0).getPartWithPort());
+ // Log.log(Log.INFO_MSG, Log.TRAFO_CONNECTOR, "end2: " + connection.getEnds().get(1).getPartWithPort());
+ // ConnectorEnd end = ConnectorUtils.connEndForPart(connection, containedProperty);
+ // // other connector end targeted at containedProperty?
+ // if(end != null) {
+ // Port containedPort = (Port)end.getRole();
+ // propagateNodesViaPort(DepUtils.getInstance(slot), containedPort, nodes);
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/CommandSupport.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/CommandSupport.java
index 44052bac45b..536afd69543 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/CommandSupport.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/CommandSupport.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,16 +27,16 @@ import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
/**
* Utility function. Allow execution of commands on a transactional command stack
- *
+ *
* @author ansgar
- *
+ *
*/
@SuppressWarnings("deprecation")
public class CommandSupport {
/**
* Execute the passed Runnable within a command
- *
+ *
* @param label
* @param command
*/
@@ -51,7 +51,7 @@ public class CommandSupport {
/**
* Execute the passed Runnable with result within a command
- *
+ *
* @param label
* @param command
*/
@@ -60,8 +60,9 @@ public class CommandSupport {
IOperationHistory history = OperationHistoryFactory.getOperationHistory();
try {
history.execute(new AbstractTransactionalCommand(serviceUtils.getTransactionalEditingDomain(),
- label, Collections.EMPTY_LIST) {
+ label, Collections.EMPTY_LIST) {
+ @Override
public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) {
return command.run();
}
@@ -75,12 +76,12 @@ public class CommandSupport {
/**
* Execute the passed Runnable within a command
- *
+ *
* @param label
* @param command
*/
public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) {
- if(domain == null) {
+ if (domain == null) {
command.run();
}
else {
@@ -88,6 +89,7 @@ public class CommandSupport {
try {
history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) {
+ @Override
public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) {
command.run();
return CommandResult.newOKCommandResult();
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Copy.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Copy.java
index 4a0e65c20cf..ac59862641e 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Copy.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Copy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,9 +53,9 @@ import org.eclipse.uml2.uml.ValueSpecification;
/**
* information about source and target packages within a model transformation
- *
+ *
* @author ansgar
- *
+ *
*/
public class Copy extends Copier {
@@ -70,7 +70,7 @@ public class Copy extends Copier {
standardMap = new HashMap<EObject, EObject>();
shallowMap = new HashMap<EObject, Boolean>();
boundPackages = new Stack<Namespace>();
- if(copyExtReferences) {
+ if (copyExtReferences) {
// original source package becomes a sub-package in the target model
Package newSourceRoot = target.createNestedPackage(source.getName());
put(source, newSourceRoot);
@@ -81,7 +81,7 @@ public class Copy extends Copier {
};
/**
- *
+ *
*/
private static final long serialVersionUID = -1664013545661635289L;
@@ -141,14 +141,14 @@ public class Copy extends Copier {
public Map<EObject, EObject> getMap(EObject sourceEObj) {
boolean withinTemplate = withinTemplate(sourceEObj);
return withinTemplate ?
- templateMap :
- standardMap;
+ templateMap :
+ standardMap;
}
@Override
public EObject get(Object sourceEObj) {
- if(sourceEObj instanceof EObject) {
- Map<EObject, EObject> map = getMap((EObject)sourceEObj);
+ if (sourceEObj instanceof EObject) {
+ Map<EObject, EObject> map = getMap((EObject) sourceEObj);
return map.get(sourceEObj);
}
return null;
@@ -156,8 +156,8 @@ public class Copy extends Copier {
@Override
public EObject put(EObject sourceEObj, EObject targetEObj) {
- if(sourceEObj instanceof EObject) {
- Map<EObject, EObject> map = getMap((EObject)sourceEObj);
+ if (sourceEObj instanceof EObject) {
+ Map<EObject, EObject> map = getMap(sourceEObj);
return map.put(sourceEObj, targetEObj);
}
return null;
@@ -165,8 +165,8 @@ public class Copy extends Copier {
@Override
public boolean containsKey(Object sourceEObj) {
- if(sourceEObj instanceof EObject) {
- Map<EObject, EObject> map = getMap((EObject)sourceEObj);
+ if (sourceEObj instanceof EObject) {
+ Map<EObject, EObject> map = getMap((EObject) sourceEObj);
return map.containsKey(sourceEObj);
}
return false;
@@ -174,8 +174,8 @@ public class Copy extends Copier {
@Override
public EObject remove(Object sourceEObj) {
- if(sourceEObj instanceof EObject) {
- Map<EObject, EObject> map = getMap((EObject)sourceEObj);
+ if (sourceEObj instanceof EObject) {
+ Map<EObject, EObject> map = getMap((EObject) sourceEObj);
return map.remove(sourceEObj);
}
return null;
@@ -187,13 +187,13 @@ public class Copy extends Copier {
/**
* return true, if a shallow copy of the passed EObject exists
- *
+ *
* @param sourceEObj
* @return
*/
public boolean isShallow(EObject targetEObj) {
Boolean shallow = shallowMap.get(targetEObj);
- if(shallow != null) {
+ if (shallow != null) {
return shallow;
}
return false;
@@ -207,21 +207,21 @@ public class Copy extends Copier {
* Set the reference of a bound package template. It must be a member of the target model.
* Setting the package template is required to assure that elements that are part of a different
* resource get copied (depending on the copyExtReferences flag, this is not the case)
- *
+ *
* @param packageTemplate
- * Reference to package (with a template signature) in source model that should be instantiated
+ * Reference to package (with a template signature) in source model that should be instantiated
* @param boundPackage
- * Reference to (an initially empty) package in which the packate template will be instantiated
- * during the copy process
+ * Reference to (an initially empty) package in which the packate template will be instantiated
+ * during the copy process
*/
public void setPackageTemplate(Namespace packageTemplate, Namespace boundPackage) {
this.boundPackage = boundPackage;
- if(packageTemplate == null) {
+ if (packageTemplate == null) {
return;
}
templateMap =
- templateMapInfo.get(boundPackage);
- if(templateMap == null) {
+ templateMapInfo.get(boundPackage);
+ if (templateMap == null) {
templateMap = new HashMap<EObject, EObject>();
templateMapInfo.put(boundPackage, templateMap);
}
@@ -238,7 +238,7 @@ public class Copy extends Copier {
public void popPackageTemplate() {
boundPackage = boundPackages.pop();
templateMap =
- templateMapInfo.get(boundPackage);
+ templateMapInfo.get(boundPackage);
}
private Stack<Namespace> boundPackages;
@@ -246,22 +246,22 @@ public class Copy extends Copier {
public void removeForCopy(EObject element) {
templateMap.remove(element);
EClass eClass = element.eClass();
- for(int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
+ for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
{
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
- if(eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived())
+ if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived())
{
- if(eStructuralFeature instanceof EAttribute) {
+ if (eStructuralFeature instanceof EAttribute) {
// copyAttribute((EAttribute)eStructuralFeature, sourceEObj, targetEObj);
}
else {
- EReference eReference = (EReference)eStructuralFeature;
- if(eReference.isContainment()) {
- for(EObject ref : getRefs(eReference, element)) {
+ EReference eReference = (EReference) eStructuralFeature;
+ if (eReference.isContainment()) {
+ for (EObject ref : getRefs(eReference, element)) {
removeForCopy(ref);
}
}
- else if(!eReference.isContainer()) {
+ else if (!eReference.isContainer()) {
// not contained, but copy reference as well
}
@@ -273,23 +273,23 @@ public class Copy extends Copier {
@SuppressWarnings("unchecked")
public EList<EObject> getRefs(EReference eReference, EObject eObject) {
EList<EObject> refs = new BasicEList<EObject>();
- if(eObject.eIsSet(eReference)) {
- if(eReference.isMany()) {
+ if (eObject.eIsSet(eReference)) {
+ if (eReference.isMany()) {
// @SuppressWarnings("unchecked")
- refs.addAll((List<EObject>)eObject.eGet(eReference));
+ refs.addAll((List<EObject>) eObject.eGet(eReference));
} else {
- refs.add((EObject)eObject.eGet(eReference));
+ refs.add((EObject) eObject.eGet(eReference));
}
}
return refs;
}
public boolean withinTemplate(EObject element) {
- if(boundPackage != null) {
+ if (boundPackage != null) {
EObject owner = element;
- while(owner != null) {
+ while (owner != null) {
owner = owner.eContainer();
- if(get(owner) == boundPackage) {
+ if (get(owner) == boundPackage) {
return true;
}
}
@@ -299,14 +299,14 @@ public class Copy extends Copier {
/**
* Returns a copy of the given eObject.
- *
+ *
* Normally, we do not want to copy elements that are from a different
* resource. There are two exceptions (1) if this is explicitly specified
* (for producing "complete" models) (2) if we want to copy elements from a
* template into the target model.
- *
+ *
* @param sourceEObj
- * the object to copy.
+ * the object to copy.
* @return the copy.
*/
@SuppressWarnings("unchecked")
@@ -318,61 +318,61 @@ public class Copy extends Copier {
boolean shallowCopy = (targetEObj != null) && isShallow(targetEObj);
- if((targetEObj != null) && !shallowCopy) {
+ if ((targetEObj != null) && !shallowCopy) {
// copy already exists, return
return targetEObj;
}
setShallow(targetEObj, false);
- if(sourceEObj == null) {
+ if (sourceEObj == null) {
// this case may happen, if elements were systematcially copied without checking for
// null references in the application code (e.g. if we copy a part-with-port which might
// be null in case of delegation or connectors without ports
return null;
}
boolean sameResource = (sourceEObj.eResource() == source.eResource());
- if(!sameResource && !copyExtReferences && !withinTemplate) {
+ if (!sameResource && !copyExtReferences && !withinTemplate) {
// do not copy if within different resource, unless
// 1. copyImports
// 2. within package template
return sourceEObj;
}
- if(sourceEObj instanceof Stereotype) {
+ if (sourceEObj instanceof Stereotype) {
// do not copy Stereotypes, as it would imply copying meta-model elements (the base_X
// attribute of the stereotype is typed with a meta-model element)
return sourceEObj;
}
- for(CopyListener listener : preCopyListeners) {
+ for (CopyListener listener : preCopyListeners) {
EObject result = listener.copyEObject(this, sourceEObj);
- if(result != sourceEObj) {
+ if (result != sourceEObj) {
return result;
}
}
- if(sourceEObj instanceof NamedElement) {
- String name = ((NamedElement)sourceEObj).getQualifiedName();
+ if (sourceEObj instanceof NamedElement) {
+ String name = ((NamedElement) sourceEObj).getQualifiedName();
// System.err.println("eC3Mcopier: " + name);
- if((name != null) && name.startsWith("uml::")) {
+ if ((name != null) && name.startsWith("uml::")) {
Log.log(Log.ERROR_MSG, Log.TRAFO_COPY, "copy for meta-model element \"" + name + "\" requested. Return original element");
return sourceEObj;
}
- if((name != null) && name.startsWith("ProducerConsumer")) {
- if(Utils.getTop((NamedElement)sourceEObj) != source) {
+ if ((name != null) && name.startsWith("ProducerConsumer")) {
+ if (Utils.getTop((NamedElement) sourceEObj) != source) {
System.err.println(name);
}
}
}
// additional sanity check: want to avoid copying (instead of instantiating) elements
// of a package template
- if((sourceEObj instanceof Package) && (!withinTemplate)) {
- if(((Package)sourceEObj).getOwnedTemplateSignature() != null) {
+ if ((sourceEObj instanceof Package) && (!withinTemplate)) {
+ if (((Package) sourceEObj).getOwnedTemplateSignature() != null) {
Log.log(Log.WARNING_MSG, Log.TRAFO_COPY, "warning: copying a package template without instantiating a template");
}
}
- if(shallowCopy) {
+ if (shallowCopy) {
// shallowCopy is true: a copy exists already
}
else {
@@ -382,17 +382,17 @@ public class Copy extends Copier {
createShallowContainer(sourceEObj);
}
EClass eClass = sourceEObj.eClass();
- for(int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
+ for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
{
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
- if(eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived())
+ if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived())
{
- if(eStructuralFeature instanceof EAttribute) {
- copyAttribute((EAttribute)eStructuralFeature, sourceEObj, targetEObj);
+ if (eStructuralFeature instanceof EAttribute) {
+ copyAttribute((EAttribute) eStructuralFeature, sourceEObj, targetEObj);
}
else {
- EReference eReference = (EReference)eStructuralFeature;
- if(eReference.isContainment()) {
+ EReference eReference = (EReference) eStructuralFeature;
+ if (eReference.isContainment()) {
copyContainment(eReference, sourceEObj, targetEObj);
}
// some containment relationships require copying the container completely
@@ -401,13 +401,13 @@ public class Copy extends Copier {
// e.g. if an operation is referenced, we need to copy the whole interface
// Currently: only the standard owning reference is not copied recursively.
// else if(!eReference.isContainer()) {
- else if(!eReference.getName().equals("owner")) {
+ else if (!eReference.getName().equals("owner")) {
// not contained, but copy reference as well
Object feature = sourceEObj.eGet(eStructuralFeature);
- if(feature instanceof Element) {
- copy((Element)feature);
- } else if(feature instanceof EList) {
- copyAll((EList<Object>)feature);
+ if (feature instanceof Element) {
+ copy((Element) feature);
+ } else if (feature instanceof EList) {
+ copyAll((EList<Object>) feature);
}
copyReference(eReference, sourceEObj, targetEObj);
}
@@ -417,14 +417,14 @@ public class Copy extends Copier {
copyProxyURI(sourceEObj, targetEObj);
copyID(sourceEObj, targetEObj);
- if(sourceEObj instanceof Element) {
+ if (sourceEObj instanceof Element) {
// TODO: handle stereotype copy in a generic way
- StUtils.copyStereotypes(this, (Element)sourceEObj, (Element)targetEObj);
+ StUtils.copyStereotypes(this, (Element) sourceEObj, (Element) targetEObj);
}
- for(CopyListener listener : postCopyListeners) {
+ for (CopyListener listener : postCopyListeners) {
EObject result = listener.copyEObject(this, targetEObj);
- if(result != targetEObj) {
+ if (result != targetEObj) {
return result;
}
}
@@ -434,42 +434,41 @@ public class Copy extends Copier {
/**
* Copy the containment of an element with respect to a certain reference
- *
- * @see org.eclipse.emf.ecore.util.EcoreUtil.Copier#copyContainment(org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.ecore.EObject)
+ *
+ * @see org.eclipse.emf.ecore.util.EcoreUtil.Copier#copyContainment(org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
* Differences to referenced function in ECoreUtil
* - If an element in copyAll is null, it is not added
* - List elements are always cleared before copying, since the list elements may already have been
* partially filled by a previous shallow copy
- *
+ *
* @param eReference
- * a reference, such as for instance packagedElement (the
- * caller needs to check, is this reference is a containment reference).
+ * a reference, such as for instance packagedElement (the
+ * caller needs to check, is this reference is a containment reference).
* @param eObject
- * the source eObject
+ * the source eObject
* @param copyEObject
- * the copy of this eObject
+ * the copy of this eObject
*/
@Override
protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) {
- if(eObject.eIsSet(eReference)) {
- if(eReference.isMany()) {
+ if (eObject.eIsSet(eReference)) {
+ if (eReference.isMany()) {
@SuppressWarnings("unchecked")
- List<EObject> source = (List<EObject>)eObject.eGet(eReference);
+ List<EObject> source = (List<EObject>) eObject.eGet(eReference);
@SuppressWarnings("unchecked")
- List<EObject> target = (List<EObject>)copyEObject.eGet(getTarget(eReference));
+ List<EObject> target = (List<EObject>) copyEObject.eGet(getTarget(eReference));
// do not clear (would remove elements that are added by copy listeners)
// But: better enforce exact copy? (listeners could only add in a post-copy step)
// target.clear();
- if(!source.isEmpty()) {
- for(EObject copyEObj : copyAll(source)) {
- if(copyEObj != null) {
+ if (!source.isEmpty()) {
+ for (EObject copyEObj : copyAll(source)) {
+ if (copyEObj != null) {
target.add(copyEObj);
}
}
}
} else {
- EObject childEObject = (EObject)eObject.eGet(eReference);
+ EObject childEObject = (EObject) eObject.eGet(eReference);
copyEObject.eSet(getTarget(eReference), childEObject == null ? null : copy(childEObject));
}
}
@@ -479,31 +478,31 @@ public class Copy extends Copier {
* Copy the containment in a "shallow" way, i.e. copy references to contained objects, if these exist already.
* If called for instance for a package, it will add those elements to the packagedElements list of the
* target package, that have already been copied.
- *
+ *
* @param eReference
* @param eObject
* @param copyEObject
*/
protected void shallowCopyContainment(EReference eReference, EObject eObject, EObject copyEObject) {
- if(eObject.eIsSet(eReference)) {
- if(eReference.isMany()) {
+ if (eObject.eIsSet(eReference)) {
+ if (eReference.isMany()) {
@SuppressWarnings("unchecked")
- List<EObject> source = (List<EObject>)eObject.eGet(eReference);
+ List<EObject> source = (List<EObject>) eObject.eGet(eReference);
@SuppressWarnings("unchecked")
- List<EObject> target = (List<EObject>)copyEObject.eGet(getTarget(eReference));
- if(source.isEmpty()) {
+ List<EObject> target = (List<EObject>) copyEObject.eGet(getTarget(eReference));
+ if (source.isEmpty()) {
target.clear();
} else {
- for(EObject sourceEObj : source) {
+ for (EObject sourceEObj : source) {
// if eObject has already been copied, add it
EObject copyEObj = get(sourceEObj);
- if((copyEObj != null) && (!target.contains(copyEObj))) {
+ if ((copyEObj != null) && (!target.contains(copyEObj))) {
target.add(copyEObj);
}
}
}
} else {
- EObject childEObject = (EObject)eObject.eGet(eReference);
+ EObject childEObject = (EObject) eObject.eGet(eReference);
copyEObject.eSet(getTarget(eReference), childEObject == null ? null : copy(childEObject));
}
}
@@ -513,14 +512,14 @@ public class Copy extends Copier {
* Create a "shallow" container for an object, i.e. create (recursively) the owner without
* adding all other children of this owner (e.g. in case of a package, the package itself will
* be created, but not all elements within that package).
- *
+ *
* @param sourceEObj
*/
public void createShallowContainer(EObject sourceEObj) {
EObject owner = sourceEObj.eContainer();
EObject copy = null;
- while(owner != null) {
- if(containsKey(owner)) {
+ while (owner != null) {
+ if (containsKey(owner)) {
// owner is in map, still need to re-copy (update) the containment
// references, since one of the children did not exist before
//
@@ -528,15 +527,15 @@ public class Copy extends Copier {
return;
}
copy = shallowCopy(owner);
- if(copy instanceof NamedElement) {
- ((NamedElement)copy).setName(((NamedElement)owner).getName());
+ if (copy instanceof NamedElement) {
+ ((NamedElement) copy).setName(((NamedElement) owner).getName());
}
owner = owner.eContainer();
}
- if(copy instanceof PackageableElement) {
+ if (copy instanceof PackageableElement) {
// if we copy external resources, we might reach the "top" on the source level
// which becomes a sub-package of the new model.
- target.getPackagedElements().add((PackageableElement)copy);
+ target.getPackagedElements().add((PackageableElement) copy);
}
}
@@ -549,33 +548,33 @@ public class Copy extends Copier {
* of a package after a single class within it has been copied. It may be called again,
* once a second class within the package has been copied => the packagedElements reference
* of the package will be updated).
- *
+ *
* @param sourceEObj
* @return
*/
public EObject shallowCopy(EObject sourceEObj) {
EObject targetEObj = get(sourceEObj);
- if(targetEObj == null) {
+ if (targetEObj == null) {
targetEObj = createCopy(sourceEObj);
put(sourceEObj, targetEObj);
setShallow(targetEObj, true);
}
- if((sourceEObj instanceof Element) && (targetEObj instanceof Element)) {
+ if ((sourceEObj instanceof Element) && (targetEObj instanceof Element)) {
// TODO: cannot copy stereotypes only after creation, since eContainer does
// not exist at this moment. Need to put that intelligently into createShallowContainer
- StUtils.copyStereotypes(this, (Element)sourceEObj, (Element)targetEObj);
+ StUtils.copyStereotypes(this, (Element) sourceEObj, (Element) targetEObj);
}
EClass eClass = sourceEObj.eClass();
- for(int i = 0, size = eClass.getFeatureCount(); i < size; ++i) {
+ for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) {
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
- if(eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) {
- if(eStructuralFeature instanceof EAttribute) {
+ if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) {
+ if (eStructuralFeature instanceof EAttribute) {
// copyAttribute((EAttribute)eStructuralFeature, sourceEObj, targetEObj);
} else {
- EReference eReference = (EReference)eStructuralFeature;
- if(eReference.isContainment()) {
+ EReference eReference = (EReference) eStructuralFeature;
+ if (eReference.isContainment()) {
shallowCopyContainment(eReference, sourceEObj, targetEObj);
}
}
@@ -586,7 +585,7 @@ public class Copy extends Copier {
@SuppressWarnings("unchecked")
public <T extends Element> T getCopy(T source) {
- return (T)copy(source);
+ return (T) copy(source);
}
public EList<CopyListener> preCopyListeners;
@@ -597,49 +596,49 @@ public class Copy extends Copier {
* Called to handle the copying of a cross reference;
* this adds values or sets a single value as appropriate for the multiplicity
* while omitting any bidirectional reference that isn't in the copy map.
- *
+ *
* @param eReference
- * the reference to copy.
+ * the reference to copy.
* @param eObject
- * the object from which to copy.
+ * the object from which to copy.
* @param copyEObject
- * the object to copy to.
+ * the object to copy to.
*/
@Override
protected void copyReference(EReference eReference, EObject eObject, EObject copyEObject)
{
- if(eObject.eIsSet(eReference)) {
- if(eReference.isMany()) {
+ if (eObject.eIsSet(eReference)) {
+ if (eReference.isMany()) {
@SuppressWarnings("unchecked")
- InternalEList<EObject> source = (InternalEList<EObject>)eObject.eGet(eReference);
+ InternalEList<EObject> source = (InternalEList<EObject>) eObject.eGet(eReference);
@SuppressWarnings("unchecked")
- InternalEList<EObject> target = (InternalEList<EObject>)copyEObject.eGet(getTarget(eReference));
- if(source.isEmpty()) {
+ InternalEList<EObject> target = (InternalEList<EObject>) copyEObject.eGet(getTarget(eReference));
+ if (source.isEmpty()) {
target.clear();
}
else {
boolean isBidirectional = eReference.getEOpposite() != null;
int index = 0;
- for(Iterator<EObject> k = resolveProxies ? source.iterator() : source.basicIterator(); k.hasNext();) {
+ for (Iterator<EObject> k = resolveProxies ? source.iterator() : source.basicIterator(); k.hasNext();) {
EObject referencedEObject = k.next();
EObject copyReferencedEObject = get(referencedEObject);
- if(copyReferencedEObject == null) {
- if(useOriginalReferences && !isBidirectional) {
+ if (copyReferencedEObject == null) {
+ if (useOriginalReferences && !isBidirectional) {
target.addUnique(index, referencedEObject);
++index;
}
}
else {
- if(isBidirectional) {
+ if (isBidirectional) {
int position = target.indexOf(copyReferencedEObject);
- if(position == -1) {
+ if (position == -1) {
target.addUnique(index, copyReferencedEObject);
}
- else if(index != position) {
+ else if (index != position) {
target.move(index, copyReferencedEObject);
}
}
- else if(!target.contains(copyReferencedEObject)) {
+ else if (!target.contains(copyReferencedEObject)) {
// TODO: does not allow multiple identical elements in the list. Problematic?
// Check above is necessary, since some references that are not
// part of the containment may have already been copied (e.g. in case of
@@ -654,18 +653,18 @@ public class Copy extends Copier {
}
else {
Object referencedEObject = eObject.eGet(eReference, resolveProxies);
- if(referencedEObject == null) {
+ if (referencedEObject == null) {
copyEObject.eSet(getTarget(eReference), null);
}
- else if(referencedEObject instanceof EObject) {
+ else if (referencedEObject instanceof EObject) {
// difference to original code in EcoreUtil: we obtain a copy (which might be null or the
// source object) of the referenced EObject. This assures that we only set a value of a
// reference to something we actually want to have in the target model.
// Specific problematic case in original code: classifierBehavior is a reference, but assigning such
// a behavior will also add an owned behavior. If we assign a referencedEObject (a behavior) from the
// source model in the target, we will actually remove it from the source model (as it is uniquely owned).
- EObject copyReferencedEObject = copy((EObject)referencedEObject);
- if(copyReferencedEObject != null) {
+ EObject copyReferencedEObject = copy((EObject) referencedEObject);
+ if (copyReferencedEObject != null) {
copyEObject.eSet(getTarget(eReference), copyReferencedEObject);
}
}
@@ -677,12 +676,12 @@ public class Copy extends Copier {
* Copy all methods from the passed source-model class.
* This function is useful, if the passed class only exist
* as a shallow copy.
- *
+ *
* @param source
- * A class within the source model
+ * A class within the source model
*/
public void copyMethods(Class source) {
- for(Behavior method : source.getOwnedBehaviors()) {
+ for (Behavior method : source.getOwnedBehaviors()) {
getCopy(method);
}
}
@@ -691,12 +690,12 @@ public class Copy extends Copier {
* Copy all attributes from the source-model classifier
* This function is useful, if the passed class only exist
* as a shallow copy.
- *
+ *
* @param source
- * A classifier within the source model
+ * A classifier within the source model
*/
public void copyAttributes(Classifier source) {
- for(Property attribute : source.getAttributes()) {
+ for (Property attribute : source.getAttributes()) {
getCopy(attribute);
}
}
@@ -705,12 +704,12 @@ public class Copy extends Copier {
* copy all operations from the source-model classifier.
* This function is useful, if the passed class only exist
* as a shallow copy.
- *
+ *
* @param source
- * A classifier within the source model
+ * A classifier within the source model
*/
public void copyOperations(Classifier source) {
- for(Operation operation : source.getOperations()) {
+ for (Operation operation : source.getOperations()) {
getCopy(operation);
}
}
@@ -733,7 +732,7 @@ public class Copy extends Copier {
/**
* Copy a value to a target slot
- *
+ *
* @param smValue
* @param target
* @return
@@ -745,7 +744,7 @@ public class Copy extends Copier {
public static ValueSpecification copyDefaultValue(Property source, Property target) {
ValueSpecification value = source.getDefaultValue();
- if(value != null) {
+ if (value != null) {
ValueSpecification newValue = target.createDefaultValue(value.getName(), value.getType(), value.eClass());
return copyValue(value, newValue);
} else {
@@ -754,24 +753,24 @@ public class Copy extends Copier {
}
public static ValueSpecification copyValue(ValueSpecification smValue, ValueSpecification tmValue) {
- if(smValue instanceof OpaqueExpression) {
- OpaqueExpression oeValue = (OpaqueExpression)smValue;
- OpaqueExpression noeValue = (OpaqueExpression)tmValue;
- for(String language : oeValue.getLanguages()) {
+ if (smValue instanceof OpaqueExpression) {
+ OpaqueExpression oeValue = (OpaqueExpression) smValue;
+ OpaqueExpression noeValue = (OpaqueExpression) tmValue;
+ for (String language : oeValue.getLanguages()) {
noeValue.getLanguages().add(language);
}
- for(String body : oeValue.getBodies()) {
+ for (String body : oeValue.getBodies()) {
noeValue.getBodies().add(body);
}
- } else if(smValue instanceof LiteralString) {
- ((LiteralString)tmValue).setValue(((LiteralString)smValue).getValue());
- } else if(smValue instanceof LiteralInteger) {
- ((LiteralInteger)tmValue).setValue(((LiteralInteger)smValue).getValue());
- } else if(smValue instanceof LiteralUnlimitedNatural) {
- ((LiteralUnlimitedNatural)tmValue).setValue(((LiteralUnlimitedNatural)smValue).getValue());
- } else if(smValue instanceof LiteralBoolean) {
- ((LiteralBoolean)tmValue).setValue(((LiteralBoolean)smValue).booleanValue());
- } else if(smValue instanceof LiteralNull) {
+ } else if (smValue instanceof LiteralString) {
+ ((LiteralString) tmValue).setValue(((LiteralString) smValue).getValue());
+ } else if (smValue instanceof LiteralInteger) {
+ ((LiteralInteger) tmValue).setValue(((LiteralInteger) smValue).getValue());
+ } else if (smValue instanceof LiteralUnlimitedNatural) {
+ ((LiteralUnlimitedNatural) tmValue).setValue(((LiteralUnlimitedNatural) smValue).getValue());
+ } else if (smValue instanceof LiteralBoolean) {
+ ((LiteralBoolean) tmValue).setValue(((LiteralBoolean) smValue).booleanValue());
+ } else if (smValue instanceof LiteralNull) {
}
return tmValue;
}
@@ -783,11 +782,11 @@ public class Copy extends Copier {
* references from the diagram to model elements would break (of course,
* they could still break, for instance if structural modifications of the
* source model are made).
- *
+ *
* @param source
- * source model element
+ * source model element
* @param dest
- * corresponding target model element
+ * corresponding target model element
*/
public static void copyID(EObject source, EObject target) {
copyID(source, target, "");
@@ -796,13 +795,13 @@ public class Copy extends Copier {
/**
* Copy the (XML) ID from the source to the destination model element.
* Prefix the ID with a string passed as parameter
- *
+ *
* @param source
- * source model element
+ * source model element
* @param dest
- * corresponding target model element
+ * corresponding target model element
* @param prefix
- * a prefix for the target model ID
+ * a prefix for the target model ID
*/
@SuppressWarnings("deprecation")
public static void copyID(EObject source, EObject target, String prefix) {
@@ -810,13 +809,13 @@ public class Copy extends Copier {
Resource resourceTarget = target.eResource();
// TODO: use EcoreUtil getURI (InternalEObject) instead?
- if((resourceSource instanceof XMLResource) && (resourceTarget instanceof XMLResource)) {
- XMLResource xmlResSource = (XMLResource)resourceSource;
- XMLResource xmlResTarget = (XMLResource)resourceTarget;
+ if ((resourceSource instanceof XMLResource) && (resourceTarget instanceof XMLResource)) {
+ XMLResource xmlResSource = (XMLResource) resourceSource;
+ XMLResource xmlResTarget = (XMLResource) resourceTarget;
String id = prefix + xmlResSource.getID(source);
int counter = 0;
String uniqueID = id;
- while(xmlResTarget.getIDToEObjectMap().containsKey(uniqueID)) {
+ while (xmlResTarget.getIDToEObjectMap().containsKey(uniqueID)) {
uniqueID = id + counter;
counter++;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepCreation.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepCreation.java
index 89cc860f038..b044252397c 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepCreation.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepCreation.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,16 +15,12 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
-import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.InstanceSpecification;
import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.LiteralInteger;
import org.eclipse.uml2.uml.Node;
import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.Port;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.Slot;
@@ -40,26 +36,26 @@ public class DepCreation {
/**
* Create a slot and add an instance value associated with a part instance
* specification.
- *
+ *
* @param is
- * the instance specification for which a slot should be created
+ * the instance specification for which a slot should be created
* @param partIS
- * the instance specification associated with the slot (to be
- * precise with slot's instance value)
+ * the instance specification associated with the slot (to be
+ * precise with slot's instance value)
* @param part
- * the part associated with the slot, i.e. its defining feature
+ * the part associated with the slot, i.e. its defining feature
* @return The created slot
*/
public static Slot createSlot(InstanceSpecification is,
- InstanceSpecification partIS, Property part) {
+ InstanceSpecification partIS, Property part) {
// the instance specification of the composite has a slot for each part
// and it points
// to the instance specification associated with the part.
Slot slot = is.createSlot();
slot.setDefiningFeature(part);
- InstanceValue iv = (InstanceValue)slot.createValue(null, null,
- UMLPackage.eINSTANCE.getInstanceValue());
+ InstanceValue iv = (InstanceValue) slot.createValue(null, null,
+ UMLPackage.eINSTANCE.getInstanceValue());
iv.setInstance(partIS);
return slot;
@@ -67,11 +63,11 @@ public class DepCreation {
/**
* Create a Slot and a value for a configuration attribute
- *
+ *
* @param attribute
*/
public static Slot createSlotForConfigProp(InstanceSpecification is,
- Property attribute) {
+ Property attribute) {
Slot slot = is.createSlot();
slot.setDefiningFeature(attribute);
@@ -92,18 +88,18 @@ public class DepCreation {
// string value must be quoted
// by the user).
Type type = attribute.getType();
- if(type != null) {
+ if (type != null) {
String name = type.getName();
String qname = type.getQualifiedName();
- if(name.equals("Integer") ) {
+ if (name.equals("Integer")) {
slot.createValue("value for " + attribute.getName(), type,
- UMLPackage.eINSTANCE.getLiteralInteger());
- } else if(name.equals("Boolean")) {
+ UMLPackage.eINSTANCE.getLiteralInteger());
+ } else if (name.equals("Boolean")) {
slot.createValue("value for " + attribute.getName(), type,
- UMLPackage.eINSTANCE.getLiteralBoolean());
+ UMLPackage.eINSTANCE.getLiteralBoolean());
} else {
slot.createValue("value for " + attribute.getName(), type,
- UMLPackage.eINSTANCE.getLiteralString());
+ UMLPackage.eINSTANCE.getLiteralString());
}
}
return slot;
@@ -111,18 +107,18 @@ public class DepCreation {
/**
* Create a string slot and a value for a configuration attribute
- *
+ *
* @param attribute
*/
public static Slot createStringSlotForConfigProp(InstanceSpecification is,
- Property attribute) {
+ Property attribute) {
Slot slot = is.createSlot();
slot.setDefiningFeature(attribute);
Type type = attribute.getType();
- if(type != null) {
+ if (type != null) {
slot.createValue("value for " + attribute.getName(), type,
- UMLPackage.eINSTANCE.getLiteralString());
+ UMLPackage.eINSTANCE.getLiteralString());
}
return slot;
}
@@ -135,144 +131,144 @@ public class DepCreation {
* type of parts (not the concrete implementation), this function also
* supports that a type is passed. In this case, an implementation is
* automatically assigned.
- *
+ *
* @param cdp
- * the deployment plan (package) in which to create instances
+ * the deployment plan (package) in which to create instances
* @param typeOrImplem
- * the type
+ * the type
* @param nane
- * the name of the instance
+ * the name of the instance
* @param createSlotsForConfigValues
- * if true, create slots for configuration values
+ * if true, create slots for configuration values
*/
public static InstanceSpecification createDepPlan(Package cdp,
- Class typeOrImplem, String name, boolean createSlotsForConfigValues)
- throws TransformationException
+ Class typeOrImplem, String name, boolean createSlotsForConfigValues)
+ throws TransformationException
{
return createDepPlan(cdp, typeOrImplem, name, createSlotsForConfigValues, new Stack<Classifier>());
}
public static InstanceSpecification createDepPlan(Package cdp,
- Class typeOrImplem, String name, boolean createSlotsForConfigValues, Stack<Classifier> visitedClassifiers)
- throws TransformationException
+ Class typeOrImplem, String name, boolean createSlotsForConfigValues, Stack<Classifier> visitedClassifiers)
+ throws TransformationException
{
// create an instance specification for the composite
- if(visitedClassifiers.contains(typeOrImplem)) {
+ if (visitedClassifiers.contains(typeOrImplem)) {
String path = "";
- for(Classifier cl : visitedClassifiers) {
- if(path.length() > 0) {
+ for (Classifier cl : visitedClassifiers) {
+ if (path.length() > 0) {
path += ", ";
}
path += cl.getName();
}
path += ", " + typeOrImplem.getName();
throw new TransformationException("Class \"" + typeOrImplem.getQualifiedName() +
- "\" is referenced in a circle! Thus, an infinite number of instance specifications would be required.\n\n" +
- "recursion path: " + path);
+ "\" is referenced in a circle! Thus, an infinite number of instance specifications would be required.\n\n" +
+ "recursion path: " + path);
}
visitedClassifiers.push(typeOrImplem);
InstanceSpecification is = (InstanceSpecification)
- cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification());
+ cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification());
// TODO: hack, could be named differently.
- if(name.equals("mainInstance")) {
+ if (name.equals("mainInstance")) {
DepUtils.setMainInstance(cdp, is);
}
Class implementation = null;
// treat HW architecture or nodes as implementations
- if(Utils.isCompImpl(typeOrImplem)
- || typeOrImplem instanceof Node) {
+ if (Utils.isCompImpl(typeOrImplem)
+ || typeOrImplem instanceof Node) {
// implementation is known => must be able to do this.
- if(typeOrImplem instanceof Class) {
- implementation = (Class)typeOrImplem;
+ if (typeOrImplem instanceof Class) {
+ implementation = typeOrImplem;
}
}
- if(!(implementation instanceof Class)) {
+ if (!(implementation instanceof Class)) {
throw new TransformationException(
- "cannot find suitable implementation for instance <" + name
- + "> (given type <" + typeOrImplem.getName() + ">)");
+ "cannot find suitable implementation for instance <" + name
+ + "> (given type <" + typeOrImplem.getName() + ">)");
}
// else implementation is instance of Class (and not null)
is.getClassifiers().add(implementation);
// add connector and container implementations
-
-
- for(Property attribute : implementation.getAllAttributes()) {
+
+
+ for (Property attribute : implementation.getAllAttributes()) {
// loop over all attributes (not only parts, since we need to
// capture singletons)
- if(attribute instanceof Port) {
+ if (attribute instanceof Port) {
continue;
}
Type type = attribute.getType();
- if(Utils.isComposition(attribute)) {
+ if (Utils.isComposition(attribute)) {
// composition, attribute is a part
- if(((type instanceof Class) && Utils.isComponent((Class)type)) || type instanceof Node) {
- Class cl = (Class)type;
+ if (((type instanceof Class) && Utils.isComponent((Class) type)) || type instanceof Node) {
+ Class cl = (Class) type;
// hack: ad-hoc replication support. Better solution via design patterns
int upper = attribute.getUpper();
String infix = "";
-
+
// TODO: check validation constraints
- for(int i = 0; i < upper; i++) {
+ for (int i = 0; i < upper; i++) {
String partName = name + "." + attribute.getName();
- if(upper > 1) {
+ if (upper > 1) {
partName += "_" + infix + i;
}
InstanceSpecification partIS = createDepPlan(cdp, cl,
- partName, createSlotsForConfigValues, visitedClassifiers);
+ partName, createSlotsForConfigValues, visitedClassifiers);
createSlot(is, partIS, attribute);
}
- }
- } else if(type instanceof Class) {
+ }
+ } else if (type instanceof Class) {
// no composition - only create slot, if a singleton
// (otherwise, it's not clear with which instance the slot
// should be associated)
Log.log(Log.INFO_MSG, Log.DEPLOYMENT,
- "DepCreation.createDepPlan: " + type.getQualifiedName());
-// if(Utils.isSingleton((Class)type)) {
-// // is a singleton - exactly one instance exists
-// // use a common instance prefix for singletons
-// String partName = "singleton_" + attribute.getName();
-// PackageableElement pe = cdp.getPackagedElement(partName);
-//
-// if(pe instanceof InstanceSpecification) {
-// // instance specification for singleton exists already
-// Slot slot = createSlot(is, (InstanceSpecification)pe,
-// attribute);
-// slot.setDefiningFeature(attribute);
-// } else if(type instanceof Class) {
-// // instance specification for singleton does not exist
-// // => create
-// // [case that a non-instance specification with the name
-// // <partName> exists already
-// // is not handled]
-// InstanceSpecification partIS = createDepPlan(cdp,
-// (Class)type, partName, createSlotsForConfigValues, visitedClassifiers);
-// Slot slot = createSlot(is, partIS, attribute);
-// slot.setDefiningFeature(attribute);
-// }
-// }
- } else if(type == null) {
+ "DepCreation.createDepPlan: " + type.getQualifiedName());
+ // if(Utils.isSingleton((Class)type)) {
+ // // is a singleton - exactly one instance exists
+ // // use a common instance prefix for singletons
+ // String partName = "singleton_" + attribute.getName();
+ // PackageableElement pe = cdp.getPackagedElement(partName);
+ //
+ // if(pe instanceof InstanceSpecification) {
+ // // instance specification for singleton exists already
+ // Slot slot = createSlot(is, (InstanceSpecification)pe,
+ // attribute);
+ // slot.setDefiningFeature(attribute);
+ // } else if(type instanceof Class) {
+ // // instance specification for singleton does not exist
+ // // => create
+ // // [case that a non-instance specification with the name
+ // // <partName> exists already
+ // // is not handled]
+ // InstanceSpecification partIS = createDepPlan(cdp,
+ // (Class)type, partName, createSlotsForConfigValues, visitedClassifiers);
+ // Slot slot = createSlot(is, partIS, attribute);
+ // slot.setDefiningFeature(attribute);
+ // }
+ // }
+ } else if (type == null) {
throw new TransformationException("type of attribute \""
- + attribute.getName() + "\" within class \""
- + implementation.getName() + "\" is not defined");
+ + attribute.getName() + "\" within class \""
+ + implementation.getName() + "\" is not defined");
}
}
visitedClassifiers.pop();
return is;
}
-
+
/**
* create a deployment plan, i.e. a set of instances that correspond to an
@@ -282,63 +278,63 @@ public class DepCreation {
* type of parts (not the concrete implementation), this function also
* supports that a type is passed. In this case, an implementation is
* automatically assigned.
- *
+ *
* @param cdp
- * the deployment plan (package) in which to create instances
+ * the deployment plan (package) in which to create instances
* @param typeOrImplem
- * the type
+ * the type
* @param nane
- * the name of the instance
+ * the name of the instance
* @param createSlotsForConfigValues
- * if true, create slots for configuration values
+ * if true, create slots for configuration values
*/
public static InstanceSpecification createPlatformInstances(
- Package platform, Class implementation, String name)
- throws TransformationException {
+ Package platform, Class implementation, String name)
+ throws TransformationException {
// create an instance specification for the composite
InstanceSpecification is = null;
- if(name != null) {
+ if (name != null) {
// donn't create instance specification for root element (detectable via the empty name)
- is = (InstanceSpecification)platform.createPackagedElement(name,
- UMLPackage.eINSTANCE.getInstanceSpecification());
+ is = (InstanceSpecification) platform.createPackagedElement(name,
+ UMLPackage.eINSTANCE.getInstanceSpecification());
is.getClassifiers().add(implementation);
}
// add connector and container implementations
- for(Property attribute : implementation.getAllAttributes()) {
+ for (Property attribute : implementation.getAllAttributes()) {
// loop over all attributes (not only parts, since we need to
// capture singletons)
- if(attribute instanceof Port) {
+ if (attribute instanceof Port) {
continue;
}
Type type = attribute.getType();
- if(Utils.isComposition(attribute)) {
+ if (Utils.isComposition(attribute)) {
// composition, attribute is a part
- if(type instanceof Class) { // should be a node, but do not require it
- Class cl = (Class)type;
+ if (type instanceof Class) { // should be a node, but do not require it
+ Class cl = (Class) type;
// hack: ad-hoc replication support. Better solution via
// Design patterns
int upper = attribute.getUpper();
String infix = "";
// TODO: check validation constraints
- for(int i = 0; i < upper; i++) {
+ for (int i = 0; i < upper; i++) {
// prefix with name, unless null
String partName = (name != null) ? name + "." : "";
partName += attribute.getName();
- if(upper > 1) {
+ if (upper > 1) {
partName += "_" + infix + i;
}
InstanceSpecification partIS = createPlatformInstances(
- platform, cl, partName);
+ platform, cl, partName);
- if(is != null) {
+ if (is != null) {
createSlot(is, partIS, attribute);
}
}
- }
+ }
}
}
return is;
@@ -347,9 +343,9 @@ public class DepCreation {
/**
* Initialize the automatic values within a deployment plan - and the update
* eventual copies of these values.
- *
+ *
* @param is
- * the main instance of the deployment plan
+ * the main instance of the deployment plan
*/
public static void initAutoValues(InstanceSpecification is) {
map = new HashMap<Object, Integer>();
@@ -360,39 +356,39 @@ public class DepCreation {
/**
* Initialize the automatic values within a deployment plan.
- *
+ *
* @param is
- * the main instance of the deployment plan
+ * the main instance of the deployment plan
*/
public static void initAutoValuesHelper(InstanceSpecification is) {
- for(Slot slot : is.getSlots()) {
+ for (Slot slot : is.getSlots()) {
StructuralFeature sf = slot.getDefiningFeature();
-
+
}
}
/**
* Initialize the automatic values within a deployment plan.
- *
+ *
* @param is
- * the main instance of the deployment plan
+ * the main instance of the deployment plan
*/
public static void copyAutoValues(Stack<InstanceSpecification> isStack,
- InstanceSpecification is) {
+ InstanceSpecification is) {
isStack.push(is);
- for(Slot slot : is.getSlots()) {
+ for (Slot slot : is.getSlots()) {
StructuralFeature sf = slot.getDefiningFeature();
- if(sf == null) {
+ if (sf == null) {
// throw new TransformationException (is.getName() + " has a slot without defining feature");
System.err.println(is.getName());
break;
}
-
+
// recursion in case of values that are instance values
- for(ValueSpecification vs : slot.getValues()) {
- if(vs instanceof InstanceValue) {
- InstanceSpecification subIS = ((InstanceValue)vs).getInstance();
- if(subIS != null) {
+ for (ValueSpecification vs : slot.getValues()) {
+ if (vs instanceof InstanceValue) {
+ InstanceSpecification subIS = ((InstanceValue) vs).getInstance();
+ if (subIS != null) {
copyAutoValues(isStack, subIS);
}
}
@@ -405,24 +401,24 @@ public class DepCreation {
* try to find a value (ValueSpecification) for the passed source element,
* beginning a the "deepest" instance specification of the passed stack. If
* not found, continue at elements higher up in the hierarchy
- *
+ *
* @param isStack
- * a stack of instance specifications corresponding to a path
- * within an instance tree
+ * a stack of instance specifications corresponding to a path
+ * within an instance tree
* @param source
- * a property (defining feature) for which we search an instance
- * specification
+ * a property (defining feature) for which we search an instance
+ * specification
* @return The value specifications for the passed source property or null
*/
public static ValueSpecification getNearestValue(
- Stack<InstanceSpecification> isStack, Property source) {
+ Stack<InstanceSpecification> isStack, Property source) {
Stack<InstanceSpecification> copy = new Stack<InstanceSpecification>();
copy.addAll(isStack);
- while(!copy.isEmpty()) {
+ while (!copy.isEmpty()) {
InstanceSpecification pop = copy.pop();
ValueSpecification vs = getNearestValueHelper(isStack, pop, source);
- if(vs != null) {
+ if (vs != null) {
return vs;
}
}
@@ -433,36 +429,36 @@ public class DepCreation {
* Helper for getNearestValue: search for an instance specification that has
* source as defining feature. Start at the passed instance specification,
* but do not recursed into elements that are contained in the stack.
- *
+ *
* @param isStack
- * A stack of instance specifications corresponding to a path
- * within an instance tree
+ * A stack of instance specifications corresponding to a path
+ * within an instance tree
* @param is
- * the starting instance specification
+ * the starting instance specification
* @param source
- * source a property (defining feature) for which we search an
- * instance specification
+ * source a property (defining feature) for which we search an
+ * instance specification
* @return The value specifications for the passed source property or null
*/
public static ValueSpecification getNearestValueHelper(
- Stack<InstanceSpecification> isStack, InstanceSpecification is,
- Property source) {
- for(Slot slot : is.getSlots()) {
+ Stack<InstanceSpecification> isStack, InstanceSpecification is,
+ Property source) {
+ for (Slot slot : is.getSlots()) {
StructuralFeature sf = slot.getDefiningFeature();
- if(sf == source) {
+ if (sf == source) {
// found property, now return first value specification
- for(ValueSpecification vs : slot.getValues()) {
+ for (ValueSpecification vs : slot.getValues()) {
return vs;
}
return null;
}
// recursion in case of values that are instance values
- for(ValueSpecification vs : slot.getValues()) {
- if(vs instanceof InstanceValue) {
- InstanceSpecification subIS = ((InstanceValue)vs)
- .getInstance();
- if(!isStack.contains(subIS)) {
+ for (ValueSpecification vs : slot.getValues()) {
+ if (vs instanceof InstanceValue) {
+ InstanceSpecification subIS = ((InstanceValue) vs)
+ .getInstance();
+ if (!isStack.contains(subIS)) {
// only recurse, if not contained in stack of instance
// specifications (avoid traversing
// the same elements multiple times)
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanSync.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanSync.java
index 0296bd68fb3..68b619eedc3 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanSync.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanSync.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,9 +28,9 @@ import org.eclipse.uml2.uml.ValueSpecification;
/**
* Currently unused synchronization for deployment plans.
- *
+ *
* @see comp.cea.ec3m.gentools.core.listeners.DepPlanListener
- *
+ *
* @author ansgar
*/
public class DepPlanSync {
@@ -38,14 +38,14 @@ public class DepPlanSync {
/**
* Synchronize a deployment plan: remove slots that refer to properties that exist no longer
* and add those that do not exist yet
- *
+ *
* @param element
- * an arbitrary element of the source model (i.e. the model that will
- * store the deployment plan
+ * an arbitrary element of the source model (i.e. the model that will
+ * store the deployment plan
* @throws TransformationException
*/
public static void syncAllDepPlans(Element element) {
- for(Package depPlan : DepPlanUtils.getAllDepPlans(element)) {
+ for (Package depPlan : DepPlanUtils.getAllDepPlans(element)) {
syncDepPlan(depPlan);
}
}
@@ -53,7 +53,7 @@ public class DepPlanSync {
/**
* Synchronize a deployment plan: remove slots that refer to properties that exist no longer
* and add those that do not exist yet
- *
+ *
* @param depPlan
* @throws TransformationException
*/
@@ -61,7 +61,7 @@ public class DepPlanSync {
removeUnusedSlots(depPlan);
// EList<InstanceSpecification> list = new BasicEList<InstanceSpecification>();
DeploymentPlan cdp = StUtils.getApplication(depPlan, DeploymentPlan.class);
- if(cdp == null) {
+ if (cdp == null) {
return;
}
InstanceSpecification mainInstance = cdp.getMainInstance();
@@ -74,23 +74,23 @@ public class DepPlanSync {
private static void addCDP(Package depPlan, InstanceSpecification instance, String canonicalName)
{
Class implementation = DepUtils.getImplementation(instance);
- if(!instance.getName().equals(canonicalName)) {
+ if (!instance.getName().equals(canonicalName)) {
instance.setName(canonicalName);
}
// check sub-instances
- for(Slot slot : instance.getSlots()) {
+ for (Slot slot : instance.getSlots()) {
InstanceSpecification subInstance = DepUtils.getInstance(slot);
- if(subInstance != null) {
+ if (subInstance != null) {
addCDP(depPlan, subInstance, canonicalName + "." + slot.getDefiningFeature().getName());
}
}
- for(Property attribute : Utils.getParts(implementation)) {
+ for (Property attribute : Utils.getParts(implementation)) {
Type type = attribute.getType();
- if(type instanceof Class) {
- if(!hasSlot(instance, attribute)) {
+ if (type instanceof Class) {
+ if (!hasSlot(instance, attribute)) {
try {
InstanceSpecification partIS =
- DepCreation.createDepPlan(depPlan, (Class)type, instance.getName() + "." + attribute.getName(), true);
+ DepCreation.createDepPlan(depPlan, (Class) type, instance.getName() + "." + attribute.getName(), true);
DepPlanUtils.createSlot(depPlan, instance, partIS, attribute);
} catch (TransformationException e) {
Log.log(Log.ERROR_MSG, Log.DEPLOYMENT, e.getMessage());
@@ -101,8 +101,8 @@ public class DepPlanSync {
}
private static boolean hasSlot(InstanceSpecification instance, Property attribute) {
- for(Slot slot : instance.getSlots()) {
- if(slot.getDefiningFeature() == attribute) {
+ for (Slot slot : instance.getSlots()) {
+ if (slot.getDefiningFeature() == attribute) {
return true;
}
}
@@ -111,17 +111,17 @@ public class DepPlanSync {
public static void removeUnusedSlots(Package depPlan) {
// remove elements that are no longer in the plan
- for(NamedElement member : depPlan.getMembers()) {
- if(member instanceof InstanceSpecification) {
- InstanceSpecification instance = (InstanceSpecification)member;
+ for (NamedElement member : depPlan.getMembers()) {
+ if (member instanceof InstanceSpecification) {
+ InstanceSpecification instance = (InstanceSpecification) member;
Iterator<Slot> slotIt = instance.getSlots().iterator();
- while(slotIt.hasNext()) {
+ while (slotIt.hasNext()) {
Slot slot = slotIt.next();
- if(slot.getDefiningFeature() == null) {
+ if (slot.getDefiningFeature() == null) {
// property has been removed => remove associated slot
- for(ValueSpecification value : slot.getValues()) {
- if(value instanceof InstanceValue) {
- InstanceSpecification is = ((InstanceValue)value).getInstance();
+ for (ValueSpecification value : slot.getValues()) {
+ if (value instanceof InstanceValue) {
+ InstanceSpecification is = ((InstanceValue) value).getInstance();
DepPlanUtils.delDepPlan(is);
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanUtils.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanUtils.java
index ba4a784a172..7037fa19a2b 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanUtils.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepPlanUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,10 +41,10 @@ public class DepPlanUtils {
/**
* Return the package in which deployment plans are stored. Caveat: needs to be executed within a
* transition, since the deployment plan package will be created, if it does not exist yet.
- *
+ *
* @param element
- * an arbitrary element of the source model (i.e. the model that will
- * store the deployment plan
+ * an arbitrary element of the source model (i.e. the model that will
+ * store the deployment plan
* @return package in which deployment plans are stored
*/
public static Package getDepPlanRoot(Element element) {
@@ -53,19 +53,19 @@ public class DepPlanUtils {
/**
* Return all deployment plans
- *
+ *
* @param element
- * an arbitrary element of the source model (i.e. the model that will
- * store the deployment plan
+ * an arbitrary element of the source model (i.e. the model that will
+ * store the deployment plan
* @return
*/
public static EList<Package> getAllDepPlans(Element element) {
Package root = Utils.getTop(element);
Package depPlanRoot = root.getNestedPackage(depPlanFolder);
EList<Package> depPlanList = new BasicEList<Package>();
- if(depPlanRoot != null) {
- for(Package pkg : depPlanRoot.getNestedPackages()) {
- if(StUtils.isApplied(pkg, DeploymentPlan.class)) {
+ if (depPlanRoot != null) {
+ for (Package pkg : depPlanRoot.getNestedPackages()) {
+ if (StUtils.isApplied(pkg, DeploymentPlan.class)) {
depPlanList.add(pkg);
}
}
@@ -75,32 +75,32 @@ public class DepPlanUtils {
public static void delDepPlan(InstanceSpecification is) {
Iterator<Slot> slots = is.getSlots().iterator();
- while(slots.hasNext()) {
+ while (slots.hasNext()) {
Slot slot = slots.next();
InstanceSpecification subInstance = getInstance(slot);
- if(subInstance != null) {
+ if (subInstance != null) {
delDepPlan(subInstance);
}
}
Element owner = is.getOwner();
- if(owner instanceof Package) {
- ((Package)owner).getPackagedElements().remove(is);
+ if (owner instanceof Package) {
+ ((Package) owner).getPackagedElements().remove(is);
}
}
/**
* Return the instance that is defined by a slot value
- *
+ *
* @param slot
* @return the first slot that corresponds to an instance specification
*/
public static InstanceSpecification getInstance(Slot slot) {
Iterator<ValueSpecification> values = slot.getValues().iterator();
- while(values.hasNext()) {
+ while (values.hasNext()) {
ValueSpecification value = values.next();
// instances are accessible via ValueSpecification subclass InstanceValue
- if(value instanceof InstanceValue) {
- return ((InstanceValue)value).getInstance();
+ if (value instanceof InstanceValue) {
+ return ((InstanceValue) value).getInstance();
}
}
return null;
@@ -108,15 +108,15 @@ public class DepPlanUtils {
/**
* create a slot for a given sub-instance specification.
- *
+ *
* @param cdp
- * a deployment plan
+ * a deployment plan
* @param is
- * an instance specification for a composite class
+ * an instance specification for a composite class
* @param partIS
- * the instance specification of a part within the composite
+ * the instance specification of a part within the composite
* @param part
- * the part within the composite
+ * the part within the composite
*/
public static Slot createSlot(Package cdp, InstanceSpecification is, InstanceSpecification partIS, Property part) {
// the instance specification of the composite has a slot for each part and it points
@@ -125,7 +125,7 @@ public class DepPlanUtils {
slot.setDefiningFeature(part);
InstanceValue iv = (InstanceValue)
- slot.createValue(null, null, UMLPackage.eINSTANCE.getInstanceValue());
+ slot.createValue(null, null, UMLPackage.eINSTANCE.getInstanceValue());
iv.setInstance(partIS);
return slot;
@@ -133,15 +133,15 @@ public class DepPlanUtils {
/**
* Apply the stereotype deployment plan and set the mainInstance value
- *
+ *
* @param cdp
- * the deployment plan
+ * the deployment plan
* @param main
- * instance the top-level instance specification of the plan
+ * instance the top-level instance specification of the plan
*/
public static void setMainInstance(Package cdp, InstanceSpecification mainInstance) {
DeploymentPlan cdpApp = StUtils.applyApp(cdp, DeploymentPlan.class);
- if(cdpApp != null) {
+ if (cdpApp != null) {
cdpApp.setMainInstance(mainInstance);
}
}
@@ -156,11 +156,11 @@ public class DepPlanUtils {
// get reference to component model, then search all classes contained in it.
Package compModel = Utils.getRoot(componentType, "ComponentModel");
Iterator<Element> elements = compModel.allOwnedElements().iterator();
- while(elements.hasNext()) {
+ while (elements.hasNext()) {
Element element = elements.next();
- if(element instanceof Class) {
- Class candidate = (Class)element;
- if(candidate.getSuperClass(componentType.getName()) != null) {
+ if (element instanceof Class) {
+ Class candidate = (Class) element;
+ if (candidate.getSuperClass(componentType.getName()) != null) {
return candidate;
}
}
@@ -171,25 +171,25 @@ public class DepPlanUtils {
/**
* create a deployment plan, i.e. a set of instances
* Automatic choice of implementations (otherwise leave unassigned)
- *
+ *
* @param composite
- * System composite
+ * System composite
*/
public static InstanceSpecification createDepPlan(Package cdp, Classifier composite, String name) {
// create an instance specification for the composite
InstanceSpecification is = (InstanceSpecification)
- cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification());
+ cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification());
- if(name == "mainInstance") {
+ if (name == "mainInstance") {
setMainInstance(cdp, is);
}
Class implementation = null;
- if(Utils.isCompImpl(composite)) {
+ if (Utils.isCompImpl(composite)) {
// implementation is known => must be able to do this.
- if(composite instanceof Class) {
- implementation = (Class)composite;
+ if (composite instanceof Class) {
+ implementation = (Class) composite;
}
} else {
// TODO: really need that? (better indicate to user that he needs to choose?)
@@ -197,7 +197,7 @@ public class DepPlanUtils {
implementation = autoChooseImplementation(composite);
}
- if(!(implementation instanceof Class)) {
+ if (!(implementation instanceof Class)) {
return is;
}
// else implementation is instance of Class (and not null)
@@ -209,12 +209,12 @@ public class DepPlanUtils {
* }
*/
- for(Property part : Utils.getParts(implementation)) {
- if(part instanceof Port) {
+ for (Property part : Utils.getParts(implementation)) {
+ if (part instanceof Port) {
continue;
}
InstanceSpecification partIS =
- createDepPlan(cdp, (Classifier)part.getType(), name + "." + part.getName());
+ createDepPlan(cdp, (Classifier) part.getType(), name + "." + part.getName());
createSlot(cdp, is, partIS, part);
}
@@ -227,18 +227,18 @@ public class DepPlanUtils {
public static void configureProperty(InstanceSpecification instance, String propertyName, String value) {
Classifier extension = DepUtils.getClassifier(instance);
- Property attribute = (Property)Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName);
- if(attribute == null) {
+ Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName);
+ if (attribute == null) {
throw new RuntimeException("cannot find attribute " + propertyName + " in classifier " + extension.getName());
}
- if(attribute.getType() instanceof Enumeration) {
+ if (attribute.getType() instanceof Enumeration) {
configureEnumProperty(instance, propertyName, value);
}
else {
// create a slot for a string value
Slot slotStringVal = DepCreation.createSlotForConfigProp(instance, attribute);
- if(slotStringVal.getValues().get(0) instanceof LiteralString) {
- ((LiteralString)slotStringVal.getValues().get(0)).setValue(value);
+ if (slotStringVal.getValues().get(0) instanceof LiteralString) {
+ ((LiteralString) slotStringVal.getValues().get(0)).setValue(value);
}
else {
// indicates that operation has been called although types do not match
@@ -254,14 +254,14 @@ public class DepPlanUtils {
public static void configureProperty(InstanceSpecification instance, String propertyName, int value) {
Classifier extension = DepUtils.getClassifier(instance);
- Property attribute = (Property)Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName);
- if(attribute == null) {
+ Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName);
+ if (attribute == null) {
throw new RuntimeException("cannot find attribute " + propertyName + " in classifier " + extension.getName());
}
Slot slotIntVal = instance.createSlot();
slotIntVal.setDefiningFeature(attribute);
LiteralInteger intValue = (LiteralInteger)
- slotIntVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getLiteralInteger());
+ slotIntVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getLiteralInteger());
intValue.setValue(value);
}
@@ -270,7 +270,7 @@ public class DepPlanUtils {
* Convenience function: allow that an ecore named element is passed instead of a property name. This is useful if the
* parameter that should be configured stems from a static profile [TODO: should not be in the general class support, but
* in the instance configurators for RT-Describe)
- *
+ *
* @param instance
* @param extension
* @param property
@@ -283,13 +283,13 @@ public class DepPlanUtils {
/**
* configure a property for an enumeration. Enumerations are a bit difficult to handle, since the enumeration literal itself
* must be created first in form of an instance specification
- *
+ *
* @param instance
- * The instance of which an attribute should be configured.
+ * The instance of which an attribute should be configured.
* @param propertyName
- * The name of the property that should be configured
+ * The name of the property that should be configured
* @param value
- * its value in form of an element of a static profile [TODO: not general enough?]
+ * its value in form of an element of a static profile [TODO: not general enough?]
*/
public static void configureProperty(InstanceSpecification instance, String propertyName, Enumerator value) {
configureProperty(instance, propertyName, value.getName());
@@ -297,19 +297,19 @@ public class DepPlanUtils {
public static void configureEnumProperty(InstanceSpecification instance, String propertyName, String literalName) {
Classifier extension = DepUtils.getClassifier(instance);
- Property attribute = (Property)Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName);
- if(attribute == null) {
+ Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName);
+ if (attribute == null) {
throw new RuntimeException("cannot find attribute " + propertyName + " in classifier " + extension.getName());
}
- if(attribute.getType() instanceof Enumeration) {
- Enumeration enumeration = (Enumeration)attribute.getType();
- for(EnumerationLiteral enumLiteral : enumeration.getOwnedLiterals()) {
- if(enumLiteral.getLabel().equals(literalName)) {
+ if (attribute.getType() instanceof Enumeration) {
+ Enumeration enumeration = (Enumeration) attribute.getType();
+ for (EnumerationLiteral enumLiteral : enumeration.getOwnedLiterals()) {
+ if (enumLiteral.getLabel().equals(literalName)) {
Slot slotEnumVal = instance.createSlot();
slotEnumVal.setDefiningFeature(attribute);
InstanceValue enumLitValue = (InstanceValue)
- slotEnumVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getInstanceValue());
+ slotEnumVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getInstanceValue());
enumLitValue.setInstance(enumLiteral);
break;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepUtils.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepUtils.java
index c3946428104..50efabdf761 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepUtils.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DepUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,35 +40,35 @@ import org.eclipse.uml2.uml.ValueSpecification;
* [DepPlanUtils?]
* [but missing: creation, ..., allocation?]
* Structuration ??
- *
+ *
* @author ansgar
- *
+ *
*/
public class DepUtils {
-
+
/**
* Find a sub instance via its name. This is in particular useful for connectors that cannot be
* found via a slot, since UML only supports structural features (a connector is only a feature)
* in the definingFeature attribute of a slot.
- *
+ *
* @param owningInstance
- * an owning instance
+ * an owning instance
* @param name
- * name of the sub-element (unqualified)
+ * name of the sub-element (unqualified)
* @return the found sub-instance or null
*/
public static InstanceSpecification getNamedSubInstance(InstanceSpecification owningInstance, String name) {
Element cdp = owningInstance.getOwner();
String candidateName = owningInstance.getName() + "." + name;
- if(cdp instanceof Package) {
- for(PackageableElement instance : ((Package)cdp).getPackagedElements()) {
- if(instance instanceof InstanceSpecification) {
- InstanceSpecification candidate = (InstanceSpecification)instance;
+ if (cdp instanceof Package) {
+ for (PackageableElement instance : ((Package) cdp).getPackagedElements()) {
+ if (instance instanceof InstanceSpecification) {
+ InstanceSpecification candidate = (InstanceSpecification) instance;
- if(candidateName != null) {
- if(candidateName.equals(candidate.getName())) {
+ if (candidateName != null) {
+ if (candidateName.equals(candidate.getName())) {
return candidate;
}
}
@@ -78,14 +78,14 @@ public class DepUtils {
return null;
}
-
+
/**
* return an instance specification for the main instance within
* a package.
- *
+ *
* @param cdp
- * the deployment plan
+ * the deployment plan
*/
public static InstanceSpecification getMainInstance(Package cdp) {
DeploymentPlan dp = StUtils.getApplication(cdp, DeploymentPlan.class);
@@ -94,11 +94,11 @@ public class DepUtils {
/**
* Apply the stereotype deployment plan and set the mainInstance value
- *
+ *
* @param cdp
- * the deployment plan
+ * the deployment plan
* @param main
- * instance the top-level instance specification of the plan
+ * instance the top-level instance specification of the plan
*/
public static void setMainInstance(Package cdp, InstanceSpecification mainInstance) {
StUtils.apply(cdp, DeploymentPlan.class);
@@ -109,31 +109,31 @@ public class DepUtils {
/**
* return the implementation associated with an instance specification, i.e. a
* Class.
- *
+ *
* @param instance
* @return
*/
public static Class getImplementation(InstanceSpecification instance) {
Classifier cl = getClassifier(instance);
- if(cl instanceof Class) {
- return (Class)cl;
+ if (cl instanceof Class) {
+ return (Class) cl;
}
return null;
}
-
+
/**
* Return the first classifier referenced by an instance specification. Whereas UML supports
* a set of classifiers, we assume that that an instance specification has only one.
- *
+ *
* @param instance
- * the instance, for which we are interested in type information
+ * the instance, for which we are interested in type information
*/
public static Classifier getClassifier(InstanceSpecification instance) {
Iterator<Classifier> classifierIt = instance.getClassifiers().iterator();
// simply return the first element (if there is any)
- if(classifierIt.hasNext()) {
+ if (classifierIt.hasNext()) {
return classifierIt.next();
}
return null;
@@ -142,18 +142,18 @@ public class DepUtils {
/**
* Return the first instance specification within a deployment plan that instantiates a given
* classifier
- *
+ *
* @param cdp
- * the deployment plan
+ * the deployment plan
* @param cl
- * the classifier
+ * the classifier
* @return
*/
public static InstanceSpecification getInstanceForClassifier(Package cdp, Classifier cl) {
- for(PackageableElement pe : cdp.getPackagedElements()) {
- if(pe instanceof InstanceSpecification) {
- InstanceSpecification is = (InstanceSpecification)pe;
- if(getClassifier(is) == cl) {
+ for (PackageableElement pe : cdp.getPackagedElements()) {
+ if (pe instanceof InstanceSpecification) {
+ InstanceSpecification is = (InstanceSpecification) pe;
+ if (getClassifier(is) == cl) {
return is;
}
}
@@ -168,7 +168,7 @@ public class DepUtils {
public static EList<Classifier> getContainedImplementations(InstanceSpecification is) {
Iterator<InstanceSpecification> instances = getContainedInstances(is).iterator();
EList<Classifier> list = new UniqueEList<Classifier>();
- while(instances.hasNext()) {
+ while (instances.hasNext()) {
Classifier implementation = getClassifier(instances.next());
list.add(implementation);
}
@@ -177,18 +177,18 @@ public class DepUtils {
/**
* Return the slot that is associated with a property
- *
+ *
* @param is
- * an instance specification (of a class having properties)
+ * an instance specification (of a class having properties)
* @param property
- * A property of the classifier associated with the passed instance specification
+ * A property of the classifier associated with the passed instance specification
* @return the associated slot or null, if it does not exist
*/
public static Slot getSlot(InstanceSpecification is, Property property) {
Iterator<Slot> slots = is.getSlots().iterator();
- while(slots.hasNext()) {
+ while (slots.hasNext()) {
Slot slot = slots.next();
- if(slot.getDefiningFeature() == property) {
+ if (slot.getDefiningFeature() == property) {
return slot;
}
}
@@ -198,15 +198,15 @@ public class DepUtils {
/**
* Return the instance referenced by a slot value, i.e. the first instance value associated
* with a slot
- *
+ *
* @param slot
* @return
*/
public static InstanceSpecification getInstance(Slot slot) {
- for(ValueSpecification value : slot.getValues()) {
+ for (ValueSpecification value : slot.getValues()) {
// instances are accessible via ValueSpecification subclass InstanceValue
- if(value instanceof InstanceValue) {
- return ((InstanceValue)value).getInstance();
+ if (value instanceof InstanceValue) {
+ return ((InstanceValue) value).getInstance();
}
}
return null;
@@ -218,9 +218,9 @@ public class DepUtils {
*/
public static EList<InstanceSpecification> getContainedInstances(InstanceSpecification is) {
EList<InstanceSpecification> contained = new BasicEList<InstanceSpecification>();
- for(Slot slot : is.getSlots()) {
+ for (Slot slot : is.getSlots()) {
InstanceSpecification instance = getInstance(slot);
- if(instance != null) {
+ if (instance != null) {
contained.add(instance);
}
}
@@ -229,20 +229,21 @@ public class DepUtils {
/**
* return all slots that reference an instance specification
- *
+ *
* @param is
* @return
*/
public static EList<Slot> getReferencingSlots(InstanceSpecification is) {
EList<Slot> list = new BasicEList<Slot>();
- for(Setting setting : UML2Util.getNonNavigableInverseReferences(is)) {
+ for (Setting setting : UML2Util.getNonNavigableInverseReferences(is)) {
// no trigger is referencing the event any more, delete call event
EObject eObj = setting.getEObject();
- if(eObj instanceof ValueSpecification) {
- ValueSpecification vs = (ValueSpecification)eObj;
+ if (eObj instanceof ValueSpecification) {
+ ValueSpecification vs = (ValueSpecification) eObj;
Element owner = vs.getOwner();
- if(owner instanceof Slot)
- list.add((Slot)owner);
+ if (owner instanceof Slot) {
+ list.add((Slot) owner);
+ }
}
}
return list;
@@ -251,17 +252,17 @@ public class DepUtils {
/**
* Return an instance specification that refers to the composite in which the
* passed instance is contained
- *
+ *
* @param is
- * an instance that is contained within an composite (i.e. that
- * belongs to a part of this composite).
+ * an instance that is contained within an composite (i.e. that
+ * belongs to a part of this composite).
* @return
*/
public static Slot getParentSlot(InstanceSpecification is) {
- for(Slot slot : getReferencingSlots(is)) {
+ for (Slot slot : getReferencingSlots(is)) {
// no trigger is referencing the event any more, delete call event
- if(slot.getDefiningFeature() instanceof Property) {
- if(((Property)slot.getDefiningFeature()).getAggregation() == AggregationKind.COMPOSITE_LITERAL) {
+ if (slot.getDefiningFeature() instanceof Property) {
+ if (((Property) slot.getDefiningFeature()).getAggregation() == AggregationKind.COMPOSITE_LITERAL) {
return slot;
}
}
@@ -272,15 +273,15 @@ public class DepUtils {
/**
* Return an instance specification that refers to the composite in which the
* passed instance is contained
- *
+ *
* @param is
- * an instance that is contained within an composite (i.e. that
- * belongs to a part of this composite).
+ * an instance that is contained within an composite (i.e. that
+ * belongs to a part of this composite).
* @return
*/
public static InstanceSpecification getParentIS(InstanceSpecification is) {
Slot parentSlot = getParentSlot(is);
- if(parentSlot != null) {
+ if (parentSlot != null) {
return parentSlot.getOwningInstance();
}
return null;
@@ -288,9 +289,9 @@ public class DepUtils {
public static Stack<Slot> getAccessPath(InstanceSpecification is) {
Stack<Slot> path = new Stack<Slot>();
- while(is != null) {
+ while (is != null) {
Slot parentSlot = getParentSlot(is);
- if(parentSlot == null) {
+ if (parentSlot == null) {
break;
}
path.insertElementAt(parentSlot, 0);
@@ -301,8 +302,8 @@ public class DepUtils {
public static boolean isShared(Slot slot) {
StructuralFeature df = slot.getDefiningFeature();
- if(df instanceof Property) {
- return ((Property)df).getAggregation() == AggregationKind.SHARED_LITERAL;
+ if (df instanceof Property) {
+ return ((Property) df).getAggregation() == AggregationKind.SHARED_LITERAL;
}
return false;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DialogUtils.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DialogUtils.java
index bcef553b11d..c9e189cf8ce 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DialogUtils.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/DialogUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -86,7 +86,7 @@ public class DialogUtils {
/**
* Create a GridData object which fills the available vertical and horizontal space
- *
+ *
* @return
*/
public static GridData createFillGridData() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Log.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Log.java
index 8b0f1b377d7..c5988b53590 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Log.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Log.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,9 +16,9 @@ import java.util.Map;
/**
* Very simple message logging class
- *
+ *
* @author ansgar
- *
+ *
*/
public class Log {
@@ -54,7 +54,7 @@ public class Log {
static Map<Integer, String> moduleMap;
static String getModuleInfo(int moduleKind) {
- if(moduleMap == null) {
+ if (moduleMap == null) {
moduleMap = new HashMap<Integer, String>();
moduleMap.put(TRAFO_CONNECTOR, "Trafo connector");
moduleMap.put(TRAFO_CONTAINER, "Trafo container");
@@ -72,10 +72,10 @@ public class Log {
}
public static void log(int msgKind, int moduleKind, String message) {
- if(msgKind == ERROR_MSG) {
+ if (msgKind == ERROR_MSG) {
System.err.println(getModuleInfo(moduleKind) + message);
- } else if(msgKind == INFO_MSG) {
- if((moduleKind & moduleFilter) != 0) {
+ } else if (msgKind == INFO_MSG) {
+ if ((moduleKind & moduleFilter) != 0) {
System.out.println(getModuleInfo(moduleKind) + message);
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/RunnableWithResult.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/RunnableWithResult.java
index fa7c8bdfb5d..1a5fa1a2ad8 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/RunnableWithResult.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/RunnableWithResult.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ public interface RunnableWithResult {
/**
* Execute a commad
- *
+ *
* @return CommandResult.newOKCommandResult() if successful
* CommandResult.newErrorCommandResult(..) or
* CommandReuslt.newCancelCommandResult(..) otherwise
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/StUtils.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/StUtils.java
index 652e2ff4aef..2c351c5a241 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/StUtils.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/StUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@ package org.eclipse.papyrus.robotml.deployment;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.Stereotype;
@@ -24,19 +23,19 @@ import org.eclipse.uml2.uml.util.UMLUtil;
* Some functions around stereotype usage.
* TODO: originally developed without use of static profile. It thus contains many functions
* that are no longer needed (e.g. getBoolean) => needs some cleanup
- *
+ *
* @author ansgar
- *
+ *
*/
public class StUtils {
/**
* This method verifies if a stereotype is applied on an UML element
- *
+ *
* @param element
- * A UML element
+ * A UML element
* @param str_name
- * a qualified stereotype name
+ * a qualified stereotype name
*/
public static boolean isApplied(Element element, String str_name) {
return (element.getAppliedStereotype(str_name) != null);
@@ -44,16 +43,16 @@ public class StUtils {
/**
* This method verifies if a stereotype is applied on an UML element
- *
+ *
* @param element
- * A UML element
+ * A UML element
* @param the
- * class of an element of a static profile
+ * class of an element of a static profile
*/
public static boolean isApplied(Element element, java.lang.Class<? extends EObject> clazz) {
- for(EObject stereoApplication : element.getStereotypeApplications()) {
+ for (EObject stereoApplication : element.getStereotypeApplications()) {
// check whether the stereotype is a subclass of the passed parameter clazz
- if(clazz.isAssignableFrom(stereoApplication.getClass())) {
+ if (clazz.isAssignableFrom(stereoApplication.getClass())) {
return true;
}
}
@@ -63,18 +62,18 @@ public class StUtils {
/**
* Return the attribute of a stereotype. If the attribute type is a model reference,
* use the function getAttributeBase instead.
- *
+ *
* @param element
- * the element which holds the stereotype
+ * the element which holds the stereotype
* @param stereo_name
- * the name of the stereotype
+ * the name of the stereotype
* @param attrib_name
- * the name of an attribute of this stereotype
+ * the name of an attribute of this stereotype
* @return The value that is associated with the stereotype attribute
*/
public static Object getAttribute(Element element, String stereo_name, String attrib_name) {
Stereotype stereotype = element.getAppliedStereotype(stereo_name);
- if(stereotype == null) {
+ if (stereotype == null) {
return null;
}
return element.getValue(stereotype, attrib_name);
@@ -82,19 +81,19 @@ public class StUtils {
/**
* Set the value of a stereotype attribute
- *
+ *
* @param element
- * the element which holds the stereotype
+ * the element which holds the stereotype
* @param stereo_name
- * the name of the stereotype
+ * the name of the stereotype
* @param attrib_name
- * the name of an attribute of this stereotype
+ * the name of an attribute of this stereotype
* @param value
- * the value that is associated with the stereotype attribute
+ * the value that is associated with the stereotype attribute
*/
public static void setAttribute(Element element, String stereo_name, String attr_name, Object value) {
Stereotype st = apply(element, stereo_name);
- if(st != null) {
+ if (st != null) {
element.setValue(st, attr_name, value);
}
}
@@ -102,24 +101,24 @@ public class StUtils {
/**
* Return the stereotype application. Like getApplication below, except
* that the passed stereotype is a string.
- *
+ *
* @param element
* @param stereo_name
- * the qualified name of a stereotype. Applications of compatible sub-types will be returned as well (if exact stereotype is not applied)
+ * the qualified name of a stereotype. Applications of compatible sub-types will be returned as well (if exact stereotype is not applied)
* @return
*/
public static EObject getApplication(Element element, String stereo_name) {
Stereotype stereotype = element.getApplicableStereotype(stereo_name);
- if(stereotype != null) {
+ if (stereotype != null) {
EObject application = element.getStereotypeApplication(stereotype);
- if(application != null) {
+ if (application != null) {
return application;
}
- // not found, now try sub-stereotypes
- for(Stereotype subStereo : element.getAppliedSubstereotypes(stereotype)) {
+ // not found, now try sub-stereotypes
+ for (Stereotype subStereo : element.getAppliedSubstereotypes(stereotype)) {
application = element.getStereotypeApplication(subStereo);
- if(application != null) {
+ if (application != null) {
return application;
}
}
@@ -130,19 +129,19 @@ public class StUtils {
/**
* Return the stereotype application by passing an element of the static profile
- *
+ *
* @param element
- * the UML model element
+ * the UML model element
* @param clazz
- * the class of an element of a static profile. Compatible sub-types will be returned as well
+ * the class of an element of a static profile. Compatible sub-types will be returned as well
* @return the stereotype application (first compatible with passed clazz) or null
*/
@SuppressWarnings("unchecked")
public static <T extends EObject> T getApplication(Element element, java.lang.Class<T> clazz) {
- for(EObject stereoApplication : element.getStereotypeApplications()) {
+ for (EObject stereoApplication : element.getStereotypeApplications()) {
// check whether the stereotype is an instance of the passed parameter clazz
- if(clazz.isInstance(stereoApplication)) {
- return (T)stereoApplication;
+ if (clazz.isInstance(stereoApplication)) {
+ return (T) stereoApplication;
}
}
return null;
@@ -151,21 +150,21 @@ public class StUtils {
/**
* Apply a stereotype. The stereotype is not applied, if already a sub-stereotype is applied.
* If you want to apply the new stereotype also in this case, use applyExact instead.
- *
+ *
* @param element
- * the element
+ * the element
* @param stereo_name
- * the stereotype name
+ * the stereotype name
* @return
*/
public static Stereotype apply(Element element, String stereo_name) {
Stereotype stereotype = element.getApplicableStereotype(stereo_name);
- if(stereotype != null) {
+ if (stereotype != null) {
EList<Stereotype> subStereos = element.getAppliedSubstereotypes(stereotype);
boolean alreadyApplied = (subStereos.size() > 0);
- if(!alreadyApplied) {
+ if (!alreadyApplied) {
// it seems that subSterotypes do not include the stereotype itself
- if(element.getStereotypeApplication(stereotype) == null) {
+ if (element.getStereotypeApplication(stereotype) == null) {
element.applyStereotype(stereotype);
}
}
@@ -175,17 +174,17 @@ public class StUtils {
/**
* unapply a stereotype when the name of the stereotype is given.
- *
+ *
* @param element
- * the element
+ * the element
* @param stereo_name
- * the stereotype name
+ * the stereotype name
* @return
*/
public static void unapply(Element element, String stereo_name) {
Stereotype stereotype = element.getApplicableStereotype(stereo_name);
- if(stereotype != null) {
- if(element.getStereotypeApplication(stereotype) != null) {
+ if (stereotype != null) {
+ if (element.getStereotypeApplication(stereotype) != null) {
element.unapplyStereotype(stereotype);
}
}
@@ -195,15 +194,15 @@ public class StUtils {
* Apply a stereotype and return the stereotype application (if successful).
* The stereotype is not applied, if already a sub-stereotype is applied.
* If you want to apply the new stereotype also in this case, use applyExact instead.
- *
+ *
* @param element
- * the element
+ * the element
* @param stereo_name
- * the stereotype name
+ * the stereotype name
* @return
*/
public static <T extends EObject> T applyApp(Element element, java.lang.Class<T> clazz) {
- if(apply(element, clazz) != null) {
+ if (apply(element, clazz) != null) {
return getApplication(element, clazz);
}
return null;
@@ -216,9 +215,9 @@ public class StUtils {
*/
public static Stereotype applyExact(Element element, String stereo_name) {
Stereotype stereotype = element.getApplicableStereotype(stereo_name);
- if(stereotype != null) {
+ if (stereotype != null) {
Stereotype alreadyApplied = element.getAppliedSubstereotype(stereotype, stereo_name);
- if(alreadyApplied == null) {
+ if (alreadyApplied == null) {
element.applyStereotype(stereotype);
}
}
@@ -230,9 +229,9 @@ public class StUtils {
* Caveat: the function relies on the correspondence between the fully qualified
* stereotype name and the package name within the static profile. The latter may
* use a different prefix (as it is the case with the MARTE analysis & design profile).
- *
+ *
* @param element
- * the element
+ * the element
* @param class a class of a static profile
* @return
*/
@@ -245,11 +244,11 @@ public class StUtils {
* Caveat: the function relies on the correspondence between the fully qualified
* stereotype name and the package name within the static profile. The latter may
* use a different prefix (as it is the case with the MARTE analysis & design profile).
- *
+ *
* @param element
- * the element
+ * the element
* @param stereo_name
- * the stereotype name
+ * the stereotype name
* @return
*/
public static void unapply(Element element, java.lang.Class<? extends EObject> clazz) {
@@ -261,11 +260,11 @@ public class StUtils {
* Caveat: the function relies on the correspondence between the fully qualified
* stereotype name and the package name within the static profile. The latter may
* use a different prefix (as it is the case with the MARTE analysis & design profile).
- *
+ *
* @param element
- * the element
+ * the element
* @param stereo_name
- * the stereotype name
+ * the stereotype name
* @return
*/
public static Stereotype applyExact(Element element, java.lang.Class<? extends EObject> clazz) {
@@ -277,19 +276,19 @@ public class StUtils {
* elements and the user wants to retrieve the underlying base elements (instead of the stereotype application)
* The function applies the getBaseElement operation to the result of the
* getStereotypeAttribute function above.
- *
+ *
* @param element
- * the element while holds the stereotype
+ * the element while holds the stereotype
* @param stereo_name
- * the name of the stereotype
+ * the name of the stereotype
* @param attrib_name
- * the name of an attribute of this stereotype
+ * the name of an attribute of this stereotype
* @return The value that is associated with the stereotype attribute
*/
public static Element getAttributeBase(Element element, String stereo_name, String attrib_name) {
Object obj = getAttribute(element, stereo_name, attrib_name);
- if(obj instanceof EObject) {
- return UMLUtil.getBaseElement((EObject)obj);
+ if (obj instanceof EObject) {
+ return UMLUtil.getBaseElement((EObject) obj);
} else {
return null;
}
@@ -298,23 +297,23 @@ public class StUtils {
/**
* Copy the stereotype application from a source to a destination element. The
* function will also copy the stereotype attributes.
- *
+ *
* @param source
* @param destination
* @return
*/
public static void copyStereotypes(Copy copy, Element source, Element destination) {
-
- for(Stereotype stereotype : source.getAppliedStereotypes()) {
+
+ for (Stereotype stereotype : source.getAppliedStereotypes()) {
String stereoName = stereotype.getQualifiedName();
-
- // Hack: do not copy derived element stereotype. Problem: when templates are instantiated,
- // some operations are derived from interface operations which in turn are derived from the
- // formal template parameter (e.g. FIFO). Since interface derived from ports are put into a
- // top-level directory "derived elements", they may be outside the package template and do not
- // get replaced.
- copyAttributes(copy, stereotype.getQualifiedName(), source, destination);
-
+
+ // Hack: do not copy derived element stereotype. Problem: when templates are instantiated,
+ // some operations are derived from interface operations which in turn are derived from the
+ // formal template parameter (e.g. FIFO). Since interface derived from ports are put into a
+ // top-level directory "derived elements", they may be outside the package template and do not
+ // get replaced.
+ copyAttributes(copy, stereotype.getQualifiedName(), source, destination);
+
}
}
@@ -324,11 +323,11 @@ public class StUtils {
/**
* copy stereotype attributes.
- *
+ *
* TODO: verify if it is necessary to distinguish between stereoSource and stereoDest
* (they should be identical, if the resource sets are).
* => simplify code
- *
+ *
* @param stereotypeName
* @param source
* @param destination
@@ -339,27 +338,27 @@ public class StUtils {
Stereotype stereoSource = source.getAppliedStereotype(stereotypeName);
Stereotype stereoDest = destination.getApplicableStereotype(stereotypeName);
- if((stereoSource == null) || (stereoDest == null)) {
+ if ((stereoSource == null) || (stereoDest == null)) {
return false;
}
Stereotype alreadyApplied = destination.getAppliedStereotype(stereotypeName);
- if(alreadyApplied == null) {
+ if (alreadyApplied == null) {
// only apply stereotype, if not already applied
destination.applyStereotype(stereoDest);
}
// getAllAttributes? (but have to avoid attribute base_Class which resets stereotype application)
- for(Property attribute : stereoSource.getAllAttributes()) {
+ for (Property attribute : stereoSource.getAllAttributes()) {
String attrName = attribute.getName();
- if(attrName.length() >= 5) {
+ if (attrName.length() >= 5) {
// do not copy base_ stereotypes (base_class, base_package and base_PackageImport)
- if(attrName.startsWith("base_")) {
+ if (attrName.startsWith("base_")) {
continue;
}
}
// do not copy derived attributes
- if(attribute.isDerived()) {
+ if (attribute.isDerived()) {
continue;
}
@@ -372,21 +371,21 @@ public class StUtils {
* }
*/
- if(value instanceof EList) {
+ if (value instanceof EList) {
// copy list
EList<Object> newList = new BasicEList<Object>();
- for(Object valueEl : (EList<Object>)value) {
- if((copy != null) && (valueEl instanceof Element)) {
- newList.add(copy.getCopy((Element)valueEl));
+ for (Object valueEl : (EList<Object>) value) {
+ if ((copy != null) && (valueEl instanceof Element)) {
+ newList.add(copy.getCopy((Element) valueEl));
} else {
newList.add(valueEl);
}
}
- if(newList.size() > 0) {
+ if (newList.size() > 0) {
destination.setValue(stereoDest, attrName, newList);
}
- } else if((copy != null) && (value instanceof Element)) {
- destination.setValue(stereoDest, attrName, copy.getCopy((Element)value));
+ } else if ((copy != null) && (value instanceof Element)) {
+ destination.setValue(stereoDest, attrName, copy.getCopy((Element) value));
} else {
destination.setValue(stereoDest, attrName, value);
}
@@ -397,7 +396,7 @@ public class StUtils {
public static boolean copyAttribute(String stereotypeName, String attribute, Element source, Element destination) {
Stereotype stereotype = source.getAppliedStereotype(stereotypeName);
- if(stereotype == null) {
+ if (stereotype == null) {
return false;
}
Object value = source.getValue(stereotype, attribute);
@@ -406,13 +405,13 @@ public class StUtils {
return true;
}
-// public static org.eclipse.papyrus.FCM.Connector getConnector(Connector connector) {
-// return getApplication(connector, org.eclipse.papyrus.FCM.Connector.class);
-// }
-//
-// public static boolean isConnector(Connector candidate) {
-// return StUtils.isApplied(candidate, org.eclipse.papyrus.FCM.Connector.class);
-// }
+ // public static org.eclipse.papyrus.FCM.Connector getConnector(Connector connector) {
+ // return getApplication(connector, org.eclipse.papyrus.FCM.Connector.class);
+ // }
+ //
+ // public static boolean isConnector(Connector candidate) {
+ // return StUtils.isApplied(candidate, org.eclipse.papyrus.FCM.Connector.class);
+ // }
public static Stereotype getStereo(Element element, java.lang.Class<? extends EObject> clazz) {
return element.getAppliedStereotype(getStereoName(element, clazz));
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/TransformationException.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/TransformationException.java
index febaa4ad08d..26489435b49 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/TransformationException.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/TransformationException.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Utils.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Utils.java
index c993bceaf8e..fd8c16946b6 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Utils.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/Utils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,6 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.UniqueEList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
import org.eclipse.uml2.uml.AggregationKind;
@@ -43,18 +42,18 @@ public class Utils {
/**
* Retrieve an element from a list of named elements via its name
- *
+ *
* @param namedElementList
* @param name
* @return
*/
public static NamedElement getNamedElementFromList(
- EList<? extends NamedElement> namedElementList, String name) {
+ EList<? extends NamedElement> namedElementList, String name) {
Iterator<? extends NamedElement> namedElements = namedElementList
- .iterator();
- while(namedElements.hasNext()) {
+ .iterator();
+ while (namedElements.hasNext()) {
NamedElement namedElement = namedElements.next();
- if(namedElement.getName().equals(name)) {
+ if (namedElement.getName().equals(name)) {
return namedElement;
}
}
@@ -67,16 +66,16 @@ public class Utils {
* case for models, model libraries have a top-level package (not a model).
* In this case, getTop returns the top-level package whereas getModel would
* return null.
- *
+ *
* @param element
* @return the top-level owning package
*/
public static Package getTop(Element element) {
- while(element != null) {
+ while (element != null) {
Element owner = element.getOwner();
- if(owner == null) {
- if(element instanceof Package) {
- return (Package)element;
+ if (owner == null) {
+ if (element instanceof Package) {
+ return (Package) element;
}
}
element = owner;
@@ -86,16 +85,16 @@ public class Utils {
/**
* @param element
- * an element which is owned by a model.
+ * an element which is owned by a model.
* @param subfolder
- * the name of a sub-folder within root (created, if not
- * existent)
+ * the name of a sub-folder within root (created, if not
+ * existent)
* @return a reference to the sub folder within the root of the model that
* belongs to the passed element.
*/
public static Package getRoot(Element element, String subfolder) {
Package root = getTop(element);
- if(root.getNestedPackage(subfolder) != null) {
+ if (root.getNestedPackage(subfolder) != null) {
return root.getNestedPackage(subfolder);
} else {
return root.createNestedPackage(subfolder);
@@ -105,7 +104,7 @@ public class Utils {
/**
* Convenience method enabling to apply getOwnedOperation equally to classes
* and interfaces
- *
+ *
* @param cl
* @param name
* @param paramNames
@@ -113,25 +112,25 @@ public class Utils {
* @return
*/
public static Operation createOwnedOperation(Classifier cl, String name,
- EList<String> paramNames, EList<Type> paramTypes, Type retType) {
- if(cl instanceof Class) {
- return ((Class)cl).createOwnedOperation(name, paramNames,
- paramTypes, retType);
- } else if(cl instanceof Interface) {
- return ((Interface)cl).createOwnedOperation(name, paramNames,
- paramTypes, retType);
+ EList<String> paramNames, EList<Type> paramTypes, Type retType) {
+ if (cl instanceof Class) {
+ return ((Class) cl).createOwnedOperation(name, paramNames,
+ paramTypes, retType);
+ } else if (cl instanceof Interface) {
+ return ((Interface) cl).createOwnedOperation(name, paramNames,
+ paramTypes, retType);
} else {
return null;
}
}
public static Operation getOwnedOperation(Classifier cl, String name,
- EList<String> paramNames, EList<Type> paramTypes) {
- if(cl instanceof Class) {
- return ((Class)cl).getOwnedOperation(name, paramNames, paramTypes);
- } else if(cl instanceof Interface) {
- return ((Interface)cl).getOwnedOperation(name, paramNames,
- paramTypes);
+ EList<String> paramNames, EList<Type> paramTypes) {
+ if (cl instanceof Class) {
+ return ((Class) cl).getOwnedOperation(name, paramNames, paramTypes);
+ } else if (cl instanceof Interface) {
+ return ((Interface) cl).getOwnedOperation(name, paramNames,
+ paramTypes);
} else {
return null;
}
@@ -142,12 +141,12 @@ public class Utils {
* on the modeling convention that implemen tations inherit from types.
*/
public static Class componentType(Class implementation) {
- if(Utils.isCompImpl(implementation)) {
+ if (Utils.isCompImpl(implementation)) {
Iterator<Class> superclasses = implementation.getSuperClasses()
- .iterator();
- while(superclasses.hasNext()) {
+ .iterator();
+ while (superclasses.hasNext()) {
Class componentType = superclasses.next();
- if(Utils.isCompType(componentType)) {
+ if (Utils.isCompType(componentType)) {
return componentType;
}
}
@@ -161,23 +160,23 @@ public class Utils {
*/
public static boolean isComposite(Class implementation) {
return Utils.isCompImpl(implementation)
- && (getParts(implementation).size() > 0);
+ && (getParts(implementation).size() > 0);
}
public static EList<Property> getParts(Class implementation) {
-
- return implementation.getParts();
-
+
+ return implementation.getParts();
+
}
/**
* @param attribute
- * an attribute
+ * an attribute
* @return true, if the aggregation kind is considered as a composition
*/
public static boolean isComposition(Property attribute) {
- if(treatNoneAsComposite()) {
+ if (treatNoneAsComposite()) {
return (attribute.getAggregation() != AggregationKind.SHARED_LITERAL);
}
else {
@@ -198,28 +197,28 @@ public class Utils {
* Get an element via its qualified name. Will find elements from the root
* model and elements in imported models. Also supports target model in
* which imports have been copied (while keeping the top-level name)
- *
+ *
* @param root
* @param qualifiedName
* @return
*/
public static NamedElement getQualifiedElement(Package root,
- String qualifiedName) {
+ String qualifiedName) {
NamedElement namedElement = null;
int index = qualifiedName.indexOf("::");
- if(index != -1) {
+ if (index != -1) {
// first try using a path without top element (since
// getQualifiedElement is typically used for
// imported elements)
String remainder = qualifiedName.substring(index + 2);
namedElement = getQualifiedElement(root, remainder, qualifiedName);
}
- if(namedElement == null) {
+ if (namedElement == null) {
// try with complete name as path name, but assume that the element
// has been copied into the model,
// i.e. qualifiedName is prefixed by model name
namedElement = getQualifiedElement(root, qualifiedName,
- root.getName() + "::" + qualifiedName);
+ root.getName() + "::" + qualifiedName);
}
return namedElement;
}
@@ -227,19 +226,19 @@ public class Utils {
/**
* Retrieve an element via its qualified name within a package The segments
* of the package may be non unique due to imports
- *
+ *
* @return the found element, if it exists
*/
public static NamedElement getQualifiedElement(Package root,
- String remainingPath, String qualifiedName) {
- if(root == null) {
+ String remainingPath, String qualifiedName) {
+ if (root == null) {
return null;
}
- if(!remainingPath.contains("::")) {
- for(NamedElement candidate : root.getMembers()) {
+ if (!remainingPath.contains("::")) {
+ for (NamedElement candidate : root.getMembers()) {
String name = candidate.getName();
- if((name != null) && name.equals(remainingPath)) {
- if(candidate.getQualifiedName().equals(qualifiedName)) {
+ if ((name != null) && name.equals(remainingPath)) {
+ if (candidate.getQualifiedName().equals(qualifiedName)) {
return candidate;
}
}
@@ -247,13 +246,13 @@ public class Utils {
} else {
String segment = remainingPath.split("::")[0];
String remainder = remainingPath.substring(segment.length() + 2);
- for(Element element : root.getMembers()) {
- if(element instanceof Package) {
- if(((NamedElement)element).getName().equals(segment)) {
+ for (Element element : root.getMembers()) {
+ if (element instanceof Package) {
+ if (((NamedElement) element).getName().equals(segment)) {
NamedElement foundElement = getQualifiedElement(
- (Package)element, remainder, qualifiedName);
+ (Package) element, remainder, qualifiedName);
// return, if not found
- if(foundElement != null) {
+ if (foundElement != null) {
return foundElement;
}
}
@@ -270,7 +269,7 @@ public class Utils {
* imported or not. This distinction is however not required in our context.
*/
public static boolean isElementInDifferentModel(Package model,
- NamedElement namedElement) {
+ NamedElement namedElement) {
return model != getTop(namedElement);
}
@@ -278,23 +277,23 @@ public class Utils {
* Check whether an element (referenced from the source model) is part of a
* package that is imported on top-level by the target model. It will always
* return false, if the passed element is part of the source model.
- *
+ *
* @param sat
- * source and target model information
+ * source and target model information
* @param namedElement
- * a named element
+ * a named element
* @return true, if imported (on top level), false otherwise
*/
public static boolean isElementImported(Copy sat, NamedElement namedElement) {
- if(isElementInDifferentModel(sat.source, namedElement)) {
+ if (isElementInDifferentModel(sat.source, namedElement)) {
String qualifiedName = namedElement.getQualifiedName();
int index = qualifiedName.indexOf("::");
// remove top level element of name
- if(index != -1) {
+ if (index != -1) {
qualifiedName = qualifiedName.substring(index + 2);
}
// check whether the element is reachable from the target root
- if(getQualifiedElement(sat.target, qualifiedName) != null) {
+ if (getQualifiedElement(sat.target, qualifiedName) != null) {
return true;
}
/*
@@ -315,14 +314,14 @@ public class Utils {
* within the target model. If imports are not copied, the function assumes
* that all elements of a different model are actually reachable via the
* import relationship
- *
+ *
* @param sat
* @param namedElement
* @return the corresponding element within the target model - if it exits
*/
public static NamedElement getExistingNEinTarget(Copy sat,
- NamedElement namedElement) {
- if(sat.copyExtReferences) {
+ NamedElement namedElement) {
+ if (sat.copyExtReferences) {
// copy imports into new model
// return existing element (or null)
return getExistingElement(sat.target, namedElement, false);
@@ -331,7 +330,7 @@ public class Utils {
// Function assumes that all elements that are in a different model
// are actually
// reachable via import relations, i.e. exist already
- if(isElementInDifferentModel(sat.source, namedElement)) {
+ if (isElementInDifferentModel(sat.source, namedElement)) {
return namedElement;
}
return getExistingElement(sat.target, namedElement, false);
@@ -339,7 +338,7 @@ public class Utils {
}
public static NamedElement getExistingElement(Package model,
- NamedElement namedElement, boolean skipTop) {
+ NamedElement namedElement, boolean skipTop) {
EList<Namespace> list = namedElement.allNamespaces();
int offset = (skipTop ? 2 : 1);
// start with list size - 2, i.e. skip last element which points to the
@@ -347,11 +346,11 @@ public class Utils {
// (potentially) imported model, since getImportedElement will start
// there.
Package currentPkg = model;
- for(int i = list.size() - offset; i >= 0; i--) {
+ for (int i = list.size() - offset; i >= 0; i--) {
String name = list.get(i).getName();
NamedElement member = currentPkg.getMember(name);
- if(member instanceof Package) {
- currentPkg = (Package)member;
+ if (member instanceof Package) {
+ currentPkg = (Package) member;
} else {
return null;
}
@@ -362,14 +361,14 @@ public class Utils {
/**
* Check whether a class contains a non-port attribute of a given name
- *
+ *
* @param cl
* @return
*/
public static boolean hasNonPortOwnedAttribute(Class cl, String name) {
- for(Property p : cl.getOwnedAttributes()) {
- if(!(p instanceof Port)) {
- if(p.getName().equals(name)) {
+ for (Property p : cl.getOwnedAttributes()) {
+ if (!(p instanceof Port)) {
+ if (p.getName().equals(name)) {
return true;
}
}
@@ -388,15 +387,15 @@ public class Utils {
public static <T extends EObject> EList<T> getAllElementsOfType(Element examineElement, java.lang.Class<T> clazz, EList<Element> visitedPackages)
{
EList<T> list = new UniqueEList<T>();
- for(Element element : examineElement.allOwnedElements()) {
- if(element instanceof Package) {
- if(!visitedPackages.contains(element)) {
+ for (Element element : examineElement.allOwnedElements()) {
+ if (element instanceof Package) {
+ if (!visitedPackages.contains(element)) {
visitedPackages.add(element);
- list.addAll(getAllElementsOfType((Package)element, clazz,
- visitedPackages));
+ list.addAll(getAllElementsOfType(element, clazz,
+ visitedPackages));
}
- } else if(clazz.isInstance(element)) {
- list.add((T)element);
+ } else if (clazz.isInstance(element)) {
+ list.add((T) element);
}
}
return list;
@@ -407,7 +406,7 @@ public class Utils {
* assumption that the user model is the first resource that is loaded into the model set.
* Use this function instead of Utils.getTop (or getModel) if you want to avoid navigating to the
* root of an imported model.
- *
+ *
* @return the top level package of the model currently loaded into an editor.
*/
public static Package getUserModel() {
@@ -415,14 +414,14 @@ public class Utils {
try {
// IPath fn = serviceUtils.getModelSet().getFilenameWithoutExtension();
EList<Resource> resources = serviceUtils.getModelSet().getResources();
- if(resources.size() >= 3) {
+ if (resources.size() >= 3) {
// check first three resources (di, notation, uml)
- for(int i = 0; i < 3; i++) {
+ for (int i = 0; i < 3; i++) {
Resource userResource = resources.get(i);
- if(userResource.getContents().size() > 0) {
+ if (userResource.getContents().size() > 0) {
EObject topEObj = userResource.getContents().get(0);
- if(topEObj instanceof Package) {
- return (Package)topEObj;
+ if (topEObj instanceof Package) {
+ return (Package) topEObj;
}
}
}
@@ -434,7 +433,7 @@ public class Utils {
/**
* @param a
- * potential implementation
+ * potential implementation
* @return true, if passed classifier is an implementation (i.e. declared
* via stereotypes as component or connector implementation (a sub-type of component implementations,
* therefore no additional check is required)
@@ -446,7 +445,7 @@ public class Utils {
/**
* Check whether the passed class is a component type (and not a component implementation).
* This includes connector and container types as well.
- *
+ *
* @param component
* @return
*/
@@ -454,23 +453,23 @@ public class Utils {
return component.isAbstract();
}
-// public static boolean isSingleton(Class component) {
-// return StUtils.isApplied(component, Singleton.class);
-// }
+ // public static boolean isSingleton(Class component) {
+ // return StUtils.isApplied(component, Singleton.class);
+ // }
public static boolean treatNoneAsComposite() {
-
+
return true;
}
-// public static boolean allAttributesAreConfigAttributs() {
-// IPreferenceStore store = org.eclipse.papyrus.qompass.designer.core.Activator.getDefault().getPreferenceStore();
-// return store.getBoolean(QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES);
-// }
+ // public static boolean allAttributesAreConfigAttributs() {
+ // IPreferenceStore store = org.eclipse.papyrus.qompass.designer.core.Activator.getDefault().getPreferenceStore();
+ // return store.getBoolean(QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES);
+ // }
/**
* True, if either a component implementation or a type
- *
+ *
* @param component
* @return
*/
@@ -478,25 +477,25 @@ public class Utils {
return (isCompType(component) || isCompImpl(component));
}
-// /**
-// * Return the rules associated with a component
-// *
-// * @param component
-// * @return
-// */
-// public static EList<ContainerRule> getRules(Class component) {
-// RuleApplication ruleApplication = StUtils.getApplication(component, RuleApplication.class);
-// if(ruleApplication != null) {
-// return ruleApplication.getContainerRule();
-// }
-// return null;
-// }
+ // /**
+ // * Return the rules associated with a component
+ // *
+ // * @param component
+ // * @return
+ // */
+ // public static EList<ContainerRule> getRules(Class component) {
+ // RuleApplication ruleApplication = StUtils.getApplication(component, RuleApplication.class);
+ // if(ruleApplication != null) {
+ // return ruleApplication.getContainerRule();
+ // }
+ // return null;
+ // }
/**
* Return the absolute file name to a file name given e.g. in the form platform:/plugin/xxx
- *
+ *
* @param fileName
- * the file name using eclipse elements such as platform:/plugin
+ * the file name using eclipse elements such as platform:/plugin
* @return the absolute file name
*/
public static String getAbsoluteFN(String fileName) {
@@ -509,29 +508,29 @@ public class Utils {
return null;
}
-// // TODO: need a generic utility function for getting all elements obeying a certain
-// // criteria from a model
-// public static EList<ContainerRule> getAllRules(Package pkg) {
-// EList<Package> visitedPackages = new BasicEList<Package>();
-// EList<ContainerRule> contRuleList = new BasicEList<ContainerRule>();
-// getAllRules(pkg, visitedPackages, contRuleList);
-// return contRuleList;
-// }
-
-// public static void getAllRules(Package pkg, EList<Package> visitedPackages, EList<ContainerRule> contRuleList) {
-// for(Element el : pkg.getMembers()) {
-// if(el instanceof Package) {
-// if(!visitedPackages.contains(el)) {
-// visitedPackages.add((Package)el);
-// getAllRules((Package)el, visitedPackages, contRuleList);
-// }
-// }
-// else if(el instanceof Class) {
-// if(StUtils.isApplied(el, ContainerRule.class)) {
-// ContainerRule rule = StUtils.getApplication((Class)el, ContainerRule.class);
-// contRuleList.add(rule);
-// }
-// }
-// }
-// }
+ // // TODO: need a generic utility function for getting all elements obeying a certain
+ // // criteria from a model
+ // public static EList<ContainerRule> getAllRules(Package pkg) {
+ // EList<Package> visitedPackages = new BasicEList<Package>();
+ // EList<ContainerRule> contRuleList = new BasicEList<ContainerRule>();
+ // getAllRules(pkg, visitedPackages, contRuleList);
+ // return contRuleList;
+ // }
+
+ // public static void getAllRules(Package pkg, EList<Package> visitedPackages, EList<ContainerRule> contRuleList) {
+ // for(Element el : pkg.getMembers()) {
+ // if(el instanceof Package) {
+ // if(!visitedPackages.contains(el)) {
+ // visitedPackages.add((Package)el);
+ // getAllRules((Package)el, visitedPackages, contRuleList);
+ // }
+ // }
+ // else if(el instanceof Class) {
+ // if(StUtils.isApplied(el, ContainerRule.class)) {
+ // ContainerRule rule = StUtils.getApplication((Class)el, ContainerRule.class);
+ // contRuleList.add(rule);
+ // }
+ // }
+ // }
+ // }
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AllocationDialog.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AllocationDialog.java
index 5f8ebf24718..beda2296435 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AllocationDialog.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AllocationDialog.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@ package org.eclipse.papyrus.robotml.deployment.dialog;
import org.eclipse.draw2d.Label;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.papyrus.RobotML.DeploymentPlan;
import org.eclipse.papyrus.robotml.deployment.AllocUtils;
import org.eclipse.papyrus.robotml.deployment.DepUtils;
@@ -42,9 +41,9 @@ import org.eclipse.uml2.uml.Package;
* Select a connector type and implementation (group)
* TODO: show information about the used connector [usage, implem properties, ...]
* similar help for ports?
- *
+ *
* @author ansgar
- *
+ *
*/
/*
@@ -83,12 +82,14 @@ public class AllocationDialog extends SelectionStatusDialog {
/**
* @see SelectionStatusDialog#computeResult()
*/
+ @Override
protected void computeResult() {
// nothing to do
}
+ @Override
public Control createDialogArea(Composite parent) {
- Composite contents = (Composite)super.createDialogArea(parent);
+ Composite contents = (Composite) super.createDialogArea(parent);
// (parent, "Container rules", "Avail. extensions/interceptors");
fTree = new Tree(contents, SWT.H_SCROLL | SWT.BORDER);
@@ -120,7 +121,7 @@ public class AllocationDialog extends SelectionStatusDialog {
@Override
public void widgetSelected(SelectionEvent e) {
- if(fTree.getSelection().length > 0) {
+ if (fTree.getSelection().length > 0) {
selectInstance(fTree.getSelection()[0]);
}
}
@@ -136,13 +137,13 @@ public class AllocationDialog extends SelectionStatusDialog {
/**
* Helper method to fill a tree with data
- *
+ *
* @param tree
- * the tree to fill
+ * the tree to fill
*/
private void fillTree(Tree tree, TreeItem treeItem, InstanceSpecification is) {
TreeItem item;
- if(treeItem != null) {
+ if (treeItem != null) {
item = new TreeItem(treeItem, SWT.NONE);
} else {
item = new TreeItem(tree, SWT.NONE);
@@ -151,7 +152,7 @@ public class AllocationDialog extends SelectionStatusDialog {
setTextFromData(item);
// create children
- for(InstanceSpecification subIS : DepUtils.getContainedInstances(is)) {
+ for (InstanceSpecification subIS : DepUtils.getContainedInstances(is)) {
fillTree(tree, item, subIS);
}
}
@@ -159,46 +160,46 @@ public class AllocationDialog extends SelectionStatusDialog {
// obtain name and explicit/implicit node Allocation
protected void setTextFromData(TreeItem ti) {
Object data = ti.getData();
- if(data instanceof InstanceSpecification) {
- InstanceSpecification is = (InstanceSpecification)data;
+ if (data instanceof InstanceSpecification) {
+ InstanceSpecification is = (InstanceSpecification) data;
String name = is.getName();
int index = name.lastIndexOf(".");
- if(index != -1) {
+ if (index != -1) {
name = name.substring(index + 1);
}
InstanceSpecification explicitNodeOrThread = AllocUtils.getNodeOrThread(is);
Classifier cl = DepUtils.getClassifier(is);
String nodeName;
- if(explicitNodeOrThread == null) {
+ if (explicitNodeOrThread == null) {
nodeName = "-";
} else {
nodeName = getAllocName(explicitNodeOrThread);
}
-
+
EList<InstanceSpecification> implicitNodes = AllocUtils.getAllNodesOrThreadsParent(is);
implicitNodes.addAll(AllocUtils.getAllNodesOrThreadsParent(is));
String list = "";
- for(InstanceSpecification node : implicitNodes) {
- if(list.equals("")) {
+ for (InstanceSpecification node : implicitNodes) {
+ if (list.equals("")) {
list = getAllocName(node);
} else {
list += ", " + getAllocName(node);
}
}
- ti.setText(new String[]{ name, nodeName, "[" + list + "]" });
+ ti.setText(new String[] { name, nodeName, "[" + list + "]" });
}
}
protected void refreshTree(TreeItem ti) {
setTextFromData(ti);
- for(TreeItem subItem : ti.getItems()) {
+ for (TreeItem subItem : ti.getItems()) {
refreshTree(subItem);
}
}
private String getAllocName(InstanceSpecification nodeOrThread) {
- if(nodeOrThread == null) {
+ if (nodeOrThread == null) {
return "no explicit allocation";
} else {
String name = nodeOrThread.getName();
@@ -210,21 +211,22 @@ public class AllocationDialog extends SelectionStatusDialog {
protected void createAllocInfo(Composite parent) {
// create extension kind combo
fAlloc = DialogUtils.createComboWithText(parent, "Alloc to node:",
- SWT.DROP_DOWN | SWT.READ_ONLY, SWT.NONE);
+ SWT.DROP_DOWN | SWT.READ_ONLY, SWT.NONE);
String items[] = new String[nodeOrThreadList.size()];
int i = 0;
- for(InstanceSpecification nodeOrThread : nodeOrThreadList) {
+ for (InstanceSpecification nodeOrThread : nodeOrThreadList) {
items[i++] = getAllocName(nodeOrThread);
}
fAlloc.setItems(items);
fAlloc.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
- if(currentIS != null) {
+ if (currentIS != null) {
updateAllocation(currentIS, fAlloc.getSelectionIndex());
// selectionCount should always be 1
- for(TreeItem ti : fTree.getSelection()) {
+ for (TreeItem ti : fTree.getSelection()) {
refreshTree(ti);
}
}
@@ -236,21 +238,21 @@ public class AllocationDialog extends SelectionStatusDialog {
/**
* Select a rule, i.e. update the visual representation from the rule
- *
+ *
* @param rule
*/
protected void selectInstance(TreeItem item) {
// for (Port port : rule.getPortSet ()) {
- // fPorts.setSelection()
+ // fPorts.setSelection()
// }
- currentIS = (InstanceSpecification)item.getData();
+ currentIS = (InstanceSpecification) item.getData();
fLabel.setText(currentIS.getName());
fAlloc.setEnabled(true);
InstanceSpecification nodeOrThread = AllocUtils.getNodeOrThread(currentIS);
- for(int i = 0; i < nodeOrThreadList.size(); i++) {
- if(nodeOrThreadList.get(i) == nodeOrThread) {
+ for (int i = 0; i < nodeOrThreadList.size(); i++) {
+ if (nodeOrThreadList.get(i) == nodeOrThread) {
fAlloc.select(i);
}
}
@@ -260,45 +262,45 @@ public class AllocationDialog extends SelectionStatusDialog {
InstanceSpecification oldNode = AllocUtils.getNodeOrThread(is);
InstanceSpecification newNode = nodeOrThreadList.get(index);
- if(oldNode == newNode) {
+ if (oldNode == newNode) {
return;
}
// add or update
- if(oldNode == null) {
-
- AllocUtils.allocate(is, newNode);
-
-
+ if (oldNode == null) {
+
+ AllocUtils.allocate(is, newNode);
+
+
} else {
AllocUtils.updateAllocation(is, oldNode, newNode);
}
}
void getAllNodesOrThreads(Package pkg, EList<InstanceSpecification> nodeList) {
- for(Element el : pkg.getMembers()) {
- if(el instanceof Package) {
- if(!visitedPackages.contains(el)) {
- visitedPackages.add((Package)el);
- getAllNodesOrThreads((Package)el, nodeList);
+ for (Element el : pkg.getMembers()) {
+ if (el instanceof Package) {
+ if (!visitedPackages.contains(el)) {
+ visitedPackages.add((Package) el);
+ getAllNodesOrThreads((Package) el, nodeList);
}
- }
- else if(el instanceof InstanceSpecification) {
- Classifier cl = DepUtils.getClassifier((InstanceSpecification)el);
- if(cl != null) {
- if((cl instanceof Class) ) {
+ }
+ else if (el instanceof InstanceSpecification) {
+ Classifier cl = DepUtils.getClassifier((InstanceSpecification) el);
+ if (cl != null) {
+ if ((cl instanceof Class)) {
// check that instances are not part of a deployment plan
- // [TODO:] check that owner of instance is a platform definition
- if(!StUtils.isApplied(el.getOwner(), DeploymentPlan.class)) {
- nodeList.add((InstanceSpecification)el);
+ // [TODO:] check that owner of instance is a platform definition
+ if (!StUtils.isApplied(el.getOwner(), DeploymentPlan.class)) {
+ nodeList.add((InstanceSpecification) el);
}
}
}
}
}
}
-
-
+
+
private EList<Package> visitedPackages;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AttributeLabelProvider.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AttributeLabelProvider.java
index 2e6f8d92ef0..299a5122656 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AttributeLabelProvider.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/AttributeLabelProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,13 +17,14 @@ import org.eclipse.uml2.uml.Type;
public class AttributeLabelProvider extends LabelProvider {
+ @Override
public String getText(Object element) {
- if(element instanceof Property) {
- Property p = (Property)element;
+ if (element instanceof Property) {
+ Property p = (Property) element;
Type type = p.getType();
return p.getClass_().getName() + "." + p.getName() + ((type != null) ?
- " : " + type.getQualifiedName() :
- "");
+ " : " + type.getQualifiedName() :
+ "");
}
else {
return "invalid";
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/ConfigureInstanceDialog.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/ConfigureInstanceDialog.java
index 510bb0e8f15..f55c69f220f 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/ConfigureInstanceDialog.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/ConfigureInstanceDialog.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,7 +28,6 @@ import org.eclipse.papyrus.robotml.deployment.DepPlanSync;
import org.eclipse.papyrus.robotml.deployment.DepPlanUtils;
import org.eclipse.papyrus.robotml.deployment.DepUtils;
import org.eclipse.papyrus.robotml.deployment.DialogUtils;
-import org.eclipse.papyrus.robotml.deployment.StUtils;
import org.eclipse.papyrus.robotml.deployment.Utils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
@@ -63,10 +62,10 @@ import org.eclipse.uml2.uml.ValueSpecification;
/**
* Select container rules, either from a list of globally defined rules or from
* local rules which may be created "on the fly" by this dialog.
- *
+ *
* TODO: extend rule application to instances (problematic, since rules
* transformation is done on type level)
- *
+ *
* @author ansgar
*/
public class ConfigureInstanceDialog extends SelectionStatusDialog {
@@ -130,10 +129,10 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
m_feature = feature;
m_model = Utils.getUserModel();
m_instance = null;
- if(feature instanceof Property) {
- Type type = ((Property)feature).getType();
- if(type instanceof Class) {
- m_component = (Class)type;
+ if (feature instanceof Property) {
+ Type type = ((Property) feature).getType();
+ if (type instanceof Class) {
+ m_component = (Class) type;
return checkAndGetInstances();
}
}
@@ -143,7 +142,7 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
/**
* retrieve the instance list. Returns false, if no deploymentplan could be found.
- *
+ *
* @return
*/
public boolean checkAndGetInstances() {
@@ -151,24 +150,24 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
m_instanceList = new BasicEList<InstanceSpecification>();
getInstances(m_instanceList);
- if(m_instanceList.size() == 0) {
+ if (m_instanceList.size() == 0) {
Shell shell = new Shell();
- if(DepPlanUtils.getAllDepPlans(m_model).size() == 0) {
+ if (DepPlanUtils.getAllDepPlans(m_model).size() == 0) {
MessageDialog.openInformation(shell, "Instance configuration",
- "No deployment plans are defined. Create a deployment plan before configuring instances");
+ "No deployment plans are defined. Create a deployment plan before configuring instances");
return false;
}
- else if(MessageDialog.openConfirm(shell, "Instance configuration",
- "The list of available instances is empty. Synchronize deployment plans?")) {
+ else if (MessageDialog.openConfirm(shell, "Instance configuration",
+ "The list of available instances is empty. Synchronize deployment plans?")) {
DepPlanSync.syncAllDepPlans(m_model);
visitedPackages = new BasicEList<Package>();
getInstances(m_instanceList);
- if(m_instanceList.size() == 0) {
+ if (m_instanceList.size() == 0) {
MessageDialog.openInformation(shell, "Instance configuration",
- "There are still no instances available\n" +
- "Check whether you created already a deployment plan for your system." +
- "Check as well, if the parts in your a composite use \"composite\" as aggregation kind\n." +
- "(Results of deployment plan synchronizations will be unrolled)");
+ "There are still no instances available\n" +
+ "Check whether you created already a deployment plan for your system." +
+ "Check as well, if the parts in your a composite use \"composite\" as aggregation kind\n." +
+ "(Results of deployment plan synchronizations will be unrolled)");
return false;
}
}
@@ -179,12 +178,14 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
/**
* @see SelectionStatusDialog#computeResult()
*/
+ @Override
protected void computeResult() {
// nothing to do
}
+ @Override
public Control createDialogArea(Composite parent) {
- Composite contents = (Composite)super.createDialogArea(parent);
+ Composite contents = (Composite) super.createDialogArea(parent);
// (parent, "Container rules", "Avail. extensions/interceptors");
createInstanceSelectionGroup(contents);
@@ -229,27 +230,33 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
fInstanceList.setLabelProvider(new InstanceLabelProvider());
fInstanceList.setContentProvider(new ITreeContentProvider() {
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
+ @Override
public void dispose() {
}
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
+ @Override
public Object getParent(Object element) {
return null;
}
+ @Override
public Object[] getElements(Object inputElement) {
- return (Object[])inputElement;
+ return (Object[]) inputElement;
}
+ @Override
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof InstanceSpecification) {
- return DepUtils.getContainedInstances((InstanceSpecification)parentElement).toArray();
+ if (parentElement instanceof InstanceSpecification) {
+ return DepUtils.getContainedInstances((InstanceSpecification) parentElement).toArray();
}
return new Object[0];
}
@@ -258,14 +265,15 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
fInstanceList.setInput(m_instanceList.toArray());
fInstanceList.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = fInstanceList.getSelection();
- if(selection instanceof StructuredSelection) {
- Object[] selected = ((StructuredSelection)selection)
- .toArray();
- if((selected.length == 1)
- && (selected[0] instanceof InstanceSpecification)) {
- m_instance = (InstanceSpecification)selected[0];
+ if (selection instanceof StructuredSelection) {
+ Object[] selected = ((StructuredSelection) selection)
+ .toArray();
+ if ((selected.length == 1)
+ && (selected[0] instanceof InstanceSpecification)) {
+ m_instance = (InstanceSpecification) selected[0];
Classifier cl = DepUtils.getClassifier(m_instance);
fPropertyList.setInput(getConfigAttributes(cl).toArray());
selectProperty(m_currentAttribute);
@@ -273,9 +281,9 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
}
}
});
- if(m_instance != null) {
+ if (m_instance != null) {
int index = m_instanceList.indexOf(m_instance);
- if(index != -1) {
+ if (index != -1) {
TreeItem treeItem = fInstanceList.getTree().getItem(index);
fInstanceList.getTree().setSelection(treeItem);
}
@@ -301,20 +309,21 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
fPropertyList.setContentProvider(new ArrayContentProvider());
fPropertyList.setInput(getConfigAttributes(m_component).toArray());
fPropertyList
- .addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = fPropertyList.getSelection();
- if(selection instanceof StructuredSelection) {
- Object[] selected = ((StructuredSelection)selection)
- .toArray();
- if((selected.length == 1)
- && (selected[0] instanceof Property)) {
- selectProperty((Property)selected[0]);
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = fPropertyList.getSelection();
+ if (selection instanceof StructuredSelection) {
+ Object[] selected = ((StructuredSelection) selection)
+ .toArray();
+ if ((selected.length == 1)
+ && (selected[0] instanceof Property)) {
+ selectProperty((Property) selected[0]);
+ }
}
}
- }
- });
+ });
fValueLabel = new Label(instanceConfigurationGroup, SWT.NONE);
@@ -331,39 +340,41 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
fValue.setLayoutData(span2);
fValue.addFocusListener(new FocusListener() {
+ @Override
public void focusLost(FocusEvent e) {
// store value, once focus is lost (different element is
// selected)
String valueStr = fValue.getText();
Slot valueSlot = null;
- if(m_instance == null) {
+ if (m_instance == null) {
// no instance has been selected
// (field should be inactive, if not selected)
return;
}
- for(Slot slot : m_instance.getSlots()) {
- if(slot.getDefiningFeature() == m_currentAttribute) {
+ for (Slot slot : m_instance.getSlots()) {
+ if (slot.getDefiningFeature() == m_currentAttribute) {
valueSlot = slot;
}
}
- if(valueSlot == null) {
+ if (valueSlot == null) {
// slot does not exist yet, create
valueSlot = DepCreation.createSlotForConfigProp(m_instance,
- m_currentAttribute);
+ m_currentAttribute);
}
- for(ValueSpecification value : valueSlot.getValues()) {
- if(value instanceof LiteralString) {
- ((LiteralString)value).setValue(valueStr);
- } else if(value instanceof LiteralInteger) {
- ((LiteralInteger)value).setValue(Integer
- .parseInt(valueStr));
- } else if(value instanceof LiteralBoolean) {
- ((LiteralBoolean)value).setValue(Boolean
- .parseBoolean(valueStr));
+ for (ValueSpecification value : valueSlot.getValues()) {
+ if (value instanceof LiteralString) {
+ ((LiteralString) value).setValue(valueStr);
+ } else if (value instanceof LiteralInteger) {
+ ((LiteralInteger) value).setValue(Integer
+ .parseInt(valueStr));
+ } else if (value instanceof LiteralBoolean) {
+ ((LiteralBoolean) value).setValue(Boolean
+ .parseBoolean(valueStr));
}
}
}
+ @Override
public void focusGained(FocusEvent e) {
}
});
@@ -380,7 +391,7 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
span2.heightHint = 80;
fDescription = new Text(instanceConfigurationGroup, SWT.NONE | SWT.WRAP
- | SWT.V_SCROLL | SWT.READ_ONLY);
+ | SWT.V_SCROLL | SWT.READ_ONLY);
fDescription.setLayoutData(span2);
// createMessageArea (ruleInfoGroup);
instanceConfigurationGroup.pack();
@@ -389,33 +400,33 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
/**
* Select a rule, i.e. update the visual representation from the rule
- *
+ *
* @param rule
*/
protected void selectProperty(Property attribute) {
m_currentAttribute = attribute;
- if((attribute == null) || (fValue == null)) {
+ if ((attribute == null) || (fValue == null)) {
setEnabled(false);
return;
}
setEnabled(true);
fDescription.setText(Description.getDescription(attribute, "not available"));
fValueLabel.setText(getValueLabel(attribute));
- for(Slot slot : m_instance.getSlots()) {
- if(slot.getDefiningFeature() == m_currentAttribute) {
- for(ValueSpecification value : slot.getValues()) {
- if(value instanceof LiteralInteger) {
- Integer intVal = ((LiteralInteger)value).getValue();
+ for (Slot slot : m_instance.getSlots()) {
+ if (slot.getDefiningFeature() == m_currentAttribute) {
+ for (ValueSpecification value : slot.getValues()) {
+ if (value instanceof LiteralInteger) {
+ Integer intVal = ((LiteralInteger) value).getValue();
fValue.setText(intVal.toString());
return;
}
- else if(value instanceof LiteralBoolean) {
- Boolean boolVal = ((LiteralBoolean)value).booleanValue();
+ else if (value instanceof LiteralBoolean) {
+ Boolean boolVal = ((LiteralBoolean) value).booleanValue();
fValue.setText(boolVal.toString());
return;
}
- else if(value instanceof LiteralString) {
- fValue.setText(((LiteralString)value).getValue());
+ else if (value instanceof LiteralString) {
+ fValue.setText(((LiteralString) value).getValue());
return;
}
}
@@ -429,7 +440,7 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
fDescription.setEnabled(enabled);
fValueLabel.setEnabled(enabled);
fValue.setEnabled(enabled);
- if(!enabled) {
+ if (!enabled) {
fValue.setText("");
fDescription.setText("");
fValueLabel.setText(valueLabelPrefix);
@@ -438,7 +449,7 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
private String getValueLabel(Property attribute) {
String label = valueLabelPrefix;
- if(attribute.getDefault() != null) {
+ if (attribute.getDefault() != null) {
return label + " (Default = " + attribute.getDefault() + ")";
}
return label;
@@ -449,33 +460,33 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
void getInstances(EList<InstanceSpecification> instanceList) {
Package deploymentPlans = Utils.getRoot(m_model, "DeploymentPlans");
String featureCandidateName = null;
- for(PackageableElement deploymentPlan : deploymentPlans
- .getPackagedElements()) {
- if(deploymentPlan instanceof Package) {
- for(PackageableElement instance : ((Package)deploymentPlan).getPackagedElements()) {
- if(instance instanceof InstanceSpecification) {
- InstanceSpecification candidate = (InstanceSpecification)instance;
- if(m_feature instanceof Property) {
- for(Slot slot : candidate.getSlots()) {
- if(slot.getDefiningFeature() == m_feature) {
+ for (PackageableElement deploymentPlan : deploymentPlans
+ .getPackagedElements()) {
+ if (deploymentPlan instanceof Package) {
+ for (PackageableElement instance : ((Package) deploymentPlan).getPackagedElements()) {
+ if (instance instanceof InstanceSpecification) {
+ InstanceSpecification candidate = (InstanceSpecification) instance;
+ if (m_feature instanceof Property) {
+ for (Slot slot : candidate.getSlots()) {
+ if (slot.getDefiningFeature() == m_feature) {
instanceList
- .add(DepUtils.getInstance(slot));
+ .add(DepUtils.getInstance(slot));
}
}
- } else if(m_feature instanceof Connector) {
+ } else if (m_feature instanceof Connector) {
// Connector cannot be found directly, since there is no slot in containing composite (defining
// feature is a structural-feature, not a feature): find via name.
Element owner = m_feature.getOwner();
- if(DepUtils.getImplementation(candidate) == owner) {
+ if (DepUtils.getImplementation(candidate) == owner) {
// instance is for owner of feature: examine name
featureCandidateName = candidate.getName() + "." + m_feature.getName();
}
- else if(featureCandidateName != null) {
- if(featureCandidateName.equals(candidate.getName())) {
+ else if (featureCandidateName != null) {
+ if (featureCandidateName.equals(candidate.getName())) {
instanceList.add(candidate);
}
}
- } else if(DepUtils.getImplementation(candidate) == m_component) {
+ } else if (DepUtils.getImplementation(candidate) == m_component) {
instanceList.add(candidate);
}
}
@@ -486,23 +497,23 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
private EList<Property> getConfigAttributes(Classifier component) {
EList<Property> list = new BasicEList<Property>();
-// // add properties of component
-// list.addAll(ConfigUtils.getConfigAttributes(component));
-// // now add properties of container rules
-// // TODO: is it possible that multiple container extensions of the same
-// // type exist, and if yes, how do we configure these?
-// if(component instanceof Class) {
-// EList<ContainerRule> rules = Utils.getRules((Class)component);
-// if(rules != null) {
-// for(ContainerRule aRule : rules) {
-// // (many, in case of a composite rule)
-// try {
-// list.addAll(ConfigUtils.getConfigAttributes(aRule));
-// } catch (TransformationException e) {
-// }
-// }
-// }
-// }
+ // // add properties of component
+ // list.addAll(ConfigUtils.getConfigAttributes(component));
+ // // now add properties of container rules
+ // // TODO: is it possible that multiple container extensions of the same
+ // // type exist, and if yes, how do we configure these?
+ // if(component instanceof Class) {
+ // EList<ContainerRule> rules = Utils.getRules((Class)component);
+ // if(rules != null) {
+ // for(ContainerRule aRule : rules) {
+ // // (many, in case of a composite rule)
+ // try {
+ // list.addAll(ConfigUtils.getConfigAttributes(aRule));
+ // } catch (TransformationException e) {
+ // }
+ // }
+ // }
+ // }
return list;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/Description.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/Description.java
index f3f5e8bb262..17491fa7811 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/Description.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/Description.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@ public class Description {
* if we search for a description of a class)
*
* @param element
- * the element for which to obtain a description
+ * the element for which to obtain a description
* @return the description of the element
*/
public static String getDescription(Element element) {
@@ -32,9 +32,11 @@ public class Description {
/**
* Convenience function: Return a description of an element. It will delegate to
* default getDescription, but returns a user specified text, if a description is
- * not available in the model.
+ * not available in the model.
+ *
* @param element
- * @param unavailable The text that is return, if no description is available
+ * @param unavailable
+ * The text that is return, if no description is available
* @return
*/
public static String getDescription(Element element, String unavailable) {
@@ -46,14 +48,17 @@ public class Description {
return unavailable;
}
}
+
/**
* Return a description or implementation description of an element, i.e. the
* first owned comment that annotated the passed element
- *
- * @param the owner of the comment
- * the element for which to obtain a description
- * @param annotated element
- * the element for which to obtain a description
+ *
+ * @param the
+ * owner of the comment
+ * the element for which to obtain a description
+ * @param annotated
+ * element
+ * the element for which to obtain a description
* @return the description of the element
*/
public static String getDescription(Element owner, Element annotatedElement) {
@@ -62,10 +67,10 @@ public class Description {
}
// loop over all owned comments, check those that begins with
// "description"
- for(Comment comment : owner.getOwnedComments()) {
+ for (Comment comment : owner.getOwnedComments()) {
// identify "right" comment via annotated element ref (to a specific
// class of the BasicCalls library) instead?
- if(comment.getAnnotatedElements().contains(annotatedElement)) {
+ if (comment.getAnnotatedElements().contains(annotatedElement)) {
return comment.getBody();
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/InstanceLabelProvider.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/InstanceLabelProvider.java
index 31ea24cbe8c..75f6b16daea 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/InstanceLabelProvider.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/dialog/InstanceLabelProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,15 +17,16 @@ import org.eclipse.uml2.uml.NamedElement;
public class InstanceLabelProvider extends LabelProvider {
+ @Override
public String getText(Object element) {
- if (element instanceof NamedElement) {
- String instanceName = ((NamedElement)element).getName();
+ if (element instanceof NamedElement) {
+ String instanceName = ((NamedElement) element).getName();
Element owner = ((Element) element).getOwner();
if (owner instanceof NamedElement) {
return "Plan " + ((NamedElement) owner).getName() + ": " + instanceName;
}
else {
- return instanceName;
+ return instanceName;
}
}
else {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/AllocateHandler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/AllocateHandler.java
index 164cebc41cc..a3e028f2e54 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/AllocateHandler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/AllocateHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
package org.eclipse.papyrus.robotml.deployment.handlers;
import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -35,11 +34,12 @@ public class AllocateHandler extends CmdHandler {
/**
* {@inheritDoc}
*/
+ @Override
public boolean isEnabled() {
updateSelectedEObject();
EObject selectedObj = getSelectedEObject();
- if(selectedObj instanceof Package) {
- return (StUtils.isApplied((Package)selectedObj, DeploymentPlan.class));
+ if (selectedObj instanceof Package) {
+ return (StUtils.isApplied((Package) selectedObj, DeploymentPlan.class));
}
return false;
}
@@ -47,18 +47,19 @@ public class AllocateHandler extends CmdHandler {
/**
* {@inheritDoc}
*/
+ @Override
public Object execute(ExecutionEvent event) {
- if(!(getSelectedEObject() instanceof Package)) {
+ if (!(getSelectedEObject() instanceof Package)) {
return null;
}
- final Package cdp = (Package)getSelectedEObject();
+ final Package cdp = (Package) getSelectedEObject();
final Shell shell = new Shell();
// com.cea.ec3m.vsl.ParseVSL.test();
- if(DepUtils.getMainInstance(cdp) == null) {
+ if (DepUtils.getMainInstance(cdp) == null) {
MessageDialog.openInformation(shell, "Error",
- "Deployment plan has no main instance (check stereotype attribute mainInstance)");
+ "Deployment plan has no main instance (check stereotype attribute mainInstance)");
return null;
}
@@ -70,12 +71,13 @@ public class AllocateHandler extends CmdHandler {
// howto select? which? (and howto add/remove?) - Std - dialog is good?
CommandSupport.exec("Instance allocation", new RunnableWithResult() {
+ @Override
public CommandResult run() {
AllocationDialog allocDialog =
- new AllocationDialog(shell, cdp);
+ new AllocationDialog(shell, cdp);
allocDialog.setTitle("Allocate instances");
allocDialog.open();
- if(allocDialog.getReturnCode() == IDialogConstants.OK_ID) {
+ if (allocDialog.getReturnCode() == IDialogConstants.OK_ID) {
return CommandResult.newOKCommandResult();
}
else {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CmdHandler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CmdHandler.java
index 9ffd9f917eb..ee3ac7327b7 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CmdHandler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CmdHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Vector;
-
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.runtime.IAdaptable;
@@ -46,15 +45,16 @@ public class CmdHandler extends AbstractHandler implements IObjectActionDelegate
/**
* {@inheritDoc}
*/
+ @Override
public Object execute(ExecutionEvent event) {
Display current = Display.getCurrent();
- if(current == null) {
+ if (current == null) {
current = Display.getDefault();
}
Shell shell = current.getActiveShell();
- if(shell == null) {
+ if (shell == null) {
// Activator.log.error("impossible to find a shell to open the message dialog", null);
}
@@ -64,42 +64,42 @@ public class CmdHandler extends AbstractHandler implements IObjectActionDelegate
/**
* Convert each selected elements from the explorator menu, or modeling view
* to an EObject and add it to a list
- *
+ *
* @return list of EObject
*/
public void updateSelectedEObject() {
Vector<EObject> currentSelectedEObjects = new Vector<EObject>();
// Retrieve selected elements
- IStructuredSelection selection = (IStructuredSelection)PlatformUI
+ IStructuredSelection selection = (IStructuredSelection) PlatformUI
.getWorkbench().getActiveWorkbenchWindow()
.getSelectionService().getSelection();
- Iterator<?> eltIt = (Iterator<?>)selection.iterator();
+ Iterator<?> eltIt = selection.iterator();
- while(eltIt.hasNext()) {
+ while (eltIt.hasNext()) {
Object currentObject = eltIt.next();
// If the object is an edit part, try to get semantic bridge
- if(currentObject instanceof GraphicalEditPart) {
- GraphicalEditPart editPart = (GraphicalEditPart)currentObject;
- if(editPart.getModel() instanceof View) {
- View view = (View)editPart.getModel();
- if(view.getElement() instanceof Element) {
- currentObject = (Element)view.getElement();
+ if (currentObject instanceof GraphicalEditPart) {
+ GraphicalEditPart editPart = (GraphicalEditPart) currentObject;
+ if (editPart.getModel() instanceof View) {
+ View view = (View) editPart.getModel();
+ if (view.getElement() instanceof Element) {
+ currentObject = view.getElement();
}
}
}
// check whether part of model explorer
- if(currentObject instanceof IAdaptable) {
+ if (currentObject instanceof IAdaptable) {
// modisco ModelElementItem supports IAdaptable (cleaner than cast / dependency with modisco)
- currentObject = ((IAdaptable)currentObject).getAdapter(EObject.class);
+ currentObject = ((IAdaptable) currentObject).getAdapter(EObject.class);
}
// If element is a UML Element
- if(currentObject instanceof Element) {
- currentSelectedEObjects.add((EObject)currentObject);
+ if (currentObject instanceof Element) {
+ currentSelectedEObjects.add((EObject) currentObject);
}
}
@@ -109,11 +109,11 @@ public class CmdHandler extends AbstractHandler implements IObjectActionDelegate
/**
* Convert each selected elements from the explorer menu, or modeling view
* to an EObject and add it to a list
- *
+ *
* @return list of EObject
*/
public EObject getSelectedEObject() {
- if(selectedEObjects.size() > 0) {
+ if (selectedEObjects.size() > 0) {
return selectedEObjects.get(0);
}
return null;
@@ -125,15 +125,18 @@ public class CmdHandler extends AbstractHandler implements IObjectActionDelegate
private List<EObject> selectedEObjects;
+ @Override
public void run(IAction action) {
- // method from action-delegate
+ // method from action-delegate
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
- // method from action-delegate
+ // method from action-delegate
updateSelectedEObject(); // required??
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
// TODO Auto-generated method stub
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/ConfigureInstanceHandler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/ConfigureInstanceHandler.java
index d3828ec55ae..e413cef8975 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/ConfigureInstanceHandler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/ConfigureInstanceHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
package org.eclipse.papyrus.robotml.deployment.handlers;
import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -40,10 +39,10 @@ public class ConfigureInstanceHandler extends CmdHandler {
public boolean isEnabled() {
updateSelectedEObject();
EObject selectedObj = getSelectedEObject();
- if((selectedObj instanceof Class) ||
- (selectedObj instanceof Connector) ||
- (selectedObj instanceof Property) ||
- (selectedObj instanceof InstanceSpecification)) {
+ if ((selectedObj instanceof Class) ||
+ (selectedObj instanceof Connector) ||
+ (selectedObj instanceof Property) ||
+ (selectedObj instanceof InstanceSpecification)) {
return true;
}
return false;
@@ -54,50 +53,53 @@ public class ConfigureInstanceHandler extends CmdHandler {
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public Object execute(ExecutionEvent event) {
- if(!(getSelectedEObject() instanceof NamedElement)) {
+ if (!(getSelectedEObject() instanceof NamedElement)) {
return null;
}
- final NamedElement element = (NamedElement)getSelectedEObject();
+ final NamedElement element = (NamedElement) getSelectedEObject();
final Shell shell = new Shell();
// 1. select possible connectors according to port types
// (only show compatible connectors check-box?)
// 2. select implementation group according to connector type
- if(element instanceof Class) {
+ if (element instanceof Class) {
// container dialog: either extension, rule or interceptor
// howto select? which? (and howto add/remove?) - Std - dialog is good?
CommandSupport.exec("Configure associated component instance", new RunnableWithResult() {
+ @Override
public CommandResult run() {
ConfigureInstanceDialog configureInstanceDialog =
- new ConfigureInstanceDialog(shell);
- if (configureInstanceDialog.init((Class)element)) {
+ new ConfigureInstanceDialog(shell);
+ if (configureInstanceDialog.init((Class) element)) {
configureInstanceDialog.setTitle("Configure instance");
configureInstanceDialog.setMessage("Configure instance for component " + element.getName());
configureInstanceDialog.open();
- if(configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) {
+ if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) {
return CommandResult.newOKCommandResult();
}
}
return CommandResult.newCancelledCommandResult();
}
});
- } else if(element instanceof Feature) {
+ } else if (element instanceof Feature) {
// container dialog: either extension, rule or interceptor
// howto select? which? (and howto add/remove?) - Std - dialog is good?
CommandSupport.exec("Configure associated instance", new RunnableWithResult() {
+ @Override
public CommandResult run() {
ConfigureInstanceDialog configureInstanceDialog =
- new ConfigureInstanceDialog(shell);
- if (configureInstanceDialog.init((Feature)element)) {
+ new ConfigureInstanceDialog(shell);
+ if (configureInstanceDialog.init((Feature) element)) {
configureInstanceDialog.setTitle("Configure instance");
configureInstanceDialog.setMessage("Configure instance for property/connector " + element.getName());
configureInstanceDialog.open();
- if(configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) {
+ if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) {
return CommandResult.newOKCommandResult();
}
}
@@ -105,18 +107,19 @@ public class ConfigureInstanceHandler extends CmdHandler {
}
});
-
- } else if(element instanceof InstanceSpecification) {
+
+ } else if (element instanceof InstanceSpecification) {
CommandSupport.exec("Configure instance", new RunnableWithResult() {
+ @Override
public CommandResult run() {
ConfigureInstanceDialog configureInstanceDialog =
- new ConfigureInstanceDialog(shell);
- if (configureInstanceDialog.init((InstanceSpecification)element)) {
+ new ConfigureInstanceDialog(shell);
+ if (configureInstanceDialog.init((InstanceSpecification) element)) {
configureInstanceDialog.setMessage("Configure instance " + element.getName());
configureInstanceDialog.open();
- if(configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) {
+ if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) {
return CommandResult.newOKCommandResult();
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreateDepPlanHandler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreateDepPlanHandler.java
index 28299bbead0..7f9a0e8b4a6 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreateDepPlanHandler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreateDepPlanHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@
package org.eclipse.papyrus.robotml.deployment.handlers;
import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -47,32 +46,35 @@ public class CreateDepPlanHandler extends CmdHandler {
public boolean isEnabled() {
updateSelectedEObject();
EObject selectedObj = getSelectedEObject();
- if((selectedObj instanceof Class) && Utils.isCompImpl((Class)selectedObj) && isEnvironment((Class)selectedObj)) {
+ if ((selectedObj instanceof Class) && Utils.isCompImpl((Class) selectedObj) && isEnvironment((Class) selectedObj)) {
return true;
}
return false;
}
- private boolean isEnvironment(Class elt){
+ private boolean isEnvironment(Class elt) {
Environment environment = UMLUtil.getStereotypeApplication(elt, Environment.class);
- if (environment != null){
+ if (environment != null) {
return true;
}
-
+
return false;
-
+
}
+
/**
* {@inheritDoc}
*/
+ @Override
public Object execute(ExecutionEvent event) {
- if(!(getSelectedEObject() instanceof Class)) {
+ if (!(getSelectedEObject() instanceof Class)) {
return null;
}
- final Class selectedComposite = (Class)getSelectedEObject();
+ final Class selectedComposite = (Class) getSelectedEObject();
CommandSupport.exec("Create deployment plans", new Runnable() {
+ @Override
public void run() {
// execute with transaction support
depPlans = DepPlanUtils.getDepPlanRoot(selectedComposite);
@@ -81,35 +83,36 @@ public class CreateDepPlanHandler extends CmdHandler {
try {
String name = selectedComposite.getName() + DepPlanPostfix;
- if(depPlans.getMember(name) != null) {
+ if (depPlans.getMember(name) != null) {
Shell shell = new Shell();
- String dialogButtonLabels[] = new String[]{
- "Cancel",
- "Synchronize",
- "create new (auto number name)"
+ String dialogButtonLabels[] = new String[] {
+ "Cancel",
+ "Synchronize",
+ "create new (auto number name)"
};
MessageDialog dialog = new MessageDialog(shell, "What should I do?", null,
- "Deployment plan with name \"" + name + "\" exists already. You can always synchronize an " +
- "existing deployment plan via the context menu \"Synchronize derived elements\"",
- MessageDialog.QUESTION, dialogButtonLabels, 0);
+ "Deployment plan with name \"" + name + "\" exists already. You can always synchronize an " +
+ "existing deployment plan via the context menu \"Synchronize derived elements\"",
+ MessageDialog.QUESTION, dialogButtonLabels, 0);
int result = dialog.open();
- if(result == 0) {
+ if (result == 0) {
return null;
}
- else if(result == 1) {
+ else if (result == 1) {
NamedElement existing = depPlans.getMember(name);
- if(existing instanceof Package) {
- DepPlanSync.syncDepPlan((Package)existing);
+ if (existing instanceof Package) {
+ DepPlanSync.syncDepPlan((Package) existing);
}
else {
MessageDialog.openError(shell, "Cannot synchronize", "Element with name \"" + name + "\" exists, but is not a package");
}
}
else {
- for(int i = 2;; i++) {
+ for (int i = 2;; i++) {
name = selectedComposite.getName() + DepPlanPostfix + i;
- if(depPlans.getMember(name) == null)
+ if (depPlans.getMember(name) == null) {
break;
+ }
}
}
@@ -118,23 +121,24 @@ public class CreateDepPlanHandler extends CmdHandler {
CommandSupport.exec("Create deployment plan", new RunnableWithResult() {
+ @Override
public CommandResult run() {
Package cdp = depPlans.createNestedPackage(depPlanName);
Stereotype st = StUtils.apply(cdp, DeploymentPlan.class);
- if(st == null) {
+ if (st == null) {
MessageDialog.openInformation(new Shell(), "Cannot create deployment plan",
- "Application of stereotype \"RobotML::DeploymentPlan\" failed. Check, if RobotML profile is applied");
+ "Application of stereotype \"RobotML::DeploymentPlan\" failed. Check, if RobotML profile is applied");
return CommandResult.newErrorCommandResult("cannot create deployment plan");
}
try {
InstanceSpecification newRootIS =
- DepCreation.createDepPlan(cdp, selectedComposite, "mainInstance", true);
+ DepCreation.createDepPlan(cdp, selectedComposite, "mainInstance", true);
DepCreation.initAutoValues(newRootIS);
return CommandResult.newOKCommandResult();
}
catch (TransformationException e) {
MessageDialog.openInformation(new Shell(), "Error during deployment plan creation",
- e.getMessage());
+ e.getMessage());
return CommandResult.newErrorCommandResult(e.getMessage());
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreatePlatformHandler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreatePlatformHandler.java
index 3587d92f6ed..3373fb6679b 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreatePlatformHandler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/handlers/CreatePlatformHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@
package org.eclipse.papyrus.robotml.deployment.handlers;
import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.papyrus.RobotML.Platform;
@@ -36,32 +35,35 @@ public class CreatePlatformHandler extends CmdHandler {
public boolean isEnabled() {
updateSelectedEObject();
EObject selectedObj = getSelectedEObject();
- if(selectedObj instanceof Class && isPlatform((Class)selectedObj)) {
+ if (selectedObj instanceof Class && isPlatform((Class) selectedObj)) {
return true;
}
return false;
}
- private boolean isPlatform(Class elt){
- Platform platform = UMLUtil.getStereotypeApplication((Class)elt, Platform.class);
- if (platform != null){
+ private boolean isPlatform(Class elt) {
+ Platform platform = UMLUtil.getStereotypeApplication(elt, Platform.class);
+ if (platform != null) {
return true;
}
return false;
-
-
+
+
}
+
/**
* {@inheritDoc}
*/
+ @Override
public Object execute(ExecutionEvent event) {
- if(!(getSelectedEObject() instanceof Class)) {
+ if (!(getSelectedEObject() instanceof Class)) {
return null;
}
- final Class selectedComposite = (Class)getSelectedEObject();
+ final Class selectedComposite = (Class) getSelectedEObject();
CommandSupport.exec("Create platform model", new Runnable() {
+ @Override
public void run() {
// execute with transaction support
platform = Utils.getRoot(selectedComposite, "PlatformModel");
@@ -71,13 +73,14 @@ public class CreatePlatformHandler extends CmdHandler {
final String newPlatform = selectedComposite.getName() + "Platform";
try {
- if(platform.getMember(newPlatform) != null) {
+ if (platform.getMember(newPlatform) != null) {
Shell shell = new Shell();
MessageDialog.openInformation(shell, "Error",
- "Platform definition \"" + newPlatform + "\" exists already");
+ "Platform definition \"" + newPlatform + "\" exists already");
} else {
CommandSupport.exec("Create platform definition", new Runnable() {
+ @Override
public void run() {
Package platformPkg = platform.createNestedPackage(newPlatform);
try {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/listener/CopyListener.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/listener/CopyListener.java
index 70926fbcf3b..c75b3c0c38c 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/listener/CopyListener.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.deployment/src/org/eclipse/papyrus/robotml/deployment/listener/CopyListener.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import org.eclipse.papyrus.robotml.deployment.Copy;
/**
* Interface for listeners that are notified for the addition of a classifier
* via copy
- *
+ *
* @see com.cea.ec3m.gentools.core.transformations.Copy
*/
public interface CopyListener {
@@ -27,9 +27,9 @@ public interface CopyListener {
* indicated object should not be copied. If it returns a different object
* than the passed EObject, this object is used (the returned object of the
* first listener is used).
- *
+ *
* @param sourceEObj
- * the added classifier
+ * the added classifier
*/
public EObject copyEObject(Copy copy, EObject sourceEObj);
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/Activator.java
index 9fd9541672f..6f8fc23ce00 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,7 +19,7 @@ import org.osgi.framework.BundleContext;
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
-
+
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.papyrus.robotml.diagram.common"; //$NON-NLS-1$
@@ -60,7 +60,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/commands/CreateRobotmlModelCommand.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/commands/CreateRobotmlModelCommand.java
index 103b58a3d4d..35c550fd4e7 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/commands/CreateRobotmlModelCommand.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/commands/CreateRobotmlModelCommand.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,14 +29,14 @@ public class CreateRobotmlModelCommand extends ModelCreationCommandBase {
public static final String ROBOTML_PROFILE_URI = PROFILES_PATHMAP + "RobotMLProfile.profile.uml"; //$NON-NLS-1$
- //public static final String FCM_PROFILE_URI = "pathmap://FCM_PROFILES/FCM.profile.uml";
+ // public static final String FCM_PROFILE_URI = "pathmap://FCM_PROFILES/FCM.profile.uml";
//public static final String ROBOTML_PROFILE_URI = PROFILES_PATHMAP + "RobotML.profile.uml"; //$NON-NLS-1$
/**
* @see org.eclipse.papyrus.core.extension.commands.ModelCreationCommandBase#createRootElement()
- *
+ *
* @return
*/
@@ -47,27 +47,27 @@ public class CreateRobotmlModelCommand extends ModelCreationCommandBase {
/**
* @see org.eclipse.papyrus.core.extension.commands.ModelCreationCommandBase#initializeModel(org.eclipse.emf.ecore.EObject)
- *
+ *
* @param owner
*/
@Override
protected void initializeModel(EObject owner) {
super.initializeModel(owner);
- ((org.eclipse.uml2.uml.Package)owner).setName(getModelName());
+ ((org.eclipse.uml2.uml.Package) owner).setName(getModelName());
// Retrieve robotml profile and apply with Sub-profile
org.eclipse.uml2.uml.Package robotml = PackageUtil.loadPackage(URI.createURI(ROBOTML_PROFILE_URI), owner.eResource().getResourceSet());
- //org.eclipse.uml2.uml.Package fcm = PackageUtil.loadPackage(URI.createURI(FCM_PROFILE_URI), owner.eResource().getResourceSet());
- if((robotml != null) && (robotml instanceof Profile)) {
- PackageUtil.applyProfile(((org.eclipse.uml2.uml.Package)owner), (org.eclipse.uml2.uml.Profile)robotml, true);
- //PackageUtil.applyProfile(((org.eclipse.uml2.uml.Package)owner), (org.eclipse.uml2.uml.Profile) fcm, true);
+ // org.eclipse.uml2.uml.Package fcm = PackageUtil.loadPackage(URI.createURI(FCM_PROFILE_URI), owner.eResource().getResourceSet());
+ if ((robotml != null) && (robotml instanceof Profile)) {
+ PackageUtil.applyProfile(((org.eclipse.uml2.uml.Package) owner), (org.eclipse.uml2.uml.Profile) robotml, true);
+ // PackageUtil.applyProfile(((org.eclipse.uml2.uml.Package)owner), (org.eclipse.uml2.uml.Profile) fcm, true);
}
}
/**
* Gets the model name.
- *
+ *
* @return the model name
*/
protected String getModelName() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicies/PortNodeLabelDisplayEditPolicy.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicies/PortNodeLabelDisplayEditPolicy.java
index 2b482e68fee..01216cfb0d2 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicies/PortNodeLabelDisplayEditPolicy.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicies/PortNodeLabelDisplayEditPolicy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,7 +33,7 @@ public class PortNodeLabelDisplayEditPolicy extends AppliedStereotypeNodeLabelDi
@Override
public void notifyChanged(Notification notification) {
final Object feature = notification.getFeature();
- if(feature == NotationPackage.eINSTANCE.getLocation_X() || feature == NotationPackage.eINSTANCE.getLocation_Y()) {
+ if (feature == NotationPackage.eINSTANCE.getLocation_X() || feature == NotationPackage.eINSTANCE.getLocation_Y()) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
@@ -51,11 +51,11 @@ public class PortNodeLabelDisplayEditPolicy extends AppliedStereotypeNodeLabelDi
// retrieve the first stereotype in the list of displayed stereotype
- //String firstStereotypeName = tokenizer.nextToken();
+ // String firstStereotypeName = tokenizer.nextToken();
EList<Stereotype> stereotype_list = getUMLElement().getAppliedStereotypes();
- if(stereotype_list.size() != 0) {
+ if (stereotype_list.size() != 0) {
Stereotype stereotype = stereotype_list.get(0);
- if(stereotype.getName().equals("DataFlowPort") || stereotype.getName().equals("ServicePort")) {
+ if (stereotype.getName().equals("DataFlowPort") || stereotype.getName().equals("ServicePort")) {
Image icon = Activator.getIconElement(getUMLElement(), stereotype, false);
IFigure portView = getHostFigure();
@@ -64,18 +64,18 @@ public class PortNodeLabelDisplayEditPolicy extends AppliedStereotypeNodeLabelDi
Rectangle parentBounds = parentView.getBounds();
Rectangle portBounds = portView.getBounds();
- if(portBounds.x() <= parentBounds.x()) {
- //left
+ if (portBounds.x() <= parentBounds.x()) {
+ // left
return icon;
- } else if(portBounds.x() >= (parentBounds.right() - portBounds.width())) {
- //right
+ } else if (portBounds.x() >= (parentBounds.right() - portBounds.width())) {
+ // right
return new Image(icon.getDevice(), RotationHelper.rotateImage(icon, 180), SWT.IMAGE_COPY);
- } else if(portBounds.y() <= parentBounds.y()) {
- //top
+ } else if (portBounds.y() <= parentBounds.y()) {
+ // top
return new Image(icon.getDevice(), RotationHelper.rotateImage(icon, 90), SWT.IMAGE_COPY);
- } else if(portBounds.y() >= parentBounds.bottom() - portBounds.height()) {
- //bottom
+ } else if (portBounds.y() >= parentBounds.bottom() - portBounds.height()) {
+ // bottom
return new Image(icon.getDevice(), RotationHelper.rotateImage(icon, -90), SWT.IMAGE_COPY);
} else {
return null;
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicy/provider/RobotMLDiagramsEditPolicyProvider.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicy/provider/RobotMLDiagramsEditPolicyProvider.java
index 4799ce927c4..a903f80ff00 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicy/provider/RobotMLDiagramsEditPolicyProvider.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/editpolicy/provider/RobotMLDiagramsEditPolicyProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -63,8 +63,7 @@ public class RobotMLDiagramsEditPolicyProvider extends AbstractProvider
EObject element = ((View) editPart.getModel()).getElement();
if (element instanceof Element) {
if (((Element) element).getNearestPackage().getAppliedProfile(
- ROBOTML_ID) != null)
-
+ ROBOTML_ID) != null) {
// System.err.println(list.get(i).getProfile().getName());
if (editPart instanceof PortEditPart) {
NotificationListener editPolicy = new PortNodeLabelDisplayEditPolicy();
@@ -85,6 +84,7 @@ public class RobotMLDiagramsEditPolicyProvider extends AbstractProvider
editPolicy.notifyChanged(notification);
}
}
+ }
}
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/MigrateDiagramsHandler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/MigrateDiagramsHandler.java
index 1aab6f97b4e..fda01732f98 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/MigrateDiagramsHandler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/MigrateDiagramsHandler.java
@@ -35,11 +35,11 @@ public class MigrateDiagramsHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
- if(currentSelection.isEmpty() || !(currentSelection instanceof IStructuredSelection)) {
+ if (currentSelection.isEmpty() || !(currentSelection instanceof IStructuredSelection)) {
return null;
}
- IStructuredSelection selection = (IStructuredSelection)currentSelection;
+ IStructuredSelection selection = (IStructuredSelection) currentSelection;
Object selectedElement = selection.getFirstElement();
@@ -47,10 +47,10 @@ public class MigrateDiagramsHandler extends AbstractHandler {
- if(selectedAdapter instanceof IFile) {
- final IFile selectedFile = (IFile)selectedAdapter;
+ if (selectedAdapter instanceof IFile) {
+ final IFile selectedFile = (IFile) selectedAdapter;
- //Load the model in background and add a user information
+ // Load the model in background and add a user information
Job openDialogJob = new Job("Switch profile") {
@Override
@@ -69,15 +69,15 @@ public class MigrateDiagramsHandler extends AbstractHandler {
ViewPrototype protoDatatypeDef = null;
ViewPrototype protoInterfaceDef = null;
ViewPrototype protoComponentDef = null;
- for(ViewPrototype proto : PolicyChecker.getCurrent().getAllPrototypes()) {
- if(proto.getLabel().contains("RobotML Architecture")) {
+ for (ViewPrototype proto : PolicyChecker.getCurrent().getAllPrototypes()) {
+ if (proto.getLabel().contains("RobotML Architecture")) {
protoArchitecture = proto;
- } else if(proto.getLabel().contains("RobotML Component")) {
+ } else if (proto.getLabel().contains("RobotML Component")) {
protoComponentDef = proto;
- } else if(proto.getLabel().contains("RobotML Interface")) {
+ } else if (proto.getLabel().contains("RobotML Interface")) {
protoInterfaceDef = proto;
- } else if(proto.getLabel().contains("RobotML Datatype")) {
+ } else if (proto.getLabel().contains("RobotML Datatype")) {
protoDatatypeDef = proto;
}
}
@@ -85,45 +85,45 @@ public class MigrateDiagramsHandler extends AbstractHandler {
try {
modelSet.loadModels(workspaceURI);
- //do the diagrams migration
- NotationModel notationModel = (NotationModel)modelSet.getModel(NotationModel.MODEL_ID);
- if(notationModel != null) {
+ // do the diagrams migration
+ NotationModel notationModel = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID);
+ if (notationModel != null) {
Resource mainNotationResource = notationModel.getResource();
Iterator<EObject> allContents = mainNotationResource.getAllContents();
- while(allContents.hasNext()) {
+ while (allContents.hasNext()) {
EObject currentElement = allContents.next();
- if(currentElement instanceof Diagram) {
+ if (currentElement instanceof Diagram) {
// 1. Changing the type of the diagram
- //System.err.println(currentElement);
- if(((Diagram)currentElement).getType().equalsIgnoreCase("architecture")) {
- ((Diagram)currentElement).setType(CompositeStructureDiagramEditPart.MODEL_ID);
- DiagramUtils.setPrototype((Diagram)currentElement, protoArchitecture);
- DiagramUtils.setOwner(((Diagram)currentElement), ((Diagram)currentElement).getElement());
-
- } else if(((Diagram)currentElement).getType().equalsIgnoreCase("componentdef")) {
- ((Diagram)currentElement).setType(CompositeStructureDiagramEditPart.MODEL_ID);
- DiagramUtils.setPrototype((Diagram)currentElement, protoComponentDef);
- DiagramUtils.setOwner(((Diagram)currentElement), ((Diagram)currentElement).getElement());
+ // System.err.println(currentElement);
+ if (((Diagram) currentElement).getType().equalsIgnoreCase("architecture")) {
+ ((Diagram) currentElement).setType(CompositeStructureDiagramEditPart.MODEL_ID);
+ DiagramUtils.setPrototype((Diagram) currentElement, protoArchitecture);
+ DiagramUtils.setOwner(((Diagram) currentElement), ((Diagram) currentElement).getElement());
+
+ } else if (((Diagram) currentElement).getType().equalsIgnoreCase("componentdef")) {
+ ((Diagram) currentElement).setType(CompositeStructureDiagramEditPart.MODEL_ID);
+ DiagramUtils.setPrototype((Diagram) currentElement, protoComponentDef);
+ DiagramUtils.setOwner(((Diagram) currentElement), ((Diagram) currentElement).getElement());
}
- else if(((Diagram)currentElement).getType().equalsIgnoreCase("datatypedef")) {
- ((Diagram)currentElement).setType(ModelEditPart.MODEL_ID);
- DiagramUtils.setPrototype((Diagram)currentElement, protoDatatypeDef);
- DiagramUtils.setOwner(((Diagram)currentElement), ((Diagram)currentElement).getElement());
+ else if (((Diagram) currentElement).getType().equalsIgnoreCase("datatypedef")) {
+ ((Diagram) currentElement).setType(ModelEditPart.MODEL_ID);
+ DiagramUtils.setPrototype((Diagram) currentElement, protoDatatypeDef);
+ DiagramUtils.setOwner(((Diagram) currentElement), ((Diagram) currentElement).getElement());
- } else if(((Diagram)currentElement).getType().equalsIgnoreCase("interfacedef")) {
- ((Diagram)currentElement).setType(ModelEditPart.MODEL_ID);
- DiagramUtils.setPrototype((Diagram)currentElement, protoInterfaceDef);
- DiagramUtils.setOwner(((Diagram)currentElement), ((Diagram)currentElement).getElement());
+ } else if (((Diagram) currentElement).getType().equalsIgnoreCase("interfacedef")) {
+ ((Diagram) currentElement).setType(ModelEditPart.MODEL_ID);
+ DiagramUtils.setPrototype((Diagram) currentElement, protoInterfaceDef);
+ DiagramUtils.setOwner(((Diagram) currentElement), ((Diagram) currentElement).getElement());
}
}
- }//end while
+ }// end while
mainNotationResource.save(null);
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/RobotMLReconciler.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/RobotMLReconciler.java
index 08b9424e5c6..9a9899383d1 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/RobotMLReconciler.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/migration/RobotMLReconciler.java
@@ -53,7 +53,7 @@ public class RobotMLReconciler extends DiagramReconciler {
static {
ourMigrations = new HashMap<String, MigrationData>();
- for(MigrationData next : new MigrationData[]{ ARCHITECTURE, COMPONENT, INTERFACE, DATATYPE }) {
+ for (MigrationData next : new MigrationData[] { ARCHITECTURE, COMPONENT, INTERFACE, DATATYPE }) {
ourMigrations.put(safeToLowerCase(next.getOldType()), next);
}
}
@@ -152,15 +152,15 @@ public class RobotMLReconciler extends DiagramReconciler {
}
public ViewPrototype getPrototype() {
- if(myCachedPrototype == null) {
+ if (myCachedPrototype == null) {
myCachedPrototype = findPrototype(myPrototypeLabel);
}
return myCachedPrototype;
}
private static ViewPrototype findPrototype(String label) {
- for(ViewPrototype proto : PolicyChecker.getCurrent().getAllPrototypes()) {
- if(proto.getLabel().contains(label)) {
+ for (ViewPrototype proto : PolicyChecker.getCurrent().getAllPrototypes()) {
+ if (proto.getLabel().contains(label)) {
return proto;
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/utils/RobotmlSelectionTester.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/utils/RobotmlSelectionTester.java
index 46906183b07..b2677f7e1d3 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/utils/RobotmlSelectionTester.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common/src/org/eclipse/papyrus/robotml/diagram/common/utils/RobotmlSelectionTester.java
@@ -41,7 +41,7 @@ public class RobotmlSelectionTester extends PropertyTester {
public final static String IS_ROBOTML_MODEL = "isRobotmlModel";
- //public static String ROBOTML_ID = "RobotML";
+ // public static String ROBOTML_ID = "RobotML";
/** Default constructor */
public RobotmlSelectionTester() {
@@ -52,12 +52,12 @@ public class RobotmlSelectionTester extends PropertyTester {
// Ensure Papyrus is the active editor
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if((editor == null) || (!(editor instanceof IMultiDiagramEditor))) {
+ if ((editor == null) || (!(editor instanceof IMultiDiagramEditor))) {
return false;
}
Object currentValue = null;
- if(IS_ROBOTML_MODEL.equals(property)) {
+ if (IS_ROBOTML_MODEL.equals(property)) {
currentValue = testRobotmlModelNature(receiver);
return (currentValue == expectedValue);
}
@@ -73,16 +73,16 @@ public class RobotmlSelectionTester extends PropertyTester {
EObject root = getRoot(receiver);
- if(root instanceof Package) {
- return (((Package)root).getAppliedProfile("RobotML") != null);
+ if (root instanceof Package) {
+ return (((Package) root).getAppliedProfile("RobotML") != null);
- //FIX: UMLUtil.getProfile() loads the profile into the resource set. This is not desired.
+ // FIX: UMLUtil.getProfile() loads the profile into the resource set. This is not desired.
//
- // Profile robotml = UMLUtil.getProfile(RobotMLPackage.eINSTANCE, root);
+ // Profile robotml = UMLUtil.getProfile(RobotMLPackage.eINSTANCE, root);
//
- // if(((Package)root).isProfileApplied(robotml)) {
- // isRobotmlModel = true;
- // }
+ // if(((Package)root).isProfileApplied(robotml)) {
+ // isRobotmlModel = true;
+ // }
}
@@ -94,23 +94,23 @@ public class RobotmlSelectionTester extends PropertyTester {
private EObject getRoot(Object receiver) {
EObject root = null;
- if(receiver instanceof ISelection) {
- ISelection selection = (ISelection)receiver;
- if(selection.isEmpty()) {
+ if (receiver instanceof ISelection) {
+ ISelection selection = (ISelection) receiver;
+ if (selection.isEmpty()) {
return null;
}
try {
- //this is the case where the selection is on the Project Explorer
- IStructuredSelection selectionstructured = (IStructuredSelection)selection;
+ // this is the case where the selection is on the Project Explorer
+ IStructuredSelection selectionstructured = (IStructuredSelection) selection;
Object selectedElement = selectionstructured.getFirstElement();
Object selectedAdapter = Platform.getAdapterManager().getAdapter(selectedElement, IFile.class);
- if(selectedAdapter instanceof IFile) {
- final IFile selectedFile = (IFile)selectedAdapter;
+ if (selectedAdapter instanceof IFile) {
+ final IFile selectedFile = (IFile) selectedAdapter;
ModelSet modelSet = new ModelSet();
ModelsReader reader = new ModelsReader();
reader.readModel(modelSet);
@@ -121,22 +121,22 @@ public class RobotmlSelectionTester extends PropertyTester {
URI workspaceURI = URI.createPlatformResourceURI(workspacePath.toString(), true);
modelSet.loadModels(workspaceURI);
- UmlModel openedModel = (UmlModel)modelSet.getModel(UmlModel.MODEL_ID);
- if(openedModel != null) {
+ UmlModel openedModel = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID);
+ if (openedModel != null) {
root = openedModel.lookupRoot();
}
} else {
- //this is the case where the selection is on the Model Explorer
+ // this is the case where the selection is on the Model Explorer
ServiceUtilsForSelection serviceUtils = ServiceUtilsForSelection.getInstance();
- UmlModel openedModel = (UmlModel)serviceUtils.getModelSet(selection).getModel(UmlModel.MODEL_ID);
- if(openedModel != null) {
+ UmlModel openedModel = (UmlModel) serviceUtils.getModelSet(selection).getModel(UmlModel.MODEL_ID);
+ if (openedModel != null) {
root = openedModel.lookupRoot();
}
}
} catch (Exception e) {
- //Ignored: The selection cannot be used to retrieve the ServicesRegistry.
- //Do not log exceptions: this is just not a Papyrus/RobotML model
+ // Ignored: The selection cannot be used to retrieve the ServicesRegistry.
+ // Do not log exceptions: this is just not a Papyrus/RobotML model
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/Activator.java
index 486736f8250..7d12892d439 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,7 +55,7 @@ public class Activator extends Plugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlModelWizard.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlModelWizard.java
index 2746854a491..bde156bbbf6 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlModelWizard.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlModelWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@ public class NewRobotmlModelWizard extends CreateModelWizard {
/**
* @see org.eclipse.papyrus.wizards.CreateModelWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- *
+ *
* @param workbench
* @param selection
*/
@@ -52,7 +52,7 @@ public class NewRobotmlModelWizard extends CreateModelWizard {
@Override
protected String[] getDiagramCategoryIds() {
- return new String[]{ CreateRobotmlModelCommand.COMMAND_ID };
+ return new String[] { CreateRobotmlModelCommand.COMMAND_ID };
}
/**
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlProjectWizard.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlProjectWizard.java
index 9bd2c0bff06..476eea946ea 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlProjectWizard.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.ui/src/org/eclipse/papyrus/robotml/diagram/ui/NewRobotmlProjectWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@ public class NewRobotmlProjectWizard extends NewPapyrusProjectWizard {
/**
* @see org.eclipse.papyrus.wizards.NewPapyrusProjectWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- *
+ *
* @param workbench
* @param selection
*/
@@ -48,7 +48,7 @@ public class NewRobotmlProjectWizard extends NewPapyrusProjectWizard {
*/
@Override
protected SelectDiagramCategoryPage createSelectDiagramCategoryPage() {
- //here SysML is the only available category
+ // here SysML is the only available category
return null;
}
@@ -57,8 +57,8 @@ public class NewRobotmlProjectWizard extends NewPapyrusProjectWizard {
*/
@Override
protected void saveDiagramCategorySettings() {
- //do nothing
- //here SysML is the only available category
+ // do nothing
+ // here SysML is the only available category
}
/**
@@ -66,7 +66,7 @@ public class NewRobotmlProjectWizard extends NewPapyrusProjectWizard {
*/
@Override
protected String[] getDiagramCategoryIds() {
- return new String[]{ CreateRobotmlModelCommand.COMMAND_ID };
+ return new String[] { CreateRobotmlModelCommand.COMMAND_ID };
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.doc/src/org/eclipse/papyrus/robotml/doc/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.doc/src/org/eclipse/papyrus/robotml/doc/Activator.java
index 95959b58923..2c89120006a 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.doc/src/org/eclipse/papyrus/robotml/doc/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.doc/src/org/eclipse/papyrus/robotml/doc/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,7 +55,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/Activator.java
index 31dda0043b8..e80114a4460 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@ public class Activator extends Plugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllPortsQuery.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllPortsQuery.java
index 5fdca9fd95c..15db3292ef0 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllPortsQuery.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllPortsQuery.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,14 +26,15 @@ import org.eclipse.uml2.uml.Property;
/** get all ports from a classifier */
public class GetAllPortsQuery implements IJavaModelQuery<Classifier, Collection<Property>> {
+ @Override
public Collection<Property> evaluate(final Classifier context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
ArrayList<Property> result = new ArrayList<Property>();
- if(ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
+ if (ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
Iterator<Property> iter = context.getAllAttributes().iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
Property currentElement = iter.next();
- if(currentElement instanceof Port) {
- result.add((Port)currentElement);
+ if (currentElement instanceof Port) {
+ result.add(currentElement);
}
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllSubSystemsQuery.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllSubSystemsQuery.java
index b78287f23ec..8e1bbe00226 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllSubSystemsQuery.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetAllSubSystemsQuery.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,17 +28,18 @@ import org.eclipse.uml2.uml.Property;
/** get all ports from a classifier */
public class GetAllSubSystemsQuery implements IJavaModelQuery<Classifier, Collection<Property>> {
+ @Override
public Collection<Property> evaluate(final Classifier context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
ArrayList<Property> result = new ArrayList<Property>();
- //System.err.println("context.getNearestPackage(): "+ context.getNearestPackage());
- if(ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
+ // System.err.println("context.getNearestPackage(): "+ context.getNearestPackage());
+ if (ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
Iterator<Property> iter = context.getAllAttributes().iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
Property currentElement = iter.next();
- //if the property is typed by a classifier, it is a subsystem
- if((currentElement.getType() instanceof Class) && !(currentElement instanceof Port) && !(currentElement.getType() instanceof DataType)) {
- result.add((Property)currentElement);
+ // if the property is typed by a classifier, it is a subsystem
+ if ((currentElement.getType() instanceof Class) && !(currentElement instanceof Port) && !(currentElement.getType() instanceof DataType)) {
+ result.add(currentElement);
}
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetImageQuery.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetImageQuery.java
index ae4646a5f2f..f4f384bc1ae 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetImageQuery.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetImageQuery.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,21 +27,22 @@ public class GetImageQuery implements IJavaModelQuery<Element, String> {
public static final String robotML_plugin_path = "/org.eclipse.papyrus.robotml/";
+ @Override
public String evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
String icon_relative_path = "";
- if(!context.getAppliedStereotypes().isEmpty()) {
+ if (!context.getAppliedStereotypes().isEmpty()) {
Stereotype first_stereotype = context.getAppliedStereotypes().get(0);
Profile robotML = first_stereotype.getProfile();
- if(robotML != null && robotML.getName().equals(ROBOTML_ID)) {
- if(!first_stereotype.getIcons().isEmpty()) {
+ if (robotML != null && robotML.getName().equals(ROBOTML_ID)) {
+ if (!first_stereotype.getIcons().isEmpty()) {
org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(context, first_stereotype, "icon");
- if(icon != null) {
+ if (icon != null) {
icon_relative_path = icon.getLocation();
}
}
@@ -49,7 +50,7 @@ public class GetImageQuery implements IJavaModelQuery<Element, String> {
}
String image_path = "";
- if(!"".equals(icon_relative_path)) {
+ if (!"".equals(icon_relative_path)) {
image_path = robotML_plugin_path + icon_relative_path;
}
return image_path;
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetOtherPropertiesQuery.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetOtherPropertiesQuery.java
index 2da05e980f2..e614e368208 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetOtherPropertiesQuery.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/GetOtherPropertiesQuery.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,15 +27,16 @@ import org.eclipse.uml2.uml.Property;
/** get all ports from a classifier */
public class GetOtherPropertiesQuery implements IJavaModelQuery<Classifier, Collection<Property>> {
+ @Override
public Collection<Property> evaluate(final Classifier context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
ArrayList<Property> result = new ArrayList<Property>();
- if(ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
+ if (ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
Iterator<Property> iter = context.getAllAttributes().iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
Property currentElement = iter.next();
- if(!(currentElement instanceof Port) && !(currentElement.getType() instanceof Class)) {
- result.add((Property)currentElement);
+ if (!(currentElement instanceof Port) && !(currentElement.getType() instanceof Class)) {
+ result.add(currentElement);
}
}
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/HasImageQuery.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/HasImageQuery.java
index 4fb3e9538e6..6ec9fc4dbbb 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/HasImageQuery.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/HasImageQuery.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,11 +19,12 @@ import org.eclipse.uml2.uml.Element;
/** Check is the element has a stereotype icon that can be used */
public class HasImageQuery implements IJavaModelQuery<Element, Boolean> {
+ @Override
public Boolean evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
IJavaModelQuery<Element, String> ImgageGetter = new GetImageQuery();
String temp_img_path = ImgageGetter.evaluate(context, parameterValues);
- if(!"".equals(temp_img_path)) {
+ if (!"".equals(temp_img_path)) {
return true;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/RobotMLProfileAppliedQuery.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/RobotMLProfileAppliedQuery.java
index ac1ae0be9e9..dfe7e0df979 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/RobotMLProfileAppliedQuery.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/query/RobotMLProfileAppliedQuery.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,9 +21,10 @@ public class RobotMLProfileAppliedQuery implements IJavaModelQuery<Element, Bool
public static String ROBOTML_ID = "RobotML";
+ @Override
public Boolean evaluate(Element context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
// TODO Auto-generated method stub
- if(ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
+ if (ProfileUtil.getAppliedProfile(context.getNearestPackage(), "RobotML") != null) {
return false;
}
return true;
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/util/ProfileUtil.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/util/ProfileUtil.java
index 34011f607ff..ef305c5abdb 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/util/ProfileUtil.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.modelexplorer/src/org/eclipse/papyrus/robotml/modelexplorer/util/ProfileUtil.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,11 +19,11 @@ public class ProfileUtil {
public static Profile getAppliedProfile(org.eclipse.uml2.uml.Package package_, String qualifiedName) {
- for(ProfileApplication profileApplication : package_.getAllProfileApplications()) {
+ for (ProfileApplication profileApplication : package_.getAllProfileApplications()) {
Profile appliedProfile = profileApplication.getAppliedProfile();
- if(appliedProfile != null && UML2Util.safeEquals(appliedProfile.getQualifiedName(), qualifiedName)) {
+ if (appliedProfile != null && UML2Util.safeEquals(appliedProfile.getQualifiedName(), qualifiedName)) {
return appliedProfile;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/Activator.java
index 871686d6b8d..fbfb2d63506 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the CeCILL-C Free Software License v1.0
* which accompanies this distribution, and is available at
@@ -57,7 +57,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/RobotmlPerspective.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/RobotmlPerspective.java
index d158a964753..eb36beb8378 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/RobotmlPerspective.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.perspective/src/org/eclipse/papyrus/robotml/perspective/RobotmlPerspective.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the CeCILL-C Free Software License v1.0
* which accompanies this distribution, and is available at
@@ -31,7 +31,7 @@ public class RobotmlPerspective extends PapyrusPerspective {
@Override
public void defineActions(IPageLayout layout) {
// TODO Auto-generated method stub
- //super.defineActions(layout);
+ // super.defineActions(layout);
layout.addNewWizardShortcut("org.eclipse.papyrus.wizards.createrobotmlwizard");
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");
layout.addNewWizardShortcut("org.eclipse.papyrus.wizards.createrobotmlmodel");
@@ -67,7 +67,7 @@ public class RobotmlPerspective extends PapyrusPerspective {
layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.BOTTOM, 0.5f, IPageLayout.ID_PROJECT_EXPLORER);
// place properties under the editor
- layout.addView(IPageLayout.ID_PROP_SHEET, IPageLayout.BOTTOM, (float)0.70, editorArea);
+ layout.addView(IPageLayout.ID_PROP_SHEET, IPageLayout.BOTTOM, (float) 0.70, editorArea);
// bottom.addView("org.eclipse.pde.runtime.LogView");
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.templaterepository/src/org/eclipse/papyrus/robotml/templaterepository/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.templaterepository/src/org/eclipse/papyrus/robotml/templaterepository/Activator.java
index b61e4de2370..23a7df845ba 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.templaterepository/src/org/eclipse/papyrus/robotml/templaterepository/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.templaterepository/src/org/eclipse/papyrus/robotml/templaterepository/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,7 +55,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/Activator.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/Activator.java
index 915194f47ac..5d10a3f7276 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/Activator.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,7 +55,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/ValidationDelegateClientSelector.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/ValidationDelegateClientSelector.java
index f579a55d852..f21e36263b9 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/ValidationDelegateClientSelector.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/ValidationDelegateClientSelector.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,14 +20,14 @@ public class ValidationDelegateClientSelector implements IClientSelector {
/**
* Queries whether I select the specified object, which indicates that it
* belongs to my client context.
- *
+ *
* @param object
- * a model element of some kind
+ * a model element of some kind
* @return <code>true</code> if the <code>object</code> matches my client
* context; <code>false</code>, otherwise
*/
public boolean selects(Object object) {
- if(object instanceof PackageImport) {
+ if (object instanceof PackageImport) {
// return false;
}
return (object instanceof Element);
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/ConstraintsUtil.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/ConstraintsUtil.java
index 0aa901514ce..1ef110c0af1 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/ConstraintsUtil.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/ConstraintsUtil.java
@@ -7,20 +7,20 @@ import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.util.UMLUtil;
-public class ConstraintsUtil {
- public static Boolean verifyRobotMLApplied(Element elt){
+public class ConstraintsUtil {
+ public static Boolean verifyRobotMLApplied(Element elt) {
Boolean isRobotmlModel = false;
Model model = elt.getModel();
- if ((model != null)&& (model instanceof Package)){
+ if ((model != null) && (model instanceof Package)) {
+
+ Profile robotml = UMLUtil.getProfile(RobotMLPackage.eINSTANCE, model);
+
+ if (((Package) model).isProfileApplied(robotml)) {
+ isRobotmlModel = true;
+ }
+
- Profile robotml = UMLUtil.getProfile(RobotMLPackage.eINSTANCE, model);
- if(((Package)model).isProfileApplied(robotml)) {
- isRobotmlModel = true;
- }
-
-
-
}
return isRobotmlModel;
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java
index 79593bae69e..50cc6750850 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,17 +12,9 @@
package org.eclipse.papyrus.robotml.validation.constraints;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.validation.AbstractModelConstraint;
import org.eclipse.emf.validation.IValidationContext;
-import org.eclipse.papyrus.RobotML.RobotMLPackage;
-import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLUtil;
// TODO: Auto-generated Javadoc
/**
@@ -36,23 +28,24 @@ public class DetectRecursivity extends AbstractModelConstraint {
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
*/
+ @Override
public IStatus validate(IValidationContext ctx) {
-
- Property subsystem = (Property)ctx.getTarget();
-
- if (ConstraintsUtil.verifyRobotMLApplied(subsystem)){
- //System.err.println("\n\n Type: "+subsystem.getType() +"\n Owner: "+ subsystem.getOwner());
- if(subsystem.getType() == null) {
- return ctx.createFailureStatus("Property (subsystem or attribute) must have a Type " + subsystem.getQualifiedName());
- } else if(subsystem.getType().equals(subsystem.getOwner())) {
- return ctx.createFailureStatus("Problem of recursivity the subsystem " + subsystem.getQualifiedName() + " is typed by the same system that contains it)");
- }
+
+ Property subsystem = (Property) ctx.getTarget();
+
+ if (ConstraintsUtil.verifyRobotMLApplied(subsystem)) {
+ // System.err.println("\n\n Type: "+subsystem.getType() +"\n Owner: "+ subsystem.getOwner());
+ if (subsystem.getType() == null) {
+ return ctx.createFailureStatus("Property (subsystem or attribute) must have a Type " + subsystem.getQualifiedName());
+ } else if (subsystem.getType().equals(subsystem.getOwner())) {
+ return ctx.createFailureStatus("Problem of recursivity the subsystem " + subsystem.getQualifiedName() + " is typed by the same system that contains it)");
+ }
}
-
+
return ctx.createSuccessStatus();
}
-
-
-
-
+
+
+
+
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/OnlyOneConnectionBetweenTwoPorts.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/OnlyOneConnectionBetweenTwoPorts.java
index 3f500c1afa6..9aee7cba8b8 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/OnlyOneConnectionBetweenTwoPorts.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/OnlyOneConnectionBetweenTwoPorts.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,33 +28,34 @@ public class OnlyOneConnectionBetweenTwoPorts extends AbstractModelConstraint {
@Override
public IStatus validate(IValidationContext ctx) {
- Connector elt = (Connector)ctx.getTarget();
- if (ConstraintsUtil.verifyRobotMLApplied(elt)){
- List<ConnectorEnd> cends = new ArrayList<ConnectorEnd>();
- cends = elt.getEnds();
- if(cends != null) {//if1
- if(cends.size() == 2) {//if2
- if((cends.get(0) instanceof ConnectorEnd) && (cends.get(1) instanceof ConnectorEnd)) {//if3
- final ConnectableElement connectorEndRole0 = cends.get(0).getRole();
- ConnectableElement connectorEndRole1 = cends.get(1).getRole();
- Property partWithPort0 = cends.get(0).getPartWithPort();
- Property partWithPort1 = cends.get(1).getPartWithPort();
- if((connectorEndRole0 instanceof Port) && (connectorEndRole1 instanceof Port)) {//if4
- List<ConnectorEnd> port1Ends = new ArrayList<ConnectorEnd>();
- List<ConnectorEnd> port0Ends = new ArrayList<ConnectorEnd>();
- port0Ends = connectorEndRole0.getEnds();
- port1Ends = connectorEndRole1.getEnds();
- for(ConnectorEnd end0 : port0Ends) {
+ Connector elt = (Connector) ctx.getTarget();
+ if (ConstraintsUtil.verifyRobotMLApplied(elt)) {
+ List<ConnectorEnd> cends = new ArrayList<ConnectorEnd>();
+ cends = elt.getEnds();
+ if (cends != null) {// if1
+ if (cends.size() == 2) {// if2
+ if ((cends.get(0) instanceof ConnectorEnd) && (cends.get(1) instanceof ConnectorEnd)) {// if3
+ final ConnectableElement connectorEndRole0 = cends.get(0).getRole();
+ ConnectableElement connectorEndRole1 = cends.get(1).getRole();
+ Property partWithPort0 = cends.get(0).getPartWithPort();
+ Property partWithPort1 = cends.get(1).getPartWithPort();
+ if ((connectorEndRole0 instanceof Port) && (connectorEndRole1 instanceof Port)) {// if4
+ List<ConnectorEnd> port1Ends = new ArrayList<ConnectorEnd>();
+ List<ConnectorEnd> port0Ends = new ArrayList<ConnectorEnd>();
+ port0Ends = connectorEndRole0.getEnds();
+ port1Ends = connectorEndRole1.getEnds();
+ for (ConnectorEnd end0 : port0Ends) {
- for(ConnectorEnd end1 : port1Ends) {
+ for (ConnectorEnd end1 : port1Ends) {
- if((end0.eContainer().equals(end1.eContainer())) && !(end0.eContainer().equals(elt))) {
- //verify that partwithPort of the found connector ends are the same than those of the connector that will be created
- if(end0.getPartWithPort().equals(partWithPort0) && end1.getPartWithPort().equals(partWithPort1)) {
- return ctx.createFailureStatus("Connection must be set between ports that are not already connected. There is already a connector named : " + ((Connector)end0.eContainer()).getQualifiedName());
- }
+ if ((end0.eContainer().equals(end1.eContainer())) && !(end0.eContainer().equals(elt))) {
+ // verify that partwithPort of the found connector ends are the same than those of the connector that will be created
+ if (end0.getPartWithPort().equals(partWithPort0) && end1.getPartWithPort().equals(partWithPort1)) {
+ return ctx.createFailureStatus("Connection must be set between ports that are not already connected. There is already a connector named : " + ((Connector) end0.eContainer()).getQualifiedName());
+ }
+ }
}
}
}
@@ -62,7 +63,6 @@ public class OnlyOneConnectionBetweenTwoPorts extends AbstractModelConstraint {
}
}
}
- }
return ctx.createSuccessStatus();
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortIsCorrectlyTyped.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortIsCorrectlyTyped.java
index 13e1a0c48ad..2810bcfc0b4 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortIsCorrectlyTyped.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortIsCorrectlyTyped.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,28 +27,28 @@ public class PortIsCorrectlyTyped extends AbstractModelConstraint {
@Override
public IStatus validate(IValidationContext ctx) {
- Port elt = (Port)ctx.getTarget();
- if (ConstraintsUtil.verifyRobotMLApplied(elt)){
- //1. verify if the port is typed
- if(elt.getType() == null) {
- return ctx.createFailureStatus("Port should have a type (" + elt.getQualifiedName() + ")");
- } else {//2. verify if the port is correctly typed
- ServicePort serviceport = UMLUtil.getStereotypeApplication(elt, ServicePort.class);
- if(serviceport != null) {
- if(!(elt.getType() instanceof Interface)) {
+ Port elt = (Port) ctx.getTarget();
+ if (ConstraintsUtil.verifyRobotMLApplied(elt)) {
+ // 1. verify if the port is typed
+ if (elt.getType() == null) {
+ return ctx.createFailureStatus("Port should have a type (" + elt.getQualifiedName() + ")");
+ } else {// 2. verify if the port is correctly typed
+ ServicePort serviceport = UMLUtil.getStereotypeApplication(elt, ServicePort.class);
+ if (serviceport != null) {
+ if (!(elt.getType() instanceof Interface)) {
- return ctx.createFailureStatus("Port should be typed by an Interface (" + elt.getQualifiedName() + ")");
- }
- } else {
- DataFlowPort flowport = UMLUtil.getStereotypeApplication(elt, DataFlowPort.class);
- if(flowport != null) {
- if(!(elt.getType() instanceof DataType)) {
- return ctx.createFailureStatus("Port should be typed by a DataType (" + elt.getQualifiedName() + ")");
+ return ctx.createFailureStatus("Port should be typed by an Interface (" + elt.getQualifiedName() + ")");
+ }
+ } else {
+ DataFlowPort flowport = UMLUtil.getStereotypeApplication(elt, DataFlowPort.class);
+ if (flowport != null) {
+ if (!(elt.getType() instanceof DataType)) {
+ return ctx.createFailureStatus("Port should be typed by a DataType (" + elt.getQualifiedName() + ")");
+ }
}
}
}
}
- }
return ctx.createSuccessStatus();
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortsAreCorrectlyConnected.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortsAreCorrectlyConnected.java
index 06f22d7aae9..140e7263dd8 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortsAreCorrectlyConnected.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PortsAreCorrectlyConnected.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,87 +44,87 @@ public class PortsAreCorrectlyConnected extends AbstractModelConstraint {
*/
@Override
public IStatus validate(IValidationContext ctx) {
- Connector elt = (Connector)ctx.getTarget();
- if (ConstraintsUtil.verifyRobotMLApplied(elt)){
- List<ConnectorEnd> cends = new ArrayList<ConnectorEnd>();
- cends = elt.getEnds();
- // 1. verify that only ports of the same kind are connected
- if(cends != null) {// if1
-
- if(cends.size() == 2) {// if2
- if((cends.get(0) instanceof ConnectorEnd) && (cends.get(1) instanceof ConnectorEnd)) {// if3
- // verify that the connection is between two ports of two
- // subsystems
-
- ConnectableElement connectorEndRole0 = cends.get(0).getRole();
- ConnectableElement connectorEndRole1 = cends.get(1).getRole();
-
-
- if((connectorEndRole0 instanceof Port) && (connectorEndRole1 instanceof Port)) {// if4
- // verify that the connection is between two ports of
- // two subsystems of the same containing system
-
- if(!(connectorEndRole0.getAppliedStereotypes().isEmpty()) && !(connectorEndRole1.getAppliedStereotypes().isEmpty())) {// if5
- // verify if the applied stereotype on the ports is
- // the same
- List<Stereotype> steretypesPort0 = new ArrayList<Stereotype>();
- steretypesPort0 = connectorEndRole0.getAppliedStereotypes();
- List<Stereotype> steretypesPort1 = new ArrayList<Stereotype>();
- steretypesPort1 = connectorEndRole1.getAppliedStereotypes();
-
- if(steretypesPort0.get(0).getName().equals(steretypesPort1.get(0).getName())) {// if8
- // verify that connections are set between ports
- // of the same type
- if(!(connectorEndRole0.getType().equals(connectorEndRole1.getType()))) {
- return ctx.createFailureStatus("Connection must be set between ports that have the same type (" + elt.getQualifiedName() + ")");
- }
- // here I have to check that the connection is
- // between ports of sub systems and not between
- // a port of the container system and a
- // subsystem port's.
- Boolean areSubsystems = true;
-
- if((elt.getOwner() == connectorEndRole0.getOwner()) || (elt.getOwner() == connectorEndRole1.getOwner())) {
- areSubsystems = false;
- }
-
- // verify if connections are set between in and
- // out DataFlowPorts or provided and required
- // ServicePorts
- DataFlowPort flowport0 = UMLUtil.getStereotypeApplication((Element)connectorEndRole0, DataFlowPort.class);
- DataFlowPort flowport1 = UMLUtil.getStereotypeApplication(connectorEndRole1, DataFlowPort.class);
-
- if(flowport0 != null && flowport1 != null) {
- if((flowport0.getDirection().getValue() == flowport1.getDirection().getValue()) && areSubsystems) {
- return ctx.createFailureStatus("Connection must be set between Flow ports that have opposite direction (" + elt.getQualifiedName() + ")");
- } else if((flowport0.getDirection().getValue() != flowport1.getDirection().getValue()) && !areSubsystems) {
- return ctx.createFailureStatus("Connection must be set between Flow ports that have the same direction (" + elt.getQualifiedName() + ")");
+ Connector elt = (Connector) ctx.getTarget();
+ if (ConstraintsUtil.verifyRobotMLApplied(elt)) {
+ List<ConnectorEnd> cends = new ArrayList<ConnectorEnd>();
+ cends = elt.getEnds();
+ // 1. verify that only ports of the same kind are connected
+ if (cends != null) {// if1
+
+ if (cends.size() == 2) {// if2
+ if ((cends.get(0) instanceof ConnectorEnd) && (cends.get(1) instanceof ConnectorEnd)) {// if3
+ // verify that the connection is between two ports of two
+ // subsystems
+
+ ConnectableElement connectorEndRole0 = cends.get(0).getRole();
+ ConnectableElement connectorEndRole1 = cends.get(1).getRole();
+
+
+ if ((connectorEndRole0 instanceof Port) && (connectorEndRole1 instanceof Port)) {// if4
+ // verify that the connection is between two ports of
+ // two subsystems of the same containing system
+
+ if (!(connectorEndRole0.getAppliedStereotypes().isEmpty()) && !(connectorEndRole1.getAppliedStereotypes().isEmpty())) {// if5
+ // verify if the applied stereotype on the ports is
+ // the same
+ List<Stereotype> steretypesPort0 = new ArrayList<Stereotype>();
+ steretypesPort0 = connectorEndRole0.getAppliedStereotypes();
+ List<Stereotype> steretypesPort1 = new ArrayList<Stereotype>();
+ steretypesPort1 = connectorEndRole1.getAppliedStereotypes();
+
+ if (steretypesPort0.get(0).getName().equals(steretypesPort1.get(0).getName())) {// if8
+ // verify that connections are set between ports
+ // of the same type
+ if (!(connectorEndRole0.getType().equals(connectorEndRole1.getType()))) {
+ return ctx.createFailureStatus("Connection must be set between ports that have the same type (" + elt.getQualifiedName() + ")");
+ }
+ // here I have to check that the connection is
+ // between ports of sub systems and not between
+ // a port of the container system and a
+ // subsystem port's.
+ Boolean areSubsystems = true;
+
+ if ((elt.getOwner() == connectorEndRole0.getOwner()) || (elt.getOwner() == connectorEndRole1.getOwner())) {
+ areSubsystems = false;
}
- }
- ServicePort serviceport0 = UMLUtil.getStereotypeApplication(connectorEndRole0, ServicePort.class);
+ // verify if connections are set between in and
+ // out DataFlowPorts or provided and required
+ // ServicePorts
+ DataFlowPort flowport0 = UMLUtil.getStereotypeApplication(connectorEndRole0, DataFlowPort.class);
+ DataFlowPort flowport1 = UMLUtil.getStereotypeApplication(connectorEndRole1, DataFlowPort.class);
+
+ if (flowport0 != null && flowport1 != null) {
+ if ((flowport0.getDirection().getValue() == flowport1.getDirection().getValue()) && areSubsystems) {
+ return ctx.createFailureStatus("Connection must be set between Flow ports that have opposite direction (" + elt.getQualifiedName() + ")");
+ } else if ((flowport0.getDirection().getValue() != flowport1.getDirection().getValue()) && !areSubsystems) {
+ return ctx.createFailureStatus("Connection must be set between Flow ports that have the same direction (" + elt.getQualifiedName() + ")");
+ }
+ }
+
+ ServicePort serviceport0 = UMLUtil.getStereotypeApplication(connectorEndRole0, ServicePort.class);
- ServicePort serviceport1 = UMLUtil.getStereotypeApplication(connectorEndRole1, ServicePort.class);
- if(serviceport0 != null && serviceport1 != null) {
- if((serviceport0.getKind().getValue() == serviceport1.getKind().getValue()) && areSubsystems) {
- return ctx.createFailureStatus("Connection must be set between Service ports that have opposite direction (" + elt.getQualifiedName() + ")");
- } else if((serviceport0.getKind().getValue() != serviceport1.getKind().getValue()) && !areSubsystems) {
- return ctx.createFailureStatus("Connection must be set between Service ports that have the same direction (" + elt.getQualifiedName() + ")");
+ ServicePort serviceport1 = UMLUtil.getStereotypeApplication(connectorEndRole1, ServicePort.class);
+ if (serviceport0 != null && serviceport1 != null) {
+ if ((serviceport0.getKind().getValue() == serviceport1.getKind().getValue()) && areSubsystems) {
+ return ctx.createFailureStatus("Connection must be set between Service ports that have opposite direction (" + elt.getQualifiedName() + ")");
+ } else if ((serviceport0.getKind().getValue() != serviceport1.getKind().getValue()) && !areSubsystems) {
+ return ctx.createFailureStatus("Connection must be set between Service ports that have the same direction (" + elt.getQualifiedName() + ")");
+ }
}
+ return ctx.createSuccessStatus();
+ }// endif8
+ else {
+ return ctx.createFailureStatus("Connection must be set between ports of same kind (" + elt.getQualifiedName() + ")");
}
- return ctx.createSuccessStatus();
- }// endif8
- else {
- return ctx.createFailureStatus("Connection must be set between ports of same kind (" + elt.getQualifiedName() + ")");
- }
-
- }// endif5
- }// end if4
-
- }// end if3
- }// end if2
- }// end if1
- // 2. verify that there is only one connection between ports
+
+ }// endif5
+ }// end if4
+
+ }// end if3
+ }// end if2
+ }// end if1
+ // 2. verify that there is only one connection between ports
}
return ctx.createSuccessStatus();
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PropertyNameVsItsTypeName.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PropertyNameVsItsTypeName.java
index dc137dc9f33..4ced6d487f5 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PropertyNameVsItsTypeName.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/PropertyNameVsItsTypeName.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,30 +24,32 @@ public class PropertyNameVsItsTypeName extends AbstractModelConstraint {
@Override
public IStatus validate(IValidationContext ctx) {
- Property subsystem = (Property)ctx.getTarget();
- //System.err.println("\n\n Type: "+subsystem.getType() +"\n Owner: "+ subsystem.getOwner());
- if (ConstraintsUtil.verifyRobotMLApplied(subsystem)){
- //1. verify that a property has a type
- if(subsystem.getType() == null) {
- return ctx.createFailureStatus("Property (subsystem or attribute) should have a Type" + subsystem.getQualifiedName());
- }
-
- //2. verify that a property has a name different from ""
- String typeName = ((NamedElement)subsystem.getType()).getName();
-
- if(subsystem.getName().replaceAll(" ", "").compareToIgnoreCase("") == 0) {
- if(subsystem instanceof Port) {
- return ctx.createFailureStatus("Port should have a name ");
- } else
- return ctx.createFailureStatus("Property (subsystem or attribute) should have a name " + subsystem.getQualifiedName());
- } else
- //3. verify that a property has a name different from its type name
- if(subsystem.getName().compareToIgnoreCase(typeName) == 0) {
- if(subsystem instanceof Port) {
- return ctx.createFailureStatus("Port should have a name diffrent from its Type name" + subsystem.getQualifiedName());
+ Property subsystem = (Property) ctx.getTarget();
+ // System.err.println("\n\n Type: "+subsystem.getType() +"\n Owner: "+ subsystem.getOwner());
+ if (ConstraintsUtil.verifyRobotMLApplied(subsystem)) {
+ // 1. verify that a property has a type
+ if (subsystem.getType() == null) {
+ return ctx.createFailureStatus("Property (subsystem or attribute) should have a Type" + subsystem.getQualifiedName());
+ }
+
+ // 2. verify that a property has a name different from ""
+ String typeName = ((NamedElement) subsystem.getType()).getName();
+
+ if (subsystem.getName().replaceAll(" ", "").compareToIgnoreCase("") == 0) {
+ if (subsystem instanceof Port) {
+ return ctx.createFailureStatus("Port should have a name ");
+ } else {
+ return ctx.createFailureStatus("Property (subsystem or attribute) should have a name " + subsystem.getQualifiedName());
+ }
} else
- return ctx.createFailureStatus("Property (subsystem or attribute) should have a name diffrent from its Type name " + subsystem.getQualifiedName());
- }
+ // 3. verify that a property has a name different from its type name
+ if (subsystem.getName().compareToIgnoreCase(typeName) == 0) {
+ if (subsystem instanceof Port) {
+ return ctx.createFailureStatus("Port should have a name diffrent from its Type name" + subsystem.getQualifiedName());
+ } else {
+ return ctx.createFailureStatus("Property (subsystem or attribute) should have a name diffrent from its Type name " + subsystem.getQualifiedName());
+ }
+ }
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/VerifyAlphanumericNamedElement.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/VerifyAlphanumericNamedElement.java
index 26b28048363..8523659d87a 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/VerifyAlphanumericNamedElement.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/VerifyAlphanumericNamedElement.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@ public class VerifyAlphanumericNamedElement extends AbstractModelConstraint {
public static Pattern ALPHANUMERIC = Pattern.compile("[A-Za-z][A-Za-z0-9_]*");
public boolean checkAlphaNumeric(String s) {
- if(s == null) {
+ if (s == null) {
return false;
} else {
Matcher m = ALPHANUMERIC.matcher(s);
@@ -38,13 +38,13 @@ public class VerifyAlphanumericNamedElement extends AbstractModelConstraint {
@Override
public IStatus validate(IValidationContext ctx) {
// TODO Auto-generated method stub
- NamedElement element = (NamedElement)ctx.getTarget();
- if (ConstraintsUtil.verifyRobotMLApplied(element)){
- //4. verify that a property has an alphanumeric name that can also contain underscore
- if(((element instanceof Classifier) || (element instanceof Property) || (element instanceof DataType)) && !checkAlphaNumeric(element.getName())) {
- return ctx.createFailureStatus("Element should have an alphanumeric name beginning by a letter" + element.getQualifiedName());
+ NamedElement element = (NamedElement) ctx.getTarget();
+ if (ConstraintsUtil.verifyRobotMLApplied(element)) {
+ // 4. verify that a property has an alphanumeric name that can also contain underscore
+ if (((element instanceof Classifier) || (element instanceof Property) || (element instanceof DataType)) && !checkAlphaNumeric(element.getName())) {
+ return ctx.createFailureStatus("Element should have an alphanumeric name beginning by a letter" + element.getQualifiedName());
+ }
}
- }
return ctx.createSuccessStatus();
}
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/helper/RobotmlProfileHelper.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/helper/RobotmlProfileHelper.java
index 26207b5ef3b..ce98fc44d66 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/helper/RobotmlProfileHelper.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/helper/RobotmlProfileHelper.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Agent.java b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Agent.java
index 8f0f3fdd140..c47d22b92af 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Agent.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Agent.java
@@ -12,7 +12,7 @@ import org.eclipse.emf.common.util.EList;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.RobotML.Agent#getMovesOver <em>Moves Over</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Agent#getMovesOver <em>Moves Over</em>}</li>
* </ul>
* </p>
*
@@ -26,10 +26,10 @@ public interface Agent extends PhysicalObject {
* The list contents are of type {@link org.eclipse.papyrus.RobotML.Surface}.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Moves Over</em>' reference list isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Moves Over</em>' reference list isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Moves Over</em>' reference list.
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAgent_MovesOver()
* @model ordered="false"
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Algorithm.java b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Algorithm.java
index bcab380925e..d9d5b8fe334 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Algorithm.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Algorithm.java
@@ -18,11 +18,11 @@ import org.eclipse.uml2.uml.Operation;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getBase_Operation <em>Base Operation</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#isIsExternal <em>Is External</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getExtFunctionName <em>Ext Function Name</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getLibPath <em>Lib Path</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getLibFileFormat <em>Lib File Format</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getBase_Operation <em>Base Operation</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#isIsExternal <em>Is External</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getExtFunctionName <em>Ext Function Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getLibPath <em>Lib Path</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Algorithm#getLibFileFormat <em>Lib File Format</em>}</li>
* </ul>
* </p>
*
@@ -35,10 +35,10 @@ public interface Algorithm extends EObject {
* Returns the value of the '<em><b>Base Operation</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Base Operation</em>' reference isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Base Operation</em>' reference isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Base Operation</em>' reference.
* @see #setBase_Operation(Operation)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithm_Base_Operation()
@@ -51,7 +51,9 @@ public interface Algorithm extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.Algorithm#getBase_Operation <em>Base Operation</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Base Operation</em>' reference.
+ *
+ * @param value
+ * the new value of the '<em>Base Operation</em>' reference.
* @see #getBase_Operation()
* @generated
*/
@@ -61,10 +63,10 @@ public interface Algorithm extends EObject {
* Returns the value of the '<em><b>Is External</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Is External</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Is External</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Is External</em>' attribute.
* @see #setIsExternal(boolean)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithm_IsExternal()
@@ -77,7 +79,9 @@ public interface Algorithm extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.Algorithm#isIsExternal <em>Is External</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Is External</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Is External</em>' attribute.
* @see #isIsExternal()
* @generated
*/
@@ -87,10 +91,10 @@ public interface Algorithm extends EObject {
* Returns the value of the '<em><b>Ext Function Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Ext Function Name</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Ext Function Name</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Ext Function Name</em>' attribute.
* @see #setExtFunctionName(String)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithm_ExtFunctionName()
@@ -103,7 +107,9 @@ public interface Algorithm extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.Algorithm#getExtFunctionName <em>Ext Function Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Ext Function Name</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Ext Function Name</em>' attribute.
* @see #getExtFunctionName()
* @generated
*/
@@ -113,10 +119,10 @@ public interface Algorithm extends EObject {
* Returns the value of the '<em><b>Lib Path</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Lib Path</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Lib Path</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Lib Path</em>' attribute.
* @see #setLibPath(String)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithm_LibPath()
@@ -129,7 +135,9 @@ public interface Algorithm extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.Algorithm#getLibPath <em>Lib Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Lib Path</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Lib Path</em>' attribute.
* @see #getLibPath()
* @generated
*/
@@ -140,10 +148,10 @@ public interface Algorithm extends EObject {
* The default value is <code>"elf"</code>.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Lib File Format</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Lib File Format</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Lib File Format</em>' attribute.
* @see #setLibFileFormat(String)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithm_LibFileFormat()
@@ -156,7 +164,9 @@ public interface Algorithm extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.Algorithm#getLibFileFormat <em>Lib File Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Lib File Format</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Lib File Format</em>' attribute.
* @see #getLibFileFormat()
* @generated
*/
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/AlgorithmLibrary.java b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/AlgorithmLibrary.java
index 14bd683c7e6..e040cb964aa 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/AlgorithmLibrary.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/AlgorithmLibrary.java
@@ -12,8 +12,8 @@ import org.eclipse.emf.ecore.EObject;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.RobotML.AlgorithmLibrary#getBase_Class <em>Base Class</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.AlgorithmLibrary#getPath <em>Path</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.AlgorithmLibrary#getBase_Class <em>Base Class</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.AlgorithmLibrary#getPath <em>Path</em>}</li>
* </ul>
* </p>
*
@@ -26,10 +26,10 @@ public interface AlgorithmLibrary extends EObject {
* Returns the value of the '<em><b>Base Class</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Base Class</em>' reference isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Base Class</em>' reference isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Base Class</em>' reference.
* @see #setBase_Class(org.eclipse.uml2.uml.Class)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithmLibrary_Base_Class()
@@ -42,7 +42,9 @@ public interface AlgorithmLibrary extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.AlgorithmLibrary#getBase_Class <em>Base Class</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Base Class</em>' reference.
+ *
+ * @param value
+ * the new value of the '<em>Base Class</em>' reference.
* @see #getBase_Class()
* @generated
*/
@@ -52,10 +54,10 @@ public interface AlgorithmLibrary extends EObject {
* Returns the value of the '<em><b>Path</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Path</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Path</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Path</em>' attribute.
* @see #setPath(String)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAlgorithmLibrary_Path()
@@ -68,7 +70,9 @@ public interface AlgorithmLibrary extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.AlgorithmLibrary#getPath <em>Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Path</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Path</em>' attribute.
* @see #getPath()
* @generated
*/
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Allocate.java b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Allocate.java
index 168bc021920..719dcff48fa 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Allocate.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/Allocate.java
@@ -14,7 +14,7 @@ import org.eclipse.uml2.uml.Abstraction;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.RobotML.Allocate#getBase_Abstraction <em>Base Abstraction</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.Allocate#getBase_Abstraction <em>Base Abstraction</em>}</li>
* </ul>
* </p>
*
@@ -27,10 +27,10 @@ public interface Allocate extends EObject {
* Returns the value of the '<em><b>Base Abstraction</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Base Abstraction</em>' reference isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Base Abstraction</em>' reference isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Base Abstraction</em>' reference.
* @see #setBase_Abstraction(Abstraction)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getAllocate_Base_Abstraction()
@@ -43,7 +43,9 @@ public interface Allocate extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.Allocate#getBase_Abstraction <em>Base Abstraction</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Base Abstraction</em>' reference.
+ *
+ * @param value
+ * the new value of the '<em>Base Abstraction</em>' reference.
* @see #getBase_Abstraction()
* @generated
*/
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/BlenderMorse.java b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/BlenderMorse.java
index 7b8e1238921..53eaf235a6d 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/BlenderMorse.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/BlenderMorse.java
@@ -11,10 +11,10 @@ package org.eclipse.papyrus.RobotML;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#isDebugMode <em>Debug Mode</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#isDebugDisplay <em>Debug Display</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#getGravity <em>Gravity</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#get_viewport_shade <em>viewport shade</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#isDebugMode <em>Debug Mode</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#isDebugDisplay <em>Debug Display</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#getGravity <em>Gravity</em>}</li>
+ * <li>{@link org.eclipse.papyrus.RobotML.BlenderMorse#get_viewport_shade <em>viewport shade</em>}</li>
* </ul>
* </p>
*
@@ -27,10 +27,10 @@ public interface BlenderMorse extends RoboticSimulator {
* Returns the value of the '<em><b>Debug Mode</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Debug Mode</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Debug Mode</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Debug Mode</em>' attribute.
* @see #setDebugMode(boolean)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getBlenderMorse_DebugMode()
@@ -43,7 +43,9 @@ public interface BlenderMorse extends RoboticSimulator {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.BlenderMorse#isDebugMode <em>Debug Mode</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Debug Mode</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Debug Mode</em>' attribute.
* @see #isDebugMode()
* @generated
*/
@@ -53,10 +55,10 @@ public interface BlenderMorse extends RoboticSimulator {
* Returns the value of the '<em><b>Debug Display</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Debug Display</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Debug Display</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Debug Display</em>' attribute.
* @see #setDebugDisplay(boolean)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getBlenderMorse_DebugDisplay()
@@ -69,7 +71,9 @@ public interface BlenderMorse extends RoboticSimulator {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.BlenderMorse#isDebugDisplay <em>Debug Display</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Debug Display</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Debug Display</em>' attribute.
* @see #isDebugDisplay()
* @generated
*/
@@ -79,10 +83,10 @@ public interface BlenderMorse extends RoboticSimulator {
* Returns the value of the '<em><b>Gravity</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Gravity</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Gravity</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Gravity</em>' attribute.
* @see #setGravity(float)
* @see org.eclipse.papyrus.RobotML.RobotMLPackage#getBlenderMorse_Gravity()
@@ -95,7 +99,9 @@ public interface BlenderMorse extends RoboticSimulator {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.BlenderMorse#getGravity <em>Gravity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Gravity</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Gravity</em>' attribute.
* @see #getGravity()
* @generated
*/
@@ -107,10 +113,10 @@ public interface BlenderMorse extends RoboticSimulator {
* The literals are from the enumeration {@link org.eclipse.papyrus.RobotML.Shade}.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>viewport shade</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>viewport shade</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>viewport shade</em>' attribute.
* @see org.eclipse.papyrus.RobotML.Shade
* @see #set_viewport_shade(Shade)
@@ -124,7 +130,9 @@ public interface BlenderMorse extends RoboticSimulator {
* Sets the value of the '{@link org.eclipse.papyrus.RobotML.BlenderMorse#get_viewport_shade <em>viewport shade</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>viewport shade</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>viewport shade</em>' attribute.
* @see org.eclipse.papyrus.RobotML.Shade
* @see #get_viewport_shade()
* @generated
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CameraSystem.java b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CameraSystem.java
index ee82fb51b68..ad4bfc95998 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CameraSystem.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/CameraSystem.java
@@ -12,15 +12,15 @@ import org.eclipse.papyrus.RobotMLLibraries.RobotML_ModelLibrary.RobotML_DataTyp
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getWidth <em>Width</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getHeight <em>Height</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getAlpha_u <em>Alpha u</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getAlpha_v <em>Alpha v</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getU0 <em>U0</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getV0 <em>V0</em>}</li>
- * <li>{@link org.eclipse.papyrus.RobotML.CameraSystem#getColor_format <em>Color format</em>}</li>