Class BPMNLayout

java.lang.Object
com.mxgraph.layout.mxGraphLayout
org.activiti.bpmn.BPMNLayout
All Implemented Interfaces:
com.mxgraph.layout.mxIGraphLayout

public class BPMNLayout extends com.mxgraph.layout.mxGraphLayout
BPMNLayout
  • Field Details

    • bpmnAutoLayout

      protected BpmnAutoLayout bpmnAutoLayout
    • horizontal

      protected boolean horizontal
      Specifies the orientation of the layout. Default is true.
    • invert

      protected boolean invert
      Specifies if edge directions should be inverted. Default is false.
    • resizeParent

      protected boolean resizeParent
      If the parent should be resized to match the width/height of the tree. Default is true.
    • moveTree

      protected boolean moveTree
      Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer. Default is true.
    • resetEdges

      protected boolean resetEdges
      Specifies if all edge points of traversed edges should be removed. Default is true.
    • levelDistance

      protected int levelDistance
      Holds the levelDistance. Default is 40.
    • nodeDistance

      protected int nodeDistance
      Holds the nodeDistance. Default is 20.
  • Constructor Details

    • BPMNLayout

      public BPMNLayout(com.mxgraph.view.mxGraph graph)
      Parameters:
      graph -
    • BPMNLayout

      public BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal)
      Parameters:
      graph -
      horizontal -
    • BPMNLayout

      public BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal, boolean invert)
      Parameters:
      graph -
      horizontal -
      invert -
  • Method Details

    • setBpmnAutoLayout

      public void setBpmnAutoLayout(BpmnAutoLayout bpmnAutoLayout)
    • getGraph

      public com.mxgraph.view.mxGraph getGraph()
      Overrides:
      getGraph in class com.mxgraph.layout.mxGraphLayout
    • isVertexIgnored

      public boolean isVertexIgnored(Object vertex)
      Returns a boolean indicating if the given mxCell should be ignored as a vertex. This returns true if the cell has no connections.
      Overrides:
      isVertexIgnored in class com.mxgraph.layout.mxGraphLayout
      Parameters:
      vertex - Object that represents the vertex to be tested.
      Returns:
      Returns true if the vertex should be ignored.
    • isHorizontal

      public boolean isHorizontal()
      Returns:
      the horizontal
    • setHorizontal

      public void setHorizontal(boolean horizontal)
      Parameters:
      horizontal - the horizontal to set
    • isInvert

      public boolean isInvert()
      Returns:
      the invert
    • setInvert

      public void setInvert(boolean invert)
      Parameters:
      invert - the invert to set
    • isResizeParent

      public boolean isResizeParent()
      Returns:
      the resizeParent
    • setResizeParent

      public void setResizeParent(boolean resizeParent)
      Parameters:
      resizeParent - the resizeParent to set
    • isMoveTree

      public boolean isMoveTree()
      Returns:
      the moveTree
    • setMoveTree

      public void setMoveTree(boolean moveTree)
      Parameters:
      moveTree - the moveTree to set
    • isResetEdges

      public boolean isResetEdges()
      Returns:
      the resetEdges
    • setResetEdges

      public void setResetEdges(boolean resetEdges)
      Parameters:
      resetEdges - the resetEdges to set
    • getLevelDistance

      public int getLevelDistance()
      Returns:
      the levelDistance
    • setLevelDistance

      public void setLevelDistance(int levelDistance)
      Parameters:
      levelDistance - the levelDistance to set
    • getNodeDistance

      public int getNodeDistance()
      Returns:
      the nodeDistance
    • setNodeDistance

      public void setNodeDistance(int nodeDistance)
      Parameters:
      nodeDistance - the nodeDistance to set
    • execute

      public void execute(Object parent)
      Specified by:
      execute in interface com.mxgraph.layout.mxIGraphLayout
      Overrides:
      execute in class com.mxgraph.layout.mxGraphLayout
    • isBoundaryEvent

      protected boolean isBoundaryEvent(Object obj)
    • moveNode

      protected void moveNode(BPMNLayout.TreeNode node, double dx, double dy)
      Moves the specified node and all of its children by the given amount.
    • dfs

      protected BPMNLayout.TreeNode dfs(Object cell, Object parent, Set<Object> visited)
      Does a depth first search starting at the specified cell. Makes sure the specified swimlane is never left by the algorithm.
    • layout

      protected void layout(BPMNLayout.TreeNode node)
      Starts the actual compact tree layout algorithm at the given node.
    • horizontalLayout

      protected com.mxgraph.util.mxRectangle horizontalLayout(BPMNLayout.TreeNode node, double x0, double y0, com.mxgraph.util.mxRectangle bounds)
    • verticalLayout

      protected com.mxgraph.util.mxRectangle verticalLayout(BPMNLayout.TreeNode node, Object parent, double x0, double y0, com.mxgraph.util.mxRectangle bounds)
    • attachParent

      protected void attachParent(BPMNLayout.TreeNode node, double height)
    • layoutLeaf

      protected void layoutLeaf(BPMNLayout.TreeNode node)
    • join

      protected double join(BPMNLayout.TreeNode node)
    • merge

      protected double merge(BPMNLayout.Polygon p1, BPMNLayout.Polygon p2)
    • offset

      protected double offset(double p1, double p2, double a1, double a2, double b1, double b2)
    • bridge

      protected BPMNLayout.Polyline bridge(BPMNLayout.Polyline line1, double x1, double y1, BPMNLayout.Polyline line2, double x2, double y2)
    • createNode

      protected BPMNLayout.TreeNode createNode(Object cell)
    • apply

      protected com.mxgraph.util.mxRectangle apply(BPMNLayout.TreeNode node, com.mxgraph.util.mxRectangle bounds)
    • createLine

      protected BPMNLayout.Polyline createLine(double dx, double dy, BPMNLayout.Polyline next)