Cytoscape 2.8.0-alpha1 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.giny
Class FingCyNetwork

java.lang.Object
  extended by fing.model.FingExtensibleGraphPerspective
      extended by cytoscape.giny.FingCyNetwork
All Implemented Interfaces:
CyNetwork, cytoscape.graph.fixed.FixedGraph, giny.model.GraphPerspective

public class FingCyNetwork
extends fing.model.FingExtensibleGraphPerspective
implements CyNetwork, giny.model.GraphPerspective

FinhCyNetwork provides an implementation of the CyNetwork interface, as well as the GraphPerspective inteface, and also provides the functionality formally provided by GraphObjAttributes. The Network will notify listeners when nodes/edges are added/removed and when relavant data changes.


Field Summary
 
Fields inherited from interface cytoscape.graph.fixed.FixedGraph
DIRECTED_EDGE, UNDIRECTED_EDGE
 
Constructor Summary
FingCyNetwork(fing.model.FingExtensibleRootGraph root, cytoscape.util.intr.IntIterator rootGraphNodeInx, cytoscape.util.intr.IntIterator rootGraphEdgeInx)
          rootGraphNodeInx need not contain all endpoint nodes corresponding to edges in rootGraphEdgeInx - this is calculated automatically by this constructor.
 
Method Summary
 void addCyNetworkListener(CyNetworkListener listener)
          Registers the argument as a listener to this object.
 CyEdge addEdge(giny.model.Edge cytoscape_edge)
          Add a edge to this Network that already exists in Cytoscape
 int addEdge(int cytoscape_edge)
          Add a edge to this Network that already exists in Cytoscape
 int addEdge(String attribute, Object value)
          Adds a edge to this Network, by looking it up via the given attribute and value
 int addNode(int cytoscape_node)
          Add a node to this Network that already exists in Cytoscape
 CyNode addNode(giny.model.Node cytoscape_node)
          Add a node to this Network that already exists in Cytoscape
 int addNode(String attribute, Object value)
          Adds a node to this Network, by looking it up via the given attribute and value
 void addSelectEventListener(SelectEventListener listener)
          Adds a listener for SelectEvents to this CyNetwork
 void appendNetwork(CyNetwork network)
          Appends all of the nodes and edges in teh given Network to this Network
 int createEdge(int source, int target, boolean directed)
          This method will create a new edge.
 int createNode()
          This method will create a new node.
 void deleteEdgeAttribute(String attribute)
          Deletes the attribute with the given name from edge attributes
 void deleteNodeAttribute(String attribute)
          Deletes the attribute with the given name from node attributes
 Object getClientData(String data_name)
          Deprecated. Get Some client data
 Collection getClientDataNames()
          Deprecated. Get a list of all currently available ClientData objects
 Set getCyNetworkListeners()
          Returns the set of listeners registered with this object.
 String[] getEdgeAttributesList()
          Return all availble Attributes for the Edges in this CyNetwork
 Object getEdgeAttributeValue(giny.model.Edge edge, String attribute)
          Return the requested Attribute for the given Edge
 Object getEdgeAttributeValue(int edge, String attribute)
          Return the requested Attribute for the given Edge
 String getIdentifier()
          DOCUMENT ME!
 String[] getNodeAttributesList()
          Return all availble Attributes for the Nodes in this CyNetwork
 String[] getNodeAttributesList(giny.model.Edge[] edges)
          Return all available Attributes for the given Edges
 String[] getNodeAttributesList(giny.model.Node[] nodes)
          Return all available Attributes for the given Nodes
 Object getNodeAttributeValue(int node, String attribute)
          Return the requested Attribute for the given Node
 Object getNodeAttributeValue(giny.model.Node node, String attribute)
          Return the requested Attribute for the given Node
 Set getSelectedEdges()
          Returns the set of selected edges in this CyNetwork
 Set getSelectedNodes()
          Returns the set of selected nodes in this CyNetwork
 SelectFilter getSelectFilter()
           
 String getTitle()
          Can Change
 boolean isSelected(giny.model.Edge edge)
          Returns the selected state of the given edge.
 boolean isSelected(giny.model.Node node)
          Returns the selected state of the given node.
 void putClientData(String data_name, Object data)
          Deprecated. Networks can support client data.
 boolean removeCyNetworkListener(CyNetworkListener listener)
          Removes the argument from the set of listeners for this object.
 boolean removeEdge(int edge_index, boolean force)
          This will remove this edge from the Network.
 boolean removeNode(int node_index, boolean force)
          This will remove this node from the Network.
 void removeSelectEventListener(SelectEventListener listener)
          Removes a listener for SelectEvents from this CyNetwork
 void selectAllEdges()
          Sets the selected state of all edges in this CyNetwork to true
 void selectAllNodes()
          Sets the selected state of all nodes in this CyNetwork to true
 boolean setEdgeAttributeValue(giny.model.Edge edge, String attribute, Object value)
          Return the requested Attribute for the given Edge
 boolean setEdgeAttributeValue(int edge, String attribute, Object value)
          Return the requested Attribute for the given Edge
 String setIdentifier(String new_id)
          DOCUMENT ME!
 boolean setNodeAttributeValue(int node, String attribute, Object value)
          Return the requested Attribute for the given Node
 boolean setNodeAttributeValue(giny.model.Node node, String attribute, Object value)
          Return the requested Attribute for the given Node
 void setSelectedEdgeState(Collection edges, boolean selected_state)
          Sets the selected state of a collection of edges.
 void setSelectedEdgeState(giny.model.Edge edge, boolean selected_state)
          Sets the selected state of an edge.
 void setSelectedNodeState(Collection nodes, boolean selected_state)
          Sets the selected state of a collection of nodes.
 void setSelectedNodeState(giny.model.Node node, boolean selected_state)
          Sets the selected state of a node.
 void setTitle(String new_id)
          Can Change Throws a PropertyChangeEvent if the title has changed with a CyNetworkTitleChange object that contains the network id and the name.
 void unselectAllEdges()
          Sets the selected state of all edges in this CyNetwork to false
 void unselectAllNodes()
          Sets the selected state of all nodes in this CyNetwork to false
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface giny.model.GraphPerspective
addGraphPerspectiveChangeListener, clone, containsEdge, containsEdge, containsNode, containsNode, createGraphPerspective, createGraphPerspective, createGraphPerspective, createGraphPerspective, edgeExists, edgeExists, edgeMetaChildrenList, edgeMetaChildrenList, edgeMetaParentsList, edgesIterator, edgesList, edgesList, edgesList, getAdjacentEdgeIndicesArray, getAdjacentEdgesList, getConnectingEdgeIndicesArray, getConnectingEdges, getConnectingNodeIndicesArray, getDegree, getDegree, getEdge, getEdgeCount, getEdgeCount, getEdgeCount, getEdgeIndex, getEdgeIndicesArray, getEdgeIndicesArray, getEdgeIndicesArray, getEdgeMetaChildIndicesArray, getEdgeMetaParentIndicesArray, getEdgeSourceIndex, getEdgeTargetIndex, getInDegree, getInDegree, getInDegree, getInDegree, getIndex, getIndex, getNode, getNodeCount, getNodeIndex, getNodeIndicesArray, getNodeMetaChildIndicesArray, getNodeMetaParentIndicesArray, getOutDegree, getOutDegree, getOutDegree, getOutDegree, getRootGraph, getRootGraphEdgeIndex, getRootGraphNodeIndex, hideEdge, hideEdge, hideEdges, hideEdges, hideNode, hideNode, hideNodes, hideNodes, isEdgeDirected, isEdgeMetaChild, isEdgeMetaParent, isMetaChild, isMetaChild, isMetaParent, isMetaParent, isNeighbor, isNeighbor, isNodeMetaChild, isNodeMetaParent, join, metaParentsList, metaParentsList, neighborsArray, neighborsList, nodeMetaChildrenList, nodeMetaChildrenList, nodeMetaParentsList, nodesIterator, nodesList, removeGraphPerspectiveChangeListener, restoreEdge, restoreEdge, restoreEdges, restoreEdges, restoreNode, restoreNode, restoreNodes, restoreNodes, restoreNodes, restoreNodes
 

