Class BPMNLayout

  • All Implemented Interfaces:
    com.mxgraph.layout.mxIGraphLayout

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

      • 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 Detail

      • 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 Detail

      • 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​(java.lang.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​(java.lang.Object parent)
        Specified by:
        execute in interface com.mxgraph.layout.mxIGraphLayout
        Overrides:
        execute in class com.mxgraph.layout.mxGraphLayout
      • isBoundaryEvent

        protected boolean isBoundaryEvent​(java.lang.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​(java.lang.Object cell,
                                          java.lang.Object parent,
                                          java.util.Set<java.lang.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,
                                                              java.lang.Object parent,
                                                              double x0,
                                                              double y0,
                                                              com.mxgraph.util.mxRectangle bounds)
      • offset

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

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