Class ElementStyle

java.lang.Object
com.structurizr.view.AbstractStyle
com.structurizr.view.ElementStyle
All Implemented Interfaces:
PropertyHolder

public final class ElementStyle extends AbstractStyle
A definition of an element style.
  • Field Details

  • Constructor Details

  • Method Details

    • getTag

      public String getTag()
      The tag to which this element style applies.
      Returns:
      the tag, as a String
    • setTag

      public void setTag(String tag)
    • getWidth

      public Integer getWidth()
      Gets the width of the element, in pixels.
      Returns:
      the width as an Integer, or null if not specified
    • setWidth

      public void setWidth(Integer width)
    • width

      public ElementStyle width(int width)
    • getHeight

      public Integer getHeight()
      Gets the height of the element, in pixels.
      Returns:
      the height as an Integer, or null if not specified
    • setHeight

      public void setHeight(Integer height)
    • height

      public ElementStyle height(int height)
    • getBackground

      public String getBackground()
      Gets the background colour of the element, as a HTML RGB hex string (e.g. #123456).
      Returns:
      the background colour as a String, or null if not specified
    • setBackground

      public void setBackground(String color)
    • background

      public ElementStyle background(String background)
    • getStroke

      public String getStroke()
      Gets the stroke colour of the element, as a HTML RGB hex string (e.g. #123456).
      Returns:
      the stroke colour as a String, or null if not specified
    • setStroke

      public void setStroke(String color)
    • stroke

      public ElementStyle stroke(String color)
    • getStrokeWidth

      public Integer getStrokeWidth()
      Gets the stroke width, in pixels, between 1 and 10.
      Returns:
      the stroke width
    • setStrokeWidth

      public void setStrokeWidth(Integer strokeWidth)
    • strokeWidth

      public ElementStyle strokeWidth(Integer strokeWidth)
    • getColor

      public String getColor()
      Gets the foreground (text) colour of the element, as a HTML RGB hex string (e.g. #123456).
      Returns:
      the foreground colour as a String, or null if not specified
    • setColor

      public void setColor(String color)
    • color

      public ElementStyle color(String color)
    • getFontSize

      public Integer getFontSize()
      Gets the standard font size used to render text, in pixels.
      Returns:
      the font size, in pixels, as an Integer, or null if not specified
    • setFontSize

      public void setFontSize(Integer fontSize)
    • fontSize

      public ElementStyle fontSize(int fontSize)
    • getShape

      public Shape getShape()
      Gets the shape used to render the element.
      Returns:
      a Shape, or null if not specified
    • setShape

      public void setShape(Shape shape)
    • shape

      public ElementStyle shape(Shape shape)
    • getIcon

      public String getIcon()
      Gets the icon of the element (a URL, or a data URI representing a Base64 encoded PNG/JPG/GIF file).
      Returns:
      the icon, or null if not specified
    • setIcon

      public void setIcon(String icon)
    • icon

      public ElementStyle icon(String icon)
    • getBorder

      public Border getBorder()
      Gets the border used when rendering the element.
      Returns:
      a Border, or null if not specified
    • setBorder

      public void setBorder(Border border)
    • border

      public ElementStyle border(Border border)
    • getOpacity

      public Integer getOpacity()
      Gets the opacity used when rendering the element.
      Returns:
      the opacity, as an integer between 0 and 100.
    • setOpacity

      public void setOpacity(Integer opacity)
    • opacity

      public ElementStyle opacity(int opacity)
    • getMetadata

      public Boolean getMetadata()
      Determines whether the element metadata should be shown or not.
      Returns:
      true (shown), false (hidden) or null (not set)
    • setMetadata

      public void setMetadata(Boolean metadata)
      Sets whether the element metadata should be shown or not.
      Parameters:
      metadata - true (shown), false (hidden) or null (not set)
    • metadata

      public ElementStyle metadata(boolean metadata)
    • getDescription

      public Boolean getDescription()
      Determines whether the element description should be shown or not.
      Returns:
      true (shown), false (hidden) or null (not set)
    • setDescription

      public void setDescription(Boolean description)
      Sets whether the element description should be shown or not.
      Parameters:
      description - true (shown), false (hidden) or null (not set)
    • description

      public ElementStyle description(boolean description)