Class ElementStyle

java.lang.Object
com.structurizr.view.ElementStyle

public final class ElementStyle
extends java.lang.Object
A definition of an element style.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int DEFAULT_HEIGHT  
    static int DEFAULT_WIDTH  
  • Constructor Summary

    Constructors 
    Constructor Description
    ElementStyle​(java.lang.String tag, java.lang.Integer width, java.lang.Integer height, java.lang.String background, java.lang.String color, java.lang.Integer fontSize)  
    ElementStyle​(java.lang.String tag, java.lang.Integer width, java.lang.Integer height, java.lang.String background, java.lang.String color, java.lang.Integer fontSize, Shape shape)  
  • Method Summary

    Modifier and Type Method Description
    ElementStyle background​(java.lang.String background)  
    ElementStyle border​(Border border)  
    ElementStyle color​(java.lang.String color)  
    ElementStyle description​(boolean description)  
    ElementStyle fontSize​(int fontSize)  
    java.lang.String getBackground()
    Gets the background colour of the element, as a HTML RGB hex string (e.g.
    Border getBorder()
    Gets the border used when rendering the element.
    java.lang.String getColor()
    Gets the foreground (text) colour of the element, as a HTML RGB hex string (e.g.
    java.lang.Boolean getDescription()
    Determines whether the element description should be shown or not.
    java.lang.Integer getFontSize()
    Gets the standard font size used to render text, in pixels.
    java.lang.Integer getHeight()
    Gets the height of the element, in pixels.
    java.lang.String getIcon()
    Gets the icon of the element (a URL, or a data URI representing a Base64 encoded PNG/JPG/GIF file).
    java.lang.Boolean getMetadata()
    Determines whether the element metadata should be shown or not.
    java.lang.Integer getOpacity()
    Gets the opacity used when rendering the element.
    Shape getShape()
    Gets the shape used to render the element.
    java.lang.String getStroke()
    Gets the stroke colour of the element, as a HTML RGB hex string (e.g.
    java.lang.String getTag()
    The tag to which this element style applies.
    java.lang.Integer getWidth()
    Gets the width of the element, in pixels.
    ElementStyle height​(int height)  
    ElementStyle icon​(java.lang.String icon)  
    ElementStyle metadata​(boolean metadata)  
    ElementStyle opacity​(int opacity)  
    void setBackground​(java.lang.String background)  
    void setBorder​(Border border)  
    void setColor​(java.lang.String color)  
    void setDescription​(java.lang.Boolean description)
    Sets whether the element description should be shown or not.
    void setFontSize​(java.lang.Integer fontSize)  
    void setHeight​(java.lang.Integer height)  
    void setIcon​(java.lang.String icon)  
    void setMetadata​(java.lang.Boolean metadata)
    Sets whether the element metadata should be shown or not.
    void setOpacity​(java.lang.Integer opacity)  
    void setShape​(Shape shape)  
    void setStroke​(java.lang.String color)  
    void setTag​(java.lang.String tag)  
    void setWidth​(java.lang.Integer width)  
    ElementStyle shape​(Shape shape)  
    ElementStyle stroke​(java.lang.String color)  
    ElementStyle width​(int width)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ElementStyle

      public ElementStyle​(java.lang.String tag, java.lang.Integer width, java.lang.Integer height, java.lang.String background, java.lang.String color, java.lang.Integer fontSize)
    • ElementStyle

      public ElementStyle​(java.lang.String tag, java.lang.Integer width, java.lang.Integer height, java.lang.String background, java.lang.String color, java.lang.Integer fontSize, Shape shape)
  • Method Details

    • getTag

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

      public void setTag​(java.lang.String tag)
    • getWidth

      public java.lang.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​(java.lang.Integer width)
    • width

      public ElementStyle width​(int width)
    • getHeight

      public java.lang.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​(java.lang.Integer height)
    • height

      public ElementStyle height​(int height)
    • getBackground

      public java.lang.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​(java.lang.String background)
    • background

      public ElementStyle background​(java.lang.String background)
    • getStroke

      public java.lang.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​(java.lang.String color)
    • stroke

      public ElementStyle stroke​(java.lang.String color)
    • getColor

      public java.lang.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​(java.lang.String color)
    • color

      public ElementStyle color​(java.lang.String color)
    • getFontSize

      public java.lang.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​(java.lang.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 java.lang.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​(java.lang.String icon)
    • icon

      public ElementStyle icon​(java.lang.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 java.lang.Integer getOpacity()
      Gets the opacity used when rendering the element.
      Returns:
      the opacity, as an integer between 0 and 100.
    • setOpacity

      public void setOpacity​(java.lang.Integer opacity)
    • opacity

      public ElementStyle opacity​(int opacity)
    • getMetadata

      public java.lang.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​(java.lang.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 java.lang.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​(java.lang.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)