Package de.xima.fc.common.workflow.bpmn
Class WorkflowBpmnTextLayoutSettings.Builder
- java.lang.Object
-
- de.xima.fc.common.workflow.bpmn.WorkflowBpmnTextLayoutSettings.Builder
-
- Enclosing class:
- WorkflowBpmnTextLayoutSettings
public static final class WorkflowBpmnTextLayoutSettings.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowBpmnTextLayoutSettings
build()
Creates a new text layout settings instance with the current settings.WorkflowBpmnTextLayoutSettings.Builder
coalesceSpaces(boolean coalesceSpaces)
Whether to coalesce multiple spaces into a single space.WorkflowBpmnTextLayoutSettings.Builder
explicitBounds(boolean explicitBounds)
Sets whether the name in the BPMN diagram should have theBounds
set explicitly.WorkflowBpmnTextLayoutSettings.Builder
fontSize(QuantityDouble<Length> fontSize)
Sets the font size for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
fontSizePt(double fontSizePoints)
Sets the font size for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
fontSizePx(double fontSizePixels)
Sets the font size for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
lineBreakMode(EWorkflowBpmnTextLayoutLineBreakMode lineBreakMode)
Sets how to treat line breaks when lay-outing text.WorkflowBpmnTextLayoutSettings.Builder
lineHeight(double lineHeight)
Sets the line height for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
maxHeight(double maxHeight, EWorkflowBpmnTextLayoutSettingsMaxHeightType maxHeightType)
Sets the maximum number of lines for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
maxWidth(double maxWidth)
Sets the maximum width for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
minWidth(double minWidth)
Sets the minimum width for the text bounding box.WorkflowBpmnTextLayoutSettings.Builder
noMaxHeight()
Removes the maximum height for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
noMaxWidth()
Removes the maximum width for the text layout settings.WorkflowBpmnTextLayoutSettings.Builder
trimSpaces(boolean trimSpaces)
Whether to trim leading and trailing spaces from the text.
-
-
-
Method Detail
-
build
public WorkflowBpmnTextLayoutSettings build()
Creates a new text layout settings instance with the current settings.- Returns:
- A new text layout settings instance.
-
coalesceSpaces
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder coalesceSpaces(boolean coalesceSpaces)
Whether to coalesce multiple spaces into a single space. This transformation is applied to the input text, before the text is laid out. Spaces are defined as the characters in the range U+0000 to U+0020 and the Unicode whitespace characters.Defaults totrue
.- Parameters:
coalesceSpaces
-true
if multiple spaces should be coalesced into a single space,false
otherwise.- Returns:
- This builder for chaining method calls.
-
explicitBounds
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder explicitBounds(boolean explicitBounds)
Sets whether the name in the BPMN diagram should have theBounds
set explicitly. Defaults totrue
.- Parameters:
explicitBounds
- true if explicit bounds are set, false if bounds are omitted from the BPMN diagram.
-
fontSize
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder fontSize(QuantityDouble<Length> fontSize)
Sets the font size for the text layout settings.- Parameters:
fontSize
- The font size to set.- Returns:
- This builder for chaining method calls.
-
fontSizePt
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder fontSizePt(double fontSizePoints)
Sets the font size for the text layout settings.- Parameters:
fontSizePoints
- The font size to set, in points.- Returns:
- This builder for chaining method calls.
-
fontSizePx
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder fontSizePx(double fontSizePixels)
Sets the font size for the text layout settings.- Parameters:
fontSizePixels
- The font size to set, in pixels.- Returns:
- This builder for chaining method calls.
-
lineBreakMode
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder lineBreakMode(EWorkflowBpmnTextLayoutLineBreakMode lineBreakMode)
Sets how to treat line breaks when lay-outing text.- Parameters:
lineBreakMode
- How to treat line breaks.- Returns:
- This builder for chaining method calls.
-
lineHeight
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder lineHeight(double lineHeight)
Sets the line height for the text layout settings. This is a relative value, where 1.0 means the line height is equal to the font size, 1.5 means the line height is 1.5 times the font size, etc.- Parameters:
lineHeight
- The relative line height to set.- Returns:
- This builder for chaining method calls.
-
maxHeight
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder maxHeight(double maxHeight, EWorkflowBpmnTextLayoutSettingsMaxHeightType maxHeightType)
Sets the maximum number of lines for the text layout settings.- Parameters:
maxHeight
- The maximum number of lines to set.- Returns:
- This builder for chaining method calls.
-
maxWidth
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder maxWidth(double maxWidth)
Sets the maximum width for the text layout settings.- Parameters:
maxWidth
- The maximum width to set.- Returns:
- This builder for chaining method calls.
-
minWidth
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder minWidth(double minWidth)
Sets the minimum width for the text bounding box. By default, the bounding box is as wide as computed by the text layout engine. If this value is non-zero, the text will have a minimum width of this value. May be useful for tools that require a certain minimum width. Defaults to 0.- Parameters:
minWidth
- The minimum width to set for the text bounding box.- Returns:
- This builder for chaining method calls.
-
noMaxHeight
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder noMaxHeight()
Removes the maximum height for the text layout settings.- Returns:
- This builder for chaining method calls.
-
noMaxWidth
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder noMaxWidth()
Removes the maximum width for the text layout settings.- Returns:
- This builder for chaining method calls.
-
trimSpaces
@CanIgnoreReturnValue public WorkflowBpmnTextLayoutSettings.Builder trimSpaces(boolean trimSpaces)
Whether to trim leading and trailing spaces from the text. This transformation is applied to the input text, before the text is laid out. Spaces are defined as the characters in the range U+0000 to U+0020 and the Unicode whitespace characters. Defaults totrue
.- Parameters:
trimSpaces
-true
if leading and trailing spaces should be trimmed,false
otherwise.- Returns:
- This builder for chaining method calls.
-
-