Interface JGraphLayout.Stoppable

All Known Implementing Classes:
JGraphAnnealingLayout, JGraphFastOrganicLayout, JGraphFRLayout, JGraphHierarchicalLayout, JGraphMedianHybridCrossingReduction, JGraphOrganicLayout, JGraphSpringLayout
Enclosing interface:
JGraphLayout

public static interface JGraphLayout.Stoppable
An additional interface that should be implemented if a layout is expected to run longer. Eg. if a layout for a few hundred cells is likely to take more than 1 second.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the progress object that represents the progress of the current layout run.
  • Method Details

    • getProgress

      JGraphLayoutProgress getProgress()
      Returns the progress object that represents the progress of the current layout run. Once created, this instance should not be replaced during a layout run. For new runs you should use the reset method on the progress. Consequently, the max progress is only valid after the run method has been invoked, which means you should use a listener if you spawn a new thread.

      By convention, the layout must check the isStopped method in its inner-most loops and return immediately if the method returns true.

      Returns:
      Returns the progress for all layout runs.