public static ToolsPanelController openNww( String appName, int onCloseAction ) {
        try {
            if (appName == null) {
                appName = APPNAME;
            }
            if (onCloseAction < 0) {
                onCloseAction = JFrame.EXIT_ON_CLOSE;
            }

            Class<SimpleNwwViewer> class1 = SimpleNwwViewer.class;
            ImageIcon icon = new ImageIcon(class1.getResource("/org/hortonmachine/images/hm150.png"));

            Component nwwComponent = NwwPanel.createNwwPanel(true);
            NwwPanel wwjPanel = null;
            LayersPanelController layerPanel = null;
            ToolsPanelController toolsPanel = null;

            if (nwwComponent instanceof NwwPanel) {
                wwjPanel = (NwwPanel) nwwComponent;
                ((Component) wwjPanel.getWwd()).setPreferredSize(new Dimension(500, 500));
                wwjPanel.addOsmLayer();
                ViewControlsLayer viewControls = wwjPanel.addViewControls();
                viewControls.setScale(1.5);

                layerPanel = new LayersPanelController(wwjPanel);
                toolsPanel = new ToolsPanelController(wwjPanel, layerPanel);
            }

            final JFrame nwwFrame = new JFrame();
            nwwFrame.setTitle(appName + ": map view");
            nwwFrame.setIconImage(icon.getImage());

//            JPanel mapPanel = new JPanel(new BorderLayout());
//            mapPanel.add(nwwComponent, BorderLayout.CENTER);
            nwwFrame.getContentPane().add(nwwComponent, BorderLayout.CENTER);
            nwwFrame.setResizable(true);
            nwwFrame.setPreferredSize(new Dimension(800, 800));
            nwwFrame.pack();
            WWUtil.alignComponent(null, nwwFrame, AVKey.CENTER);

            if (wwjPanel != null) {
                final JFrame layersFrame = new JFrame();
                layersFrame.setTitle(appName + ": layers view");
                layersFrame.setIconImage(icon.getImage());
                java.awt.EventQueue.invokeLater(new Runnable(){

                    public void run() {
                        layersFrame.setVisible(true);
                    }
                });
                layersFrame.getContentPane().add(layerPanel, BorderLayout.CENTER);
                layersFrame.setResizable(true);
                layersFrame.setPreferredSize(new Dimension(400, 500));
                layersFrame.setLocation(0, 0);
                layersFrame.pack();
                final JFrame toolsFrame = new JFrame();
                toolsFrame.setTitle(appName + ": tools view");
                toolsFrame.setIconImage(icon.getImage());
                java.awt.EventQueue.invokeLater(new Runnable(){

                    public void run() {
                        toolsFrame.setVisible(true);
                    }
                });
                toolsFrame.getContentPane().add(toolsPanel, BorderLayout.CENTER);
                toolsFrame.setResizable(true);
                toolsFrame.setPreferredSize(new Dimension(400, 400));
                toolsFrame.setLocation(0, 510);
                toolsFrame.pack();
                
                toolsFrame.setDefaultCloseOperation(onCloseAction);
                layersFrame.setDefaultCloseOperation(onCloseAction);
            }
            
            nwwFrame.setDefaultCloseOperation(onCloseAction);

            java.awt.EventQueue.invokeLater(new Runnable(){
                public void run() {
                    nwwFrame.setVisible(true);
                }
            });
            return toolsPanel;
        } catch (Exception e) {
            Logging.logger().log(java.util.logging.Level.SEVERE, "Exception at application start", e);
        }
        return null;
    }
public static ToolsPanelController openNww ( String appName , int onCloseAction ) { try { if ( appName == null ) { appName = APPNAME ; } if ( onCloseAction < 0 ) { onCloseAction = JFrame . EXIT_ON_CLOSE ; } Class < SimpleNwwViewer > class1 = SimpleNwwViewer . class ; ImageIcon icon = new ImageIcon ( class1 . getResource ( "/org/hortonmachine/images/hm150.png" ) ) ; Component nwwComponent = NwwPanel . createNwwPanel ( true ) ; NwwPanel wwjPanel = null ; LayersPanelController layerPanel = null ; ToolsPanelController toolsPanel = null ; if ( nwwComponent instanceof NwwPanel ) { wwjPanel = ( NwwPanel ) nwwComponent ; ( ( Component ) wwjPanel . getWwd ( ) ) . setPreferredSize ( new Dimension ( 500 , 500 ) ) ; wwjPanel . addOsmLayer ( ) ; ViewControlsLayer viewControls = wwjPanel . addViewControls ( ) ; viewControls . setScale ( 1.5 ) ; layerPanel = new LayersPanelController ( wwjPanel ) ; toolsPanel = new ToolsPanelController ( wwjPanel , layerPanel ) ; } final JFrame nwwFrame = new JFrame ( ) ; nwwFrame . setTitle ( appName + ": map view" ) ; nwwFrame . setIconImage ( icon . getImage ( ) ) ; nwwFrame . getContentPane ( ) . add ( nwwComponent , BorderLayout . CENTER ) ; nwwFrame . setResizable ( true ) ; nwwFrame . setPreferredSize ( new Dimension ( 800 , 800 ) ) ; nwwFrame . pack ( ) ; WWUtil . alignComponent ( null , nwwFrame , AVKey . CENTER ) ; if ( wwjPanel != null ) { final JFrame layersFrame = new JFrame ( ) ; layersFrame . setTitle ( appName + ": layers view" ) ; layersFrame . setIconImage ( icon . getImage ( ) ) ; java . awt . EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { layersFrame . setVisible ( true ) ; } } ) ; layersFrame . getContentPane ( ) . add ( layerPanel , BorderLayout . CENTER ) ; layersFrame . setResizable ( true ) ; layersFrame . setPreferredSize ( new Dimension ( 400 , 500 ) ) ; layersFrame . setLocation ( 0 , 0 ) ; layersFrame . pack ( ) ; final JFrame toolsFrame = new JFrame ( ) ; toolsFrame . setTitle ( appName + ": tools view" ) ; toolsFrame . setIconImage ( icon . getImage ( ) ) ; java . awt . EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { toolsFrame . setVisible ( true ) ; } } ) ; toolsFrame . getContentPane ( ) . add ( toolsPanel , BorderLayout . CENTER ) ; toolsFrame . setResizable ( true ) ; toolsFrame . setPreferredSize ( new Dimension ( 400 , 400 ) ) ; toolsFrame . setLocation ( 0 , 510 ) ; toolsFrame . pack ( ) ; toolsFrame . setDefaultCloseOperation ( onCloseAction ) ; layersFrame . setDefaultCloseOperation ( onCloseAction ) ; } nwwFrame . setDefaultCloseOperation ( onCloseAction ) ; java . awt . EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { nwwFrame . setVisible ( true ) ; } } ) ; return toolsPanel ; } catch ( Exception e ) { Logging . logger ( ) . log ( java . util . logging . Level . SEVERE , "Exception at application start" , e ) ; } return null ; }
A way to open the NWW viewer and get the tools panel, which has reference to the rest.

@param appName
@return