Class SimpleGridLayout

java.lang.Object
com.jgraph.layout.simple.SimpleGridLayout
All Implemented Interfaces:
JGraphLayout

public class SimpleGridLayout extends Object implements JGraphLayout
A simple grid layout algorithm that takes the specified vertices and arranges them in rectangular fashion
  • Field Details

    • numCellsPerRow

      protected int numCellsPerRow
      Limit of the number of vertices
    • heightSpacing

      protected int heightSpacing
      Height spacing between vertices
    • widthSpacing

      protected int widthSpacing
      Width spacing between vertices
    • offsetX

      protected int offsetX
      Offset of the top left corner of the grid
    • offsetY

      protected int offsetY
      Offset of the top left corner of the grid
    • actOnUnconnectedVerticesOnly

      protected boolean actOnUnconnectedVerticesOnly
      Whether or not to only act of unconnected vertices
    • ordered

      protected boolean ordered
      Whether or not the vertices are to be ordered by their model ordering
  • Constructor Details

    • SimpleGridLayout

      public SimpleGridLayout()
  • Method Details

    • run

      public void run(JGraphFacade graph)
      Executes the main layout
      Specified by:
      run in interface JGraphLayout
      Parameters:
      graph - The layout facade that the layout will use as input
    • getNumCellsPerRow

      public int getNumCellsPerRow()
      Returns:
      the numCellsPerRow
    • setNumCellsPerRow

      public void setNumCellsPerRow(int numCellsPerRow)
      Parameters:
      numCellsPerRow - the numCellsPerRow to set
    • isActOnUnconnectedVerticesOnly

      public boolean isActOnUnconnectedVerticesOnly()
      Returns:
      the actOnUnconnectedVerticesOnly
    • setActOnUnconnectedVerticesOnly

      public void setActOnUnconnectedVerticesOnly(boolean actOnUnconnectedVerticesOnly)
      Parameters:
      actOnUnconnectedVerticesOnly - the actOnUnconnectedVerticesOnly to set
    • getHeightSpacing

      public int getHeightSpacing()
      Returns:
      the heightSpacing
    • setHeightSpacing

      public void setHeightSpacing(int heightSpacing)
      Parameters:
      heightSpacing - the heightSpacing to set
    • getWidthSpacing

      public int getWidthSpacing()
      Returns:
      the widthSpacing
    • setWidthSpacing

      public void setWidthSpacing(int widthSpacing)
      Parameters:
      widthSpacing - the widthSpacing to set
    • isOrdered

      public boolean isOrdered()
      Returns:
      the ordered
    • setOrdered

      public void setOrdered(boolean ordered)
      Parameters:
      ordered - the ordered to set
    • getOffsetX

      public int getOffsetX()
      Returns:
      the offsetX
    • setOffsetX

      public void setOffsetX(int offsetX)
      Parameters:
      offsetX - the offsetX to set
    • getOffsetY

      public int getOffsetY()
      Returns:
      the offsetY
    • setOffsetY

      public void setOffsetY(int offsetY)
      Parameters:
      offsetY - the offsetY to set