Skip to content
Snippets Groups Projects
Commit 307f0df7 authored by Alberto Debiasi's avatar Alberto Debiasi
Browse files

Update EntityUtil.java.

Change-Id: Idb3688931f36f6527f6c01f6824b0606094d34df
parent 19e7bca4
No related branches found
No related tags found
No related merge requests found
......@@ -250,7 +250,7 @@ public class EntityUtil {
} catch (PartInitException e) {
}
return null;
return null;
}
public Model loadModel(String projectName, String fileName) {
......@@ -1759,26 +1759,26 @@ public class EntityUtil {
}
public Set<StateMachine> getNominalStateMachines(Model umlModel) {
Set<StateMachine> stateMachines = new HashSet<StateMachine>();
if (umlModel != null) {
TreeIterator<EObject> allElements = umlModel.eResource().getAllContents();
if (allElements != null) {
Collection<org.eclipse.uml2.uml.Class> classes = EcoreUtil
.getObjectsByType(iterator2Collection(allElements), UMLPackage.eINSTANCE.getClass_());
for (Class c : classes) {
if (isNominalStateMachine(c)) {
stateMachines.add((StateMachine) c);
}
}
}
}
return stateMachines;
}
public Set<StateMachine> getNominalStateMachines(UmlModel umlModel) {
Set<StateMachine> stateMachines = new HashSet<StateMachine>();
......@@ -2226,8 +2226,8 @@ public class EntityUtil {
return ports;
}
private Collection<? extends Port> getUmlPortsExceptEventsFromClass(Class umlElement, int portDirection) {
Set<Port> ports = new HashSet<Port>();
private EList<? extends Port> getUmlPortsExceptEventsFromClass(Class umlElement, int portDirection) {
EList<Port> ports = new BasicEList<Port>();
for (Port umlPort : umlElement.getOwnedPorts()) {
FlowPort fp = getFlowPort(umlPort);
if ((fp.getDirection().getValue() == portDirection) && (!isEventPortAttribute(umlPort))) {
......@@ -3675,24 +3675,24 @@ public class EntityUtil {
}
}
public Class getSystemElement(Model model) throws Exception {
if (model != null) {
TreeIterator<EObject> allElements = model.eResource().getAllContents();
if (allElements != null) {
Collection<org.eclipse.uml2.uml.Class> classes = EcoreUtil
.getObjectsByType(iterator2Collection(allElements), UMLPackage.eINSTANCE.getClass_());
for (Class c : classes) {
if (isSystem(c)) {
return c;
}
}
}
}
return null;
}
/**
* Returns the System component of the given package, if any.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment