public class GridLayoutAlgorithm extends AbstractLayoutAlgorithm
| Modifier and Type | Field and Description |
|---|---|
protected int |
rowPadding |
comparator, filter, internalAsynchronous, internalContinuous, layout_styles, layoutStopped, MIN_ENTITY_SIZE, resizeEntitiesAfterLayout| Constructor and Description |
|---|
GridLayoutAlgorithm()
Inititalizes the grid layout with no style.
|
GridLayoutAlgorithm(int styles)
Initializes the grid layout.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyLayoutInternal(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider,
double boundsX,
double boundsY,
double boundsWidth,
double boundsHeight)
Use this algorithm to layout the given entities, using the given relationships and bounds.
|
protected double[] |
calculateNodeSize(double colWidth,
double rowHeight) |
protected int[] |
calculateNumberOfRowsAndCols_rectangular(int numChildren) |
protected int[] |
calculateNumberOfRowsAndCols_square(int numChildren,
double boundX,
double boundY,
double boundWidth,
double boundHeight) |
protected int[] |
calculateNumberOfRowsAndCols(int numChildren,
double boundX,
double boundY,
double boundWidth,
double boundHeight)
Calculates and returns an array containing the number of columns, followed by the number of rows
|
protected int |
getCurrentLayoutStep()
Gets the current layout step
|
protected int |
getTotalNumberOfLayoutSteps()
Gets the total number of steps in this layout
|
protected boolean |
isValidConfiguration(boolean asynchronous,
boolean continueous)
Determines if the configuration is valid for this layout
|
protected void |
postLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider)
Code called after the layout algorithm ends
|
protected void |
preLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider,
double x,
double y,
double width,
double height)
Code called before the layout algorithm starts
|
void |
setLayoutArea(double x,
double y,
double width,
double height) |
void |
setRowPadding(int rowPadding)
Increases the padding between rows in the grid
|
addEntity, addProgressListener, addRelationship, applyLayout, defaultFitWithinBounds, defaultFitWithinBounds, fireProgressEnded, fireProgressEvent, fireProgressStarted, getEntityAspectRatio, getLayoutBounds, getLocalLocation, getNumberOfProgressListeners, getStyle, isRunning, removeEntity, removeProgressListener, removeRelationship, removeRelationships, removeRelationships, setComparator, setEntityAspectRatio, setFilter, setStyle, stop, updateBendPoints, updateEntities, updateLayoutLocations, updateRelationships, verifyInputpublic GridLayoutAlgorithm(int styles)
styles - LayoutStylespublic GridLayoutAlgorithm()
public void setLayoutArea(double x,
double y,
double width,
double height)
setLayoutArea in class AbstractLayoutAlgorithmprotected int getCurrentLayoutStep()
AbstractLayoutAlgorithmgetCurrentLayoutStep in class AbstractLayoutAlgorithmprotected int getTotalNumberOfLayoutSteps()
AbstractLayoutAlgorithmgetTotalNumberOfLayoutSteps in class AbstractLayoutAlgorithmprotected void preLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider,
double x,
double y,
double width,
double height)
AbstractLayoutAlgorithmpreLayoutAlgorithm in class AbstractLayoutAlgorithmprotected void applyLayoutInternal(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider,
double boundsX,
double boundsY,
double boundsWidth,
double boundsHeight)
applyLayoutInternal in class AbstractLayoutAlgorithmentitiesToLayout - Apply the algorithm to these entitiesrelationshipsToConsider - Only consider these relationships when applying the algorithm.boundsX - The left side of the bounds in which the layout can place the entities.boundsY - The top side of the bounds in which the layout can place the entities.boundsWidth - The width of the bounds in which the layout can place the entities.boundsHeight - The height of the bounds in which the layout can place the entities.java.lang.RuntimeException - Thrown if entitiesToLayout doesn't contain all of the endpoints for each relationship in relationshipsToConsiderprotected void postLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider)
AbstractLayoutAlgorithmpostLayoutAlgorithm in class AbstractLayoutAlgorithmprotected int[] calculateNumberOfRowsAndCols(int numChildren,
double boundX,
double boundY,
double boundWidth,
double boundHeight)
protected int[] calculateNumberOfRowsAndCols_square(int numChildren,
double boundX,
double boundY,
double boundWidth,
double boundHeight)
protected int[] calculateNumberOfRowsAndCols_rectangular(int numChildren)
protected double[] calculateNodeSize(double colWidth,
double rowHeight)
public void setRowPadding(int rowPadding)
rowPadding - Value will not be set if less than 0.protected boolean isValidConfiguration(boolean asynchronous,
boolean continueous)
AbstractLayoutAlgorithmisValidConfiguration in class AbstractLayoutAlgorithmCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.