| 
 | Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.router.polyline.GraphPartition
public class GraphPartition
A GraphPartition partitions the bounding box of a graph into rectangles using the graph elements as Obstacles.
 
   All Obstacles used during the partitioning are created
   by GraphPartitionExtensions. GraphPartitionExtensions have been
   registered before
   using method GraphPartitionExtension.preparePartition(PathSearchConfiguration, GraphPartition) 
   which is called during the initialization of a GraphPartition.
 
   The core partitioning is delegated to an ObstaclePartition that is
   initialized with these Obstacles.
 
   If the ObstaclePartition is of type DynamicDecomposition, GraphPartition re-dispatches
   the decomposition notifications to its extensions.
 
GraphPartitionExtension| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from interface y.layout.router.polyline.DynamicDecomposition | 
|---|
| DynamicDecomposition.Listener | 
| Constructor Summary | |
|---|---|
| GraphPartition(ObstaclePartition partition)Creates a new GraphPartitioninstance using the givendelegate inner obstacle partition. | |
| Method Summary | |
|---|---|
|  void | addDynamicDecompositionListener(DynamicDecomposition.Listener listener)Adds the given listener to the GraphPartition. | 
|  void | clear()Clears the partitiondata such that theGraphPartitioncan be reused andinitializedwith a new configuration. | 
|  Obstacle | createObstacle(YRectangle bounds,
               java.lang.Object data)Creates and returns a new Obstacleusing the given bounds and data. | 
|  YRectangle | getBounds()Returns the bounds of the original rectangular area that is being partitioned. | 
|  java.util.List | getCells(Node node)Returns all PartitionCells that are completely covered by the bounds of the given node. | 
|  java.util.List | getCells(YRectangle rect)Returns a list of all PartitionCells that intersect or cover the given rectangle by delegating to the
 corresponding method of theinner partition. | 
|  java.util.List | getNeighbors(PartitionCell cell)Returns a list of all PartitionCells that are neighbors of the given cell, i.e., those cells that have a
 common border segment with the given cell. | 
|  java.util.List | getNodes(PartitionCell cell)Returns a list of all Nodes whose bounds intersect or cover the bounds of the given cell. | 
|  Obstacle | getObstacle(java.lang.Object data)Returns the Obstaclethat has been created earlier for the given data object. | 
|  java.util.List | getObstacles(PartitionCell cell)Returns all Obstacles covering the givenPartitionCellby delegating to the corresponding method
 of theinner partition. | 
| protected  ObstaclePartition | getPartition()Returns the delegate inner obstacle partition. | 
|  void | init(PathSearchConfiguration configuration)Initializes the GraphPartitionwith the given graph instance based on the givenconfigurationused by path search algorithms. | 
|  void | onCellCreated(PartitionCell createdCell)Re-dispatches the event of the creation of a new PartitionCellto all registeredDynamicDecomposition.Listeners. | 
|  void | onCellFinalized(PartitionCell finalizedCell)Re-dispatches the event of having completed the process of subdivisions of a given PartitionCellto all registeredDynamicDecomposition.Listeners. | 
|  void | onCellSubdivided(PartitionCell cell,
                 java.util.List subCells)Re-dispatches the event of the subdivision of a given PartitionCellinto several sub-cells to all registeredDynamicDecomposition.Listeners. | 
|  void | onCellUnlocked(PartitionCell unlockedCell)Re-dispatches the event of having unlocked a previously finalizedPartitionCellto all registeredDynamicDecomposition.Listeners. | 
|  void | removeDynamicDecompositionListener(DynamicDecomposition.Listener listener)Removes the given listener from the GraphPartition. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public GraphPartition(ObstaclePartition partition)
GraphPartition instance using the given delegate inner obstacle partition.
partition - the delegate inner obstacle partition| Method Detail | 
|---|
protected ObstaclePartition getPartition()
public void addDynamicDecompositionListener(DynamicDecomposition.Listener listener)
GraphPartition.
 
   The listener will be notified upon dynamic decomposition events. If it is a GraphPartitionExtension, method
   GraphPartitionExtension.preparePartition(PathSearchConfiguration, GraphPartition)
   is called during initialization.
 
addDynamicDecompositionListener in interface DynamicDecompositionlistener - the listener to be addedpublic void removeDynamicDecompositionListener(DynamicDecomposition.Listener listener)
GraphPartition.
 The listener will not be notified of dynamic decomposition events anymore.
