/** * Adds the specified software system. * Please note that the parent software system of the container in scope cannot be added to this view. * * @param softwareSystem the SoftwareSystem to add to this view * @param addRelationships whether to add relationships to/from the component */ @Override public void add(@Nonnull SoftwareSystem softwareSystem, boolean addRelationships) { if (softwareSystem != null && !softwareSystem.equals(getSoftwareSystem())) { addElement(softwareSystem, addRelationships); } }
/** * Adds an individual container to this view. * * @param container the Container to add * @param addRelationships whether to add relationships to/from the container */ public void add(Container container, boolean addRelationships) { if (container != null && !container.equals(getContainer())) { addElement(container, addRelationships); } }
/** * Adds an individual component to this view. * * @param component the Component to add * @param addRelationships whether to add relationships to/from the component */ public void add(Component component, boolean addRelationships) { if (component != null) { if (!component.getContainer().equals(getContainer())) { throw new IllegalArgumentException("Only components belonging to " + container.getName() + " can be added to this view."); } addElement(component, addRelationships); } }
private void addExternalDependency(Element element, Set<Element> components) { if (element instanceof Component) { if (element.getParent().equals(getContainer())) { // the component is in the same container, so we'll ignore it since we're only interested in external dependencies return; } else { // the component is in a different container, so let's try to add that instead element = element.getParent(); } } if (element instanceof Container) { if (element.getParent().equals(this.getContainer().getParent())) { // the container is in the same software system addElement(element, true); return; } else { // the container is in a different software system, so add that instead element = element.getParent(); } } if (element instanceof SoftwareSystem || element instanceof Person) { addElement(element, true); } }