private void showContextMenu(final PInputEvent event){
  event.setHandled(true);
  JPopupMenu contextMenu=getContextMenu();
  Point2D canvasPosition=event.getCanvasPosition();
  networkPanel.setLastClickedPosition(canvasPosition);
  contextMenu.show(networkPanel.getCanvas(),(int)canvasPosition.getX(),(int)canvasPosition.getY());
}

private void showContextMenu ( final PInputEvent event ) { event . setHandled ( true ) ; JPopupMenu contextMenu = getContextMenu ( ) ; Point2D canvasPosition = event . getCanvasPosition ( ) ; networkPanel . setLastClickedPosition ( canvasPosition ) ; contextMenu . show ( networkPanel . getCanvas ( ) , ( int ) canvasPosition . getX ( ) , ( int ) canvasPosition . getY ( ) ) ; }
show the context menu .