Constructor Detail

FingCyNetwork

public FingCyNetwork(fing.model.FingExtensibleRootGraph root,
                     cytoscape.util.intr.IntIterator rootGraphNodeInx,
                     cytoscape.util.intr.IntIterator rootGraphEdgeInx)
rootGraphNodeInx need not contain all endpoint nodes corresponding to edges in rootGraphEdgeInx - this is calculated automatically by this constructor. If any index does not correspond to an existing node or edge, an IllegalArgumentException is thrown. The indices lists need not be non-repeating - the logic in this constructor handles duplicate filtering.

Method Detail

getTitle

public String getTitle()
Can Change

Specified by:
getTitle in interface CyNetwork

setTitle

public void setTitle(String new_id)
Can Change Throws a PropertyChangeEvent if the title has changed with a CyNetworkTitleChange object that contains the network id and the name.

Specified by:
setTitle in interface CyNetwork

getIdentifier

public String getIdentifier()
DOCUMENT ME!

Specified by:
getIdentifier in interface CyNetwork
Returns:
DOCUMENT ME!

setIdentifier

public String setIdentifier(String new_id)
DOCUMENT ME!

Specified by:
setIdentifier in interface CyNetwork
Parameters:
new_id - DOCUMENT ME!
Returns:
DOCUMENT ME!

