public class SimpleGraphLayout extends GraphLayout
| Modifier and Type | Field and Description |
|---|---|
(package private) Graphics2D |
graphics |
(package private) GNode[][] |
grid
A 2-dimensional grid for laying out nodes.
|
(package private) int |
gridCellHeight |
(package private) int |
gridCellPadding |
(package private) int |
gridCellWidth |
(package private) int |
numCols |
(package private) int |
numNodes |
(package private) int |
numRows |
graph, verbose| Constructor and Description |
|---|
SimpleGraphLayout(Graph g,
Graphics2D graphics) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyToGraph()
Use the results of the layout procedure and update the graph to reflect the new positions.
|
void |
establishGrid(Iterator<GraphObject> iter)
Determine the rows and columns of the grid layout, and the max width and
height per grid cell.
|
void |
naivePlacement(Iterator<GraphObject> iter)
Places nodes in row first, right-to-left order without regard to any links.
|
boolean |
performLayout()
Execute whatever layout procedure is implemented by the class.
|
void |
placeObjectInGrid(GNode node,
int row,
int col) |
void |
reduceEdgeLengthPlacement(Iterator<GraphObject> iter)
Places nodes in row first, right-to-left order without regard to any
links.
|
isVerbose, setVerboseGNode[][] grid
int numRows
int numCols
int gridCellWidth
int gridCellHeight
int gridCellPadding
int numNodes
Graphics2D graphics
public SimpleGraphLayout(Graph g, Graphics2D graphics)
public boolean performLayout()
GraphLayoutperformLayout in class GraphLayoutGraphLayout.copyToGraph()public void reduceEdgeLengthPlacement(Iterator<GraphObject> iter)
iter - An iterator of GraphObjectspublic void naivePlacement(Iterator<GraphObject> iter)
iter - An iterator of GraphObjectspublic void placeObjectInGrid(GNode node, int row, int col)
public void establishGrid(Iterator<GraphObject> iter)
public void copyToGraph()
GraphLayoutcopyToGraph in class GraphLayout