cytoscape.editor
Interface CytoscapeEditor

All Superinterfaces:
cytoscape.data.FlagEventListener
All Known Implementing Classes:
BasicCytoscapeEditor

public interface CytoscapeEditor
extends cytoscape.data.FlagEventListener

CytoscapeEditor provides a framework for developers to implement specialized, semantics driven graphical editors and incorporate them into Cytoscape. For example, a developer might build a BioPAX editor whose operations adhere to the semantics of the BioPAX specification. The basic idea of the framework is to provide, on the Cytotoscape side, a set of common operations that all editors would use to interact with the Cytoscape environment. Such common operations include drag/drop support, mouse event handling, management of CyNetworks and CyNetworkViews, and wrappers for Cytoscape core methods that add and delete Cytoscape nodes and edges.

CytoscapeEditor is an interface that specifies common methods which all editors must implement. These methods will be called by methods in the framework.

Version:
1.0
Author:
Allan Kuchinsky, Agilent Technologies

Method Summary
 cytoscape.CyEdge addEdge(giny.model.Node node_1, giny.model.Node node_2, java.lang.String attribute, java.lang.Object attribute_value)
          wrapper for adding an edge in Cytoscape.
 cytoscape.CyEdge addEdge(giny.model.Node node_1, giny.model.Node node_2, java.lang.String attribute, java.lang.Object attribute_value, boolean create)
          wrapper for adding an edge in Cytoscape.
 cytoscape.CyEdge addEdge(giny.model.Node node_1, giny.model.Node node_2, java.lang.String attribute, java.lang.Object attribute_value, boolean create, java.lang.String edgeType)
          wrapper for adding an edge in Cytoscape.
 cytoscape.CyEdge addEdge(giny.model.Node node_1, giny.model.Node node_2, java.lang.String attribute, java.lang.Object attribute_value, java.lang.String edgeType)
          wrapper for adding an edge in Cytoscape.
 cytoscape.CyNode addNode(java.lang.String nodeName)
          wrapper for adding a node in Cytoscape.
 cytoscape.CyNode addNode(java.lang.String nodeName, java.lang.String nodeType)
          wrapper for adding a node in Cytoscape.
 cytoscape.CyNode addNode(java.lang.String nodeName, java.lang.String attribute, java.lang.String value)
          wrapper for adding a node in Cytoscape.
 cytoscape.CyNode addNode(java.lang.String nodeName, java.lang.String attribute, java.lang.String value, java.awt.geom.Point2D location)
          wrapper for adding a node in Cytoscape.
 void buildVisualStyle()
          build the visual style for this editor should be overidden by specialized editors
 void deleteEdge(cytoscape.CyEdge edge)
          Deletes (hides) an edge from the current network
 void deleteNode(giny.model.Node node)
          Deletes (hides) a node from the current network
 void disableControls(java.util.List args)
          specialized code that disables and/or removes controls when a ntework view changes, should be overridden by the developer
 void enableControls(java.util.List args)
          specialized code that enables and/or adds controls when a network view changes.
 java.lang.String getControllingEdgeAttribute()
           
 java.lang.String getControllingNodeAttribute()
           
 java.lang.String getEditorName()
          gets the name of the editor
 NetworkEditEventAdapter getNetworkEditEventAdapter()
           
 void initializeControls(java.util.List args)
          specialized initialization code for editor, called by CyNetworkEditorFactory, should be overridden
 void setControllingEdgeAttribute(java.lang.String controllingEdgeAttribute)
           
 void setControllingNodeAttribute(java.lang.String controllingNodeAttribute)
           
 void setEditorName(java.lang.String editorName)
          set the name of the editor.
 void setNetworkEditEventAdapter(NetworkEditEventAdapter adapter)
           
 
Methods inherited from interface cytoscape.data.FlagEventListener
onFlagEvent
 

Method Detail

buildVisualStyle

public void buildVisualStyle()
build the visual style for this editor should be overidden by specialized editors


initializeControls

public void initializeControls(java.util.List args)
specialized initialization code for editor, called by CyNetworkEditorFactory, should be overridden

