Package com.structurizr.view
Class ElementStyle
java.lang.Object
com.structurizr.view.AbstractStyle
com.structurizr.view.ElementStyle
- All Implemented Interfaces:
PropertyHolder
A definition of an element style.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbackground
(String background) description
(boolean description) fontSize
(int fontSize) Gets the background colour of the element, as a HTML RGB hex string (e.g.Gets the border used when rendering the element.getColor()
Gets the foreground (text) colour of the element, as a HTML RGB hex string (e.g.Determines whether the element description should be shown or not.Gets the standard font size used to render text, in pixels.Gets the height of the element, in pixels.getIcon()
Gets the icon of the element (a URL, or a data URI representing a Base64 encoded PNG/JPG/GIF file).Determines whether the element metadata should be shown or not.Gets the opacity used when rendering the element.getShape()
Gets the shape used to render the element.Gets the stroke colour of the element, as a HTML RGB hex string (e.g.getTag()
The tag to which this element style applies.getWidth()
Gets the width of the element, in pixels.height
(int height) metadata
(boolean metadata) opacity
(int opacity) void
setBackground
(String background) void
void
void
setDescription
(Boolean description) Sets whether the element description should be shown or not.void
setFontSize
(Integer fontSize) void
void
void
setMetadata
(Boolean metadata) Sets whether the element metadata should be shown or not.void
setOpacity
(Integer opacity) void
void
void
void
width
(int width) Methods inherited from class com.structurizr.view.AbstractStyle
addProperty, getProperties
-
Field Details
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
-
Constructor Details
-
ElementStyle
-
ElementStyle
-
-
Method Details
-
getTag
The tag to which this element style applies.- Returns:
- the tag, as a String
-
setTag
-
getWidth
Gets the width of the element, in pixels.- Returns:
- the width as an Integer, or null if not specified
-
setWidth
-
width
-
getHeight
Gets the height of the element, in pixels.- Returns:
- the height as an Integer, or null if not specified
-
setHeight
-
height
-
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
-
background
-
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
-
stroke
-
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
-
color
-
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
-
fontSize
-
getShape
Gets the shape used to render the element.- Returns:
- a Shape, or null if not specified
-
setShape
-
shape
-
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
-
icon
-
getBorder
Gets the border used when rendering the element.- Returns:
- a Border, or null if not specified
-
setBorder
-
border
-
getOpacity
Gets the opacity used when rendering the element.- Returns:
- the opacity, as an integer between 0 and 100.
-
setOpacity
-
opacity
-
getMetadata
Determines whether the element metadata should be shown or not.- Returns:
- true (shown), false (hidden) or null (not set)
-
setMetadata
Sets whether the element metadata should be shown or not.- Parameters:
metadata
- true (shown), false (hidden) or null (not set)
-
metadata
-
getDescription
Determines whether the element description should be shown or not.- Returns:
- true (shown), false (hidden) or null (not set)
-
setDescription
Sets whether the element description should be shown or not.- Parameters:
description
- true (shown), false (hidden) or null (not set)
-
description
-