Package com.structurizr.view
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 intDEFAULT_HEIGHTstatic intDEFAULT_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 ElementStylebackground(java.lang.String background)ElementStyleborder(Border border)ElementStylecolor(java.lang.String color)ElementStyledescription(boolean description)ElementStylefontSize(int fontSize)java.lang.StringgetBackground()Gets the background colour of the element, as a HTML RGB hex string (e.g.BordergetBorder()Gets the border used when rendering the element.java.lang.StringgetColor()Gets the foreground (text) colour of the element, as a HTML RGB hex string (e.g.java.lang.BooleangetDescription()Determines whether the element description should be shown or not.java.lang.IntegergetFontSize()Gets the standard font size used to render text, in pixels.java.lang.IntegergetHeight()Gets the height of the element, in pixels.java.lang.StringgetIcon()Gets the icon of the element (a URL, or a data URI representing a Base64 encoded PNG/JPG/GIF file).java.lang.BooleangetMetadata()Determines whether the element metadata should be shown or not.java.lang.IntegergetOpacity()Gets the opacity used when rendering the element.ShapegetShape()Gets the shape used to render the element.java.lang.StringgetStroke()Gets the stroke colour of the element, as a HTML RGB hex string (e.g.java.lang.StringgetTag()The tag to which this element style applies.java.lang.IntegergetWidth()Gets the width of the element, in pixels.ElementStyleheight(int height)ElementStyleicon(java.lang.String icon)ElementStylemetadata(boolean metadata)ElementStyleopacity(int opacity)voidsetBackground(java.lang.String background)voidsetBorder(Border border)voidsetColor(java.lang.String color)voidsetDescription(java.lang.Boolean description)Sets whether the element description should be shown or not.voidsetFontSize(java.lang.Integer fontSize)voidsetHeight(java.lang.Integer height)voidsetIcon(java.lang.String icon)voidsetMetadata(java.lang.Boolean metadata)Sets whether the element metadata should be shown or not.voidsetOpacity(java.lang.Integer opacity)voidsetShape(Shape shape)voidsetStroke(java.lang.String color)voidsetTag(java.lang.String tag)voidsetWidth(java.lang.Integer width)ElementStyleshape(Shape shape)ElementStylestroke(java.lang.String color)ElementStylewidth(int width)
-
Field Details
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
- Constant Field Values
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
- Constant Field Values
-
-
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
-
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
-
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
-
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
-
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
-
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
-
getShape
Gets the shape used to render the element.- Returns:
- a Shape, or null if not specified
-
setShape
-
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
-
getBorder
Gets the border used when rendering the element.- Returns:
- a Border, or null if not specified
-
setBorder
-
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
-
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
-
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
-