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 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)
-
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
-