Package org.cytoscape.application
Interface CyApplicationManager
-
public interface CyApplicationManagerBasic access to current and/or currently selected networks, views and rendering engines in an instance of Cytoscape.Module:
application-apiTo 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FilegetCurrentDirectory()Get the current working directory.CyNetworkgetCurrentNetwork()Provides access to the current network.CyNetworkViewgetCurrentNetworkView()Returns the current network view.NetworkViewRenderergetCurrentNetworkViewRenderer()Returns the NetworkViewRenderer associated with the current RenderingEngine.RenderingEngine<CyNetwork>getCurrentRenderingEngine()Returns the rendering engine associated with the current network view.CyTablegetCurrentTable()Returns the currently active table.NetworkViewRenderergetDefaultNetworkViewRenderer()Returns the NetworkViewRenderer that should be used to create CyNetworkViews.NetworkViewRenderergetNetworkViewRenderer(String rendererId)Returns theNetworkViewRendererthat has the passed id or null if it doesn't exist.Set<NetworkViewRenderer>getNetworkViewRendererSet()Returns a set with all theNetworkViewRendererobjects that have been registered.List<CyNetwork>getSelectedNetworks()Returns the list of selected networks.List<CyNetworkView>getSelectedNetworkViews()Returns the list of selected network views.voidreset()Releases all currently held references and resources.booleansetCurrentDirectory(File dir)Set the current working directory.voidsetCurrentNetwork(CyNetwork net)Sets the current network to the specified network.voidsetCurrentNetworkView(CyNetworkView netView)Sets the current network view to the specified network view.voidsetCurrentRenderingEngine(RenderingEngine<CyNetwork> engine)Sets the current rendering engine.voidsetCurrentTable(CyTable table)Sets the currently active table.voidsetDefaultNetworkViewRenderer(NetworkViewRenderer renderer)Sets theNetworkViewRendererthat should be used to create CyNetworkViews.voidsetSelectedNetworks(List<CyNetwork> nets)Sets the networks specified as selected.voidsetSelectedNetworkViews(List<CyNetworkView> views)Sets the specified network views as selected.
-
-
-
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, aSetCurrentNetworkEventis fired. If the passed network is not yet selected, any selected networks are unselected before the passed one is selected. That means that theSetSelectedNetworksEventcan 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
CyTableor 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 theNetworkViewRendererthat should be used to create CyNetworkViews.- Parameters:
renderer- the NetworkViewRenderer that should be used by default.
-
getNetworkViewRenderer
NetworkViewRenderer getNetworkViewRenderer(String rendererId)
Returns theNetworkViewRendererthat 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 theNetworkViewRendererobjects 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
-
-