Class AbstractLayoutAlgorithm.Zest1
java.lang.Object
org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm.Zest1
- All Implemented Interfaces:
- LayoutAlgorithm,- LayoutAlgorithm.Zest1,- Stoppable
- Direct Known Subclasses:
- CompositeLayoutAlgorithm.Zest1,- ContinuousLayoutAlgorithm,- DirectedGraphLayoutAlgorithm.Zest1,- GridLayoutAlgorithm.Zest1,- HorizontalShift,- TreeLayoutAlgorithm.Zest1
- Enclosing class:
- AbstractLayoutAlgorithm
@Deprecated(since="2.0",
            forRemoval=true)
public abstract static class AbstractLayoutAlgorithm.Zest1
extends Object
implements LayoutAlgorithm.Zest1, Stoppable
Deprecated, for removal: This API element is subject to removal in a future version.
No longer used in Zest 2.x. This class will be removed in a
             future release.
- Since:
- 2.0
- @noextend
- This class is not intended to be subclassed by clients.
- @noreference
- This class is not intended to be referenced by clients.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.eclipse.zest.layouts.LayoutAlgorithmLayoutAlgorithm.Zest1
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ComparatorDeprecated, for removal: This API element is subject to removal in a future version.protected FilterDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected intDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.
- 
Constructor SummaryConstructorsConstructorDescriptionZest1(int styles) Deprecated, for removal: This API element is subject to removal in a future version.Initializes the abstract layout algorithm.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddEntity(LayoutEntity entity) Deprecated, for removal: This API element is subject to removal in a future version.Queues up the given entity (if it isn't in the list) to be added to the algorithm.voidaddProgressListener(ProgressListener listener) Deprecated, for removal: This API element is subject to removal in a future version.A layout algorithm could take an uncomfortable amout of time to complete.voidaddRelationship(LayoutRelationship relationship) Deprecated, for removal: This API element is subject to removal in a future version.Queues up the given relationshp (if it isn't in the list) to be added to the algorithm.voidapplyLayout(boolean clean) Deprecated, for removal: This API element is subject to removal in a future version.Makes this algorithm perform layout computation and apply it to its context.voidapplyLayout(LayoutEntity[] entitiesToLayout, LayoutRelationship[] relationshipsToConsider, double x, double y, double width, double height, boolean asynchronous, boolean continuous) Deprecated, for removal: This API element is subject to removal in a future version.This actually applies the layoutprotected abstract voidapplyLayoutInternal(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider, double boundsX, double boundsY, double boundsWidth, double boundsHeight) Deprecated, for removal: This API element is subject to removal in a future version.Apply the layout to the given entities.protected voiddefaultFitWithinBounds(InternalNode[] entitiesToLayout, DisplayIndependentRectangle realBounds) Deprecated, for removal: This API element is subject to removal in a future version.Find an appropriate size for the given nodes, then fit them into the given bounds.protected voiddefaultFitWithinBounds(InternalNode[] entitiesToLayout, InternalRelationship[] relationships, DisplayIndependentRectangle realBounds) Deprecated, for removal: This API element is subject to removal in a future version.Find an appropriate size for the given nodes, then fit them into the given bounds.protected voidfireProgressEnded(int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.protected voidfireProgressEvent(int currentStep, int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.Fires an event to notify all of the registered ProgressListeners that another step has been completed in the algorithm.protected voidfireProgressStarted(int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.protected voidfireProgressUpdated(int currentStep, int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.protected abstract intDeprecated, for removal: This API element is subject to removal in a future version.Gets the current layout stepdoubleDeprecated, for removal: This API element is subject to removal in a future version.Returns the width to height ratio this layout will use to set the size of the entities.protected DisplayIndependentRectanglegetLayoutBounds(InternalNode[] entitiesToLayout, boolean includeNodeSize) Deprecated, for removal: This API element is subject to removal in a future version.Find the bounds in which the nodes are located.protected DisplayIndependentPointgetLocalLocation(InternalNode[] entitiesToLayout, double x, double y, DisplayIndependentRectangle realBounds) Deprecated, for removal: This API element is subject to removal in a future version.Gets the location in the layout bounds for this nodeprotected intDeprecated, for removal: This API element is subject to removal in a future version.intgetStyle()Deprecated, for removal: This API element is subject to removal in a future version.Gets the current layout styleprotected abstract intDeprecated, for removal: This API element is subject to removal in a future version.Gets the total number of steps in this layoutbooleanDeprecated, for removal: This API element is subject to removal in a future version.Returns true if the layout algorithm is runningprotected abstract booleanisValidConfiguration(boolean asynchronous, boolean continuous) Deprecated, for removal: This API element is subject to removal in a future version.Determines if the configuration is valid for this layoutprotected abstract voidpostLayoutAlgorithm(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider) Deprecated, for removal: This API element is subject to removal in a future version.Code called after the layout algorithm endsprotected abstract voidpreLayoutAlgorithm(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider, double x, double y, double width, double height) Deprecated, for removal: This API element is subject to removal in a future version.Code called before the layout algorithm startsvoidremoveEntity(LayoutEntity entity) Deprecated, for removal: This API element is subject to removal in a future version.Queues up the given entity to be removed from the algorithm next time it runs.voidremoveProgressListener(ProgressListener listener) Deprecated, for removal: This API element is subject to removal in a future version.Removes the given progress listener, preventing it from receiving any more updates.voidremoveRelationship(LayoutRelationship relationship) Deprecated, for removal: This API element is subject to removal in a future version.Queues up the given relationship to be removed from the algorithm next time it runs.voidremoveRelationships(Collection<? extends LayoutRelationship> collection) Deprecated, for removal: This API element is subject to removal in a future version.voidremoveRelationships(List<? extends LayoutRelationship> relationships) Deprecated, for removal: This API element is subject to removal in a future version.Queues up all the relationships in the list to be removed.voidsetComparator(Comparator comparator) Deprecated, for removal: This API element is subject to removal in a future version.Determines the order in which the objects should be displayed.voidsetEntityAspectRatio(double ratio) Deprecated, for removal: This API element is subject to removal in a future version.Set the width to height ratio you want the entities to usevoidDeprecated, for removal: This API element is subject to removal in a future version.Filters the entities and relationships to apply the layout onabstract voidsetLayoutArea(double x, double y, double width, double height) Deprecated, for removal: This API element is subject to removal in a future version.voidsetLayoutContext(LayoutContext context) Deprecated, for removal: This API element is subject to removal in a future version.Sets the layout context for this algorithm.voidsetStyle(int style) Deprecated, for removal: This API element is subject to removal in a future version.Sets the current layout style.voidstop()Deprecated, for removal: This API element is subject to removal in a future version.Stops the current layout from running.protected voidupdateBendPoints(InternalRelationship[] relationshipsToConsider) Deprecated, for removal: This API element is subject to removal in a future version.Update external bend points from the internal bendpoints list.protected InternalNode[]updateEntities(InternalNode[] entities) Deprecated, for removal: This API element is subject to removal in a future version.Updates the given array of entities checking if any need to be removed or added.protected voidupdateLayoutLocations(InternalNode[] nodes) Deprecated, for removal: This API element is subject to removal in a future version.Updates the layout locations so the external nodes know about the new locationsprotected InternalRelationship[]updateRelationships(InternalRelationship[] relationships) Deprecated, for removal: This API element is subject to removal in a future version.Updates the given array of relationships checking if any need to be removed or added.static booleanverifyInput(LayoutEntity[] entitiesToLayout, LayoutRelationship[] relationshipsToConsider) Deprecated, for removal: This API element is subject to removal in a future version.Verifies the endpoints of the relationships are entities in the entitiesToLayout list.
- 
Field Details- 
MIN_ENTITY_SIZEpublic static final int MIN_ENTITY_SIZEDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
 
- 
comparatorDeprecated, for removal: This API element is subject to removal in a future version.
- 
filterDeprecated, for removal: This API element is subject to removal in a future version.
- 
internalContinuousprotected boolean internalContinuousDeprecated, for removal: This API element is subject to removal in a future version.
- 
internalAsynchronousprotected boolean internalAsynchronousDeprecated, for removal: This API element is subject to removal in a future version.
- 
layoutStoppedprotected boolean layoutStoppedDeprecated, for removal: This API element is subject to removal in a future version.
- 
layout_stylesprotected int layout_stylesDeprecated, for removal: This API element is subject to removal in a future version.
- 
resizeEntitiesAfterLayoutprotected boolean resizeEntitiesAfterLayoutDeprecated, for removal: This API element is subject to removal in a future version.
 
- 
- 
Constructor Details- 
Zest1public Zest1(int styles) Deprecated, for removal: This API element is subject to removal in a future version.Initializes the abstract layout algorithm.- See Also:
 
 
- 
- 
Method Details- 
removeRelationshipsDeprecated, for removal: This API element is subject to removal in a future version.
- 
addEntityDeprecated, for removal: This API element is subject to removal in a future version.Queues up the given entity (if it isn't in the list) to be added to the algorithm.- Specified by:
- addEntityin interface- LayoutAlgorithm.Zest1
- Parameters:
- entity-
 
- 
addRelationshipDeprecated, for removal: This API element is subject to removal in a future version.Queues up the given relationshp (if it isn't in the list) to be added to the algorithm.- Specified by:
- addRelationshipin interface- LayoutAlgorithm.Zest1
- Parameters:
- relationship-
 
- 
removeEntityDeprecated, for removal: This API element is subject to removal in a future version.Queues up the given entity to be removed from the algorithm next time it runs.- Specified by:
- removeEntityin interface- LayoutAlgorithm.Zest1
- Parameters:
- entity- The entity to remove
 
- 
removeRelationshipDeprecated, for removal: This API element is subject to removal in a future version.Queues up the given relationship to be removed from the algorithm next time it runs.- Specified by:
- removeRelationshipin interface- LayoutAlgorithm.Zest1
- Parameters:
- relationship- The relationship to remove.
 
- 
removeRelationshipsDeprecated, for removal: This API element is subject to removal in a future version.Queues up all the relationships in the list to be removed.- Specified by:
- removeRelationshipsin interface- LayoutAlgorithm.Zest1
- Parameters:
- relationships-
 
- 
setStylepublic void setStyle(int style) Deprecated, for removal: This API element is subject to removal in a future version.Sets the current layout style. This overwrites all other layout styles. Use getStyle to get the current style.- Specified by:
- setStylein interface- LayoutAlgorithm.Zest1
- Parameters:
- style-
 
- 
getStylepublic int getStyle()Deprecated, for removal: This API element is subject to removal in a future version.Gets the current layout style- Specified by:
- getStylein interface- LayoutAlgorithm.Zest1
- Returns:
- the layout styles for this layout
 
- 
setLayoutAreapublic abstract void setLayoutArea(double x, double y, double width, double height) Deprecated, for removal: This API element is subject to removal in a future version.
- 
isValidConfigurationprotected abstract boolean isValidConfiguration(boolean asynchronous, boolean continuous) Deprecated, for removal: This API element is subject to removal in a future version.Determines if the configuration is valid for this layout- Parameters:
- asynchronous-
- continuous-
 
- 
applyLayoutInternalprotected abstract void applyLayoutInternal(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider, double boundsX, double boundsY, double boundsWidth, double boundsHeight) Deprecated, for removal: This API element is subject to removal in a future version.Apply the layout to the given entities. The entities will be moved and resized based on the algorithm.- Parameters:
- entitiesToLayout- Apply the algorithm to these entities
- relationshipsToConsider- 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.
 
- 
updateEntitiesDeprecated, for removal: This API element is subject to removal in a future version.Updates the given array of entities checking if any need to be removed or added.- Parameters:
- entities- the current entities
- Returns:
- the updated entities array
 
- 
updateRelationshipsDeprecated, for removal: This API element is subject to removal in a future version.Updates the given array of relationships checking if any need to be removed or added. Also updates the original array of relationships.- Parameters:
- relationships- the current relationships
- Returns:
- the update relationships array
 
- 
isRunningpublic boolean isRunning()Deprecated, for removal: This API element is subject to removal in a future version.Returns true if the layout algorithm is running- Specified by:
- isRunningin interface- LayoutAlgorithm.Zest1
- Returns:
- boolean if the layout algorithm is running
 
- 
stoppublic void stop()Deprecated, for removal: This API element is subject to removal in a future version.Stops the current layout from running. All layout algorithms should constantly check isLayoutRunning- Specified by:
- stopin interface- LayoutAlgorithm.Zest1
- Specified by:
- stopin interface- Stoppable
 
- 
preLayoutAlgorithmprotected abstract void preLayoutAlgorithm(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider, double x, double y, double width, double height) Deprecated, for removal: This API element is subject to removal in a future version.Code called before the layout algorithm starts
- 
postLayoutAlgorithmprotected abstract void postLayoutAlgorithm(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider) Deprecated, for removal: This API element is subject to removal in a future version.Code called after the layout algorithm ends
- 
getTotalNumberOfLayoutStepsprotected abstract int getTotalNumberOfLayoutSteps()Deprecated, for removal: This API element is subject to removal in a future version.Gets the total number of steps in this layout
- 
getCurrentLayoutStepprotected abstract int getCurrentLayoutStep()Deprecated, for removal: This API element is subject to removal in a future version.Gets the current layout step
- 
applyLayoutpublic void applyLayout(LayoutEntity[] entitiesToLayout, LayoutRelationship[] relationshipsToConsider, double x, double y, double width, double height, boolean asynchronous, boolean continuous) throws InvalidLayoutConfiguration Deprecated, for removal: This API element is subject to removal in a future version.This actually applies the layout- Specified by:
- applyLayoutin interface- LayoutAlgorithm.Zest1
- Parameters:
- entitiesToLayout- Apply the algorithm to these entities
- relationshipsToConsider- Only consider these relationships when applying the algorithm.
- x- The left side of the bounds in which the layout can place the entities.
- y- The top side of the bounds in which the layout can place the entities.
- width- The width of the bounds in which the layout can place the entities.
- height- The height of the bounds in which the layout can place the entities.
- asynchronous- Should the algorithm run Asynchronously
- Throws:
- InvalidLayoutConfiguration
 
- 
updateBendPointsDeprecated, for removal: This API element is subject to removal in a future version.Update external bend points from the internal bendpoints list. Save the source and destination points for later use in scaling and translating- Parameters:
- relationshipsToConsider-
 
- 
setFilterDeprecated, for removal: This API element is subject to removal in a future version.Filters the entities and relationships to apply the layout on- Specified by:
- setFilterin interface- LayoutAlgorithm.Zest1
 
- 
setComparatorDeprecated, for removal: This API element is subject to removal in a future version.Determines the order in which the objects should be displayed. Note: Some algorithms force a specific order.- Specified by:
- setComparatorin interface- LayoutAlgorithm.Zest1
 
- 
verifyInputpublic static boolean verifyInput(LayoutEntity[] entitiesToLayout, LayoutRelationship[] relationshipsToConsider) Deprecated, for removal: This API element is subject to removal in a future version.Verifies the endpoints of the relationships are entities in the entitiesToLayout list. Allows other classes in this package to use this method to verify the input
- 
getLocalLocationprotected DisplayIndependentPoint getLocalLocation(InternalNode[] entitiesToLayout, double x, double y, DisplayIndependentRectangle realBounds) Deprecated, for removal: This API element is subject to removal in a future version.Gets the location in the layout bounds for this node- Parameters:
- x-
- y-
 
- 
defaultFitWithinBoundsprotected void defaultFitWithinBounds(InternalNode[] entitiesToLayout, DisplayIndependentRectangle realBounds) Deprecated, for removal: This API element is subject to removal in a future version.Find an appropriate size for the given nodes, then fit them into the given bounds. The relative locations of the nodes to each other must be preserved. Child classes should set flag reresizeEntitiesAfterLayout to false if they want to preserve node sizes.
- 
defaultFitWithinBoundsprotected void defaultFitWithinBounds(InternalNode[] entitiesToLayout, InternalRelationship[] relationships, DisplayIndependentRectangle realBounds) Deprecated, for removal: This API element is subject to removal in a future version.Find an appropriate size for the given nodes, then fit them into the given bounds. The relative locations of the nodes to each other must be preserved. Child classes should set flag reresizeEntitiesAfterLayout to false if they want to preserve node sizes.
- 
getLayoutBoundsprotected DisplayIndependentRectangle getLayoutBounds(InternalNode[] entitiesToLayout, boolean includeNodeSize) Deprecated, for removal: This API element is subject to removal in a future version.Find the bounds in which the nodes are located. Using the bounds against the real bounds of the screen, the nodes can proportionally be placed within the real bounds. The bounds can be determined either including the size of the nodes or not. If the size is not included, the bounds will only be guaranteed to include the center of each node.
- 
setEntityAspectRatiopublic void setEntityAspectRatio(double ratio) Deprecated, for removal: This API element is subject to removal in a future version.Set the width to height ratio you want the entities to use- Specified by:
- setEntityAspectRatioin interface- LayoutAlgorithm.Zest1
 
- 
getEntityAspectRatiopublic double getEntityAspectRatio()Deprecated, for removal: This API element is subject to removal in a future version.Returns the width to height ratio this layout will use to set the size of the entities.- Specified by:
- getEntityAspectRatioin interface- LayoutAlgorithm.Zest1
 
- 
addProgressListenerDeprecated, for removal: This API element is subject to removal in a future version.A layout algorithm could take an uncomfortable amout of time to complete. To relieve some of the mystery, the layout algorithm will notify each ProgressListener of its progress.- Specified by:
- addProgressListenerin interface- LayoutAlgorithm.Zest1
- Specified by:
- addProgressListenerin interface- Stoppable
 
- 
removeProgressListenerDeprecated, for removal: This API element is subject to removal in a future version.Removes the given progress listener, preventing it from receiving any more updates.- Specified by:
- removeProgressListenerin interface- LayoutAlgorithm.Zest1
 
- 
updateLayoutLocationsDeprecated, for removal: This API element is subject to removal in a future version.Updates the layout locations so the external nodes know about the new locations
- 
fireProgressStartedprotected void fireProgressStarted(int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.
- 
fireProgressEndedprotected void fireProgressEnded(int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.
- 
fireProgressUpdatedprotected void fireProgressUpdated(int currentStep, int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.- Since:
- 1.5
 
- 
fireProgressEventprotected void fireProgressEvent(int currentStep, int totalNumberOfSteps) Deprecated, for removal: This API element is subject to removal in a future version.Fires an event to notify all of the registered ProgressListeners that another step has been completed in the algorithm.- Parameters:
- currentStep- The current step completed.
- totalNumberOfSteps- The total number of steps in the algorithm.
 
- 
getNumberOfProgressListenersprotected int getNumberOfProgressListeners()Deprecated, for removal: This API element is subject to removal in a future version.
- 
setLayoutContextDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:LayoutAlgorithmSets the layout context for this algorithm. The receiver will unregister from its previous layout context and register to the new one (registration means for example adding listeners). After a call to this method, the receiving algorithm can compute and cache internal data related to given context and perform an initial layout.- Specified by:
- setLayoutContextin interface- LayoutAlgorithm
- Parameters:
- context- a new layout context or null if this algorithm should not perform any layout
- Since:
- 2.0
 
- 
applyLayoutpublic void applyLayout(boolean clean) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:LayoutAlgorithmMakes this algorithm perform layout computation and apply it to its context.- Specified by:
- applyLayoutin interface- LayoutAlgorithm
- Parameters:
- clean- if true the receiver should assume that the layout context has changed significantly and recompute the whole layout even if it keeps track of changes with listeners. False can be used after dynamic layout in a context is turned back on so that layout algorithm working in background can apply accumulated changes. Static layout algorithm can ignore this call entirely if clean is false.
- Since:
- 2.0
 
 
-