public class Services
extends java.lang.Object
Constructor and Description |
---|
Services() |
Modifier and Type | Method and Description |
---|---|
boolean |
edgeIsPartOfCycle(org.eclipse.sirius.diagram.DEdge edge)
Checks whether there is a cycle containing the edge by running a variant of Breadth First
Search starting from the target of the edge and checking if the edge's source can be reached
|
boolean |
edgeIsPointingDownwards(org.eclipse.sirius.diagram.DEdge edge)
Checks whether the edge is pointing from a layer to a lower one
|
static java.util.Collection<Metamodel> |
getAllMetamodels(ModularReferenceStructure mrs)
Returns all metamodels present in the ModularReferenceStructure
|
java.util.Collection<EPackage> |
getAllPackages(EPackage ePackage) |
java.util.List<EObject> |
getChainOfContainers(EObject eObject,
EObject topMostContainer)
Computes the containment chain of the given EObject
|
Metamodel |
getContainingMetamodel(org.eclipse.sirius.diagram.DNodeContainer containerView)
This method returns the metamodel containing the semantic element of the container view
|
Metamodel |
getCorrespondingMetamodel(EPackage mainPackage,
ModularReferenceStructure mrs) |
static java.util.List<EClassifier> |
getEAllClassifiers(EPackage ePackage)
Gets all EClassifiers inside an EPackage recursively.
|
java.util.Collection<EPackage> |
getEAllSubPackages(EPackage ePackage)
Gets all subpackages of ePackage recursively
|
java.util.Set<Metamodel> |
getExtendedMetamodels(Metamodel metamodel) |
java.util.Set<org.modelversioning.emfprofile.Stereotype> |
getExtendingStereotypes(Metamodel extendingMetamodel,
Metamodel extendedMetamodel) |
java.util.Set<Metamodel> |
getReferencedMetamodels(Metamodel metamodel)
Gets all metamodels in the modular reference structure, on which the metamodel passed as
parameter depend.
|
static EPackage |
getTopMostPackage(EPackage ePackage)
Returns the main EPackage of the metamodel containing ePackage
|
void |
hideTransitiveEdges(org.eclipse.sirius.diagram.DSemanticDiagram diagram,
boolean excludeCyclicalDependencies)
Hides all edges in the diagram that are transitive.
|
boolean |
metamodelAlreadyExists(EPackage mainPackage,
ModularReferenceStructure mrs) |
java.lang.String |
printDependencies(org.eclipse.sirius.diagram.DEdge edge)
Returns a String of all EClassifiers in the target metamodel, on which some EClass in the
source metamodel depends.
|
java.lang.String |
printStereotypes(org.eclipse.sirius.diagram.DDiagramElement view) |
public java.util.Set<Metamodel> getReferencedMetamodels(Metamodel metamodel)
metamodel
- the metamodel being inspectedpublic java.util.Set<org.modelversioning.emfprofile.Stereotype> getExtendingStereotypes(Metamodel extendingMetamodel, Metamodel extendedMetamodel)
public java.lang.String printStereotypes(org.eclipse.sirius.diagram.DDiagramElement view)
public static java.util.Collection<Metamodel> getAllMetamodels(ModularReferenceStructure mrs)
mrs
- the ModularReferenceStructurepublic static EPackage getTopMostPackage(EPackage ePackage)
ePackage
- public boolean edgeIsPointingDownwards(org.eclipse.sirius.diagram.DEdge edge)
edge
- public boolean edgeIsPartOfCycle(org.eclipse.sirius.diagram.DEdge edge)
edge
- public Metamodel getContainingMetamodel(org.eclipse.sirius.diagram.DNodeContainer containerView)
containerView
- a graphical element in the diagram. Must be inside a Metamodelpublic java.util.Collection<EPackage> getEAllSubPackages(EPackage ePackage)
ePackage
- public java.util.List<EObject> getChainOfContainers(EObject eObject, EObject topMostContainer)
eObject
- The EObject whose containment chain is to be returnedtopMostContainer
- the container on which the search should stoppublic java.lang.String printDependencies(org.eclipse.sirius.diagram.DEdge edge)
edge
- public static java.util.List<EClassifier> getEAllClassifiers(EPackage ePackage)
ePackage
- public Metamodel getCorrespondingMetamodel(EPackage mainPackage, ModularReferenceStructure mrs)
public boolean metamodelAlreadyExists(EPackage mainPackage, ModularReferenceStructure mrs)
public void hideTransitiveEdges(org.eclipse.sirius.diagram.DSemanticDiagram diagram, boolean excludeCyclicalDependencies)
diagram
- the MRS diagramexcludeCyclicalDependencies
- if true, then edges that are part of cycles will not be hidden regardless of their being transitive or not