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
,AnimatedView
,Comparable<View>
Represents a Component view from the C4 model, showing the components within a given container.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an individual component to this view, including relationships to/from that component.void
Adds an individual component to this view.void
Adds an individual container to this view, including relationships to/from that container.void
Adds an individual container to this view.void
Adds all components in the container to this view.void
Adds all other containers in the software system to this view.void
Adds all people, software systems, sibling containers and components belonging to the container in scope.void
Adds the default set of elements to this view.void
Adds allElement
s external to the container (Person, SoftwareSystem or Container) that haveRelationship
s to or fromComponent
s in this view.void
addNearestNeighbours
(Element element) Adds all people, software systems, sibling containers and components that are directly connected to the specified element.protected boolean
canBeRemoved
(Element element) protected void
checkElementCanBeAdded
(Element element) Gets the container associated with this view.Gets the ID of the container associated with this view.boolean
Deprecated.getName()
Gets the (computed) name of this view.Gets the ID of the software system this view is associated with.void
Removes an individual component from this view.void
Removes an individual container from this view.Methods inherited from class com.structurizr.view.StaticView
add, add, add, add, add, add, add, addAllPeople, addAllSoftwareSystems, addAnimation, getAnimations, remove, remove, remove, removeElementsThatAreUnreachableFrom, removeElementsWithTag, removeRelationshipsWithTag
Methods inherited from class com.structurizr.view.ModelView
addElement, addNearestNeighbours, addRelationship, copyLayoutInformationFrom, disableAutomaticLayout, enableAutomaticLayout, enableAutomaticLayout, enableAutomaticLayout, enableAutomaticLayout, getAutomaticLayout, getDimensions, getElements, getElementView, getMergeFromRemote, getModel, getPaperSize, getRelationships, getRelationshipView, getSoftwareSystem, getViewSet, isElementInView, remove, removeElement, removeElementsWithNoRelationships, removeRelationshipsNotConnectedToElement, setDimensions, setLayoutMergeStrategy, setMergeFromRemote, setPaperSize
Methods inherited from class com.structurizr.view.View
addProperty, compareTo, getDescription, getKey, getOrder, getProperties, getTitle, isGeneratedKey, setDescription, setTitle
-
Method Details
-
getSoftwareSystemId
Description copied from class:ModelView
Gets the ID of the software system this view is associated with.- Overrides:
getSoftwareSystemId
in 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:
addDefaultElements
in classStaticView
-
addAllElements
public void addAllElements()Adds all people, software systems, sibling containers and components belonging to the container in scope.- Specified by:
addAllElements
in classStaticView
-
addNearestNeighbours
Adds all people, software systems, sibling containers and components that are directly connected to the specified element.- Specified by:
addNearestNeighbours
in classStaticView
- Parameters:
element
- an Element
-
addExternalDependencies
public void addExternalDependencies()Adds all
Element
s external to the container (Person, SoftwareSystem or Container) that haveRelationship
s to or fromComponent
s in this view.Not included are:
- References to and from the
Container
of this view (only references to and from the components are considered) Relationship
s between externalElement
s (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:
checkElementCanBeAdded
in classModelView
-
canBeRemoved
- Specified by:
canBeRemoved
in classModelView
-
getExternalContainerBoundariesVisible
Deprecated.
-