Class LayoutTools

java.lang.Object
org.cy3sbml.layout.LayoutTools

public class LayoutTools extends Object
Utilities for working with layouts.

Saves the node positions of a network view to a file and applies them to a network view. The nodes are matched by their cyId, which is unique for every node of an SBML network and the same in every import of the model, also for the nodes of elements without SBML id (rules, kinetic laws, units, math, ...). The positions of old layout files, which have only the SBML id, are matched by the SBML id. The glyph nodes of a layout network, where the glyphs of one element (aliases) have the same cyId, are matched by the glyph.

  • Constructor Details

  • Method Details

    • saveLayoutOfCurrentViewInFile

      public void saveLayoutOfCurrentViewInFile(File file) throws IOException
      Save layout of current view in file.
      Throws:
      IOException - if the file could not be written
    • saveLayoutOfViewInFile

      public int saveLayoutOfViewInFile(org.cytoscape.view.model.CyNetworkView view, File file) throws IOException
      Save layout of given view in file. Nodes without cyId and SBML id (not created by cy3sbml) are not saved.
      Returns:
      the number of saved node positions
      Throws:
      IOException - if the file could not be written
    • loadLayoutOfCurrentViewFromFile

      public void loadLayoutOfCurrentViewFromFile(File file)
      Load layout of current view from file.
    • loadLayoutForViewFromFile

      public int loadLayoutForViewFromFile(org.cytoscape.view.model.CyNetworkView view, File file)
      Moves every node of the view with a position in the file to that position.
      Returns:
      number of positioned nodes