Package com.structurizr.view
Class ThemeUtils
java.lang.Object
com.structurizr.view.ThemeUtils
Some utility methods for exporting themes to JSON.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidloadThemes(com.structurizr.Workspace workspace) Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself.static voidloadThemes(com.structurizr.Workspace workspace, int timeoutInMilliseconds) Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself.static StringtoJson(com.structurizr.Workspace workspace) Serializes the theme (element and relationship styles) in the specified workspace to a JSON string.static voidSerializes the theme (element and relationship styles) in the specified workspace to a file, as a JSON string.
-
Constructor Details
-
ThemeUtils
public ThemeUtils()
-
-
Method Details
-
toJson
Serializes the theme (element and relationship styles) in the specified workspace to a file, as a JSON string.- Parameters:
workspace- a Workspace objectfile- a File representing the JSON definition- Throws:
Exception- if something goes wrong
-
toJson
Serializes the theme (element and relationship styles) in the specified workspace to a JSON string.- Parameters:
workspace- a Workspace instance- Returns:
- a JSON string
- Throws:
Exception- if something goes wrong
-
loadThemes
Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself. This implementation simply copies the styles from all themes into the workspace. This uses a default timeout value of 10000ms.- Parameters:
workspace- a Workspace object- Throws:
Exception- if something goes wrong
-
loadThemes
public static void loadThemes(com.structurizr.Workspace workspace, int timeoutInMilliseconds) throws Exception Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself. This implementation simply copies the styles from all themes into the workspace.- Parameters:
workspace- a Workspace objecttimeoutInMilliseconds- the timeout in milliseconds- Throws:
Exception- if something goes wrong
-