I want to add "Action Listener" to the mxcell(vertex) in JGraphX. If I Double Clicked on the mxcell vertex it should do some action. Is there any way to add action listener to the mxcell vertex in jGraphX ?.
Asked
Active
Viewed 750 times
0
-
You must show us you tried something, otherwise we will think you try to let us code for you! – J. Chomel Apr 15 '16 at 06:31
1 Answers
1
On mouse click event on the graph component get the cell and add action event to the cell.
public void mouseClicked(MouseEvent e)
{
Object cell=graphComponent.getCellAt(e.getX(),e.getY());
if(cell!=null&& cell instanceof mxcell)
{
if(((mxcell)cell.getValue().toString().equals("cell-name"))
{
// your function
}
}
}

Leks
- 77
- 11