private void contextMenu(LogicalVisualizationEx visualization,MouseEvent mouseEvent){
  JComponent menu=new JPopupMenu();
  JMenuItem restore=new JMenuItem("Restore Logical View");
  restore.addActionListener(null);
  JMenuItem collapse=new JMenuItem("Collapse all");
  collapse.addActionListener(null);
  JMenuItem expand=new JMenuItem("Expand all");
  expand.addActionListener(null);
  menu.add(restore);
  menu.add(collapse);
  menu.add(expand);
  getVisibilityMenuItems(menu,visualization);
  if (menu instanceof JPopupMenu) {
    JPopupMenu popup=(JPopupMenu)menu;
    popup.setLocation(mouseEvent.getLocationOnScreen());
    popup.setInvoker(getDisplay());
    popup.setVisible(true);
    popup.requestFocus();
  }
}

private void contextMenu ( LogicalVisualizationEx visualization , MouseEvent mouseEvent ) { JComponent menu = new JPopupMenu ( ) ; JMenuItem restore = new JMenuItem ( "Restore Logical View" ) ; restore . addActionListener ( null ) ; JMenuItem collapse = new JMenuItem ( "Collapse all" ) ; collapse . addActionListener ( null ) ; JMenuItem expand = new JMenuItem ( "Expand all" ) ; expand . addActionListener ( null ) ; menu . add ( restore ) ; menu . add ( collapse ) ; menu . add ( expand ) ; getVisibilityMenuItems ( menu , visualization ) ; if ( menu instanceof JPopupMenu ) { JPopupMenu popup = ( JPopupMenu ) menu ; popup . setLocation ( mouseEvent . getLocationOnScreen ( ) ) ; popup . setInvoker ( getDisplay ( ) ) ; popup . setVisible ( true ) ; popup . requestFocus ( ) ; } }
creates and displays a context menu for the blank space on the graph .
