|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.editor.editors.BasicCytoscapeEditor
The BasicCytoscapeEditor provides base level graph editing functionality for Cytoscape, in particular the base level methods for adding nodes, edges, and context menu items.
Provides an "Edit => Connect Selected Nodes" menu item that, when chosen, creates a clique amongst the selected nodes.
Provides accelerators for modeless addition of nodes and edges. Control-clicking at a position on the canvas creates a node with default label in that position. The default label appears in an editable text field, so the user can edit its name immediately by just beginning to type. Hit ENTER or click (or control-click) anywhere outside the field, and the edited field is assigned as the label for the node. Control-clicking on a node on the canvas starts an edge with source at that node. Move the cursor and a rubber-banded line follows the cursor. As the cursor passes over another node, that node is highlighted and the rubber-banded line will snap to a connection point on that second node. Control-click the mouse again and the connection is established.
Provides functionality for deleting selected nodes and edges and an undo/redo framework for deletion of nodes and edges
BasicNetworkEditEventHandler
Field Summary | |
static java.lang.String |
BIOPAX_NAME_ATTRIBUTE
Cytoscape Attribute: BioPAX Name. |
Constructor Summary | |
BasicCytoscapeEditor()
|
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. |
void |
addEdgeContextMenuItems(giny.view.EdgeView edgeView,
javax.swing.JPopupMenu menu)
|
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 |
addNodeContextMenuItems(giny.view.NodeView nodeView,
javax.swing.JPopupMenu menu)
|
void |
buildVisualStyle()
build the visualStyle for this editor this code should be overidden by more specialized editors that programmatically create a visual style |
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)
sets controls invisible when editor type is switched |
void |
enableControls(java.util.List args)
sets controls visible when editor type is switched back to this editor |
java.lang.String |
getControllingEdgeAttribute()
|
java.lang.String |
getControllingNodeAttribute()
|
java.lang.String |
getEditorName()
gets the name (type) of this editor |
NetworkEditEventAdapter |
getNetworkEditEventAdapter()
|
void |
initializeControls(java.util.List args)
specialized initialization code for editor, called by CytoscapeEditorManager when a new editor is built, should be overridden |
boolean |
menuItemExists(javax.swing.JPopupMenu menu,
java.lang.String label)
|
void |
onFlagEvent(cytoscape.data.FlagEvent e)
respond to flagging of a Node. |
void |
setControllingEdgeAttribute(java.lang.String controllingEdgeAttribute)
|
void |
setControllingNodeAttribute(java.lang.String controllingNodeAttribute)
|
void |
setEditorName(java.lang.String editorName)
sets the name (type) for this editor |
void |
setNetworkEditEventAdapter(NetworkEditEventAdapter adapter)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String BIOPAX_NAME_ATTRIBUTE
Constructor Detail |
public BasicCytoscapeEditor()
Method Detail |
public cytoscape.CyNode addNode(java.lang.String nodeName, java.lang.String attribute, java.lang.String value, java.awt.geom.Point2D location)
addNode
in interface CytoscapeEditor
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
- the position at which to add the node
public void onFlagEvent(cytoscape.data.FlagEvent e)
onFlagEvent
in interface cytoscape.data.FlagEventListener
public void addNodeContextMenuItems(giny.view.NodeView nodeView, javax.swing.JPopupMenu menu)
addNodeContextMenuItems
in interface ding.view.NodeContextMenuListener
public boolean menuItemExists(javax.swing.JPopupMenu menu, java.lang.String label)
public void addEdgeContextMenuItems(giny.view.EdgeView edgeView, javax.swing.JPopupMenu menu)
addEdgeContextMenuItems
in interface ding.view.EdgeContextMenuListener
public cytoscape.CyNode addNode(java.lang.String nodeName, java.lang.String attribute, java.lang.String value)
addNode
in interface CytoscapeEditor
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.
public cytoscape.CyNode addNode(java.lang.String nodeName, java.lang.String nodeType)
addNode
in interface CytoscapeEditor
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.
public cytoscape.CyNode addNode(java.lang.String nodeName)
addNode
in interface CytoscapeEditor
nodeName
- the name of the node to be created. This will be used as a
unique identifier for the node.
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)
addEdge
in interface CytoscapeEditor
node_1
- Node at one end of the edgenode_2
- Node at the other end of the edgeattribute
- the attribute of the edge to be searched, a common one is
Semantics.INTERACTIONattribute_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.
public cytoscape.CyEdge addEdge(giny.model.Node node_1, giny.model.Node node_2, java.lang.String attribute, java.lang.Object attribute_value)
addEdge
in interface CytoscapeEditor
node_1
- Node at one end of the edgenode_2
- Node at the other end of the edgeattribute
- the attribute of the edge to be searched, a common one is
Semantics.INTERACTIONattribute_value
- a value for the attribute, like "pp" or "default"
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)
addEdge
in interface CytoscapeEditor
node_1
- Node at one end of the edgenode_2
- Node at the other end of the edgeattribute
- the attribute of the edge to be searched, a common one is
Semantics.INTERACTIONattribute_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.
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)
addEdge
in interface CytoscapeEditor
node_1
- Node at one end of the edgenode_2
- Node at the other end of the edgeattribute
- the attribute of the edge to be searched, a common one is
Semantics.INTERACTIONattribute_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.
public void deleteNode(giny.model.Node node)
deleteNode
in interface CytoscapeEditor
node
- the node to be deletedpublic void deleteEdge(cytoscape.CyEdge edge)
deleteEdge
in interface CytoscapeEditor
edge
- the edge to be deletedpublic void buildVisualStyle()
buildVisualStyle
in interface CytoscapeEditor
public void initializeControls(java.util.List args)
initializeControls
in interface CytoscapeEditor
args
- an arbitrary list of arguments passed to initialization
routine. Not used in this editorpublic void disableControls(java.util.List args)
disableControls
in interface CytoscapeEditor
args
- args an arbitrary list of arguments (not used in this editor)public void enableControls(java.util.List args)
enableControls
in interface CytoscapeEditor
args
- args an arbitrary list of arguments (not used in this editor) *public java.lang.String getEditorName()
getEditorName
in interface CytoscapeEditor
public void setEditorName(java.lang.String editorName)
setEditorName
in interface CytoscapeEditor
editorName
- the editorName to set.public java.lang.String getControllingEdgeAttribute()
getControllingEdgeAttribute
in interface CytoscapeEditor
public void setControllingEdgeAttribute(java.lang.String controllingEdgeAttribute)
setControllingEdgeAttribute
in interface CytoscapeEditor
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 arrowpublic java.lang.String getControllingNodeAttribute()
getControllingNodeAttribute
in interface CytoscapeEditor
public void setControllingNodeAttribute(java.lang.String controllingNodeAttribute)
setControllingNodeAttribute
in interface CytoscapeEditor
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 shape and colorpublic NetworkEditEventAdapter getNetworkEditEventAdapter()
getNetworkEditEventAdapter
in interface CytoscapeEditor
public void setNetworkEditEventAdapter(NetworkEditEventAdapter adapter)
setNetworkEditEventAdapter
in interface CytoscapeEditor
adapter
- the network event handler that is associated with this editor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |