Package org.cytoscape.application
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 Summary
Modifier and TypeMethodDescriptionGet the current working directory.Provides access to the current network.Returns the current network view.Returns the NetworkViewRenderer associated with the current RenderingEngine.Returns the rendering engine associated with the current network view.Returns the currently active table.Returns the NetworkViewRenderer that should be used to create CyNetworkViews.Returns the TableViewRenderer that should be used to create CyTableViews.getNetworkViewRenderer(String rendererId)
Returns theNetworkViewRenderer
that has the passed id or null if it doesn't exist.Returns a set with all theNetworkViewRenderer
objects that have been registered.Returns the list of selected networks.Returns the list of selected network views.getTableViewRenderer(String rendererId)
Returns theTableViewRenderer
that has the passed id or null if it doesn't exist.Returns a set with all theTableViewRenderer
objects that have been registered.void
reset()
Releases all currently held references and resources.boolean
setCurrentDirectory(File dir)
Set the current working directory.void
setCurrentNetwork(CyNetwork net)
Sets the current network to the specified network.void
setCurrentNetworkView(CyNetworkView netView)
Sets the current network view to the specified network view.void
Sets the current rendering engine.void
setCurrentTable(CyTable table)
Sets the currently active table.void
setDefaultNetworkViewRenderer(NetworkViewRenderer renderer)
Sets theNetworkViewRenderer
that should be used to create CyNetworkViews.void
setDefaultTableViewRenderer(TableViewRenderer renderer)
Sets theTableViewRenderer
that should be used to create CyTableViews.void
setSelectedNetworks(List<CyNetwork> nets)
Sets the networks specified as selected.void
setSelectedNetworkViews(List<CyNetworkView> views)
Sets the specified network views as selected.
-
Method Details
-
getCurrentNetwork
CyNetwork getCurrentNetwork()Provides access to the current network.- Returns:
- the current network or null if there is no current network
-
setCurrentNetwork
Sets the current network to the specified network. If the passed network is different from the current one, aSetCurrentNetworkEvent
is fired. If the passed network is not yet selected, any selected networks are unselected before the passed one is selected. That means that theSetSelectedNetworksEvent
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
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
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
Sets the specified network views as selected.- Parameters:
views
- The list of network views to be selected.
-
setSelectedNetworks
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
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
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.
Cytoscape Backwards Compatibility (DO NOT USE): This method may change or be removed in future minor version upgrades of Cytoscape. It is not safe for Apps to call or override this method. -
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
Sets theNetworkViewRenderer
that should be used to create CyNetworkViews.- Parameters:
renderer
- the NetworkViewRenderer that should be used by default.
-
getNetworkViewRenderer
Returns theNetworkViewRenderer
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 theNetworkViewRenderer
objects that have been registered.- Returns:
- the complete set of all the currently known renderers
-
getDefaultTableViewRenderer
TableViewRenderer getDefaultTableViewRenderer()Returns the TableViewRenderer that should be used to create CyTableViews.- Returns:
- the TableViewRenderer that should be used to create CyTableViews.
-
setDefaultTableViewRenderer
Sets theTableViewRenderer
that should be used to create CyTableViews.- Parameters:
renderer
- the TableViewRenderer that should be used by default.
-
getTableViewRenderer
Returns theTableViewRenderer
that has the passed id or null if it doesn't exist.- Parameters:
rendererId
-- Returns:
- the TableViewRenderer that should be used to create CyTableViews
-
getTableViewRendererSet
Set<TableViewRenderer> getTableViewRendererSet()Returns a set with all theTableViewRenderer
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
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
-