com.jgraph.layout.simple

Class SimpleGridLayout

public class SimpleGridLayout extends Object implements JGraphLayout

A simple grid layout algorithm that takes the specified vertices and arranges them in rectangular fashion
Field Summary
protected booleanactOnUnconnectedVerticesOnly
Whether or not to only act of unconnected vertices
protected intheightSpacing
Height spacing between vertices
protected intnumCellsPerRow
Limit of the number of vertices
protected intoffsetX
Offset of the top left corner of the grid
protected intoffsetY
Offset of the top left corner of the grid
protected booleanordered
Whether or not the vertices are to be ordered by their model ordering
protected intwidthSpacing
Width spacing between vertices
Constructor Summary
SimpleGridLayout()
Method Summary
intgetHeightSpacing()
intgetNumCellsPerRow()
intgetOffsetX()
intgetOffsetY()
intgetWidthSpacing()
booleanisActOnUnconnectedVerticesOnly()
booleanisOrdered()
voidrun(JGraphFacade graph)
Executes the main layout
voidsetActOnUnconnectedVerticesOnly(boolean actOnUnconnectedVerticesOnly)
voidsetHeightSpacing(int heightSpacing)
voidsetNumCellsPerRow(int numCellsPerRow)
voidsetOffsetX(int offsetX)
voidsetOffsetY(int offsetY)
voidsetOrdered(boolean ordered)
voidsetWidthSpacing(int widthSpacing)

Field Detail

actOnUnconnectedVerticesOnly

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

heightSpacing

protected int heightSpacing
Height spacing between vertices

numCellsPerRow

protected int numCellsPerRow
Limit of the number of 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

ordered

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

widthSpacing

protected int widthSpacing
Width spacing between vertices

Constructor Detail

SimpleGridLayout

public SimpleGridLayout()

Method Detail

getHeightSpacing

public int getHeightSpacing()

Returns: the heightSpacing

getNumCellsPerRow

public int getNumCellsPerRow()

Returns: the numCellsPerRow

getOffsetX

public int getOffsetX()

Returns: the offsetX

getOffsetY

public int getOffsetY()

Returns: the offsetY

getWidthSpacing

public int getWidthSpacing()

Returns: the widthSpacing

isActOnUnconnectedVerticesOnly

public boolean isActOnUnconnectedVerticesOnly()

Returns: the actOnUnconnectedVerticesOnly

isOrdered

public boolean isOrdered()

Returns: the ordered

run

public void run(JGraphFacade graph)
Executes the main layout

setActOnUnconnectedVerticesOnly

public void setActOnUnconnectedVerticesOnly(boolean actOnUnconnectedVerticesOnly)

Parameters: actOnUnconnectedVerticesOnly the actOnUnconnectedVerticesOnly to set

setHeightSpacing

public void setHeightSpacing(int heightSpacing)

Parameters: heightSpacing the heightSpacing to set

setNumCellsPerRow

public void setNumCellsPerRow(int numCellsPerRow)

Parameters: numCellsPerRow the numCellsPerRow to set

setOffsetX

public void setOffsetX(int offsetX)

Parameters: offsetX the offsetX to set

setOffsetY

public void setOffsetY(int offsetY)

Parameters: offsetY the offsetY to set

setOrdered

public void setOrdered(boolean ordered)

Parameters: ordered the ordered to set

setWidthSpacing

public void setWidthSpacing(int widthSpacing)

Parameters: widthSpacing the widthSpacing to set

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