Interface CyApplicationManager


  • public interface CyApplicationManager
    Basic access to current and/or currently selected networks, views and rendering engines in an instance of Cytoscape.

    Module: application-api

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

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

    Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
    • Method Detail

      • getCurrentNetwork

        CyNetwork getCurrentNetwork()
        Provides access to the current network.
        Returns:
        the current network or null if there is no current network
      • setCurrentNetwork

        void setCurrentNetwork​(CyNetwork net)
        Sets the current network to the specified network. If the passed network is different from the current one, a SetCurrentNetworkEvent is fired. If the passed network is not yet selected, any selected networks are unselected before the passed one is selected. That means that the SetSelectedNetworksEvent can also be fired.
        Parameters:
        net - The network that will become the current network (it can be null).
      • getCurrentNetworkView

        CyNetworkView getCurrentNetworkView()
        Returns the current network view.
        Returns:
        the current network view or null if no network is currently being visualized
      • setCurrentNetworkView

        void setCurrentNetworkView​(CyNetworkView netView)
        Sets the current network view to the specified network view.
        Parameters:
        netView - The network view to become the current network view (it can be null).
      • getSelectedNetworks

        List<CyNetwork> getSelectedNetworks()
        Returns the list of selected networks.
        Returns:
        The list of selected networks.
      • getSelectedNetworkViews

        List<CyNetworkView> getSelectedNetworkViews()
        Returns the list of selected network views.
        Returns:
        The list of selected network views.
      • setSelectedNetworkViews

        void setSelectedNetworkViews​(List<CyNetworkView> views)
        Sets the specified network views as selected.
        Parameters:
        views - The list of network views to be selected.
      • setSelectedNetworks

        void setSelectedNetworks​(List<CyNetwork> nets)
        Sets the networks specified as selected.
        Parameters:
        nets - The networks to be selected.
      • getCurrentRenderingEngine

        RenderingEngine<CyNetwork> getCurrentRenderingEngine()
        Returns the rendering engine associated with the current network view.
        Returns:
        The rendering engine associated with the current network view.
      • setCurrentRenderingEngine

        void setCurrentRenderingEngine​(RenderingEngine<CyNetwork> engine)
        Sets the current rendering engine.
        Parameters:
        engine - The rendering engine that should be made current.
      • getCurrentTable

        CyTable getCurrentTable()
        Returns the currently active table.
        Returns:
        the currently active CyTable or null if no table is currently being visualized
      • setCurrentTable

        void setCurrentTable​(CyTable table)
        Sets the currently active table.
        Parameters:
        table - The table that should be made current (it can be null).
      • reset

        void reset()
        Releases all currently held references and resources.
      • getCurrentNetworkViewRenderer

        NetworkViewRenderer getCurrentNetworkViewRenderer()
        Returns the NetworkViewRenderer associated with the current RenderingEngine.
        Returns:
        the NetworkViewRenderer associated with the current RenderingEngine
      • getDefaultNetworkViewRenderer

        NetworkViewRenderer getDefaultNetworkViewRenderer()
        Returns the NetworkViewRenderer that should be used to create CyNetworkViews.
        Returns:
        the NetworkViewRenderer that should be used to create CyNetworkViews.
      • setDefaultNetworkViewRenderer

        void setDefaultNetworkViewRenderer​(NetworkViewRenderer renderer)
        Sets the NetworkViewRenderer that should be used to create CyNetworkViews.
        Parameters:
        renderer - the NetworkViewRenderer that should be used by default.
      • getNetworkViewRenderer

        NetworkViewRenderer getNetworkViewRenderer​(String rendererId)
        Returns the NetworkViewRenderer that has the passed id or null if it doesn't exist.
        Parameters:
        rendererId -
        Returns:
        the NetworkViewRenderer that should be used to create CyNetworkViews
      • getNetworkViewRendererSet

        Set<NetworkViewRenderer> getNetworkViewRendererSet()
        Returns a set with all the NetworkViewRenderer objects that have been registered.
        Returns:
        the complete set of all the currently known renderers
      • getCurrentDirectory

        File getCurrentDirectory()
        Get the current working directory.
        Returns:
        a File pointing to the current working directory as set in Properties, or user.dir if a value is not set (or if the set value is not a valid directory)
      • setCurrentDirectory

        boolean setCurrentDirectory​(File dir)
        Set the current working directory.
        Parameters:
        dir - a File object pointing to an existing directory
        Returns:
        true if successful, false if the specified File is not a directory or does not exist