Class PumlStyler
java.lang.Object
org.chenile.workflow.puml.PumlStyler
Allows for styling the State Diagrams in Plant UML.
Style of a state or transition is determined by the expression. The actual style is
applied on the rule using PUML stereotypes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate static final ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRule(PumlStyler.StyleRule rule) voidaddRules(InputStream inputStream) voidclear()private PumlStyler.StyleRulefindMatchingStyle(Map<String, String> md) In Plant UML state diagrams, if we have to change the style for a connection between two states, we have to write a construct that looks like below:
A -[thickness=x,#white]-> B
This method emits the styling string (in the form "[thickness=2,#white]" or a blank string if no styling string is specified for the given metadata.getStateStyle(Map<String, String> md) In Plant UML state diagrams, if we have to change the style for a state then we have to write a construct that looks like below:
state A #White##[bold]Blackvoidload(InputStream inputStream) Use a json file to load the properties.printEventText(String text, Map<String, String> md) Renders the text with optional style.printStateText(String text, Map<String, String> md)
-
Field Details
-
EQUALS
- See Also:
-
LABEL
- See Also:
-
styleRules
-
objectMapper
-
-
Constructor Details
-
PumlStyler
public PumlStyler()
-
-
Method Details
-
load
Use a json file to load the properties.- Parameters:
inputStream- the input stream from the json file- Throws:
Exception- if an error is encountered while processing the file
-
addRule
-
addRules
- Throws:
Exception
-
clear
public void clear() -
getStateStyle
In Plant UML state diagrams, if we have to change the style for a state then we have to write a construct that looks like below:
state A #White##[bold]Black
In this example, White is the background color and Black is the border color. Bold is the line style of the border line.
This method emits the styling string (in the form "#White##[bold]Black" or a blank string if no styling string is specified for the given metadata.- Parameters:
md- metadata- Returns:
- a styling string of the form indicated above.
-
getConnectionStyle
In Plant UML state diagrams, if we have to change the style for a connection between two states, we have to write a construct that looks like below:
A -[thickness=x,#white]-> B
This method emits the styling string (in the form "[thickness=2,#white]" or a blank string if no styling string is specified for the given metadata.- Parameters:
md- metadata- Returns:
- a styling string of the form indicated above.
-
printEventText
-
printStateText
-
findMatchingStyle
-
generateStereoTypes
-