|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.editor.event.NetworkEditEventAdapter
cytoscape.editor.event.BasicNetworkEditEventHandler
The BasicNetworkEditEventHandler class provides specialized methods defining the behavior of the basic Cytoscape editor provided in Cytoscape 2.2. The behavior is defined in terms of how the event handler responds to mouse events, drag/drop events, and button press events.
revised: 04/15/2006 to integrate with Cytoscape 2.3 renderer Phase 1: switch
underlying node identification and edge drawing code Phase 2: remove
dependencies upon Piccolo
Field Summary | |
static java.lang.String |
DEFAULT_EDGE
|
static java.lang.String |
DEFAULT_NODE
|
static java.lang.String |
EDGE_TYPE
CytoscapeAttribute: EDGE_TYPE |
boolean |
handlingEdgeDrop
flag that indicates whether we are currently in the process of handling a dropped edge TODO: handling dropped edges should probably be moved to the PaletteNetworkEditEventHandler |
static java.lang.String |
NODE_TYPE
CytoscapeAttribute: NODE_TYPE |
Constructor Summary | |
BasicNetworkEditEventHandler()
|
|
BasicNetworkEditEventHandler(CytoscapeEditor caller)
|
|
BasicNetworkEditEventHandler(CytoscapeEditor caller,
cytoscape.view.CyNetworkView view)
|
Method Summary | |
void |
allAttributeValuesRemoved(java.lang.String objectKey,
java.lang.String attributeName)
|
void |
attributeValueAssigned(java.lang.String objectKey,
java.lang.String attributeName,
java.lang.Object[] keyIntoValue,
java.lang.Object oldAttributeValue,
java.lang.Object newAttributeValue)
MultiHashMapListener methods |
void |
attributeValueRemoved(java.lang.String objectKey,
java.lang.String attributeName,
java.lang.Object[] keyIntoValue,
java.lang.Object attributeValue)
|
void |
beginEdge(java.awt.geom.Point2D location,
giny.view.NodeView nv)
begin drawing an edge from the input point |
cytoscape.CyNode |
createNode(java.awt.geom.Point2D location)
create a new node at the point where mouse was pressed |
cytoscape.CyEdge |
finishEdge(java.awt.geom.Point2D location,
giny.view.NodeView target)
finish edge on node containing input pointf |
CytoscapeEditor |
get_caller()
|
ding.view.InnerCanvas |
getCanvas()
|
java.lang.String |
getEdgeAttributeName()
|
java.lang.String |
getEdgeAttributeValue()
|
java.awt.geom.Point2D |
getNextPoint()
|
giny.view.NodeView |
getNode()
|
java.lang.String |
getNodeAttributeName()
|
java.lang.String |
getNodeAttributeValue()
|
java.awt.geom.Point2D |
getStartPoint()
|
ding.view.DGraphView |
getView()
|
boolean |
isEdgeStarted()
|
boolean |
isHandlingEdgeDrop()
|
void |
keyTyped(java.awt.event.KeyEvent e)
processed keyTypedEvents, in particular use of ESC key to interupt edge drawing |
void |
mouseDragged(java.awt.event.MouseEvent e)
begin or continue drawing an edge as mouse is dragged |
void |
mouseEntered(java.awt.event.MouseEvent e)
if hovering over a node, then highlight the node by temporarily inverting its selection |
void |
mouseExited(java.awt.event.MouseEvent e)
revert temporary node highlighting that was done upon MouseEnter |
void |
mouseMoved(java.awt.event.MouseEvent e)
updates rendering of edge if an edge is under construction |
void |
mousePressed(java.awt.event.MouseEvent e)
The mousePressed() method is at the heart of the basic Cytoscape editor. |
void |
set_caller(CytoscapeEditor _caller)
|
void |
setEdgeAttributeName(java.lang.String edgeAttributeName)
|
void |
setEdgeAttributeValue(java.lang.String edgeAttributeValue)
|
void |
setEdgeStarted(boolean edgeStarted)
set the flag that indicates whether an edge is under construction |
void |
setHandlingEdgeDrop(boolean handlingEdgeDrop)
|
void |
setNextPoint(java.awt.geom.Point2D nextPoint)
|
void |
setNode(giny.view.NodeView node)
|
void |
setNodeAttributeName(java.lang.String nodeAttributeName)
|
void |
setNodeAttributeValue(java.lang.String nodeAttributeValue)
|
void |
setStartPoint(java.awt.geom.Point2D startPoint)
|
void |
setView(ding.view.DGraphView view)
|
void |
start(ding.view.DGraphView view)
starts up the event handler on the input network view adds an input event listener to the view's canvas |
void |
stop()
stops the event handler by removing the input event listener from the canvas this is called when the user switches between editors |
void |
updateEdge()
updates the rubberbanded edge line as the mouse is moved, works in Canvas coordinates |
Methods inherited from class cytoscape.editor.event.NetworkEditEventAdapter |
actionPerformed, itemDropped, keyPressed, keyReleased, mouseClicked, mouseReleased |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.ActionListener |
actionPerformed |
Field Detail |
public static final java.lang.String NODE_TYPE
public static final java.lang.String EDGE_TYPE
public static final java.lang.String DEFAULT_NODE
public static final java.lang.String DEFAULT_EDGE
public boolean handlingEdgeDrop
Constructor Detail |
public BasicNetworkEditEventHandler()
public BasicNetworkEditEventHandler(CytoscapeEditor caller)
caller
- public BasicNetworkEditEventHandler(CytoscapeEditor caller, cytoscape.view.CyNetworkView view)
caller
- view
- Method Detail |
public ding.view.InnerCanvas getCanvas()
getCanvas
in class NetworkEditEventAdapter
public void mousePressed(java.awt.event.MouseEvent e)
Control-clicking at a position on the canvas creates a node with default label in that position.
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.
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class NetworkEditEventAdapter
e
- inputEvent for mouse pressedBasicCytoscapeEditor
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
keyTyped
in class NetworkEditEventAdapter
public void beginEdge(java.awt.geom.Point2D location, giny.view.NodeView nv)
location
- works in Canvas coordinatespublic cytoscape.CyEdge finishEdge(java.awt.geom.Point2D location, giny.view.NodeView target)
location
- works in Canvas coordinatespublic cytoscape.CyNode createNode(java.awt.geom.Point2D location)
location
- point of mouse press (in Canvas coordinates)public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class NetworkEditEventAdapter
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class NetworkEditEventAdapter
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class NetworkEditEventAdapter
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class NetworkEditEventAdapter
public void updateEdge()
updateEdge
in class NetworkEditEventAdapter
public void attributeValueAssigned(java.lang.String objectKey, java.lang.String attributeName, java.lang.Object[] keyIntoValue, java.lang.Object oldAttributeValue, java.lang.Object newAttributeValue)
attributeValueAssigned
in interface cytoscape.data.attr.MultiHashMapListener
attributeValueAssigned
in class NetworkEditEventAdapter
public void attributeValueRemoved(java.lang.String objectKey, java.lang.String attributeName, java.lang.Object[] keyIntoValue, java.lang.Object attributeValue)
attributeValueRemoved
in interface cytoscape.data.attr.MultiHashMapListener
attributeValueRemoved
in class NetworkEditEventAdapter
public void allAttributeValuesRemoved(java.lang.String objectKey, java.lang.String attributeName)
allAttributeValuesRemoved
in interface cytoscape.data.attr.MultiHashMapListener
allAttributeValuesRemoved
in class NetworkEditEventAdapter
public boolean isEdgeStarted()
public void setEdgeStarted(boolean edgeStarted)
edgeStarted
- public java.awt.geom.Point2D getNextPoint()
public void setNextPoint(java.awt.geom.Point2D nextPoint)
nextPoint
- The nextPoint to setpublic giny.view.NodeView getNode()
public void setNode(giny.view.NodeView node)
node
- The node to set.public java.awt.geom.Point2D getStartPoint()
public void setStartPoint(java.awt.geom.Point2D startPoint)
startPoint
- The startPoint to set.public ding.view.DGraphView getView()
getView
in class NetworkEditEventAdapter
public void setView(ding.view.DGraphView view)
setView
in class NetworkEditEventAdapter
view
- The view to set.public boolean isHandlingEdgeDrop()
public void setHandlingEdgeDrop(boolean handlingEdgeDrop)
handlingEdgeDrop
- sets the flag that indicates whether we are handling the drop
of an edge onto the canvaspublic void start(ding.view.DGraphView view)
start
in class NetworkEditEventAdapter
view
- a Cytoscape network viewpublic void stop()
stop
in class NetworkEditEventAdapter
public java.lang.String getEdgeAttributeValue()
public void setEdgeAttributeValue(java.lang.String edgeAttributeValue)
edgeAttributeValue
- The edgeAttributeValue to set.public java.lang.String getNodeAttributeName()
public void setNodeAttributeName(java.lang.String nodeAttributeName)
nodeAttributeName
- The nodeAttributeName to set.public java.lang.String getEdgeAttributeName()
public void setEdgeAttributeName(java.lang.String edgeAttributeName)
edgeAttributeName
- The edgeAttributeName to set.public java.lang.String getNodeAttributeValue()
public void setNodeAttributeValue(java.lang.String nodeAttributeValue)
nodeAttributeValue
- The nodeAttributeValue to set.public CytoscapeEditor get_caller()
get_caller
in class NetworkEditEventAdapter
public void set_caller(CytoscapeEditor _caller)
set_caller
in class NetworkEditEventAdapter
_caller
- The _caller to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |