org.eclipse.uml2.uml.Element Java Examples

The following examples show how to use org.eclipse.uml2.uml.Element. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CompositeDiagramElementsManager.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void addPortToComposite(RoundedCompartmentEditPart compartment) {
	Element elem = (Element) ((View)compartment.getModel()).getElement();
	List<Port> ports = Collections.emptyList();
	if(elem instanceof Property){
		Property prop = (Property) elem;
		Object clazz =  prop.getType();
		if(clazz instanceof Classifier){
			ports = (List<Port>) (Object) ((Classifier)clazz).getAttributes().stream().filter(p-> p instanceof Port).collect(Collectors.toList());
		}
	}else if(elem instanceof org.eclipse.uml2.uml.Class){
		ports = (List<Port>) (Object) ((org.eclipse.uml2.uml.Class) elem).getAttributes().stream().filter(p-> p instanceof Port).collect(Collectors.toList());
	}
	
	for(Port p : ports){
		CompositeDiagramElementsController.addPortToCompartmentEditPart(compartment, p);
	}
}
 
Example #2
Source File: AbstractDiagramElementsTxtUmlArranger.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
private Map<GraphicalEditPart, hu.elte.txtuml.utils.diagrams.Rectangle> createObjectRectangleMappingFromObjectsAndEditParts(Set<RectangleObject> objects,
		List<GraphicalEditPart> editParts) {
	Map<GraphicalEditPart, hu.elte.txtuml.utils.diagrams.Rectangle> result = new HashMap<>();
	for(RectangleObject obj : objects){
		Optional<Element> e = txtUmlRegistry.findElement(obj.getName());
		if(e.isPresent()){
			GraphicalEditPart ep = (GraphicalEditPart) getEditPartOfModelElement(editParts, e.get());
			if(ep != null){
				hu.elte.txtuml.utils.diagrams.Rectangle rect =  new hu.elte.txtuml.utils.diagrams.Rectangle(obj.getPosition().getX(), obj.getPosition().getY(),
												obj.getPixelWidth(), obj.getPixelHeight());
				result.put(ep, rect);
			}
		}
	}
	return result;
}
 
Example #3
Source File: AbstractRelationshipRenderer.java    From textuml with Eclipse Public License 1.0 6 votes vote down vote up
protected boolean shouldRender(IRenderingSession<Element> context, Element source, Element destination) {
    boolean isModelLibrary = MDDUtil.getRootPackage(destination.getNearestPackage()).isModelLibrary();
    boolean showModelLibraries = context.getSettings().getBoolean(SHOW_ELEMENTS_IN_LIBRARIES);
    if (isModelLibrary && !showModelLibraries)
        return false;

    ShowCrossPackageElementOptions crossPackageElementOption = context.getSettings().getSelection(
            ShowCrossPackageElementOptions.class);
    switch (crossPackageElementOption) {
    case Never:
        return EcoreUtil.equals(source.getNearestPackage(), destination.getNearestPackage());
    case Immediate:
        return EcoreUtil.isAncestor(context.getRoot(), source);
    case Always:
        return true;
    case Local:
        return ElementUtils.sameRepository(context.getRoot(), destination);
    }
    // should never run
    return false;
}
 
Example #4
Source File: ClassDiagramElementsManager.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void addElementsToDiagram(List<Element> elements){
	List<Element> diagramelements = UMLModelManager.getElementsOfTypesFromList(elements, elementsToBeAdded);
	List<Element> diagramconnections = UMLModelManager.getElementsOfTypesFromList(elements, connectorsToBeAdded);
	
	ClassDiagramElementsController.addElementsToClassDiagram((ModelEditPart) diagramEditPart, diagramelements);
	ClassDiagramElementsController.addElementsToClassDiagram((ModelEditPart) diagramEditPart, diagramconnections);
	
	@SuppressWarnings("unchecked")
	List<EditPart> editParts = diagramEditPart.getChildren();
	
	for(EditPart editPart : editParts){
		if(editPart instanceof ClassEditPart || editPart instanceof InterfaceEditPart){
			addSubElements(editPart);
		}
	}
}
 
Example #5
Source File: AbstractGenerator.java    From textuml with Eclipse Public License 1.0 6 votes vote down vote up
protected void fillDebugInfo(final Element element, Node node) {
    if (!context.isDebug())
        return;
    Token token = null;
    while (token == null && node != null) {
        token = sourceMiner.findLastChild(node, Token.class).orElse(null);
        node = node.parent();
    }
    if (token == null)
        return;
    final int lineNumber = token.getLine();
    final String sourceFile = context.getSourcePath() != null ? context.getSourcePath() : null;
    sourceContext.getReferenceTracker().add(new IDeferredReference() {
        @Override
        public void resolve(IBasicRepository repository) {
            if (MDDExtensionUtils.isDebuggable(element))
                MDDExtensionUtils.addDebugInfo(element, sourceFile, lineNumber);
        }
    }, Step.STEREOTYPE_APPLICATIONS);
}
 
Example #6
Source File: TxtUMLElementsRegistry.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Returns all connections that are should be on the diagram according to the report 
 * @param diagramName - The name of the diagram which's {@link org.eclipse.uml2.uml.Connection Connections} are required
 * @return List of org.eclipse.uml2 model connections
 */
public List<Element> getConnections(String diagramName){
	List<Element> elements = new LinkedList<Element>();
	Optional<? extends Element> elem;
	DiagramExportationReport report = this.descriptor.getReport(diagramName);
	
	if(report != null && report.isSuccessful()){
		for(LineAssociation association : report.getLinks()){
			if(association.getType() == AssociationType.generalization){
				elem = findGeneralization(association.getFrom(), association.getTo());
			}else{
				elem = findAssociation(association.getId());
			}
			
			if(!elem.isPresent()){
				elem = findTransition(association.getId());
			}
			
			if(elem.isPresent()){
				elements.add(elem.get());
			}
		}
	}
	
	return elements;
}
 
Example #7
Source File: StateMachineDiagramElementsManager.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Adds the subElements to an EditPart. Then calls the {@link #fillState(EditPart)}
 * for every state. 
 * @param region - The EditPart
 */
private void addSubElements(RegionEditPart region, List<Element> elements){
	
	List<State> states = this.filterSubelementsOfRegion(region, UMLModelManager.getElementsOfTypeFromList(elements, State.class));
	List<Pseudostate> pseudostates = this.filterSubelementsOfRegion(region, UMLModelManager.getElementsOfTypeFromList(elements, Pseudostate.class));
	List<FinalState> finalstates = this.filterSubelementsOfRegion(region, UMLModelManager.getElementsOfTypeFromList(elements, FinalState.class));
	List<Transition> transitions = this.filterSubelementsOfRegion(region, UMLModelManager.getElementsOfTypeFromList(elements, Transition.class));

	StateMachineDiagramElementsController.addPseudostatesToRegion(region, pseudostates);
	StateMachineDiagramElementsController.addStatesToRegion(region, states);
	StateMachineDiagramElementsController.addFinalStatesToRegion(region, finalstates);
	StateMachineDiagramElementsController.addTransitionsToRegion(region, transitions);

	@SuppressWarnings("unchecked")
	List<EditPart> subEPs = StateMachineDiagramElementsController.getRegionCompatementEditPart(region).getChildren();
	
	for(EditPart subEP : subEPs){
		if(subEP instanceof StateEditPart){
			fillState(subEP, elements);
		}
	}
}
 
Example #8
Source File: DefaultPapyrusModelManager.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createDiagrams(IProgressMonitor monitor){
	monitor.beginTask("Generating empty diagrams", 100);
	monitor.subTask("Creating empty diagrams...");
	
	if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_PREF)){
		List<Element> packages = modelManager.getElementsOfTypes(Arrays.asList(Model.class, Package.class));
		diagramManager.createDiagrams(packages, new CreateClassDiagramCommand());
	}
	
	if(PreferencesManager.getBoolean(PreferencesManager.ACTIVITY_DIAGRAM_PREF)){
		List<Element> activities = modelManager.getElementsOfTypes(Arrays.asList(Activity.class));
		diagramManager.createDiagrams(activities, new CreateActivityDiagramCommand());
	}
	
	if(PreferencesManager.getBoolean(PreferencesManager.STATEMACHINE_DIAGRAM_PREF)){
		List<Element> statemachines = modelManager.getElementsOfTypes(Arrays.asList(StateMachine.class));
		diagramManager.createDiagrams(statemachines, new CreateStateMachineDiagramCommand());
	}
	monitor.worked(100);
}
 
Example #9
Source File: AssociationRenderer.java    From textuml with Eclipse Public License 1.0 6 votes vote down vote up
private void addEndAttributes(IndentedPrintWriter pw, String name, Property end, IRenderingSession<Element> context) {
    Property opposite = end.getOtherEnd();
    String arrow = end.isNavigable() & !opposite.isNavigable() ? "open" : "none";
    switch (opposite.getAggregation()) {
    case COMPOSITE_LITERAL:
        arrow = "diamond" + arrow;
        break;
    case SHARED_LITERAL:
        arrow = "ediamond" + arrow;
        break;
    default:
        arrow += "none";
    }
    if (context.getSettings().getBoolean(SHOW_ASSOCIATION_END_OWNERSHIP)
            && !end.getAssociation().getOwnedEnds().contains(opposite))
        arrow = "dot" + arrow;
    DOTRenderingUtils.addAttribute(pw, "arrow" + name, arrow);
    String label = (context.getSettings().getBoolean(SHOW_ASSOCIATION_END_NAME) && end.getName() != null ? end
            .getName() : "");
    if (context.getSettings().getBoolean(SHOW_ASSOCIATION_END_MULTIPLICITY))
        label += UML2DOTRenderingUtils.renderMultiplicity(end, false);
    DOTRenderingUtils.addAttribute(pw, name + "label", label);
}
 
Example #10
Source File: Uml2Service.java    From uml2solidity with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Returns the value cast as an List.
 * 
 * @param clazz
 * @param stereotypeName
 * @param propertyName
 * @return
 */
public static List<?> getStereotypeListValue(Element clazz, String stereotypeName, String propertyName) {
	Stereotype stereotype = getStereotype(clazz, stereotypeName);
	if (stereotype != null) {
		try {
			Object value = clazz.getValue(stereotype, propertyName);
			if (value instanceof List) {
				List<?> new_name = (List<?>) value;
				return new_name;
			}
		} catch (IllegalArgumentException e) {
		}

	}
	return new ArrayList<Object>();
}
 
Example #11
Source File: CppExporterUtils.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
private static Class getSignalFactoryClass(Signal signal, List<Element> elements) {
	for (Element element : elements) {
		if (element.eClass().equals(UMLPackage.Literals.CLASS)) {
			Class cls = (Class) element;
			for (Operation operation : cls.getOperations()) {
				if (isConstructor(operation)) {
					for (Parameter param : operation.getOwnedParameters()) {
						if (param.getType().getName().equals(signal.getName()))
							return cls;
					}
				}

			}
		}
	}

	return null;
}
 
Example #12
Source File: TxtUMLPapyrusModelManager.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void addElementsToDiagram(Diagram diagram, IProgressMonitor monitor) {
	AbstractDiagramElementsManager diagramElementsManager;

	DiagramEditPart diagep = diagramManager.getActiveDiagramEditPart();
	if(diagram.getType().equals(diagramType_CD)){
		diagramElementsManager = new ClassDiagramElementsManager(diagep);
	}else if(diagram.getType().equals(diagramType_SMD)){
		diagramElementsManager = new StateMachineDiagramElementsManager(diagep);
	}else if(diagram.getType().equals(diagramType_CSD)){
		diagramElementsManager = new CompositeDiagramElementsManager(diagep);
	}else{
		return;
	}
	
	List<Element> baseElements = new ArrayList<Element>();
	List<Element> nodes = txtumlregistry.getNodes(diagram.getName());
	List<Element> connections = txtumlregistry.getConnections(diagram.getName());
	baseElements.addAll(nodes);
	baseElements.addAll(connections);

	diagramElementsManager.addElementsToDiagram(baseElements);
}
 
Example #13
Source File: UMLModelManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Builds up a multimap. Hashes the Model Elements by their eClass
 * @return The model elements in a MultiMap
 */
private Multimap<java.lang.Class<?>, Element> buildUpMap(){
	Multimap<java.lang.Class<?>, Element> result = HashMultimap.create(); 
	Element root = getRoot();
	Queue<Element> queue = new LinkedList<Element>();
	queue.add(root);
	runThroughModelRecursive(queue, result);
	return result;
}
 
Example #14
Source File: UMLModelManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Collects the {@link Element}s of same type form a list 
 * @param <T>
 * @param elements - List of elements
 * @param type - The type that is searched
 * @return Returns the Elements of same type 
 */
@SuppressWarnings("unchecked")
public static <T extends Element> List<T> getElementsOfTypeFromList(List<Element> elements, java.lang.Class<T> type){
	List<T> result = new LinkedList<T>(); 
	for(Element element : elements){
		if (isElementOfType(element, type)){
			result.add((T) element);
		}
	}
	return result;
}
 
Example #15
Source File: UMLModelManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
private List<Element> recursive(List<Element> ownedElements){
	List<Element> result = new LinkedList<Element>();
	result.addAll(ownedElements);
	for (Element act : ownedElements) {
		if (!isElementOfType(act, Package.class)){
			result.addAll(recursive(act.getOwnedElements()));
		}
	}
	return result;
}
 
Example #16
Source File: UMLModelManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Collects the {@link Element}s of same type form a list.
 * Elements of same type will be collected at one go
 * @param <T>
 * @param elements - List of elements
 * @param types - The Collection of types that is searched
 * @return Returns the Elements of types
 */
public static List<Element> getElementsOfTypesFromList(List<Element> elements,
							Collection<java.lang.Class<? extends Element>> types){
	List<Element> all = new LinkedList<Element>();
	for(java.lang.Class<? extends Element> type : types){
		all.addAll(getElementsOfTypeFromList(elements, type));
	}
	return all;
}
 
Example #17
Source File: TxtUMLElementsRegistry.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Finds the org.eclipse.uml2 element from a model according to the elements canonical name 
 * @param nodeName - The model elements canonical name
 * @return The appropriate model element or null if not found
 */
public Optional<Element> findElement(String nodeName){
	for(ModelMapProvider modelMapProvider:  modelMapProviders.values()){
		Element elem = (Element) modelMapProvider.getByName(nodeName);
		if(elem != null){
			return Optional.of(elem);
		}
	}
	return Optional.empty();
}
 
Example #18
Source File: ElementUtils.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
public static boolean sameRepository(Element elementA, Element elementB) {
    URI resourceALocation = elementA.eResource().getURI();
    URI resourceBLocation = elementB.eResource().getURI();
    if (resourceALocation.isHierarchical() && resourceBLocation.isHierarchical())
        if (URI.createURI("..").resolve(resourceALocation).equals(URI.createURI("..").resolve(resourceBLocation)))
            return true;
    return resourceALocation.equals(resourceBLocation);
}
 
Example #19
Source File: TxtUMLElementsRegistry.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Finds an {@link Transition} that matches the given ID
 * @param id - the TxtUML ID of the transition
 * @return The Transition model Element
 */
public Optional<Transition> findTransition(String id) {
	Optional<Element> elem = findElement(id);
	if(elem.isPresent() && elem.get() instanceof Transition){
		return Optional.of((Transition) elem.get());
	}
	return Optional.empty();
}
 
