Package com.structurizr.view
Class Styles
java.lang.Object
com.structurizr.view.Styles
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ElementStyle elementStyle) void
add
(RelationshipStyle relationshipStyle) addElementStyle
(String tag) void
addStylesFromTheme
(com.structurizr.view.Theme theme) Adds the element/relationship styles from the given theme.void
Removes all element styles.void
Removes all relationship styles.findElementStyle
(Element element) Finds the element style used to render the specified element, according to the following rules: 1.findElementStyle
(String tag) Finds the element style for the given tag.findRelationshipStyle
(Relationship relationship) Finds the relationship style used to render the specified relationship, according to the following rules: 1.Finds the relationship style for the given tag.getElementStyle
(String tag) Gets the element style that has been defined (in this workspace) for the given tag.Gets the relationship style that has been defined (in this workspace) for the given tag.
-
Constructor Details
-
Styles
public Styles()
-
-
Method Details
-
getElements
-
add
-
addElementStyle
-
clearElementStyles
public void clearElementStyles()Removes all element styles. -
clearRelationshipStyles
public void clearRelationshipStyles()Removes all relationship styles. -
getRelationships
-
add
-
addRelationshipStyle
-
getElementStyle
Gets the element style that has been defined (in this workspace) for the given tag.- Parameters:
tag
- the tag (a String)- Returns:
- an ElementStyle instance, or null if no element style has been defined in this workspace
-
findElementStyle
Finds the element style for the given tag. This method creates an empty style, and copies properties from any element styles (from the workspace and any themes) for the given tag.- Parameters:
tag
- the tag (a String)- Returns:
- an ElementStyle instance, or null if there is no style for the given tag
-
getRelationshipStyle
Gets the relationship style that has been defined (in this workspace) for the given tag.- Parameters:
tag
- the tag (a String)- Returns:
- an RelationshipStyle instance, or null if no relationship style has been defined in this workspace
-
findRelationshipStyle
Finds the relationship style for the given tag. This method creates an empty style, and copies properties from any relationship styles (from the workspace and any themes) for the given tag.- Parameters:
tag
- the tag (a String)- Returns:
- a RelationshipStyle instance, or null if there is no style for the given tag
-
findElementStyle
Finds the element style used to render the specified element, according to the following rules: 1. Start with a default style. 2. Calculate set of tags associated with the element. 3. Find the style properties for each tag (themes first, followed by workspace styles)- Parameters:
element
- an Element object- Returns:
- an ElementStyle object
-
findRelationshipStyle
Finds the relationship style used to render the specified relationship, according to the following rules: 1. Start with a default style. 2. Calculate set of tags associated with the relationship, and any linked relationship(s). 3. Find the style properties for each tag (themes first, followed by workspace styles)- Parameters:
relationship
- a Relationship object- Returns:
- a RelationshipStyle object
-
addStylesFromTheme
public void addStylesFromTheme(com.structurizr.view.Theme theme) Adds the element/relationship styles from the given theme.- Parameters:
theme
- a Theme object
-