Interface IWorkflowBpmnLayoutAlignOnFlowSideConfigurator<Self extends IWorkflowBpmnLayoutAlignOnFlowSideConfigurator<Self>>

  • Type Parameters:
    Self - The type of the configurator, for method chaining.
    All Known Subinterfaces:
    IWorkflowBpmnLayoutAlignOnFlowSideBuilder

    public interface IWorkflowBpmnLayoutAlignOnFlowSideConfigurator<Self extends IWorkflowBpmnLayoutAlignOnFlowSideConfigurator<Self>>
    Options for aligning an item on the left or right side of (the edge of) a sequence flow or message flow.

    The following image illustrates the alignment for side = RIGHT_OF_FLOW, alignment = 1.0 spacing = 20, offset = 0; when the red flow line goes from top-left to bottom-right and the alignment item has a yellow bounding box of 50x20 pixels:

    Align on flow side example

    • The rectangle is on the right side of the flow line.
    • The spacing 20 is the distance between the line and the rectangle, i.e. the distance between the top-right corner of the rectangle and the line in the example image above (yellow).
    • An alignment of 1.0 means the rectangle is as close to the end of the line as possible, i.e. the bottom-right point of the rectangle touches the line that is orthogonal to the flow line and passes through the flow line's end point.
    • The offset is 0 so the rectangle is not set off. If the offset were non-zero, the rectangle would be shifted by that amount in the direction of the red flow line. A positive offset would shift the rectangle to the bottom right, a negative offset would shift it to the top left.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Self alignment​(double ratio)
      Sets the alignment of the item on the flow.
      Self moveAwayFromLine​(boolean moveAwayFromLine)
      Sets whether to move the aligned item away from the line of the flow.
      Self offset​(double offset)
      Sets the absolute offset for the item.
      Self segmentIndex​(int segmentIndex)
      Sets the index of the line segment where the item should be placed.
      Self side​(EAlignItemOnFlowSide side)
      Sets the side of the flow where the item should be aligned.
      Self spacing​(double spacing)
      The spacing (distance) between the BPMN edge of the flow and the item.
    • Method Detail

      • alignment

        @CanIgnoreReturnValue
        Self alignment​(double ratio)
        Sets the alignment of the item on the flow. The ratio is a value between 0 and 1, where 0 means the item is aligned at the start of the selected line segment, and 1 means the item is aligned at the end of the selected line segment.
         alignment = 0.0
        
              [Item]
             o────────────────────────────>o
        
        
         alignment = 0.5
        
                          [Item]
             o────────────────────────────>o
        
        
         alignment = 1.0
        
                                     [Item]
             o────────────────────────────>o
         
        Parameters:
        ratio - The alignment as a ratio in the range [0, 1].
        Returns:
        This configurator for method chaining.
      • moveAwayFromLine

        @CanIgnoreReturnValue
        Self moveAwayFromLine​(boolean moveAwayFromLine)
        Sets whether to move the aligned item away from the line of the flow. When true, ensures that the text does not intersect the flow line, even when spacing is set to 0. When false and the spacing is 0, the center of the text will be aligned with the flow line. Especially useful for text that consists of multiple lines. Defaults to true.
         alignment = 0.5, moveAwayFromLine = true
        
                          [Item]
             o────────────────────────────>o
        
        
         alignment = 0.5, moveAwayFromLine = false
        
             o────────────[Item]──────────>o
         
        Parameters:
        moveAwayFromLine - Whether to move the item away from the line of the flow.
        Returns:
        This builder for chaining method calls.
      • offset

        @CanIgnoreReturnValue
        Self offset​(double offset)
        Sets the absolute offset for the item. The offset is applied after the item was aligned and can be used to move the item along the selected line segment. 0 is no offset, positive values move the item towards the end of the selected line segment, and negative values move the item towards the start of the selected line segment.

        Setting the alignment to 0 and the offset to the length of the selected line segment is equivalent to setting the alignment to 1 and the offset to 0.

         alignment = 0.5, offset = 0.0
        
                          [Item]
             o────────────────────────────>o
        
        
         alignment = 0.5, offset = 5.0
        
                               [Item]
             o────────────────────────────>o
         
        Parameters:
        offset - The offset to apply to the item.
        Returns:
        This configurator for method chaining.
      • segmentIndex

        @CanIgnoreReturnValue
        Self segmentIndex​(int segmentIndex)
        Sets the index of the line segment where the item should be placed. When the BPMN edge has n waypoints, the segments are numbered from 0 to n-1, where segment 0 is the first segment and n-1 is the last segment. Defaults to 0.
                                     segment index = 2
                                 ┌───────────────────────>o
                                 │
                                 │
                                 │ segment index = 1
                                 │
                                 │
         o ──────────────────────┘
             segment index = 0
         
        Parameters:
        segmentIndex - The index of the segment where the item should be placed.
        Returns:
        This configurator for method chaining.
      • side

        @CanIgnoreReturnValue
        Self side​(EAlignItemOnFlowSide side)
        Sets the side of the flow where the item should be aligned. The value is relative to the direction of the edge. Defaults to LEFT_OF_FLOW.
         side = LEFT_OF_FLOW
        
                       [Item]
          o────────────────────────────>o
        
        
        
         side = RIGHT_OF_FLOW
        
          o────────────────────────────>o
                       [Item]
         
        Parameters:
        side - The side of the flow where the item should be aligned.
        Returns:
        This configurator for method chaining.
      • spacing

        @CanIgnoreReturnValue
        Self spacing​(double spacing)
        The spacing (distance) between the BPMN edge of the flow and the item. When 0, the item is placed directly next to the edge.
                [Item]
                  ^
                  |
                  |  spacing
                  |
                  v
          o───────────────o
                edge
         
        Parameters:
        spacing - The spacing between the edge and the item.
        Returns:
        This configurator for method chaining.