Class SimpleGridLayout
java.lang.Object
com.jgraph.layout.simple.SimpleGridLayout
- All Implemented Interfaces:
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 JGraphLayout
JGraphLayout.Stoppable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether or not to only act of unconnected verticesprotected intHeight spacing between verticesprotected intLimit of the number of verticesprotected intOffset of the top left corner of the gridprotected intOffset of the top left corner of the gridprotected booleanWhether or not the vertices are to be ordered by their model orderingprotected intWidth spacing between verticesFields inherited from interface JGraphLayout
VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintintintbooleanbooleanvoidrun(JGraphFacade graph) Executes the main layoutvoidsetActOnUnconnectedVerticesOnly(boolean actOnUnconnectedVerticesOnly) voidsetHeightSpacing(int heightSpacing) voidsetNumCellsPerRow(int numCellsPerRow) voidsetOffsetX(int offsetX) voidsetOffsetY(int offsetY) voidsetOrdered(boolean ordered) voidsetWidthSpacing(int widthSpacing)
-
Field Details
-
numCellsPerRow
protected int numCellsPerRowLimit of the number of vertices -
heightSpacing
protected int heightSpacingHeight spacing between vertices -
widthSpacing
protected int widthSpacingWidth spacing between vertices -
offsetX
protected int offsetXOffset of the top left corner of the grid -
offsetY
protected int offsetYOffset of the top left corner of the grid -
actOnUnconnectedVerticesOnly
protected boolean actOnUnconnectedVerticesOnlyWhether or not to only act of unconnected vertices -
ordered
protected boolean orderedWhether or not the vertices are to be ordered by their model ordering
-
-
Constructor Details
-
SimpleGridLayout
public SimpleGridLayout()
-
-
Method Details
-
run
Executes the main layout- Specified by:
runin interfaceJGraphLayout- 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
-