Class GraphLayouts

java.lang.Object
it.univr.di.cstnu.gui.layout.GraphLayouts

public final class GraphLayouts extends Object
Registry of the graph layouts available to the user interface.

The ordered list returned by available() is the canonical source of truth for the UI menu: it defines both which layouts exist and the order in which they are presented to the user. Layout classes must not be instantiated elsewhere in the UI; use this factory instead so that adding or removing a layout requires only a change here.

Author:
posenato
  • Method Details

    • available

      public static List<GraphLayout> available()
      Returns the list of layouts offered to the user, in UI display order:
      1. StoredLayout ("Saved") — leaves coordinates as stored;
      2. FruchtermanReingoldLayout ("Force-directed") — force-directed placement;
      3. CircleLayout ("Circle") — circular placement.

      Each call returns a new, independent list with fresh layout instances.

      Returns:
      an unmodifiable list of available layouts, never null, never empty