protected synchronized void updateVisualizerMenus ( ) { Projection proj = null ; if ( svgCanvas . getPlot ( ) instanceof DetailView ) { PlotItem item = ( ( DetailView ) svgCanvas . getPlot ( ) ) . getPlotItem ( ) ; proj = item . proj ; } menubar . removeAll ( ) ; menubar . add ( filemenu ) ; ResultHierarchy hier = context . getHierarchy ( ) ; Hierarchy < Object > vistree = context . getVisHierarchy ( ) ; Result start = context . getBaseResult ( ) ; ArrayList < JMenuItem > items = new ArrayList <> ( ) ; if ( start == null ) { for ( It < Result > iter = hier . iterAll ( ) ; iter . valid ( ) ; iter . advance ( ) ) { if ( hier . numParents ( iter . get ( ) ) == 0 ) { recursiveBuildMenu ( items , iter . get ( ) , hier , vistree , proj ) ; } } } else { for ( It < Result > iter = hier . iterChildren ( start ) ; iter . valid ( ) ; iter . advance ( ) ) { recursiveBuildMenu ( items , iter . get ( ) , hier , vistree , proj ) ; } } // Add all items. for ( JMenuItem item : items ) { menubar . add ( item ) ; } menubar . revalidate ( ) ; menubar . repaint ( ) ; }
Update the visualizer menus .