Package com.structurizr.view
Class ComponentView
java.lang.Object
com.structurizr.view.View
com.structurizr.view.ModelView
com.structurizr.view.StaticView
com.structurizr.view.ComponentView
- All Implemented Interfaces:
PropertyHolder
Represents a Component view from the C4 model, showing the components within a given container.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an individual component to this view, including relationships to/from that component.voidAdds an individual component to this view.voidAdds an individual container to this view, including relationships to/from that container.voidAdds an individual container to this view.voidAdds all components in the container to this view.voidAdds all other containers in the software system to this view.voidAdds all people, software systems, sibling containers and components belonging to the container in scope.voidAdds the default set of elements to this view.voidAdds allElements external to the container (Person, SoftwareSystem or Container) that haveRelationships to or fromComponents in this view.voidaddNearestNeighbours(Element element) Adds all people, software systems, sibling containers and components that are directly connected to the specified element.protected booleancanBeRemoved(Element element) protected voidcheckElementCanBeAdded(Element element) Gets the container associated with this view.Gets the ID of the container associated with this view.booleanDetermines whether container boundaries should be visible for "external" components (those outside the container in scope).getName()Gets the (computed) name of this view.Gets the ID of the software system this view is associated with.voidRemoves an individual component from this view.voidRemoves an individual container from this view.voidsetExternalSoftwareSystemBoundariesVisible(boolean externalContainerBoundariesVisible) Sets whether container boundaries should be visible for "external" components (those outside the container in scope).Methods inherited from class com.structurizr.view.StaticView
add, add, add, add, add, add, add, addAllPeople, addAllSoftwareSystems, addAnimation, getAnimations, remove, remove, remove, removeElementsThatAreUnreachableFrom, removeElementsWithTag, removeRelationshipsWithTagMethods inherited from class com.structurizr.view.ModelView
addElement, addNearestNeighbours, addRelationship, disableAutomaticLayout, enableAutomaticLayout, enableAutomaticLayout, enableAutomaticLayout, enableAutomaticLayout, getAutomaticLayout, getDimensions, getElements, getElementView, getMergeFromRemote, getModel, getPaperSize, getRelationships, getRelationshipView, getSoftwareSystem, getViewSet, isElementInView, remove, removeElement, removeElementsWithNoRelationships, removeRelationshipsNotConnectedToElement, setDimensions, setLayoutMergeStrategy, setMergeFromRemote, setPaperSizeMethods inherited from class com.structurizr.view.View
addProperty, getDescription, getKey, getOrder, getProperties, getTitle, setDescription, setTitle
-
Method Details
-
getSoftwareSystemId
Description copied from class:ModelViewGets the ID of the software system this view is associated with.- Overrides:
getSoftwareSystemIdin classModelView- Returns:
- the ID, as a String, or null if this view is not associated with a software system (e.g. it's a system landscape view)
-
getContainerId
Gets the ID of the container associated with this view.- Returns:
- the ID, as a String
-
getContainer
Gets the container associated with this view.- Returns:
- a Container object
-
addAllContainers
public void addAllContainers()Adds all other containers in the software system to this view. -
add
Adds an individual container to this view, including relationships to/from that container.- Parameters:
container- the Container to add
-
add
Adds an individual container to this view.- Parameters:
container- the Container to addaddRelationships- whether to add relationships to/from the container
-
addAllComponents
public void addAllComponents()Adds all components in the container to this view. -
add
Adds an individual component to this view, including relationships to/from that component.- Parameters:
component- the Component to add
-
add
Adds an individual component to this view.- Parameters:
component- the Component to addaddRelationships- whether to add relationships to/from the component
-
remove
Removes an individual container from this view.- Parameters:
container- the Container to remove
-
remove
Removes an individual component from this view.- Parameters:
component- the Component to remove
-
getName
Gets the (computed) name of this view. -
addDefaultElements
public void addDefaultElements()Adds the default set of elements to this view.- Specified by:
addDefaultElementsin classStaticView
-
addAllElements
public void addAllElements()Adds all people, software systems, sibling containers and components belonging to the container in scope.- Specified by:
addAllElementsin classStaticView
-
addNearestNeighbours
Adds all people, software systems, sibling containers and components that are directly connected to the specified element.- Specified by:
addNearestNeighboursin classStaticView- Parameters:
element- an Element
-
addExternalDependencies
public void addExternalDependencies()Adds all
Elements external to the container (Person, SoftwareSystem or Container) that haveRelationships to or fromComponents in this view.Not included are:
- References to and from the
Containerof this view (only references to and from the components are considered) Relationships between externalElements (i.e. elements that are not part of this container)
Don't forget to add elements to your view prior to calling this method, e.g. by calling
addAllComponents()or be selectively choosing certain components. - References to and from the
-
checkElementCanBeAdded
- Specified by:
checkElementCanBeAddedin classModelView
-
canBeRemoved
- Specified by:
canBeRemovedin classModelView
-
getExternalContainerBoundariesVisible
public boolean getExternalContainerBoundariesVisible()Determines whether container boundaries should be visible for "external" components (those outside the container in scope).- Returns:
- true if external container boundaries are visible, false otherwise
-
setExternalSoftwareSystemBoundariesVisible
public void setExternalSoftwareSystemBoundariesVisible(boolean externalContainerBoundariesVisible) Sets whether container boundaries should be visible for "external" components (those outside the container in scope).- Parameters:
externalContainerBoundariesVisible- true if external container boundaries should be visible, false otherwise
-