Class Styles

java.lang.Object
com.structurizr.view.Styles

public final class Styles extends Object
  • Constructor Details

    • Styles

      public Styles()
  • Method Details

    • getElements

      public Collection<ElementStyle> getElements()
    • add

      public void add(ElementStyle elementStyle)
    • addElementStyle

      public ElementStyle addElementStyle(String tag)
    • clearElementStyles

      public void clearElementStyles()
      Removes all element styles.
    • clearRelationshipStyles

      public void clearRelationshipStyles()
      Removes all relationship styles.
    • getRelationships

      public Collection<RelationshipStyle> getRelationships()
    • add

      public void add(RelationshipStyle relationshipStyle)
    • addRelationshipStyle

      public RelationshipStyle addRelationshipStyle(String tag)
    • getElementStyle

      public ElementStyle getElementStyle(String tag)
      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

      public ElementStyle findElementStyle(String tag)
      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

      public RelationshipStyle getRelationshipStyle(String tag)
      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

      public RelationshipStyle findRelationshipStyle(String tag)
      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

      public ElementStyle findElementStyle(Element element)
      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

      public RelationshipStyle findRelationshipStyle(Relationship relationship)
      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
    • findLogoFromThemes

      public String findLogoFromThemes()
    • findFontFromThemes

      public Font findFontFromThemes()
    • addStylesFromTheme

      public void addStylesFromTheme(com.structurizr.view.Theme theme)
      Adds the element/relationship styles from the given theme.
      Parameters:
      theme - a Theme object