@SuppressWarnings("empty-statement")
    private void load_menu_itemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_load_menu_itemActionPerformed
        //
        int returnVal = fileChooser.showOpenDialog(this);
        //
        if (returnVal == JFileChooser.APPROVE_OPTION) 
        {
            //
            File vesselConfigurationXmlFile = fileChooser.getSelectedFile();
            //
            String file_string = vesselConfigurationXmlFile.getAbsolutePath();
            //
            file_label.setText(file_string.split("\\\\")[file_string.split("\\\\").length-1]);
            //
            file_label.setForeground(Color.GREEN);
            //
            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
            //
            try 
            {
                //
                DocumentBuilder dbuilder = dbFactory.newDocumentBuilder();
                //
                Document doc = dbuilder.parse(vesselConfigurationXmlFile);
                //
                doc.getDocumentElement().normalize();
                //Check this
                NodeList configurationFile = doc.getElementsByTagName("configurationFile");
                //
                Node configurationCode = configurationFile.item(0);
                //
                Element configurationCodeElement = (Element) configurationCode;
                //
                float meter_to_count_unit_conversion_factor=(float) 5.4;
                //Check this ~ when variable names were chnged I didnt check the purpose of the string.
                switch (configurationCodeElement.getElementsByTagName("configurationCode").item(0).getTextContent()) 
                {
                    //
                    case "\"pfsmpa\"":
                    {
                        //
                        Geometry.configurationCode="pfsmpa";
                        //
                        Element port_forward_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_forward_distance_to_starboard_middle_element = (Element) configurationFile.item(0);
                        //
                        Element port_aft_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_aft_distance_to_port_forward_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_middle_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_middle_distance_to_port_aft_element = (Element) configurationFile.item(0);
                        //
                        Element alongship_distance_to_port_forward_element = (Element) configurationFile.item(0);
                        //
                        Element distance_from_center_line_element = (Element) configurationFile.item(0);
                        //
                        Element transducer_depth_element = (Element) configurationFile.item(0);
                        //
                        Element depth_of_echosounder_view_centroid_element = (Element) configurationFile.item(0);
                        //                               
                        Geometry.pfho = meter_to_count_unit_conversion_factor*Float.parseFloat(port_forward_distance_to_ocean_surface_element.getElementsByTagName("port_forward_distance_to_ocean_surface").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pfsm = meter_to_count_unit_conversion_factor*Float.parseFloat(port_forward_distance_to_starboard_middle_element.getElementsByTagName("port_forward_distance_to_starboard_middle").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.paho = meter_to_count_unit_conversion_factor*Float.parseFloat(port_aft_distance_to_ocean_surface_element.getElementsByTagName("port_aft_distance_to_ocean_surface").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.papf = meter_to_count_unit_conversion_factor*Float.parseFloat(port_aft_distance_to_port_forward_element.getElementsByTagName("port_aft_distance_to_port_forward").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.smho = meter_to_count_unit_conversion_factor*Float.parseFloat(starboard_middle_distance_to_ocean_surface_element.getElementsByTagName("starboard_middle_distance_to_ocean_surface").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.smpa = meter_to_count_unit_conversion_factor*Float.parseFloat(starboard_middle_distance_to_port_aft_element.getElementsByTagName("starboard_middle_distance_to_port_aft").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pfad = meter_to_count_unit_conversion_factor*Float.parseFloat(alongship_distance_to_port_forward_element.getElementsByTagName("alongship_distance_to_port_forward").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.dfcl = meter_to_count_unit_conversion_factor*Float.parseFloat(distance_from_center_line_element.getElementsByTagName("distance_from_center_line").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.td = meter_to_count_unit_conversion_factor*Float.parseFloat(transducer_depth_element.getElementsByTagName("transducer_depth").item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.esd = meter_to_count_unit_conversion_factor*Float.parseFloat(depth_of_echosounder_view_centroid_element.getElementsByTagName("depth_of_echosounder_view_centroid").item(0).getTextContent().split("\"")[1]);
                        //    
                        vessel_graphic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ecosounder/calibration/software/Echocal_Diagrams/pfsmpa.png")));
                        //
                        Geometry.generateCoordinatesForThreeDownriggers("pfsmpa");
                        //
                        Terminal.systemLogMessage("The Port Forward - Starboard Middle - Port Aft configuration\r\nhas been set for this calibration session.");
                        //
                        break;
                    }
                    //
                    case "\"pmsfsa\"":
                    {
                        //
                        Geometry.configurationCode="pmsfsa";
                        //
                        Element port_middle_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_middle_distance_to_starboard_forward_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_forward_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_forward_distance_to_starboard_aft_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_aft_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_aft_distance_to_port_middle_element = (Element) configurationFile.item(0);
                        //
                        Element alongship_distance_to_starboard_forward_element = (Element) configurationFile.item(0);
                        //
                        Element distance_from_center_line_element = (Element) configurationFile.item(0);
                        //
                        Element transducer_depth_element = (Element) configurationFile.item(0);
                        //
                        Element depth_of_echosounder_view_centroid_element = (Element) configurationFile.item(0);
                        //
                        Element vessel_width_element = (Element) configurationFile.item(0);
                        //    
                        Geometry.pmho = meter_to_count_unit_conversion_factor*Float.parseFloat(port_middle_distance_to_ocean_surface_element.getElementsByTagName( "port_middle_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pmsf = meter_to_count_unit_conversion_factor*Float.parseFloat(port_middle_distance_to_starboard_forward_element.getElementsByTagName( "port_middle_distance_to_starboard_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfho = meter_to_count_unit_conversion_factor*Float.parseFloat(starboard_forward_distance_to_ocean_surface_element.getElementsByTagName( "starboard_forward_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfsa = meter_to_count_unit_conversion_factor*Float.parseFloat(starboard_forward_distance_to_starboard_aft_element.getElementsByTagName( "starboard_forward_distance_to_starboard_aft" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.saho = meter_to_count_unit_conversion_factor*Float.parseFloat(starboard_aft_distance_to_ocean_surface_element.getElementsByTagName( "starboard_aft_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sapm = meter_to_count_unit_conversion_factor*Float.parseFloat(starboard_aft_distance_to_port_middle_element.getElementsByTagName( "starboard_aft_distance_to_port_middle" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfad = meter_to_count_unit_conversion_factor*Float.parseFloat(alongship_distance_to_starboard_forward_element.getElementsByTagName( "alongship_distance_to_starboard_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.dfcl = meter_to_count_unit_conversion_factor*Float.parseFloat(distance_from_center_line_element.getElementsByTagName( "distance_from_center_line" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.td = meter_to_count_unit_conversion_factor*Float.parseFloat(transducer_depth_element.getElementsByTagName( "transducer_depth" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.esd = meter_to_count_unit_conversion_factor*Float.parseFloat(depth_of_echosounder_view_centroid_element.getElementsByTagName( "depth_of_echosounder_view_centroid" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.vw = meter_to_count_unit_conversion_factor*Float.parseFloat(vessel_width_element.getElementsByTagName( "vessel_width" ).item(0).getTextContent().split("\"")[1]);
                        //
                        vessel_graphic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ecosounder/calibration/software/Echocal_Diagrams/pmsfsa.png")));
                        //
                        Geometry.generateCoordinatesForThreeDownriggers("pmsfsa");
                        //
                        Terminal.systemLogMessage("The Port Middle - Starboard Forward - Starboard Aft configuration\r\nhas been set for this calibration session.");
                        //
                        break;
                    }
                    //
                    case "\"pmsmsapa\"":
                    {
                        //
                        Geometry.configurationCode="pmsmsapa";
                        //
                        Element port_middle_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_middle_distance_to_starboard_middle_element = (Element) configurationFile.item(0);
                        //
                        Element port_aft_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_aft_distance_to_port_middle_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_middle_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_middle_distance_to_starboard_aft_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_aft_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_aft_distance_to_port_aft_element = (Element) configurationFile.item(0);
                        //
                        Element alongship_distance_to_port_middle_element = (Element) configurationFile.item(0);
                        //
                        Element distance_from_center_line_element = (Element) configurationFile.item(0);
                        //
                        Element transducer_depth_element = (Element) configurationFile.item(0);
                        //
                        Element depth_of_echosounder_view_centroid_element = (Element) configurationFile.item(0);
                        //   
                        Geometry.pmho = meter_to_count_unit_conversion_factor*Float.parseFloat( port_middle_distance_to_ocean_surface_element.getElementsByTagName( "port_middle_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pmsm = meter_to_count_unit_conversion_factor*Float.parseFloat( port_middle_distance_to_starboard_middle_element.getElementsByTagName( "port_middle_distance_to_starboard_middle" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.paho = meter_to_count_unit_conversion_factor*Float.parseFloat( port_aft_distance_to_ocean_surface_element.getElementsByTagName( "port_aft_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.papm = meter_to_count_unit_conversion_factor*Float.parseFloat( port_aft_distance_to_port_middle_element.getElementsByTagName( "port_aft_distance_to_port_middle" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.smho = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_middle_distance_to_ocean_surface_element.getElementsByTagName( "starboard_middle_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.smsa = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_middle_distance_to_starboard_aft_element.getElementsByTagName( "starboard_middle_distance_to_starboard_aft" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.saho = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_aft_distance_to_ocean_surface_element.getElementsByTagName( "starboard_aft_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sapa = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_aft_distance_to_port_aft_element.getElementsByTagName( "starboard_aft_distance_to_port_aft" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pmad = meter_to_count_unit_conversion_factor*Float.parseFloat( alongship_distance_to_port_middle_element.getElementsByTagName( "alongship_distance_to_port_middle" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.dfcl = meter_to_count_unit_conversion_factor*Float.parseFloat( distance_from_center_line_element.getElementsByTagName( "distance_from_center_line" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.td = meter_to_count_unit_conversion_factor*Float.parseFloat( transducer_depth_element.getElementsByTagName( "transducer_depth" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.esd = meter_to_count_unit_conversion_factor*Float.parseFloat( depth_of_echosounder_view_centroid_element.getElementsByTagName( "epth_of_echosounder_view_centroid" ).item(0).getTextContent().split("\"")[1]);
                        //    
                        vessel_graphic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ecosounder/calibration/software/Echocal_Diagrams/pmsmsapa.png")));
                        //
                        Geometry.generateCoordinatesForFourDownriggers("pmsmsapa");
                        //
                        Terminal.systemLogMessage("The Port Middle - Starboard Middle - Starboard Aft - Port Aft configuration\r\nhas been set for this calibration session.");
                        //
                        break;
                    }
                    //
                    case "\"pfsfsmpm\"":
                    {
                        //
                        Geometry.configurationCode="pfsfsmpm";
                        //
                        Element port_forward_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_forward_distance_to_starboard_forward_element = (Element) configurationFile.item(0);
                        //
                        Element port_middle_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_middle_distance_to_port_forward_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_forward_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_forward_distance_to_starboard_middle_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_middle_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_middle_distance_to_port_middle_element = (Element) configurationFile.item(0);
                        //
                        Element alongship_distance_to_port_forward_element = (Element) configurationFile.item(0);
                        //
                        Element distance_from_center_line_element = (Element) configurationFile.item(0);
                        //
                        Element transducer_depth_element = (Element) configurationFile.item(0);
                        //
                        Element depth_of_echosounder_view_centroid_element = (Element) configurationFile.item(0);
                        //
                        Geometry.pfho = meter_to_count_unit_conversion_factor*Float.parseFloat( port_forward_distance_to_ocean_surface_element.getElementsByTagName( "port_forward_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pfsf = meter_to_count_unit_conversion_factor*Float.parseFloat( port_forward_distance_to_starboard_forward_element.getElementsByTagName( "port_forward_distance_to_starboard_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pmho = meter_to_count_unit_conversion_factor*Float.parseFloat( port_middle_distance_to_ocean_surface_element.getElementsByTagName( "port_middle_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pmpf = meter_to_count_unit_conversion_factor*Float.parseFloat( port_middle_distance_to_port_forward_element.getElementsByTagName( "port_middle_distance_to_port_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfho = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_forward_distance_to_ocean_surface_element.getElementsByTagName( "starboard_forward_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfsm = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_forward_distance_to_starboard_middle_element.getElementsByTagName( "starboard_forward_distance_to_starboard_middle" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.smho = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_middle_distance_to_ocean_surface_element.getElementsByTagName( "starboard_middle_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.smpm = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_middle_distance_to_port_middle_element.getElementsByTagName( "starboard_middle_distance_to_port_middle" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pfad = meter_to_count_unit_conversion_factor*Float.parseFloat( alongship_distance_to_port_forward_element.getElementsByTagName( "alongship_distance_to_port_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.dfcl = meter_to_count_unit_conversion_factor*Float.parseFloat( distance_from_center_line_element.getElementsByTagName( "distance_from_center_line" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.td = meter_to_count_unit_conversion_factor*Float.parseFloat( transducer_depth_element.getElementsByTagName( "transducer_depth" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.esd = meter_to_count_unit_conversion_factor*Float.parseFloat( depth_of_echosounder_view_centroid_element.getElementsByTagName( "depth_of_echosounder_view_centroid" ).item(0).getTextContent().split("\"")[1]);
                        //
                        vessel_graphic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ecosounder/calibration/software/Echocal_Diagrams/pfsfsmpm.png")));
                        //
                        Geometry.generateCoordinatesForFourDownriggers("pfsfsmpm");
                        //
                        Terminal.systemLogMessage("The Port Forward - Starboard Forward - Starboard Middle - Port Middle configuration\r\nhas been set for this calibration session.");
                        //
                        break;
                    }
                    //
                    case "\"pfsfsapa\"":
                    {
                        //
                        Geometry.configurationCode="pfsfsapa";
                        //
                        Element port_forward_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_forward_distance_to_starboard_forward_element = (Element) configurationFile.item(0);
                        //
                        Element port_aft_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element port_aft_distance_to_port_forward_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_forward_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_forward_distance_to_starboard_aft_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_aft_distance_to_ocean_surface_element = (Element) configurationFile.item(0);
                        //
                        Element starboard_aft_distance_to_port_aft_element = (Element) configurationFile.item(0);
                        //
                        Element alongship_distance_to_port_forward_element = (Element) configurationFile.item(0);
                        //
                        Element distance_from_center_line_element = (Element) configurationFile.item(0);
                        //
                        Element transducer_depth_element = (Element) configurationFile.item(0);
                        //
                        Element depth_of_echosounder_view_centroid_element = (Element) configurationFile.item(0);
                        //    
                        Geometry.pfho = meter_to_count_unit_conversion_factor*Float.parseFloat( port_forward_distance_to_ocean_surface_element.getElementsByTagName( "port_forward_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pfsf = meter_to_count_unit_conversion_factor*Float.parseFloat( port_forward_distance_to_starboard_forward_element.getElementsByTagName( "port_forward_distance_to_starboard_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.paho = meter_to_count_unit_conversion_factor*Float.parseFloat( port_aft_distance_to_ocean_surface_element.getElementsByTagName( "port_aft_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.papf = meter_to_count_unit_conversion_factor*Float.parseFloat( port_aft_distance_to_port_forward_element.getElementsByTagName( "port_aft_distance_to_port_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfho = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_forward_distance_to_ocean_surface_element.getElementsByTagName( "starboard_forward_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sfsa = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_forward_distance_to_starboard_aft_element.getElementsByTagName( "starboard_forward_distance_to_starboard_aft" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.saho = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_aft_distance_to_ocean_surface_element.getElementsByTagName( "starboard_aft_distance_to_ocean_surface" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.sapa = meter_to_count_unit_conversion_factor*Float.parseFloat( starboard_aft_distance_to_port_aft_element.getElementsByTagName( "starboard_aft_distance_to_port_aft" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.pfad = meter_to_count_unit_conversion_factor*Float.parseFloat( alongship_distance_to_port_forward_element.getElementsByTagName( "alongship_distance_to_port_forward" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.dfcl = meter_to_count_unit_conversion_factor*Float.parseFloat( distance_from_center_line_element.getElementsByTagName( "distance_from_center_line" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.td = meter_to_count_unit_conversion_factor*Float.parseFloat( transducer_depth_element.getElementsByTagName( "transducer_depth" ).item(0).getTextContent().split("\"")[1]);
                        //
                        Geometry.esd = meter_to_count_unit_conversion_factor*Float.parseFloat( depth_of_echosounder_view_centroid_element.getElementsByTagName( "depth_of_echosounder_view_centroid" ).item(0).getTextContent().split("\"")[1]);
                        //
                        vessel_graphic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ecosounder/calibration/software/Echocal_Diagrams/pfsfsapa.png")));
                        //
                        Geometry.generateCoordinatesForFourDownriggers("pfsfsapa");
                        //
                        Terminal.systemLogMessage("The Port Forward - Starboard Forward - Starboard Aft - Port Aft configuration\r\nhas been set for this calibration session.");
                        //    
                        break;
                    }
                    //
                    default:
                    {
                        //
                        break;
                    }
                }
            } 
            //
            catch (ParserConfigurationException | SAXException | IOException ex) 
            {
                //
                Terminal.systemLogMessage("The vessel configuration file has not been read properly.");
            }
        } 
        //
        else 
        {
            //
        }
        
    }