Class AbstractLayoutAlgorithm

  • All Implemented Interfaces:
    CyLayoutAlgorithm

    public abstract class AbstractLayoutAlgorithm
    extends Object
    implements CyLayoutAlgorithm
    The AbstractLayoutAlgorithm provides a basic implementation of a layout TaskFactory.

    Module: layout-api

    To use this in your app, include the following dependency in your POM:

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>layout-api</artifactId>
    </dependency>

    Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
    • Field Detail

      • undoSupport

        protected final UndoSupport undoSupport
        An undo support object available for use
    • Constructor Detail

      • AbstractLayoutAlgorithm

        public AbstractLayoutAlgorithm​(String computerName,
                                       String humanName,
                                       UndoSupport undoSupport)
        The Constructor.
        Parameters:
        computerName - a computer readable name used to construct property strings.
        humanName - a user visible name of the layout.
    • Method Detail

      • createLayoutContext

        public Object createLayoutContext()
        Description copied from interface: CyLayoutAlgorithm
        Returns a new layout context object. This method can be used to create custom configurations for layouts.
        Specified by:
        createLayoutContext in interface CyLayoutAlgorithm
        Returns:
        a new layout context object.
      • getDefaultLayoutContext

        public final Object getDefaultLayoutContext()
        Description copied from interface: CyLayoutAlgorithm
        Returns the default instance of the layout context. This is the default layout configuration used in most cases.
        Specified by:
        getDefaultLayoutContext in interface CyLayoutAlgorithm
        Returns:
        the default instance of the layout context.
      • getName

        public String getName()
        Description copied from interface: CyLayoutAlgorithm
        Returns the computer-readable name of the layout. To get a human readable name, use toString().
        Specified by:
        getName in interface CyLayoutAlgorithm
        Returns:
        The computer-readable name of the layout.
      • getSupportedNodeAttributeTypes

        public Set<Class<?>> getSupportedNodeAttributeTypes()
        Description copied from interface: CyLayoutAlgorithm
        Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.
        Specified by:
        getSupportedNodeAttributeTypes in interface CyLayoutAlgorithm
        Returns:
        types of allowable attribute types.
      • getSupportedEdgeAttributeTypes

        public Set<Class<?>> getSupportedEdgeAttributeTypes()
        Description copied from interface: CyLayoutAlgorithm
        Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.
        Specified by:
        getSupportedEdgeAttributeTypes in interface CyLayoutAlgorithm
        Returns:
        types of allowable attribute types.
      • getSupportsSelectedOnly

        public boolean getSupportsSelectedOnly()
        Description copied from interface: CyLayoutAlgorithm
        Returns true if this algorithm supports being applied to only the currently selected nodes.
        Specified by:
        getSupportsSelectedOnly in interface CyLayoutAlgorithm
        Returns:
        true if this algorithm supports being applied to only the currently selected nodes.
      • isReady

        public boolean isReady​(CyNetworkView view,
                               Object tunableContext,
                               Set<View<CyNode>> nodesToLayout,
                               String attributeName)
        Description copied from interface: CyLayoutAlgorithm
        Returns true if the task factory is ready to produce a task iterator.
        Specified by:
        isReady in interface CyLayoutAlgorithm
        Parameters:
        view - The network view that the layout algorithm should be applied to.
        tunableContext - The layout context for this layout algorithm.
        nodesToLayout - The set of node views to layout.
        attributeName - The possibly null name of the attribute to use for this layout.
        Returns:
        true if the task factory is ready to produce a task iterator.