Parameters:
args - an arbitrary list of arguments to be used in initializing the editor

disableControls

public void disableControls(java.util.List args)
specialized code that disables and/or removes controls when a ntework view changes, should be overridden by the developer

Parameters:
args - arbitrary list of arguments

enableControls

public void enableControls(java.util.List args)
specialized code that enables and/or adds controls when a network view changes. Currently not used; rather a combination of intializeControls() and disableControls() is used to manage the association of visual controls with Network views.

Parameters:
args -

setEditorName

public void setEditorName(java.lang.String editorName)
set the name of the editor. This name also serves as 'Editor Type' attribute.

Parameters:
editorName -

getEditorName

public java.lang.String getEditorName()
gets the name of the editor

Returns:
the name of the editor

addNode

public cytoscape.CyNode addNode(java.lang.String nodeName,
                                java.lang.String attribute,
                                java.lang.String value)
wrapper for adding a node in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor. this method will ensure that the node added is unique. If it finds that there is an existing node for nodeName, it will attempt to generate a new, unique, nodeName by extending the nodeName argument with a randomly generated extension.

Parameters:
nodeName - the name of the node to be created. This will be used as a unique identifier for the node.
attribute - a defining property for the node, that can be used in conjunction with the Visual Mapper to assign visual characteristics to different types of nodes. Also can be used, by the canvas when handling a dropped item, to distinguish between nodes and edges, so should be set to something like "NodeType".
value - the value of the attribute for this node. This can be used in conjunction with the Visual Mapper to assign visual characteristics to different types of nodes, for example to assign a violet diamond shape to a 'smallMolecule' node type.
Returns:
the CyNode that has been either reused or created.

addNode

public cytoscape.CyNode addNode(java.lang.String nodeName,
                                java.lang.String attribute,
                                java.lang.String value,
                                java.awt.geom.Point2D location)
wrapper for adding a node in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor. this method will ensure that the node added is unique. If it finds that there is an existing node for nodeName, it will attempt to generate a new, unique, nodeName by extending the nodeName argument with a randomly generated extension.

Parameters:
nodeName - the name of the node to be created. This will be used as a unique identifier for the node.
attribute - a defining property for the node, that can be used in conjunction with the Visual Mapper to assign visual characteristics to different types of nodes. Also can be used, by the canvas when handling a dropped item, to distinguish between nodes and edges, so should be set to something like "NodeType".
value - the value of the attribute for this node. This can be used in conjunction with the Visual Mapper to assign visual characteristics to different types of nodes, for example to assign a violet diamond shape to a 'smallMolecule' node type.
location - position at which to add the node
Returns:
the CyNode that has been either reused or created.

addNode

public cytoscape.CyNode addNode(java.lang.String nodeName,
                                java.lang.String nodeType)
wrapper for adding a node in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor.

Parameters:
nodeName - the name of the node to be created. This will be used as a unique identifier for the node.
nodeType - the value of the 'NodeType' attribute for this node. This can be used in conjunction with the Visual Mapper to assign visual characteristics to different types of nodes. Also can be used, by the canvas when handling, a dropped item, to distinguish between nodes and edges.
Returns:
the CyNode that has been either reused or created.

addNode

public cytoscape.CyNode addNode(java.lang.String nodeName)
wrapper for adding a node in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor. This form of addNode() will create a node in all cases, whether it previously exists or not.

Parameters:
nodeName - the name of the node to be created. This will be used as a unique identifier for the node.
Returns:
the CyNode that has been either reused or created.

addEdge

public cytoscape.CyEdge addEdge(giny.model.Node node_1,
                                giny.model.Node node_2,
                                java.lang.String attribute,
                                java.lang.Object attribute_value,
                                boolean create,
                                java.lang.String edgeType)
wrapper for adding an edge in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor.

Parameters:
node_1 - Node at one end of the edge
node_2 - Node at the other end of the edge
attribute - the attribute of the edge to be searched, a common one is Semantics.INTERACTION
attribute_value - a value for the attribute, like "pp" or "default"
create - if true, then create an edge if one does not already exist. Otherwise, return the edge if it already exists.
edgeType - a value for the "EdgeType" attribute assigned to the edge. This can be used in conjunction with the Visual Mapper.
Returns:
the CyEdge that has either been reused or created

