JGraph
v5.13.0.0


com.jgraph.layout.simple
Class SimpleGridLayout

java.lang.Object
  extended by 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


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jgraph.layout.JGraphLayout
JGraphLayout.Stoppable
 
Field Summary
protected  boolean actOnUnconnectedVerticesOnly
          Whether or not to only act of unconnected vertices
protected  int heightSpacing
          Height spacing between vertices
protected  int numCellsPerRow
          Limit of the number of vertices
protected  int offsetX
          Offset of the top left corner of the grid
protected  int offsetY
          Offset of the top left corner of the grid
protected  boolean ordered
          Whether or not the vertices are to be ordered by their model ordering
protected  int widthSpacing
          Width spacing between vertices
 
Fields inherited from interface com.jgraph.layout.JGraphLayout
VERSION
 
Constructor Summary
SimpleGridLayout()
           
 
Method Summary
 int getHeightSpacing()
           
 int getNumCellsPerRow()
           
 int getOffsetX()
           
 int getOffsetY()
           
 int getWidthSpacing()
           
 boolean isActOnUnconnectedVerticesOnly()
           
 boolean isOrdered()
           
 void run(JGraphFacade graph)
          Executes the main layout
 void setActOnUnconnectedVerticesOnly(boolean actOnUnconnectedVerticesOnly)
           
 void setHeightSpacing(int heightSpacing)
           
 void setNumCellsPerRow(int numCellsPerRow)
           
 void setOffsetX(int offsetX)
           
 void setOffsetY(int offsetY)
           
 void setOrdered(boolean ordered)
           
 void setWidthSpacing(int widthSpacing)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

SimpleGridLayout

public SimpleGridLayout()
Method Detail

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

JGraph
v5.13.0.0


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.