Interface Layout


  • public interface Layout
    A Layout algorithm should implement the Layout interface to allow the LayoutController to run it properly.

    See the LayoutBuilder documentation to know how layout should be instanciated.

    To have fully integrated properties that can be changed in real-time by users, properly define the various LayoutProperty returned by the getProperties() method and provide getter and setter for each.

    Author:
    Helder Suzuki
    See Also:
    LayoutBuilder
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canAlgo()
      Tests if the algorithm can run, called before each pass.
      void endAlgo()
      Called when the algorithm is finished (canAlgo() returns false).
      LayoutBuilder getBuilder()
      The reference to the LayoutBuilder that instanciated this Layout.
      LayoutProperty[] getProperties()
      The properties for this layout.
      void goAlgo()
      Run a step in the algorithm, should be called only if canAlgo() returns true.
      void initAlgo()
      initAlgo() is called to initialize the algorithm (prepare to run).
      void resetPropertiesValues()
      Resets the properties values to the default values.
      void setGraphModel​(GraphModel graphModel)
      Injects the graph model for the graph this Layout should operate on.
    • Method Detail

      • initAlgo

        void initAlgo()
        initAlgo() is called to initialize the algorithm (prepare to run).
      • setGraphModel

        void setGraphModel​(GraphModel graphModel)
        Injects the graph model for the graph this Layout should operate on.

        It's preferable to get visible graph to perform on visualization.

        Parameters:
        graphModel - the graph model that the layout is to be working on
      • goAlgo

        void goAlgo()
        Run a step in the algorithm, should be called only if canAlgo() returns true.
      • canAlgo

        boolean canAlgo()
        Tests if the algorithm can run, called before each pass.
        Returns:
        true if the algorithm can run, false otherwise
      • endAlgo

        void endAlgo()
        Called when the algorithm is finished (canAlgo() returns false).
      • getProperties

        LayoutProperty[] getProperties()
        The properties for this layout.
        Returns:
        the layout properties
      • resetPropertiesValues

        void resetPropertiesValues()
        Resets the properties values to the default values.
      • getBuilder

        LayoutBuilder getBuilder()
        The reference to the LayoutBuilder that instanciated this Layout.
        Returns:
        the reference to the builder that builts this instance