removeDynamicDecompositionListener in interface DynamicDecompositionlistener - the listener to be removedpublic void init(PathSearchConfiguration configuration)
GraphPartition with the given graph instance based on the given 
 configuration used by path search algorithms.
 
   Before calling this method, any old partitioning information must be cleared. 
 
   This initialization method calls GraphPartitionExtension.preparePartition(PathSearchConfiguration, GraphPartition) 
   of all registered extensions. Then, the inner delegate partition is initialized passing
   all added obstacles as well as the given graph's bounds
   extended by a small padding.
 
   In the case where the delegate partition is of type DynamicDecomposition,
   this GraphPartition will also be added as DynamicDecomposition.Listener to it.
 
configuration - the configuration used by path search algorithmsclear(), 
GraphPartitionExtension.preparePartition(PathSearchConfiguration, GraphPartition), 
DynamicDecomposition.addDynamicDecompositionListener(Listener)public java.util.List getNeighbors(PartitionCell cell)
PartitionCells that are neighbors of the given cell, i.e., those cells that have a
 common border segment with the given cell.
getNeighbors in interface Partitioncell - the cell whose neighbors will be returned
PartitionCells that are neighbors of the given cellpublic java.util.List getNodes(PartitionCell cell)
Nodes whose bounds intersect or cover the bounds of the given cell.
cell - the cell
Nodes that are intersected by the given cellpublic java.util.List getObstacles(PartitionCell cell)
Obstacles covering the given PartitionCell by delegating to the corresponding method
 of the inner partition.
cell - the cell whose obstacles will be returned
Obstacles that cover the given cellObstaclePartition.getObstacles(PartitionCell)public java.util.List getCells(Node node)
PartitionCells that are completely covered by the bounds of the given node.
node - the node for which the covered cells will be returned
PartitionCell instances that are completely covered by the bounds of the given node
java.lang.IllegalArgumentException - if the node is unknownpublic java.util.List getCells(YRectangle rect)
PartitionCells that intersect or cover the given rectangle by delegating to the
 corresponding method of the inner partition.
getCells in interface Partitionrect - the rectangular area whose (partially) covered cells will be returned
PartitionCellsPartition.getCells(YRectangle)public YRectangle getBounds()
inner partition.
getBounds in interface PartitionPartition.getBounds()public void clear()
partition data such that the GraphPartition can be reused and
 initialized with a new configuration.
 
   All GraphPartitionExtensions are cleaned up;
   partition listeners and obstacles are removed.
 
init(PathSearchConfiguration)
public void onCellSubdivided(PartitionCell cell,
                             java.util.List subCells)
PartitionCell into several sub-cells to all registered 
 DynamicDecomposition.Listeners.
 
   This method is a callback after a PartitionCell has been subdivided into several sub-cells.
 
onCellSubdivided in interface DynamicDecomposition.Listenercell - the cell that has been subdividedsubCells - the sub-cells resulting from the subdivision of the given PartitionCellpublic void onCellFinalized(PartitionCell finalizedCell)
PartitionCell to all registered 
 DynamicDecomposition.Listeners.
 
   This method is a callback after a PartitionCell has been finalized and won't be further 
   subdivided.
 
onCellFinalized in interface DynamicDecomposition.ListenerfinalizedCell - the cell that has been finalizedpublic void onCellUnlocked(PartitionCell unlockedCell)
finalized
 PartitionCell to all registered DynamicDecomposition.Listeners.
 
   This method is a callback after a previously finalized PartitionCell has been unlocked again.
 
onCellUnlocked in interface DynamicDecomposition.ListenerunlockedCell - the cell that has been unlockedpublic void onCellCreated(PartitionCell createdCell)
PartitionCell to all registered 
 DynamicDecomposition.Listeners.
 
   This method is a callback after a PartitionCell has been created.
 
onCellCreated in interface DynamicDecomposition.ListenercreatedCell - the newly created PartitionCell
public Obstacle createObstacle(YRectangle bounds,
                               java.lang.Object data)
Obstacle using the given bounds and data. 
 
   All obstacles created via this method are delegated to the inner partition upon
   initialization.
 
bounds - the bounds of the obstacledata - the additional data that should be associated with the obstacle
Obstacle using the given bounds and datapublic Obstacle getObstacle(java.lang.Object data)
Obstacle that has been created earlier for the given data object.
data - the given data for which the obstacle will be returned
Obstacle that has been created earlier for the given data object| 
 | © Copyright 2000-2025, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||