Example #20
Source File: TxtUMLPapyrusModelManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createDiagrams(IProgressMonitor monitor) {
	 monitor.beginTask("Generating empty diagrams", 100);
	 monitor.subTask("Creating empty diagrams...");
	 
		List<Triple<DiagramType, String, Element>> diagramRoots = txtumlregistry.getDiagramRootsWithDiagramNames();
		modelManager.getElementsOfTypes(Arrays.asList(org.eclipse.uml2.uml.Class.class));
		
		for(Triple<DiagramType, String, Element> diagramRoot : diagramRoots){
			if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_PREF) 
					&& diagramRoot.getFirst().equals(DiagramType.Class)) {
				diagramManager.createDiagram(diagramRoot.getThird(), 
					diagramRoot.getSecond(), 
					new CreateClassDiagramCommand());
			}
			
			if(PreferencesManager.getBoolean(PreferencesManager.STATEMACHINE_DIAGRAM_PREF) 
					&& diagramRoot.getFirst().equals(DiagramType.StateMachine)) {
				diagramManager.createDiagram(diagramRoot.getThird(), 
					diagramRoot.getSecond(), 
					new CreateStateMachineDiagramCommand());
			}
			
			if(PreferencesManager.getBoolean(PreferencesManager.COMPOSITE_DIAGRAM_PREF)
					&& diagramRoot.getFirst().equals(DiagramType.Composite)) {
				diagramManager.createDiagram(diagramRoot.getThird(),
						diagramRoot.getSecond(),
						new CreateCompositeDiagramCommand());
			}
		}
	 monitor.worked(100);
}
 
Example #21
Source File: CppExporterUtils.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
public static Set<String> getAllModelClassNames(List<Element> elements) {

		Set<String> classNames = new HashSet<String>();
		for (Class cls : getAllModelClass(elements)) {
			if (!isSignalFactoryClass(cls, elements)) {
				classNames.add(cls.getName());
			}
		}

		return classNames;
	}
 
Example #22
Source File: ActivityNodeResolver.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
private <ItemType extends Element> Class getParentClass(ItemType element) {
	Element parent = element.getOwner();
	while (!parent.eClass().equals(UMLPackage.Literals.CLASS)) {
		parent = parent.getOwner();
	}
	return (Class) parent;
}
 
Example #23
Source File: StereotypeUtils.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
public static Stereotype getStereotype(Element element, String stereotypeQName) {
    for (Stereotype s : element.getAppliedStereotypes())
        if (stereotypeQName.equals(s.getName()) || stereotypeQName.equals(s.getQualifiedName()))
            return s;
    if (element instanceof Classifier)
        for (Classifier general : ((Classifier) element).getGenerals()) {
            Stereotype found = getStereotype(general, stereotypeQName);
            if (found != null)
                return found;
        }
    return null;
}
 
Example #24
Source File: CommentRenderer.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
public boolean renderObject(Comment element, IndentedPrintWriter out, IRenderingSession context) {
      if (!context.getSettings().getBoolean(UML2DOTPreferences.SHOW_COMMENTS))
          return false;
      List<Element> annotatedElements = element.getAnnotatedElements().stream().filter(it -> context.isRendered(it)).collect(Collectors.toList());
if (annotatedElements.isEmpty())
      	return false;
      String commentText = generateCommentText(element);
      if (commentText == null)
      	return false;
      String commentNodeId = "comment_" + getXMIID(element);
out.println('"' + commentNodeId + "\" [shape=note,width=2,height=1,label=\"" + escapeForDot(commentText) + "\"]");
      for (Element commented : annotatedElements) {
      	if (commented != element.getNearestPackage()) {
           String from = "\"" + ((NamedElement) commented).getName() + "\":port";
		String to = "\"" + commentNodeId + "\"";
		out.print(from + " -- " + to);
           out.println("[");
           out.runInNewLevel(() -> {
            addAttribute(out, "head", "none");
            addAttribute(out, "tail", "none");
            addAttribute(out, "constraint", Boolean.toString(false));
            addAttribute(out, "arrowtail", "none");
            addAttribute(out, "arrowhead", "none");
            addAttribute(out, "style", "dashed");
            addAttribute(out, "rank", "-1");
           });
           out.println("]");
      	}
      }
      return true;
  }
 