addEdge

public cytoscape.CyEdge addEdge(giny.model.Node node_1,
                                giny.model.Node node_2,
                                java.lang.String attribute,
                                java.lang.Object attribute_value)
wrapper for adding an edge in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor. This version always creates an edge, whether or not one already exists.

Parameters:
node_1 - Node at one end of the edge
node_2 - Node at the other end of the edge
attribute - the attribute of the edge to be searched, a common one is Semantics.INTERACTION
attribute_value - a value for the attribute, like "pp" or "default"
Returns:
the CyEdge that has been created

addEdge

public cytoscape.CyEdge addEdge(giny.model.Node node_1,
                                giny.model.Node node_2,
                                java.lang.String attribute,
                                java.lang.Object attribute_value,
                                java.lang.String edgeType)
wrapper for adding an edge in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor. This version always creates an edge, whether or not one already exists.

Parameters:
node_1 - Node at one end of the edge
node_2 - Node at the other end of the edge
attribute - the attribute of the edge to be searched, a common one is Semantics.INTERACTION
attribute_value - a value for the attribute, like "pp" or "default"
edgeType - a value for the "EdgeType" attribute assigned to the edge. This can be used in conjunction with the Visual Mapper.
Returns:
the CyEdge that has been created

addEdge

public cytoscape.CyEdge addEdge(giny.model.Node node_1,
                                giny.model.Node node_2,
                                java.lang.String attribute,
                                java.lang.Object attribute_value,
                                boolean create)
wrapper for adding an edge in Cytoscape. This is intended to be called by the CytoscapeEditor in lieu of making direct modifications to the Cytoscape model. Thus, it provides an insulating level of abstraction between the CytoscapeEditor and the Cytoscape implementation, allowing for portability and extensibility of the editor.

Parameters:
node_1 - Node at one end of the edge
node_2 - Node at the other end of the edge
attribute - the attribute of the edge to be searched, a common one is Semantics.INTERACTION
attribute_value - a value for the attribute, like "pp" or "default"
create - if true, then create an edge if one does not already exist. Otherwise, return the edge if it already exists.
Returns:
the CyEdge that has either been reused or created

deleteNode

public void deleteNode(giny.model.Node node)
Deletes (hides) a node from the current network

Parameters:
node - the node to be deleted

deleteEdge

public void deleteEdge(cytoscape.CyEdge edge)
Deletes (hides) an edge from the current network

Parameters:
edge - the edge to be deleted

getControllingEdgeAttribute

public java.lang.String getControllingEdgeAttribute()
Returns:
the name of the attribute used to determine edge shapes on palette this is the same as the controllingEdgeAttribute for mapping of visual style to edge line type, target arrow

setControllingEdgeAttribute

public void setControllingEdgeAttribute(java.lang.String controllingEdgeAttribute)
Parameters:
controllingEdgeAttribute - the name of the attribute used to determine edge shapes on palette this is the same as the controllingEdgeAttribute for mapping of visual style to edge line type, target arrow

getControllingNodeAttribute

public java.lang.String getControllingNodeAttribute()
Returns:
the name of the attribute used to determine Node shapes on palette this is the same as the controllingNodeAttribute for mapping of visual style to Node line type, target arrow

setControllingNodeAttribute

public void setControllingNodeAttribute(java.lang.String controllingNodeAttribute)
Parameters:
controllingNodeAttribute - the name of the attribute used to determine Node shapes on palette this is the same as the controllingNodeAttribute for mapping of visual style to Node line type, target arrow

getNetworkEditEventAdapter

public NetworkEditEventAdapter getNetworkEditEventAdapter()
Returns:
the network event handler that is associated with this editor

setNetworkEditEventAdapter

public void setNetworkEditEventAdapter(NetworkEditEventAdapter adapter)
Parameters:
adapter - the network event handler that is associated with this editor