putClientData

public void putClientData(String data_name,
                          Object data)
Deprecated. Networks can support client data.

Description copied from interface: CyNetwork
Networks can support client data.

Specified by:
putClientData in interface CyNetwork
Parameters:
data_name - the name of this client data

getClientDataNames

public Collection getClientDataNames()
Deprecated. Get a list of all currently available ClientData objects

Description copied from interface: CyNetwork
Get a list of all currently available ClientData objects

Specified by:
getClientDataNames in interface CyNetwork

getClientData

public Object getClientData(String data_name)
Deprecated. Get Some client data

Description copied from interface: CyNetwork
Get Some client data

Specified by:
getClientData in interface CyNetwork
Parameters:
data_name - the data to get

appendNetwork

public void appendNetwork(CyNetwork network)
Appends all of the nodes and edges in teh given Network to this Network

Specified by:
appendNetwork in interface CyNetwork

selectAllNodes

public void selectAllNodes()
Sets the selected state of all nodes in this CyNetwork to true

Specified by:
selectAllNodes in interface CyNetwork

selectAllEdges

public void selectAllEdges()
Sets the selected state of all edges in this CyNetwork to true

Specified by:
selectAllEdges in interface CyNetwork

unselectAllNodes

public void unselectAllNodes()
Sets the selected state of all nodes in this CyNetwork to false

Specified by:
unselectAllNodes in interface CyNetwork

unselectAllEdges

public void unselectAllEdges()
Sets the selected state of all edges in this CyNetwork to false

Specified by:
unselectAllEdges in interface CyNetwork

setSelectedNodeState

public void setSelectedNodeState(Collection nodes,
                                 boolean selected_state)
Sets the selected state of a collection of nodes.

Specified by:
setSelectedNodeState in interface CyNetwork
Parameters:
nodes - a Collection of Nodes
selected_state - the desired selection state for the nodes

setSelectedNodeState

public void setSelectedNodeState(giny.model.Node node,
                                 boolean selected_state)
Sets the selected state of a node.

Specified by:
setSelectedNodeState in interface CyNetwork
Parameters:
nodes - a Node
selected_state - the desired selection state for the node

setSelectedEdgeState

public void setSelectedEdgeState(Collection edges,
                                 boolean selected_state)
Sets the selected state of a collection of edges.

Specified by:
setSelectedEdgeState in interface CyNetwork
Parameters:
edges - a Collection of Edges
selected_state - the desired selection state for the edges

setSelectedEdgeState

public void setSelectedEdgeState(giny.model.Edge edge,
                                 boolean selected_state)
Sets the selected state of an edge.

Specified by:
setSelectedEdgeState in interface CyNetwork
Parameters:
edges - an Edge
selected_state - the desired selection state for the edge

isSelected

public boolean isSelected(giny.model.Node node)
Returns the selected state of the given node.

Specified by:
isSelected in interface CyNetwork
Parameters:
node - the node
Returns:
true if selected, false otherwise

isSelected

public boolean isSelected(giny.model.Edge edge)
Returns the selected state of the given edge.

Specified by:
isSelected in interface CyNetwork
Parameters:
edge - the edge
Returns:
true if selected, false otherwise

getSelectedNodes

public Set getSelectedNodes()
Returns the set of selected nodes in this CyNetwork

Specified by:
getSelectedNodes in interface CyNetwork
Returns:
a Set of selected nodes

getSelectedEdges

public Set getSelectedEdges()
Returns the set of selected edges in this CyNetwork

Specified by:
getSelectedEdges in interface CyNetwork
Returns:
a Set of selected edges

addSelectEventListener

public void addSelectEventListener(SelectEventListener listener)
Adds a listener for SelectEvents to this CyNetwork

Specified by:
addSelectEventListener in interface CyNetwork
Parameters:
listener -

removeSelectEventListener

public void removeSelectEventListener(SelectEventListener listener)
Removes a listener for SelectEvents from this CyNetwork

Specified by:
removeSelectEventListener in interface CyNetwork
Parameters:
listener -

getSelectFilter

public SelectFilter getSelectFilter()
Specified by:
getSelectFilter in interface CyNetwork
Returns:
SelectFilter

getNodeAttributeValue

public Object getNodeAttributeValue(giny.model.Node node,
                                    String attribute)
Return the requested Attribute for the given Node

Parameters:
node - the given CyNode
attribute - the name of the requested attribute
Returns:
the value for the give node, for the given attribute

getNodeAttributeValue

public Object getNodeAttributeValue(int node,
                                    String attribute)
Return the requested Attribute for the given Node


getEdgeAttributeValue

