Class MultilevelFrameworkLayout

java.lang.Object
org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
org.vanted.plugins.layout.multilevelframework.MultilevelFrameworkLayout
All Implemented Interfaces:
Algorithm

public class MultilevelFrameworkLayout
extends ThreadSafeAlgorithm
Main class of the MLF add-on that contains the method that actually performs the layout.
Author:
Gordian
See Also:
AbstractEditorAlgorithm
  • Field Details

    • mergers

      public static final List<Merger> mergers
    • placers

      public static final List<Placer> placers
    • benchmarkMode

      public boolean benchmarkMode
      Set this to true to make execute() block until it is finished and use the specified mergers instead of the ones selected through the GUI.
    • nonInteractiveMerger

      public Merger nonInteractiveMerger
    • nonInteractivePlacer

      public Placer nonInteractivePlacer
    • nonInteractiveAlgorithm

      public String nonInteractiveAlgorithm
  • Constructor Details

    • MultilevelFrameworkLayout

      public MultilevelFrameworkLayout()
  • Method Details

    • getDescription

      public String getDescription()
      See Also:
      Algorithm.getDescription()
    • getActionEvent

      public ActionEvent getActionEvent()
    • setActionEvent

      public void setActionEvent​(ActionEvent a)
    • reset

      public void reset()
      Calls super.reset() and updates the parameters.
    • getName

      public String getName()
      Description copied from interface: Algorithm
      Returns the name (ID) of the algorithm.
      Returns:
      the algorithm's name
    • check

      public void check() throws PreconditionException
      Checks, if a graph was given and that the radius is positive.
      Throws:
      PreconditionException - if no graph was given during algorithm invocation or the number of nodes is zero or negative
    • getParameters

      public Parameter[] getParameters()
      Description copied from interface: Algorithm
      Returns a list of Parameter that are set for this algorithm.
      Returns:
      a collection of Parameter that are needed by the Algorithm.
    • setParameters

      public void setParameters​(Parameter[] params)
      Description copied from interface: Algorithm
      Sets the parameters for this algorithm. Must have the same types and order as the array returned by getParameter.
    • execute

      public void execute()
      Performs the layout. Can be executed on multiple graphs at the same time (by calling attach, execute, attach, execute...), but only if the Algorithm used for the levels supports thread safe execution (i.e. multiple execute methods running at the same time using the same instance). This is only possible if the algorithm's execute method copies the parameter values or the ThreadSafeOptions object in case of a ThreadSafeAlgorithm. Unless you can guarantee that the algorithm you're using does this, it is not recommended to run this on multiple graphs at the same time.
    • attach

      public void attach​(Graph g, Selection selection)
      Description copied from interface: Algorithm
      Attaches the given graph to this algorithm. A ttaches the given Selection information to the algorithm.
      Parameters:
      g - the graph to attach.
      selection - the selection to attach.
    • getCategory

      public String getCategory()
      Description copied from interface: Algorithm
      Returns the category an algorithm should assigned to. Return NULL if the algorithm should be sorted directly in the plugin menu.
      Returns:
      The category an algorithm should assigned to.
    • getSetCategory

      public Set<Category> getSetCategory()
      Description copied from interface: Algorithm
      Returns a set of categories to classify this algorithm . e.g. return new HashSet(Arrays.asList( Category.GRAPH, Category.NODE )); is an algorithm, working on graphs and more specific on nodes
      Returns:
      Set of Category Enums that classify this algorithm.
    • getMenuCategory

      public String getMenuCategory()
      Description copied from interface: Algorithm
      Returns a path to a menu category. This is s '.' separated string which reflects the position of this Algorithm in the Menu Hierarchy e.g. "Network.Layout" would put this algorithm in the menu 'Network' and its submenu 'Layout' If this menu is not existent it will be created If this method returns 'null' the algorithm will not appear in the menu
      Returns:
    • isLayoutAlgorithm

      public boolean isLayoutAlgorithm()
      This makes sure the algorithm is moved to the layout-tab of VANTED
      Returns:
      true
    • addMerger

      public static void addMerger​(Merger merger)
      Add a new Merger that will be available for the user to choose. This method is meant to be called by other VANTED add-ons that seek to extend the MLF with new Mergers.
      Parameters:
      merger - The Merger to add. Must not be null.
    • getMergers

      public static Collection<Merger> getMergers()
      Returns:
      the currently registered Mergers as an unmodifiable Collection.
    • addPlacer

      public static void addPlacer​(Placer placer)
      Add a new Placer that will be available for the user to choose. This method is meant to be called by other VANTED add-ons that seek to extend the MLF with new Placers.
      Parameters:
      placer - The Placer to add. Must not be null.
    • getPlacers

      public static Collection<Placer> getPlacers()
      Returns:
      the currently registered Placers as an unmodifiable Collection.
    • setControlInterface

      public boolean setControlInterface​(ThreadSafeOptions __, JComponent jc)
      Description copied from class: ThreadSafeAlgorithm
      DOCUMENT ME!
      Specified by:
      setControlInterface in class ThreadSafeAlgorithm
      Returns:
      true, if an GUI was set, false if no interface is needed
    • executeThreadSafe

      public void executeThreadSafe​(ThreadSafeOptions options)
      Specified by:
      executeThreadSafe in class ThreadSafeAlgorithm
    • resetDataCache

      public void resetDataCache​(ThreadSafeOptions options)
      Specified by:
      resetDataCache in class ThreadSafeAlgorithm