public void onCanvasRightClicked ( final MouseEvent me ) { _linkPainter . cancelLink ( ) ; final JPopupMenu popup = new JPopupMenu ( ) ; final Point point = me . getPoint ( ) ; final AnalysisJobBuilder analysisJobBuilder = _graphContext . getMainAnalysisJobBuilder ( ) ; final DataCleanerConfiguration configuration = analysisJobBuilder . getConfiguration ( ) ; // add component options final Set < ComponentSuperCategory > superCategories = configuration . getEnvironment ( ) . getDescriptorProvider ( ) . getComponentSuperCategories ( ) ; for ( final ComponentSuperCategory superCategory : superCategories ) { final DescriptorMenuBuilder menuBuilder = new DescriptorMenuBuilder ( analysisJobBuilder , superCategory , point ) ; final JMenu menu = new JMenu ( superCategory . getName ( ) ) ; menu . setIcon ( IconUtils . getComponentSuperCategoryIcon ( superCategory , IconUtils . ICON_SIZE_MENU_ITEM ) ) ; menuBuilder . addItemsToMenu ( menu ) ; popup . add ( menu ) ; } // add (datastore and job) metadata option { final JMenuItem menuItem = WidgetFactory . createMenuItem ( "Job metadata" , IconUtils . MODEL_METADATA ) ; menuItem . addActionListener ( e -> { final MetadataDialog dialog = new MetadataDialog ( _windowContext , analysisJobBuilder ) ; dialog . open ( ) ; } ) ; popup . add ( menuItem ) ; } popup . show ( _graphContext . getVisualizationViewer ( ) , me . getX ( ) , me . getY ( ) ) ; }
Invoked when the canvas is right - clicked