public Object getEdgeAttributeValue(giny.model.Edge edge,
                                    String attribute)
Return the requested Attribute for the given Edge


getEdgeAttributeValue

public Object getEdgeAttributeValue(int edge,
                                    String attribute)
Return the requested Attribute for the given Edge


getNodeAttributesList

public String[] getNodeAttributesList()
Return all availble Attributes for the Nodes in this CyNetwork


getNodeAttributesList

public String[] getNodeAttributesList(giny.model.Node[] nodes)
Return all available Attributes for the given Nodes


getEdgeAttributesList

public String[] getEdgeAttributesList()
Return all availble Attributes for the Edges in this CyNetwork


getNodeAttributesList

public String[] getNodeAttributesList(giny.model.Edge[] edges)
Return all available Attributes for the given Edges


setNodeAttributeValue

public boolean setNodeAttributeValue(giny.model.Node node,
                                     String attribute,
                                     Object value)
Return the requested Attribute for the given Node

Parameters:
node - the given CyNode
attribute - the name of the requested attribute
value - the value to be set
Returns:
if it overwrites a previous value

setNodeAttributeValue

public boolean setNodeAttributeValue(int node,
                                     String attribute,
                                     Object value)
Return the requested Attribute for the given Node


setEdgeAttributeValue

public boolean setEdgeAttributeValue(giny.model.Edge edge,
                                     String attribute,
                                     Object value)
Return the requested Attribute for the given Edge


setEdgeAttributeValue

public boolean setEdgeAttributeValue(int edge,
                                     String attribute,
                                     Object value)
Return the requested Attribute for the given Edge


deleteNodeAttribute

public void deleteNodeAttribute(String attribute)
Deletes the attribute with the given name from node attributes


deleteEdgeAttribute

public void deleteEdgeAttribute(String attribute)
Deletes the attribute with the given name from edge attributes


addCyNetworkListener

public void addCyNetworkListener(CyNetworkListener listener)
Registers the argument as a listener to this object. Does nothing if the argument is already a listener.

Specified by:
addCyNetworkListener in interface CyNetwork

removeCyNetworkListener

public boolean removeCyNetworkListener(CyNetworkListener listener)
Removes the argument from the set of listeners for this object. Returns true if the argument was a listener before this call, false otherwise.

Specified by:
removeCyNetworkListener in interface CyNetwork

getCyNetworkListeners

public Set getCyNetworkListeners()
Returns the set of listeners registered with this object.

Specified by:
getCyNetworkListeners in interface CyNetwork

createNode

public int createNode()
This method will create a new node.

Returns:
the Cytoscape index of the created node

addNode

public int addNode(int cytoscape_node)
Add a node to this Network that already exists in Cytoscape

Specified by:
addNode in interface CyNetwork
Returns:
the Network Index of this node

addNode

public CyNode addNode(giny.model.Node cytoscape_node)
Add a node to this Network that already exists in Cytoscape

Specified by:
addNode in interface CyNetwork
Returns:
the Network Index of this node

addNode

public int addNode(String attribute,
                   Object value)
Adds a node to this Network, by looking it up via the given attribute and value

Returns:
the Network Index of this node

removeNode

public boolean removeNode(int node_index,
                          boolean force)
This will remove this node from the Network. However, unless forced, it will remain in Cytoscape to be possibly resused by another Network in the future.

Specified by:
removeNode in interface CyNetwork
Parameters:
force - force this node to be removed from all Networks
Returns:
true if the node is still present in Cytoscape ( i.e. in another Network )

createEdge

public int createEdge(int source,
                      int target,
                      boolean directed)
This method will create a new edge.

Parameters:
source - the source node
target - the target node
directed - weather the edge should be directed
Returns:
the Cytoscape index of the created edge

addEdge

public int addEdge(int cytoscape_edge)
Add a edge to this Network that already exists in Cytoscape

Specified by:
addEdge in interface CyNetwork
Returns:
the Network Index of this edge

addEdge

public CyEdge addEdge(giny.model.Edge cytoscape_edge)
Add a edge to this Network that already exists in Cytoscape

Specified by:
addEdge in interface CyNetwork
Returns:
the Network Index of this edge

addEdge

public int addEdge(String attribute,
                   Object value)
Adds a edge to this Network, by looking it up via the given attribute and value

Returns:
the Network Index of this edge

removeEdge

public boolean removeEdge(int edge_index,
                          boolean force)
This will remove this edge from the Network. However, unless forced, it will remain in Cytoscape to be possibly resused by another Network in the future.

Specified by:
removeEdge in interface CyNetwork
Parameters:
force - force this edge to be removed from all Networks
Returns:
true if the edge is still present in Cytoscape ( i.e. in another Network )

www.cytoscape.org