fr.systemsbiology.cyni
Class CyniNetworkUtils

java.lang.Object
  extended by fr.systemsbiology.cyni.CyniNetworkUtils

public class CyniNetworkUtils
extends Object

This is a class that contains several methods to help while creating a new network


Field Summary
protected  org.cytoscape.model.CyNetworkManager netMgr
           
protected  org.cytoscape.view.model.CyNetworkViewFactory viewFactory
           
protected  org.cytoscape.view.model.CyNetworkViewManager viewMgr
           
protected  org.cytoscape.view.vizmap.VisualMappingManager vmMgr
           
 
Constructor Summary
CyniNetworkUtils(org.cytoscape.view.model.CyNetworkViewFactory networkViewFactory, org.cytoscape.model.CyNetworkManager networkManager, org.cytoscape.view.model.CyNetworkViewManager networkViewManager, org.cytoscape.model.CyNetworkTableManager netTableMgr, org.cytoscape.model.subnetwork.CyRootNetworkManager rootNetMgr, org.cytoscape.view.vizmap.VisualMappingManager visualMapperManager)
          Constructor.
 
Method Summary
 void addColumns(org.cytoscape.model.CyNetwork origNet, org.cytoscape.model.CyNetwork newNet, org.cytoscape.model.CyTable origTable, Class<? extends org.cytoscape.model.CyIdentifiable> tableType, String namespace)
          Add columns that belong to a table associated to a network to a new table associated to a new network.
 void cloneEdgeRow(org.cytoscape.model.CyNetwork newNet, org.cytoscape.model.CyRow sourceRow, org.cytoscape.model.CyEdge targetEdge)
          Clone the row data to the row corresponding to an edge of the specified network
 void cloneNodeRow(org.cytoscape.model.CyNetwork newNet, org.cytoscape.model.CyRow sourceRow, org.cytoscape.model.CyNode targetNode)
          Clone the row data to the row corresponding to a node of the specified network
 void copyEdgeColumns(org.cytoscape.model.CyNetwork newNetwork, org.cytoscape.model.CyTable origTable)
          Copy the columns from a table to the edge table of a network.
 void copyNodeColumns(org.cytoscape.model.CyNetwork newNetwork, org.cytoscape.model.CyTable origTable)
          Copy the columns from a table to the node table of a network.
<T> void
createEdgeColumn(org.cytoscape.model.CyNetwork newNetwork, String columnName, Class<? extends T> type, boolean isImmutable)
          Create a column of the specified name and the specified type in the edge table of the specified network.
<T> void
createNetworkColumn(org.cytoscape.model.CyNetwork newNetwork, String columnName, Class<? extends T> type, boolean isImmutable)
          Create a column of the specified name and the specified type in the network table of the specified network.
<T> void
createNodeColumn(org.cytoscape.model.CyNetwork newNetwork, String columnName, Class<? extends T> type, boolean isImmutable)
          Create a column of the specified name and the specified type in the node table of the specified network.
 org.cytoscape.view.model.CyNetworkView displayNewNetwork(org.cytoscape.model.CyNetwork newNetwork, org.cytoscape.model.CyNetwork oldNetwork, boolean directed)
          This method displays the new network and return a network view that might be used to modify the display features such as the layout
 org.cytoscape.model.CyNetwork getNetworkAssociatedToTable(org.cytoscape.model.CyTable table)
          Checks if the table is associated to a network, if so it returns the associated network otherwise it returns null
 void removeNodesWithoutEdges(org.cytoscape.model.CyNetwork network)
          Remove nodes that do not have any edge
 void setNetworkName(org.cytoscape.model.CyNetwork newNetwork, String name)
          Sets the name of the network
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewFactory

protected org.cytoscape.view.model.CyNetworkViewFactory viewFactory

netMgr

protected org.cytoscape.model.CyNetworkManager netMgr

viewMgr

protected org.cytoscape.view.model.CyNetworkViewManager viewMgr

vmMgr

protected org.cytoscape.view.vizmap.VisualMappingManager vmMgr
Constructor Detail

CyniNetworkUtils

public CyniNetworkUtils(org.cytoscape.view.model.CyNetworkViewFactory networkViewFactory,
                        org.cytoscape.model.CyNetworkManager networkManager,
                        org.cytoscape.view.model.CyNetworkViewManager networkViewManager,
                        org.cytoscape.model.CyNetworkTableManager netTableMgr,
                        org.cytoscape.model.subnetwork.CyRootNetworkManager rootNetMgr,
                        org.cytoscape.view.vizmap.VisualMappingManager visualMapperManager)
Constructor.

Parameters:
networkViewFactory - The network view factory to create a new network view
networkManager - The network manager
networkViewManager - The network view manager
netTableMgr - The network table manager to generate a new network and its table
rootNetMgr - The root network manager to generate a new root network
vmMgr - The Visual mapping manager that allows changing the visual style of a network
Method Detail

copyNodeColumns

public void copyNodeColumns(org.cytoscape.model.CyNetwork newNetwork,
                            org.cytoscape.model.CyTable origTable)
Copy the columns from a table to the node table of a network. Basically, allows copying all columns from one table to another one.

Parameters:
newNet - The new network
origTable - The original table

copyEdgeColumns

public void copyEdgeColumns(org.cytoscape.model.CyNetwork newNetwork,
                            org.cytoscape.model.CyTable origTable)
Copy the columns from a table to the edge table of a network. Basically, allows copying all columns from one table to an edge table.

Parameters:
newNet - The new network
origTable - The original table

setNetworkName

public void setNetworkName(org.cytoscape.model.CyNetwork newNetwork,
                           String name)
Sets the name of the network

Parameters:
newNet - The network
name - The name of the network

createNodeColumn

public <T> void createNodeColumn(org.cytoscape.model.CyNetwork newNetwork,
                                 String columnName,
                                 Class<? extends T> type,
                                 boolean isImmutable)
Create a column of the specified name and the specified type in the node table of the specified network. The column type is limited to Integer, Long, Double, String, and Boolean. The default value for the column will be null. If the column already exists, the column will not be created.

Parameters:
newNetwork - The network where the new column will be created
columnName - The name of the new column.
type - The type of the column.
isImmutable - if true, this column can never be deleted

createEdgeColumn

public <T> void createEdgeColumn(org.cytoscape.model.CyNetwork newNetwork,
                                 String columnName,
                                 Class<? extends T> type,
                                 boolean isImmutable)
Create a column of the specified name and the specified type in the edge table of the specified network. The column type is limited to Integer, Long, Double, String, and Boolean. The default value for the column will be null. If the column already exists, the column will not be created.

Parameters:
newNetwork - The network where the new column will be created
columnName - The name of the new column.
type - The type of the column.
isImmutable - if true, this column can never be deleted

createNetworkColumn

public <T> void createNetworkColumn(org.cytoscape.model.CyNetwork newNetwork,
                                    String columnName,
                                    Class<? extends T> type,
                                    boolean isImmutable)
Create a column of the specified name and the specified type in the network table of the specified network. The column type is limited to Integer, Long, Double, String, and Boolean. The default value for the column will be null. If the column already exists, the column will not be created.

Parameters:
newNetwork - The network where the new column will be created
columnName - The name of the new column.
type - The type of the column.
isImmutable - if true, this column can never be deleted

addColumns

public void addColumns(org.cytoscape.model.CyNetwork origNet,
                       org.cytoscape.model.CyNetwork newNet,
                       org.cytoscape.model.CyTable origTable,
                       Class<? extends org.cytoscape.model.CyIdentifiable> tableType,
                       String namespace)
Add columns that belong to a table associated to a network to a new table associated to a new network. Basically, allows copying all columns from one table to another one

Parameters:
origNet - The original network(it can be null if original table does not belong to a network)
newNet - The new network
origTable - The original table
tableType - The type of the table (Node, edge or network table)
namespace - The namespace of the network table

cloneNodeRow

public void cloneNodeRow(org.cytoscape.model.CyNetwork newNet,
                         org.cytoscape.model.CyRow sourceRow,
                         org.cytoscape.model.CyNode targetNode)
Clone the row data to the row corresponding to a node of the specified network

Parameters:
newNet - The network where the node belongs
sourceRow - The source row
targetNode - The target node where the data will be cloned

cloneEdgeRow

public void cloneEdgeRow(org.cytoscape.model.CyNetwork newNet,
                         org.cytoscape.model.CyRow sourceRow,
                         org.cytoscape.model.CyEdge targetEdge)
Clone the row data to the row corresponding to an edge of the specified network

Parameters:
newNet - The network where the node belongs
sourceRow - The source row
targetEdge - The target edge where the data will be cloned

getNetworkAssociatedToTable

public org.cytoscape.model.CyNetwork getNetworkAssociatedToTable(org.cytoscape.model.CyTable table)
Checks if the table is associated to a network, if so it returns the associated network otherwise it returns null

Parameters:
table - The table to check
Returns:
null if no network is associated to the table or the network associated

removeNodesWithoutEdges

public void removeNodesWithoutEdges(org.cytoscape.model.CyNetwork network)
Remove nodes that do not have any edge

Parameters:
network - The network to remove nodes

displayNewNetwork

public org.cytoscape.view.model.CyNetworkView displayNewNetwork(org.cytoscape.model.CyNetwork newNetwork,
                                                                org.cytoscape.model.CyNetwork oldNetwork,
                                                                boolean directed)
This method displays the new network and return a network view that might be used to modify the display features such as the layout

Parameters:
newNetwork - The new network
oldNetwork - The old network in case we are using a table associated to a network otherwise it is a null
directed - Tells whether the new network is a directed graph or not
Returns:
the new network view


Copyright © 2014. All rights reserved.