Example #25
Source File: ClassDiagramElementsManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Removes the {@link Property Properties} that have {@link Association Associations} from the given list
 * @param properties - the list
 */
private void removeAssociationProperties(List<Property> properties){
	List<Element> propertiesToRemove = new LinkedList<Element>();
	for(Element property : properties){
		if(property instanceof Property){
			Property prop = (Property) property;
			if(prop.getAssociation() != null){
				propertiesToRemove.add(property);
			}
		}
	}
	properties.removeAll(propertiesToRemove);
}
 
Example #26
Source File: ElementBuilder.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
public <T extends ElementBuilder<? extends Element>> T as(Class<T> type) {
    if (type.isInstance(this))
        return (T) this;
    if (getParent() != null)
        return getParent().as(type);
    throw new ClassCastException(this + " as " + type);
}
 
Example #27
Source File: MDDUtil.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
public static <T extends Element> T findSingleByClass(List<? extends Element> elements, EClass elementClass,
        boolean required) {
    List<T> found = filterByClass(elements, elementClass);
    if (found.size() > 2)
        throw new IllegalArgumentException("Found: " + found.size());
    if (found.isEmpty())
        if (required)
            throw new IllegalArgumentException("Found none");
        else
            return null;
    return found.get(0);
}
 
Example #28
Source File: ActivityDiagramElementsManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns the types of nodes that are to be added
 * @return Returns the types of nodes that are to be added
 */
private List<java.lang.Class<? extends Element>> generateNodesToBeAdded() {
	List<java.lang.Class<? extends Element>> nodes = new LinkedList<>(Arrays.asList(
			AcceptEventAction.class,
			Activity.class,
			ActivityFinalNode.class,
			AddStructuralFeatureValueAction.class,
			AddVariableValueAction.class,
			BroadcastSignalAction.class,
			CallBehaviorAction.class, 
			CallOperationAction.class,
			CreateObjectAction.class,
			DecisionNode.class,
			DestroyObjectAction.class,
			FinalNode.class,
			FlowFinalNode.class,
			ForkNode.class,
			InitialNode.class,
			JoinNode.class,
			MergeNode.class,
			OpaqueAction.class,
			ReadSelfAction.class,
			ReadStructuralFeatureAction.class,
			ReadVariableAction.class,
			SendObjectAction.class,
			SendSignalAction.class,
			ValueSpecificationAction.class
		));
	
	if(PreferencesManager.getBoolean(PreferencesManager.ACTIVITY_DIAGRAM_COMMENT_PREF))
		nodes.add(Comment.class);
	
	return nodes;
}
 
Example #29
Source File: ActivityDiagramElementsManager.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void addElementsToDiagram(List<Element> elements) {
	List<Element> diagramelements = UMLModelManager.getElementsOfTypesFromList(elements, nodesToBeAdded);
	List<Element> diagramconnections = UMLModelManager.getElementsOfTypesFromList(elements, connectorsToBeAdded);

	ActivityDiagramElementsController.addElementsToActivityDiagram((ActivityDiagramEditPart) diagramEditPart, diagramelements);
	ActivityDiagramElementsController.addElementsToActivityDiagram((ActivityDiagramEditPart) diagramEditPart, diagramconnections);
}
 
Example #30
Source File: Repository.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public List<Element> findAll(EObjectCondition condition, boolean internalOnly) {
    List<Element> result = new ArrayList<Element>();
    for (Resource currentResource : resourceSet.getResources()) {
        if (systemResources.contains(currentResource))
            continue;
        if (internalOnly && !currentResource.getURI().toString().startsWith(baseURI.toString()))
            continue;
        IQueryResult partial = new SELECT(new FROM(currentResource.getContents()), new WHERE(condition)).execute();
        for (EObject object : partial)
            result.add((Element) object);
    }
    return result;
}