import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.io.*; public class GUI extends JFrame implements ActionListener { /* This class obviously needs access to the variables and methods of CelestialBody, SolarSystemBody, and MinorPlanet. I considered two alternatives. First, I could add these three classes to a package (orbitalMechanics), make the three classes public, put them into a folder (orbitalMechanics), and import them into this GUI class. While this is the most elegant solution, as well as the simplest, it would not be cross-platform compatible. Even if Unix has "folders", running this software on a Unix machine would require creating a "subdirectory" (orbitalMechanics), and placing the three classes into it, while retaining this GUI class at the higher parent directory level. This violates the spirit of this endeavor, which is to maintain cross-platform compatibility, so that I don't have to write this damn stuff again. Thus, I will retain the current directory structure (everything at the same level), and individually declare the referenced instance variables and methods as public. */ /* Define the pane as an instance variable. This may permit me to empty it of its contents and move from an old screen to a new screen, reusing pane in the process. I think this is necessary because pane has been instantiated by the constructor. */ JPanel pane; /* Define all buttons, choice lists, text boxes etc. as instance variables, so they are available to all methods. */ JButton title_b1 = new JButton("Begin"); JButton level_one_menu_b1 = new JButton("Create"); JButton level_one_menu_b2 = new JButton("Edit"); JButton level_one_menu_b3 = new JButton("Delete"); JTextField level_one_menu_tf1 = new JTextField(20); JComboBox level_one_menu_cl1 = new JComboBox(); JComboBox level_one_menu_cl2 = new JComboBox(); JButton add_mp_b1 = new JButton("Edit"); JButton add_mp_b2 = new JButton("Return"); JButton add_mp_b3 = new JButton("Exp Comp"); JButton delete_mp_b1 = new JButton("Return"); JButton edit_mp_b1 = new JButton("Add"); JButton edit_mp_b2 = new JButton("Rev/Del"); JButton edit_mp_b3 = new JButton("Compute"); JButton edit_mp_b4 = new JButton("Display"); JButton edit_mp_b5 = new JButton("Specify"); JButton edit_mp_b6 = new JButton("Generate"); JButton edit_mp_b7 = new JButton("Check"); JButton edit_mp_b8 = new JButton("Change"); JButton edit_mp_b9 = new JButton("Specify"); JButton edit_mp_b10 = new JButton("Return"); JButton edit_mp_b11 = new JButton("Designate"); JButton edit_mp_b12 = new JButton("Compare"); JButton edit_mp_b13 = new JButton("Import"); JButton add_obs_b1 = new JButton("Optical"); JButton add_obs_b2 = new JButton("Radar"); JButton add_obs_b3 = new JButton("MPC"); JButton add_obs_b4 = new JButton("NEODyS"); JTextField add_optical_obs_1_tf1 = new JTextField(5); JTextField add_optical_obs_1_tf2 = new JTextField(11); JTextField add_optical_obs_1_tf3 = new JTextField(3); JTextField add_optical_obs_1_tf4 = new JTextField(6); JTextField add_optical_obs_1_tf5 = new JTextField(6); JTextField add_optical_obs_1_tf6 = new JTextField(11); JTextField add_optical_obs_1_tf7 = new JTextField(3); JTextField add_optical_obs_1_tf8 = new JTextField(6); JTextField add_optical_obs_1_tf9 = new JTextField(6); JTextField add_optical_obs_1_tf10 = new JTextField(6); JTextField add_optical_obs_1_tf11 = new JTextField(6); JTextField add_optical_obs_1_tf12 = new JTextField(5); JTextField add_optical_obs_1_tf13 = new JTextField(3); JTextField add_optical_obs_1_tf14 = new JTextField(9); JButton add_optical_obs_1_b1 = new JButton("Submit"); JButton add_optical_obs_1_b2 = new JButton("Cancel"); CheckboxGroup add_optical_obs_1_catalog = new CheckboxGroup(); Checkbox add_optical_obs_1_FK5 = new Checkbox("ICRF or FK5",true,add_optical_obs_1_catalog); Checkbox add_optical_obs_1_FK4 = new Checkbox("FK4",false,add_optical_obs_1_catalog); CheckboxGroup add_optical_obs_1_epoch = new CheckboxGroup(); Checkbox add_optical_obs_1_j2000 = new Checkbox("J2000",true,add_optical_obs_1_epoch); Checkbox add_optical_obs_1_b1950 = new Checkbox("B1950",false,add_optical_obs_1_epoch); Checkbox add_optical_obs_1_j = new Checkbox("J",false,add_optical_obs_1_epoch); Checkbox add_optical_obs_1_b = new Checkbox("B",false,add_optical_obs_1_epoch); JTextField add_optical_obs_2_tf1 = new JTextField(11); JTextField add_optical_obs_2_tf2 = new JTextField(3); JTextField add_optical_obs_2_tf3 = new JTextField(6); JTextField add_optical_obs_2_tf4 = new JTextField(11); JTextField add_optical_obs_2_tf5 = new JTextField(3); JTextField add_optical_obs_2_tf6 = new JTextField(6); JTextField add_optical_obs_2_tf7 = new JTextField(7); JTextField add_optical_obs_2_tf8 = new JTextField(5); CheckboxGroup add_optical_obs_2_observatory = new CheckboxGroup(); Checkbox add_optical_obs_2_obscode = new Checkbox("Enter the MPC observatory code of the observing site",true,add_optical_obs_2_observatory); Checkbox add_optical_obs_2_latlong = new Checkbox("Enter the latitude, longitude, and altitude of the observing site",false,add_optical_obs_2_observatory); Checkbox add_optical_obs_2_EOPs = new Checkbox("Use Default Earth Orientation Parameters",false); JButton add_optical_obs_2_b1 = new JButton("Submit"); JButton add_optical_obs_2_b2 = new JButton("Cancel"); JTextField add_optical_obs_3_tf1 = new JTextField(8); JTextField add_optical_obs_3_tf2 = new JTextField(8); JTextField add_optical_obs_3_tf3 = new JTextField(9); JTextField add_optical_obs_3_tf4 = new JTextField(5); JTextField add_optical_obs_3_tf5 = new JTextField(4); JTextField add_optical_obs_3_tf6 = new JTextField(8); JTextField add_optical_obs_3_tf7 = new JTextField(8); JTextField add_optical_obs_3_tf8 = new JTextField(9); JTextField add_optical_obs_3_tf9 = new JTextField(5); JTextField add_optical_obs_3_tf10 = new JTextField(4); JTextField add_optical_obs_3_tf11 = new JTextField(8); JTextField add_optical_obs_3_tf12 = new JTextField(8); JTextField add_optical_obs_3_tf13 = new JTextField(9); JTextField add_optical_obs_3_tf14 = new JTextField(5); JTextField add_optical_obs_3_tf15 = new JTextField(4); JTextField add_optical_obs_3_tf16 = new JTextField(8); JTextField add_optical_obs_3_tf17 = new JTextField(8); JTextField add_optical_obs_3_tf18 = new JTextField(9); JTextField add_optical_obs_3_tf19 = new JTextField(5); JTextField add_optical_obs_3_tf20 = new JTextField(4); JTextField add_optical_obs_3_tf21 = new JTextField(3); JTextField add_optical_obs_3_tf22 = new JTextField(11); JButton add_optical_obs_3_b1 = new JButton("Submit"); JButton add_optical_obs_3_b2 = new JButton("Cancel"); JTextField add_radar_obs_1_tf1 = new JTextField(16); JTextField add_radar_obs_1_tf2 = new JTextField(16); JTextField add_radar_obs_1_tf3 = new JTextField(16); JTextField add_radar_obs_1_tf4 = new JTextField(16); JTextField add_radar_obs_1_tf5 = new JTextField(16); JTextField add_radar_obs_1_tf6 = new JTextField(6); JTextField add_radar_obs_1_tf7 = new JTextField(5); JTextField add_radar_obs_1_tf8 = new JTextField(3); JTextField add_radar_obs_1_tf9 = new JTextField(3); JTextField add_radar_obs_1_tf10 = new JTextField(3); JTextField add_radar_obs_1_tf11 = new JTextField(3); JTextField add_radar_obs_1_tf12 = new JTextField(6); JButton add_radar_obs_1_b1 = new JButton("Submit"); JButton add_radar_obs_1_b2 = new JButton("Cancel"); CheckboxGroup add_radar_obs_1_obstype = new CheckboxGroup(); Checkbox add_radar_obs_1_Delay = new Checkbox("Delay",true,add_radar_obs_1_obstype); Checkbox add_radar_obs_1_Doppler = new Checkbox("Doppler",false,add_radar_obs_1_obstype); JTextField add_radar_obs_2_tf1 = new JTextField(11); JTextField add_radar_obs_2_tf2 = new JTextField(3); JTextField add_radar_obs_2_tf3 = new JTextField(6); JTextField add_radar_obs_2_tf4 = new JTextField(11); JTextField add_radar_obs_2_tf5 = new JTextField(3); JTextField add_radar_obs_2_tf6 = new JTextField(6); JTextField add_radar_obs_2_tf7 = new JTextField(7); JTextField add_radar_obs_2_tf8 = new JTextField(11); JTextField add_radar_obs_2_tf9 = new JTextField(3); JTextField add_radar_obs_2_tf10 = new JTextField(6); JTextField add_radar_obs_2_tf11 = new JTextField(11); JTextField add_radar_obs_2_tf12 = new JTextField(3); JTextField add_radar_obs_2_tf13 = new JTextField(6); JTextField add_radar_obs_2_tf14 = new JTextField(7); JButton add_radar_obs_2_b1 = new JButton("Submit"); JButton add_radar_obs_2_b2 = new JButton("Cancel"); CheckboxGroup add_radar_obs_2_xmtr = new CheckboxGroup(); Checkbox add_radar_obs_2_xmtr_Arecibo = new Checkbox(" Arecibo",true,add_radar_obs_2_xmtr); Checkbox add_radar_obs_2_xmtr_DSS13 = new Checkbox(" DSS13",false,add_radar_obs_2_xmtr); Checkbox add_radar_obs_2_xmtr_DSS14 = new Checkbox(" DSS14",false,add_radar_obs_2_xmtr); Checkbox add_radar_obs_2_xmtr_other = new Checkbox(" other - enter coords below",false,add_radar_obs_2_xmtr); CheckboxGroup add_radar_obs_2_rcvr = new CheckboxGroup(); Checkbox add_radar_obs_2_rcvr_Arecibo = new Checkbox(" Arecibo",true,add_radar_obs_2_rcvr); Checkbox add_radar_obs_2_rcvr_DSS13 = new Checkbox(" DSS13",false,add_radar_obs_2_rcvr); Checkbox add_radar_obs_2_rcvr_DSS14 = new Checkbox(" DSS14",false,add_radar_obs_2_rcvr); Checkbox add_radar_obs_2_rcvr_other = new Checkbox(" other - enter coords below",false,add_radar_obs_2_rcvr); JTextField add_radar_obs_3_tf1 = new JTextField(8); JTextField add_radar_obs_3_tf2 = new JTextField(8); JTextField add_radar_obs_3_tf3 = new JTextField(9); JTextField add_radar_obs_3_tf4 = new JTextField(5); JTextField add_radar_obs_3_tf5 = new JTextField(4); JTextField add_radar_obs_3_tf6 = new JTextField(8); JTextField add_radar_obs_3_tf7 = new JTextField(8); JTextField add_radar_obs_3_tf8 = new JTextField(9); JTextField add_radar_obs_3_tf9 = new JTextField(5); JTextField add_radar_obs_3_tf10 = new JTextField(4); JTextField add_radar_obs_3_tf11 = new JTextField(8); JTextField add_radar_obs_3_tf12 = new JTextField(8); JTextField add_radar_obs_3_tf13 = new JTextField(9); JTextField add_radar_obs_3_tf14 = new JTextField(5); JTextField add_radar_obs_3_tf15 = new JTextField(4); JTextField add_radar_obs_3_tf16 = new JTextField(8); JTextField add_radar_obs_3_tf17 = new JTextField(8); JTextField add_radar_obs_3_tf18 = new JTextField(9); JTextField add_radar_obs_3_tf19 = new JTextField(5); JTextField add_radar_obs_3_tf20 = new JTextField(4); JTextField add_radar_obs_3_tf21 = new JTextField(3); JTextField add_radar_obs_3_tf22 = new JTextField(11); JButton add_radar_obs_3_b1 = new JButton("Submit"); JButton add_radar_obs_3_b2 = new JButton("Cancel"); JTextField input_state_vector_tf0 = new JTextField(23); JTextField input_state_vector_tf1 = new JTextField(23); JTextField input_state_vector_tf2 = new JTextField(23); JTextField input_state_vector_tf3 = new JTextField(23); JTextField input_state_vector_tf4 = new JTextField(23); JTextField input_state_vector_tf5 = new JTextField(23); JTextField input_state_vector_tf6 = new JTextField(23); JTextField input_state_vector_tf7 = new JTextField(23); JTextField input_state_vector_tf8 = new JTextField(23); JTextField input_state_vector_tf9 = new JTextField(23); JTextField input_state_vector_tf10 = new JTextField(23); JTextField input_state_vector_tf11 = new JTextField(23); JTextField input_state_vector_tf12 = new JTextField(23); JTextField input_state_vector_tf13 = new JTextField(23); JTextField input_state_vector_tf14 = new JTextField(23); JTextField input_state_vector_tf15 = new JTextField(23); JTextField input_state_vector_tf16 = new JTextField(23); JTextField input_state_vector_tf17 = new JTextField(23); JButton input_state_vector_b1 = new JButton("Submit"); JButton input_state_vector_b2 = new JButton("Cancel"); JTextField input_orbital_elements_tf0 = new JTextField(23); JTextField input_orbital_elements_tf1 = new JTextField(23); JTextField input_orbital_elements_tf2 = new JTextField(23); JTextField input_orbital_elements_tf3 = new JTextField(23); JTextField input_orbital_elements_tf4 = new JTextField(23); JTextField input_orbital_elements_tf5 = new JTextField(23); JTextField input_orbital_elements_tf6 = new JTextField(23); JTextField input_orbital_elements_tf7 = new JTextField(23); JTextField input_orbital_elements_tf8 = new JTextField(23); JTextField input_orbital_elements_tf9 = new JTextField(23); JTextField input_orbital_elements_tf10 = new JTextField(23); JTextField input_orbital_elements_tf11 = new JTextField(23); JTextField input_orbital_elements_tf12 = new JTextField(23); JTextField input_orbital_elements_tf13 = new JTextField(23); JTextField input_orbital_elements_tf14 = new JTextField(23); JTextField input_orbital_elements_tf15 = new JTextField(23); JTextField input_orbital_elements_tf16 = new JTextField(23); JTextField input_orbital_elements_tf17 = new JTextField(23); JButton input_orbital_elements_b1 = new JButton("Submit"); JButton input_orbital_elements_b2 = new JButton("Cancel"); JButton input_orbit_b1 = new JButton("Select"); JButton input_orbit_b2 = new JButton("Select"); JButton input_orbit_b3 = new JButton("Cancel"); JButton display_orbit_b1 = new JButton("Select"); JButton display_orbit_b2 = new JButton("Select"); JButton display_orbit_b3 = new JButton("Cancel"); JTextField display_orbital_elements_tf0 = new JTextField(23); JTextField display_orbital_elements_tf1 = new JTextField(23); JTextField display_orbital_elements_tf2 = new JTextField(23); JTextField display_orbital_elements_tf3 = new JTextField(23); JTextField display_orbital_elements_tf4 = new JTextField(23); JTextField display_orbital_elements_tf5 = new JTextField(23); JTextField display_orbital_elements_tf6 = new JTextField(23); JTextField display_orbital_elements_tf7 = new JTextField(23); JTextField display_orbital_elements_tf8 = new JTextField(23); JTextField display_orbital_elements_tf9 = new JTextField(23); JTextField display_orbital_elements_tf10 = new JTextField(23); JTextField display_orbital_elements_tf11 = new JTextField(23); JTextField display_orbital_elements_tf12 = new JTextField(23); JTextField display_orbital_elements_tf13 = new JTextField(23); JTextField display_orbital_elements_tf14 = new JTextField(23); JTextField display_orbital_elements_tf15 = new JTextField(23); JTextField display_orbital_elements_tf16 = new JTextField(23); JTextField display_orbital_elements_tf17 = new JTextField(23); JButton display_orbital_elements_b1 = new JButton("Done"); JButton display_orbital_elements_b2 = new JButton("Display State Vector"); JTextField display_state_vector_tf0 = new JTextField(23); JTextField display_state_vector_tf1 = new JTextField(23); JTextField display_state_vector_tf2 = new JTextField(23); JTextField display_state_vector_tf3 = new JTextField(23); JTextField display_state_vector_tf4 = new JTextField(23); JTextField display_state_vector_tf5 = new JTextField(23); JTextField display_state_vector_tf6 = new JTextField(23); JTextField display_state_vector_tf7 = new JTextField(23); JTextField display_state_vector_tf8 = new JTextField(23); JTextField display_state_vector_tf9 = new JTextField(23); JTextField display_state_vector_tf10 = new JTextField(23); JTextField display_state_vector_tf11 = new JTextField(23); JTextField display_state_vector_tf12 = new JTextField(23); JTextField display_state_vector_tf13 = new JTextField(23); JTextField display_state_vector_tf14 = new JTextField(23); JTextField display_state_vector_tf15 = new JTextField(23); JTextField display_state_vector_tf16 = new JTextField(23); JTextField display_state_vector_tf17 = new JTextField(23); JButton display_state_vector_b1 = new JButton("Done"); JButton display_state_vector_b2 = new JButton("Display Orbital Elements"); CheckboxGroup set_perturbers_choices = new CheckboxGroup(); Checkbox set_perturbers_one = new Checkbox(" All nine planets and Earth's Moon",false,set_perturbers_choices); Checkbox set_perturbers_two = new Checkbox(" Planets, Moon, plus Ceres, Pallas, and Vesta",true,set_perturbers_choices); Checkbox set_perturbers_three = new Checkbox(" Planets, Moon, and 300 asteroids",false,set_perturbers_choices); JButton set_perturbers_b1 = new JButton("Set"); JTextField set_radius_tf1 = new JTextField(10); JTextField set_radius_tf2 = new JTextField(6); JTextField set_radius_tf3 = new JTextField(6); JButton set_radius_b1 = new JButton("Set"); JButton set_radius_b2 = new JButton("Recalculate"); Checkbox delete_observation_cb1 = new Checkbox("",false); Checkbox delete_observation_cb2 = new Checkbox("",false); Checkbox delete_observation_cb3 = new Checkbox("",false); Checkbox delete_observation_cb4 = new Checkbox("",false); Checkbox delete_observation_cb5 = new Checkbox("",false); JButton delete_observation_b1 = new JButton("Delete Checked"); JButton delete_observation_b2 = new JButton("Next 5"); JButton delete_observation_b3 = new JButton("Done"); JButton delete_observation_b4 = new JButton("Prev 5"); JTextField check_for_collision_tf1 = new JTextField(23); JTextField check_for_collision_tf2 = new JTextField(23); JTextField check_for_collision_tf3 = new JTextField(23); JTextField check_for_collision_tf4 = new JTextField(23); JTextField check_for_collision_tf5 = new JTextField(23); JTextField check_for_collision_tf6 = new JTextField(23); JTextField check_for_collision_tf7 = new JTextField(23); JButton check_for_collision_b1 = new JButton("Next Event"); JButton check_for_collision_b2 = new JButton("Done"); JTextField display_ephemeris_1_tf1 = new JTextField(4); JTextField display_ephemeris_1_tf2 = new JTextField(4); JTextField display_ephemeris_1_tf3 = new JTextField(3); JTextField display_ephemeris_1_tf4 = new JTextField(6); JTextField display_ephemeris_1_tf5 = new JTextField(4); JTextField display_ephemeris_1_tf6 = new JTextField(3); JTextField display_ephemeris_1_tf7 = new JTextField(6); JTextField display_ephemeris_1_tf8 = new JTextField(5); JTextField display_ephemeris_1_tf9 = new JTextField(5); JTextField display_ephemeris_1_tf10 = new JTextField(3); JTextField display_ephemeris_1_tf11 = new JTextField(3); JTextField display_ephemeris_1_tf12 = new JTextField(3); JTextField display_ephemeris_1_tf13 = new JTextField(3); JTextField display_ephemeris_1_tf14 = new JTextField(5); JTextField display_ephemeris_1_tf15 = new JTextField(5); JTextField display_ephemeris_1_tf16 = new JTextField(3); JTextField display_ephemeris_1_tf17 = new JTextField(3); JTextField display_ephemeris_1_tf18 = new JTextField(3); JTextField display_ephemeris_1_tf19 = new JTextField(3); JTextField display_ephemeris_1_tf20 = new JTextField(5); JTextField display_ephemeris_1_tf21 = new JTextField(5); JTextField display_ephemeris_1_tf22 = new JTextField(3); JTextField display_ephemeris_1_tf23 = new JTextField(3); JTextField display_ephemeris_1_tf24 = new JTextField(5); JButton display_ephemeris_1_b1 = new JButton("Begin"); JButton display_ephemeris_1_b2 = new JButton("Cancel"); CheckboxGroup display_ephemeris_1_cb1 = new CheckboxGroup(); Checkbox display_ephemeris_1_ObservatoryCode = new Checkbox("Observatory Code ",true,display_ephemeris_1_cb1); Checkbox display_ephemeris_1_Geocentric = new Checkbox("Geocentric",false,display_ephemeris_1_cb1); Checkbox display_ephemeris_1_LatLongAlt = new Checkbox("Geodetic Latitude: ",false,display_ephemeris_1_cb1); JButton display_ephemeris_2_b1 = new JButton("Next 10"); JButton display_ephemeris_2_b2 = new JButton("Done"); JButton compute_orbit_b1 = new JButton("Initial"); JButton compute_orbit_b2 = new JButton("Best-Fit"); JButton compute_orbit_b3 = new JButton("Residuals"); JButton compute_orbit_b4 = new JButton("Propogate"); JButton compute_orbit_b5 = new JButton("Cancel"); JButton compute_orbit_b6 = new JButton("Obs MC"); JButton compute_orbit_b7 = new JButton("Stat Rng"); JTextField propogate_epoch_1_tf1 = new JTextField(13); JTextField propogate_epoch_1_tf2 = new JTextField(13); JButton propogate_epoch_1_b1 = new JButton("Begin"); JButton propogate_epoch_1_b2 = new JButton("Cancel"); JButton compute_residuals_1_b1 = new JButton("Begin"); JButton compute_residuals_1_b2 = new JButton("Cancel"); JButton compute_residuals_2_b1 = new JButton("Prev 5"); JButton compute_residuals_2_b2 = new JButton("Next 5"); JButton compute_residuals_2_b3 = new JButton("Phys Props"); JButton compute_residuals_2_b4 = new JButton("Done"); JButton compute_best_fit_1_b1 = new JButton("Begin"); JButton compute_best_fit_1_b2 = new JButton("Cancel"); CheckboxGroup compute_best_fit_1_thrust = new CheckboxGroup(); Checkbox compute_best_fit_1_thrust_no = new Checkbox("Do Not Use Non-Gravitational Thrust Parameters",true,compute_best_fit_1_thrust); Checkbox compute_best_fit_1_thrust_yes = new Checkbox("Use Non-Gravitational Thrust Parameters",false,compute_best_fit_1_thrust); CheckboxGroup compute_best_fit_1_selection = new CheckboxGroup(); Checkbox compute_best_fit_1_selection_all = new Checkbox("Use all observations",false,compute_best_fit_1_selection); Checkbox compute_best_fit_1_selection_chi = new Checkbox("Exclude observations where chi exceeds threshold",true,compute_best_fit_1_selection); Checkbox compute_best_fit_1_selection_residual = new Checkbox("Exclude observations where residuals exceed threshold",false,compute_best_fit_1_selection); JTextField compute_best_fit_1_tf1 = new JTextField(5); JTextField compute_best_fit_1_tf2 = new JTextField(5); JTextField compute_best_fit_1_tf3 = new JTextField(5); JTextField compute_best_fit_1_tf4 = new JTextField(5); JComboBox select_observations_cl1 = new JComboBox(); JComboBox select_observations_cl2 = new JComboBox(); JComboBox select_observations_cl3 = new JComboBox(); JButton select_observations_b1 = new JButton("Submit"); JButton select_observations_b2 = new JButton("Cancel"); JTextField display_initial_orbit_tf0 = new JTextField(23); JTextField display_initial_orbit_tf1 = new JTextField(23); JTextField display_initial_orbit_tf2 = new JTextField(23); JTextField display_initial_orbit_tf3 = new JTextField(23); JTextField display_initial_orbit_tf4 = new JTextField(23); JTextField display_initial_orbit_tf5 = new JTextField(23); JTextField display_initial_orbit_tf6 = new JTextField(23); JTextField display_initial_orbit_tf7 = new JTextField(23); JTextField display_initial_orbit_tf8 = new JTextField(23); JTextField display_initial_orbit_tf9 = new JTextField(23); JTextField display_initial_orbit_tf10 = new JTextField(23); JTextField display_initial_orbit_tf11 = new JTextField(23); JTextField display_initial_orbit_tf12 = new JTextField(23); JButton display_initial_orbit_b1 = new JButton("Select"); JButton display_initial_orbit_b2 = new JButton("Select"); JButton display_initial_orbit_b3 = new JButton("Select"); JButton display_initial_orbit_b4 = new JButton("Select"); JButton display_initial_orbit_b5 = new JButton("Select"); JButton display_initial_orbit_b6 = new JButton("Select"); JButton select_method_b1 = new JButton("Gauss"); JButton select_method_b2 = new JButton("conditioned Gauss"); JButton select_method_b3 = new JButton("Laplace"); JButton select_method_b4 = new JButton("Cancel"); JTextField set_a_tf1 = new JTextField(8); JButton set_a_b1 = new JButton("Submit"); JButton set_a_b2 = new JButton("Cancel"); JButton no_events_b1 = new JButton("Done"); JButton read_MPEC_b1 = new JButton("Process"); JButton read_MPEC_b2 = new JButton("Cancel"); JButton read_neodys_b1 = new JButton("Process"); JButton read_neodys_b2 = new JButton("Cancel"); JButton designate_mp_b1 = new JButton("Submit"); CheckboxGroup designate_mp_group = new CheckboxGroup(); Checkbox designate_mp_1 = new Checkbox("asteroid",false,designate_mp_group); Checkbox designate_mp_2 = new Checkbox("comet",false,designate_mp_group); JTextField display_physical_properties_tf1 = new JTextField(6); JTextField display_physical_properties_tf2 = new JTextField(6); JTextField display_physical_properties_tf3 = new JTextField(8); JTextField display_physical_properties_tf4 = new JTextField(16); JTextField display_physical_properties_tf5 = new JTextField(16); JButton display_physical_properties_b1 = new JButton("Display Orb Els"); JButton display_physical_properties_b2 = new JButton("Done"); JButton select_duration_b1 = new JButton("Select"); JButton select_duration_b2 = new JButton("Select"); JButton select_duration_b3 = new JButton("Select"); JButton select_duration_b4 = new JButton("Select"); JButton select_duration_b5 = new JButton("Select"); JButton select_duration_b6 = new JButton("Select"); JButton select_duration_b7 = new JButton("Cancel"); JButton compare_observations_1_b1 = new JButton("Process"); JButton compare_observations_1_b2 = new JButton("Cancel"); JButton display_candidates_b1 = new JButton("Done"); JButton display_candidates_b2 = new JButton("Back 10"); JButton display_candidates_b3 = new JButton("Forward 10"); CheckboxGroup compare_observations_1_choices = new CheckboxGroup(); Checkbox compare_observations_1_twobody_com = new Checkbox("Use two-body mechanics",true,compare_observations_1_choices); Checkbox compare_observations_1_twobody_as = new Checkbox("Use two-body mechanics, consider all asteroids",true,compare_observations_1_choices); Checkbox compare_observations_1_nbody = new Checkbox("Use integrated n-body mechanics",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_all = new Checkbox("Use integrated n-body mechanics, consider all asteroids",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_NEA = new Checkbox("Use integrated n-body mechanics, consider only NEAs",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_MB = new Checkbox("Use integrated n-body mechanics, consider only Main-Belt asteroids",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_TNO = new Checkbox("Use integrated n-body mechanics, consider only Centaurs and TNOs",false,compare_observations_1_choices); JTextField select_duration_tf1 = new JTextField(7); Checkbox compare_observations_1_nbody_singleNEA = new Checkbox("Use integrated n-body mechanics, consider only single-opp NEAs",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_NEA18 = new Checkbox("Use integrated n-body mechanics, consider only NEAs with Abs Mag <= 18",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_NEA20 = new Checkbox("Use integrated n-body mechanics, consider only NEAs with 18 < Abs Mag <= 20",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_NEA30 = new Checkbox("Use integrated n-body mechanics, consider only NEAs with 20 < Abs Mag <= 30",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_NEALT20 = new Checkbox("Use integrated n-body mechanics, consider only NEAs with Abs Mag <= 20",false,compare_observations_1_choices); Checkbox compare_observations_1_nbody_NEA1830 = new Checkbox("Use integrated n-body mechanics, consider only NEAs with 18 < Abs Mag <= 30",false,compare_observations_1_choices); CheckboxGroup select_duration_group = new CheckboxGroup(); Checkbox select_duration_nominal = new Checkbox("Linear Collision Analysis - Consider only nominal trajectory",false,select_duration_group); Checkbox select_duration_VI = new Checkbox("Nonlinear Collision Analysis - Consider ",true,select_duration_group); JTextField select_duration_tf2 = new JTextField(7); CheckboxGroup select_duration_group3 = new CheckboxGroup(); Checkbox select_duration_normal = new Checkbox("Sample normal distribution",false,select_duration_group3); Checkbox select_duration_weak = new Checkbox("Sample Line-Of-Variation",true,select_duration_group3); Checkbox select_duration_SR = new Checkbox("Use Statistical Ranging Trajectories",false,select_duration_group3); JComboBox select_mp_cl1 = new JComboBox(); JButton select_mp_b1 = new JButton("Import"); JButton select_mp_b2 = new JButton("Cancel"); CheckboxGroup select_duration_group2 = new CheckboxGroup(); Checkbox select_duration_high = new Checkbox("high",true,select_duration_group2); Checkbox select_duration_medium = new Checkbox("medium",false,select_duration_group2); CheckboxGroup select_duration_group4 = new CheckboxGroup(); Checkbox select_duration_normal_filter = new Checkbox("all",false,select_duration_group4); Checkbox select_duration_narrow_filter = new Checkbox("Earth-only",true,select_duration_group4); CheckboxGroup compare_observations_1_accuracy = new CheckboxGroup(); Checkbox compare_observations_1_high = new Checkbox("high",false,compare_observations_1_accuracy); Checkbox compare_observations_1_medium = new Checkbox("medium",true,compare_observations_1_accuracy); JButton add_obs_b5 = new JButton("Cancel"); JButton select_method_b5 = new JButton("Herget"); JTextField set_rhos_tf1 = new JTextField(8); JTextField set_rhos_tf2 = new JTextField(8); JButton set_rhos_b1 = new JButton("Submit"); JButton set_rhos_b2 = new JButton("Cancel"); CheckboxGroup set_rhos_lschoice = new CheckboxGroup(); Checkbox set_rhos_ls = new Checkbox("Refine resulting orbit using iterative least squares",false,set_rhos_lschoice); JTextField display_herget_orbit_tf0 = new JTextField(23); JTextField display_herget_orbit_tf1 = new JTextField(23); JTextField display_herget_orbit_tf2 = new JTextField(23); JTextField display_herget_orbit_tf3 = new JTextField(23); JTextField display_herget_orbit_tf4 = new JTextField(23); JTextField display_herget_orbit_tf5 = new JTextField(23); JTextField display_herget_orbit_tf6 = new JTextField(23); JTextField display_herget_orbit_tf7 = new JTextField(23); JTextField display_herget_orbit_tf8 = new JTextField(23); JTextField display_herget_orbit_tf9 = new JTextField(23); JTextField display_herget_orbit_tf10 = new JTextField(23); JTextField display_herget_orbit_tf11 = new JTextField(23); JTextField display_herget_orbit_tf12 = new JTextField(23); JButton display_herget_orbit_b1 = new JButton("Select"); JButton display_herget_orbit_b2 = new JButton("Select"); JButton display_herget_orbit_b3 = new JButton("Select"); JButton display_herget_orbit_b4 = new JButton("Select"); JButton display_herget_orbit_b5 = new JButton("Select"); JButton display_herget_orbit_b6 = new JButton("Select"); JButton sample_obs_MC_1_b1 = new JButton("Begin"); JButton sample_obs_MC_1_b2 = new JButton("Cancel"); JButton display_obs_MC_1_b1 = new JButton("q vs. e"); JButton display_obs_MC_1_b2 = new JButton("q vs. i"); JButton display_obs_MC_1_b3 = new JButton("q vs. w"); JButton display_obs_MC_1_b4 = new JButton("q vs. omega"); JButton display_obs_MC_1_b5 = new JButton("q vs. M"); JButton display_obs_MC_1_b6 = new JButton("Cancel"); JButton display_ephemeris_1_b3 = new JButton("Begin"); JButton MC_ephem_toggle_display_b1 = new JButton("Next"); JButton MC_ephem_toggle_display_b2 = new JButton("Cancel"); JTextField stat_ranging_inputs_tf1 = new JTextField(7); JTextField stat_ranging_inputs_tf2 = new JTextField(5); JTextField stat_ranging_inputs_tf4 = new JTextField(5); JTextField stat_ranging_inputs_tf5 = new JTextField(5); Checkbox stat_ranging_inputs_prograde = new Checkbox("Require prograde orbit",true); Checkbox stat_ranging_inputs_eccentricity = new Checkbox("Require e < 1.0",true); Checkbox stat_ranging_inputs_residuals = new Checkbox("Require RMS optical residuals < ",true); CheckboxGroup stat_ranging_orbit4 = new CheckboxGroup(); Checkbox stat_ranging_inputs_2body = new Checkbox("Use two-body mechanics ",true,stat_ranging_orbit4); Checkbox stat_ranging_inputs_nbody = new Checkbox("Use n-body mechanics ",false,stat_ranging_orbit4); JButton stat_ranging_inputs_b1 = new JButton("Begin"); JButton stat_ranging_inputs_b2 = new JButton("Cancel"); /* Define mp to be an instance of the MinorPlanet class; it can then be used to trigger references to MinorPlanet variables and methods. */ MinorPlanet mp = new MinorPlanet(); /* Define gp to be an instance of the Graphing class; it can then be used to trigger graphs of results. */ Graphing gp = new Graphing(); /* input_juldate is the TDT jultime of the optical observation being entered in add_optical_obs_1; it will be converted to TDB in add_optical_obs_3 once the lat/long/alt and EOPs are known. */ double input_juldate = 0; double[] classical_elements = new double[9]; double[] classical_elements_uncertainty = new double[9]; double[][] collision = new double[10000][9]; /* Define observation_counter to track observations displayed on the delete_observation screens */ int observation_counter = 0; /* Define event_counter to track VIs/collisions/near-misses displayed on the check_for_collision screens */ int event_counter = 0; double display_ephemeris_time = 0, display_ephemeris_interval = 0, display_ephemeris_endtime = 0, display_ephemeris_starttime = 0; String[] formatted_ephemerides = new String[101]; double[][] ephemeris_radec = new double[101][3]; double[] ephemeris_magnitudes = new double[101]; double[][] ephemeris_support_data = new double[101][9]; /* Define ephemeris_counter to track entries in the optical ephemeris displayed on the display_ephemeris screens */ int ephemeris_counter = 0; double[] residuals = new double[16002]; double[] rms_residuals = new double[4]; String[] formatted_observations = new String[16001]; String[] formatted_residuals = new String[16001]; String[] formatted_rms_residuals = new String[4]; int residual_counter = 0; int reset_residual_counter = 0; double[] two_body_Lx = new double[4]; double[] two_body_Ly = new double[4]; double[] two_body_Lz = new double[4]; double[] two_body_x = new double[4]; double[] two_body_y = new double[4]; double[] two_body_z = new double[4]; double[] two_body_r = new double[4]; double[] two_body_rprime = new double[4]; int[] pointer = new int[4]; String[] two_body_residuals = new String[4]; double two_body_time1 = 0, two_body_time2 = 0, two_body_time3 = 0, two_body_epoch_time = 0, two_body_recipa = 0; String two_body_method = " "; int kgaussfail = 0; double[] barycentric_two_body_r = new double[4]; double[] barycentric_two_body_rprime = new double[4]; String two_body_error_message = " "; boolean PHA = false; String[] obscode = new String[2000]; double[] obslong = new double[2000]; double[] obslat = new double[2000]; double[] obsalt = new double[2000]; int code_counter = 0; /* Define collision_duration as the julday end point of a search for collisions and/or near misses */ double collision_duration = 0; double[][] candidate_residuals = new double[1001][14]; String[] candidates = new String[1001]; double[][] candidate_sunr = new double[1001][4]; int candidate_counter = 0; int candidate_pointer = 0; int Monte_Carlo_index = 1201; double[][][] virtual_impactors = new double[1000][7][6]; String[] formatted_collisions = new String[20000]; int non_event_counter = 0; double[][] non_event_array = new double[10000][14]; double[] nominal_eigenvector = new double[7]; /* Define elapsed_time as the time (in minutes) required to perform a lengthy comparison of the observations of the current minor planet with those predicted for known minor planets */ double elapsed_time = 0; String[] import_designation_array = new String[1000001]; double[] import_elements_array = new double[13]; int import_counter = 0; double two_body_rho1 = 0, two_body_rho2 = 0; double[] two_body_times = new double[3]; String[] mjd_string = new String[30000]; String[] x_string = new String[30000]; String[] y_string = new String[30000]; String[] ut1utc_string = new String[30000]; String[] lod_string = new String[30000]; String[] dPsi_string = new String[30000]; String[] dEpsilon_string = new String[30000]; int eop_counter = 0; double[][] MC_state_vectors = new double[8001][7]; double[][] MC_orbital_elements = new double[8001][9]; double[][][] MC_ephemeris_radec = new double[25][8001][3]; int MC_counter = 0, MC_ephem_counter = 0, MC_ephem_display_counter = 0, SR_total = 0; boolean SR_flag = false; public GUI() { /* This is a constructor method. It is called when the main method creates an object in the title class. */ super("Comet/Asteroid Orbit Determination and Ephemeris Software"); /* Create a new pane container */ pane = new JPanel(); /* Define a layout manager for the pane */ GridBagLayout title_layout = new GridBagLayout(); GridBagConstraints title_constraints = new GridBagConstraints(); pane.setLayout(title_layout); /* Set the font and color for the pane */ Font font_f = new Font("monospaced",Font.PLAIN,12); Font font_g = new Font("monospaced",Font.PLAIN,10); /* Add constraints to title_blank1, then add it to pane */ JLabel title_blank1 = new JLabel(" "); buildConstraints(title_constraints,0,0,1,1,100,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_blank1,title_constraints); title_blank1.setFont(font_f); pane.add(title_blank1); /* Add constraints to title_blank2, then add it to pane */ JLabel title_blank2 = new JLabel(" "); buildConstraints(title_constraints,0,1,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_blank2,title_constraints); title_blank2.setFont(font_f); pane.add(title_blank2); /* Add constraints to title_greeting1, then add it to pane */ JLabel title_greeting1 = new JLabel("Welcome to CODES."); buildConstraints(title_constraints,0,2,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_greeting1,title_constraints); title_greeting1.setFont(font_f); pane.add(title_greeting1); /* Add constraints to title_greeting2, then add it to pane */ JLabel title_greeting2 = new JLabel("Please press the button to begin."); buildConstraints(title_constraints,0,3,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_greeting2,title_constraints); title_greeting2.setFont(font_f); pane.add(title_greeting2); /* Add constraints to title_b1, add a listener, then add it to pane */ buildConstraints(title_constraints,0,4,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_b1,title_constraints); title_b1.addActionListener(this); title_b1.setFont(font_f); pane.add(title_b1); /* Add constraints to title_blank3, then add it to pane */ JLabel title_blank3 = new JLabel(" "); buildConstraints(title_constraints,0,5,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_blank3,title_constraints); title_blank3.setFont(font_f); pane.add(title_blank3); /* Add constraints to title_blank4, then add it to pane */ JLabel title_blank4 = new JLabel("Copyright 2000 by James Baer"); buildConstraints(title_constraints,0,6,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); title_layout.setConstraints(title_blank4,title_constraints); title_blank4.setFont(font_g); pane.add(title_blank4); setContentPane(pane); } public static void main(String[] args) { /* Set the "look and feel" to Java Metal */ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { System.err.println("Can't set cross-platform look and feel: " + e); } /* Create an instance of the GUI class; this will result in the constructor method being run, and the user-interface is opened for business. */ JFrame frame = new GUI(); WindowListener l = new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }; frame.addWindowListener(l); frame.setSize(800,550); frame.setVisible(true); } public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); String choice; if (source == title_b1) { title_b1.removeActionListener(this); read_obscode_list(); level_one_menu(); } else if (source == level_one_menu_b1) { level_one_menu_b1.removeActionListener(this); level_one_menu_b2.removeActionListener(this); level_one_menu_b3.removeActionListener(this); mp.current_minor_planet = level_one_menu_tf1.getText(); add_mp(mp.current_minor_planet); } else if (source == level_one_menu_b2) { level_one_menu_b1.removeActionListener(this); level_one_menu_b2.removeActionListener(this); level_one_menu_b3.removeActionListener(this); mp.current_minor_planet = (String)level_one_menu_cl1.getSelectedItem(); edit_mp(mp.current_minor_planet); } else if (source == level_one_menu_b3) { level_one_menu_b1.removeActionListener(this); level_one_menu_b2.removeActionListener(this); level_one_menu_b3.removeActionListener(this); choice = (String)level_one_menu_cl2.getSelectedItem(); delete_mp(choice); } else if (source == add_mp_b1) { add_mp_b1.removeActionListener(this); add_mp_b2.removeActionListener(this); add_mp_b3.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == add_mp_b2) { add_mp_b1.removeActionListener(this); add_mp_b2.removeActionListener(this); add_mp_b3.removeActionListener(this); level_one_menu(); } else if (source == add_mp_b3) { add_mp_b1.removeActionListener(this); add_mp_b2.removeActionListener(this); add_mp_b3.removeActionListener(this); expedited_comparison(); } else if (source == delete_mp_b1) { delete_mp_b1.removeActionListener(this); level_one_menu(); } else if (source == edit_mp_b1) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); eop_file_reader(); add_obs(); } else if (source == edit_mp_b2) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); preprocess_delete_observation(); format_observations_residuals(); delete_observation(); } else if (source == edit_mp_b3) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); compute_orbit(); } else if (source == edit_mp_b4) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); display_orbit(); } else if (source == edit_mp_b5) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); input_orbit(); } else if (source == edit_mp_b6) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); display_ephemeris_1(); } else if (source == edit_mp_b7) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); select_duration(); } else if (source == edit_mp_b8) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); set_perturbers(); } else if (source == edit_mp_b9) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); set_radius(); } else if (source == edit_mp_b10) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); level_one_menu(); } else if (source == edit_mp_b11) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); designate_mp(); } else if (source == edit_mp_b12) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); compare_observations_1(); } else if (source == edit_mp_b13) { edit_mp_b1.removeActionListener(this); edit_mp_b2.removeActionListener(this); edit_mp_b3.removeActionListener(this); edit_mp_b4.removeActionListener(this); edit_mp_b5.removeActionListener(this); edit_mp_b6.removeActionListener(this); edit_mp_b7.removeActionListener(this); edit_mp_b8.removeActionListener(this); edit_mp_b9.removeActionListener(this); edit_mp_b10.removeActionListener(this); edit_mp_b11.removeActionListener(this); edit_mp_b12.removeActionListener(this); edit_mp_b13.removeActionListener(this); mpc_catalog_reader(1); select_mp(); } else if (source == select_mp_b1) { select_mp_b1.removeActionListener(this); select_mp_b2.removeActionListener(this); initialize_imported_mp(); edit_mp(mp.current_minor_planet); } else if (source == select_mp_b2) { select_mp_b1.removeActionListener(this); select_mp_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == add_obs_b1) { add_obs_b1.removeActionListener(this); add_obs_b2.removeActionListener(this); add_obs_b3.removeActionListener(this); add_obs_b4.removeActionListener(this); add_obs_b5.removeActionListener(this); add_optical_obs_1(); } else if (source == add_obs_b2) { add_obs_b1.removeActionListener(this); add_obs_b2.removeActionListener(this); add_obs_b3.removeActionListener(this); add_obs_b4.removeActionListener(this); add_obs_b5.removeActionListener(this); add_radar_obs_1(); } else if (source == add_obs_b3) { add_obs_b1.removeActionListener(this); add_obs_b2.removeActionListener(this); add_obs_b3.removeActionListener(this); add_obs_b4.removeActionListener(this); add_obs_b5.removeActionListener(this); read_MPEC(); } else if (source == add_obs_b4) { add_obs_b1.removeActionListener(this); add_obs_b2.removeActionListener(this); add_obs_b3.removeActionListener(this); add_obs_b4.removeActionListener(this); add_obs_b5.removeActionListener(this); read_neodys(); } else if (source == add_obs_b5) { add_obs_b1.removeActionListener(this); add_obs_b2.removeActionListener(this); add_obs_b3.removeActionListener(this); add_obs_b4.removeActionListener(this); add_obs_b5.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == read_MPEC_b1) { read_MPEC_b1.removeActionListener(this); read_MPEC_b2.removeActionListener(this); MPEC_reader(); edit_mp(mp.current_minor_planet); } else if (source == read_MPEC_b2) { read_MPEC_b1.removeActionListener(this); read_MPEC_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == read_neodys_b1) { read_neodys_b1.removeActionListener(this); read_neodys_b2.removeActionListener(this); neodys_reader(); edit_mp(mp.current_minor_planet); } else if (source == read_neodys_b2) { read_neodys_b1.removeActionListener(this); read_neodys_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == add_optical_obs_1_b1) { add_optical_obs_1_b1.removeActionListener(this); add_optical_obs_1_b2.removeActionListener(this); process_optical_obs_1(); add_optical_obs_2(); } else if (source == add_optical_obs_1_b2) { add_optical_obs_1_b1.removeActionListener(this); add_optical_obs_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == add_optical_obs_2_b1) { add_optical_obs_2_b1.removeActionListener(this); add_optical_obs_2_b2.removeActionListener(this); process_optical_obs_2(); if (((mp.optical_time[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] - 2400000.5) > (Double.valueOf(mjd_string[0]).doubleValue()+1)) && ((mp.optical_time[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] - 2400000.5) < Double.valueOf(mjd_string[eop_counter]).doubleValue())) { /* Use the EOP database */ read_optical_eop_parms(); process_optical_obs_3(); edit_mp(mp.current_minor_planet); } else if (add_optical_obs_2_EOPs.getState()) { /* Use default EOPs and skip 3rd screen */ process_optical_obs_2a(); edit_mp(mp.current_minor_planet); } else add_optical_obs_3(); } else if (source == add_optical_obs_2_b2) { add_optical_obs_2_b1.removeActionListener(this); add_optical_obs_2_b2.removeActionListener(this); cancel_optical_obs_1(); edit_mp(mp.current_minor_planet); } else if (source == add_optical_obs_3_b1) { add_optical_obs_3_b1.removeActionListener(this); add_optical_obs_3_b2.removeActionListener(this); process_optical_obs_3(); edit_mp(mp.current_minor_planet); } else if (source == add_optical_obs_3_b2) { add_optical_obs_3_b1.removeActionListener(this); add_optical_obs_3_b2.removeActionListener(this); cancel_optical_obs_2(); edit_mp(mp.current_minor_planet); } else if (source == add_radar_obs_1_b1) { add_radar_obs_1_b1.removeActionListener(this); add_radar_obs_1_b2.removeActionListener(this); process_radar_obs_1(); add_radar_obs_2(); } else if (source == add_radar_obs_1_b2) { add_radar_obs_1_b1.removeActionListener(this); add_radar_obs_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == add_radar_obs_2_b1) { add_radar_obs_2_b1.removeActionListener(this); add_radar_obs_2_b2.removeActionListener(this); process_radar_obs_2(); if (((mp.observation_type[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] == 2) && (((mp.radar_delay_receiver_time[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] - 2400000.5) > (Double.valueOf(mjd_string[0]).doubleValue()+1)) && ((mp.radar_delay_receiver_time[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] - 2400000.5) < Double.valueOf(mjd_string[eop_counter]).doubleValue()))) || ((mp.observation_type[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] == 3) && (((mp.radar_doppler_receiver_time[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] - 2400000.5) > (Double.valueOf(mjd_string[0]).doubleValue()+1)) && ((mp.radar_doppler_receiver_time[mp.number_of_optical_observations + mp.number_of_delay_observations + mp.number_of_doppler_observations] - 2400000.5) < Double.valueOf(mjd_string[eop_counter]).doubleValue())))){ /* Use the EOP database */ read_radar_eop_parms(); process_radar_obs_3(); edit_mp(mp.current_minor_planet); } else { add_radar_obs_3(); } } else if (source == add_radar_obs_2_b2) { add_radar_obs_2_b1.removeActionListener(this); add_radar_obs_2_b2.removeActionListener(this); cancel_radar_obs_1(); edit_mp(mp.current_minor_planet); } else if (source == add_radar_obs_3_b1) { add_radar_obs_3_b1.removeActionListener(this); add_radar_obs_3_b2.removeActionListener(this); process_radar_obs_3(); edit_mp(mp.current_minor_planet); } else if (source == add_radar_obs_3_b2) { add_radar_obs_3_b1.removeActionListener(this); add_radar_obs_3_b2.removeActionListener(this); cancel_radar_obs_2(); edit_mp(mp.current_minor_planet); } else if (source == input_orbit_b1) { input_orbit_b1.removeActionListener(this); input_orbit_b2.removeActionListener(this); input_orbit_b3.removeActionListener(this); preprocess_input_orbital_elements(); input_orbital_elements(); } else if (source == input_orbit_b2) { input_orbit_b1.removeActionListener(this); input_orbit_b2.removeActionListener(this); input_orbit_b3.removeActionListener(this); input_state_vector(); } else if (source == input_orbit_b3) { input_orbit_b1.removeActionListener(this); input_orbit_b2.removeActionListener(this); input_orbit_b3.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == input_state_vector_b1) { input_state_vector_b1.removeActionListener(this); input_state_vector_b2.removeActionListener(this); process_input_state_vector(); edit_mp(mp.current_minor_planet); } else if (source == input_state_vector_b2) { input_state_vector_b1.removeActionListener(this); input_state_vector_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == input_orbital_elements_b1) { input_orbital_elements_b1.removeActionListener(this); input_orbital_elements_b2.removeActionListener(this); process_input_orbital_elements(); edit_mp(mp.current_minor_planet); } else if (source == input_orbital_elements_b2) { input_orbital_elements_b1.removeActionListener(this); input_orbital_elements_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_orbit_b1) { display_orbit_b1.removeActionListener(this); display_orbit_b2.removeActionListener(this); display_orbit_b3.removeActionListener(this); preprocess_input_orbital_elements(); evaluate_PHA(); display_orbital_elements(); } else if (source == display_orbit_b2) { display_orbit_b1.removeActionListener(this); display_orbit_b2.removeActionListener(this); display_orbit_b3.removeActionListener(this); preprocess_input_orbital_elements(); evaluate_PHA(); display_state_vector(); } else if (source == display_orbit_b3) { display_orbit_b1.removeActionListener(this); display_orbit_b2.removeActionListener(this); display_orbit_b3.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_state_vector_b1) { display_state_vector_b1.removeActionListener(this); display_state_vector_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_orbital_elements_b1) { display_orbital_elements_b1.removeActionListener(this); display_orbital_elements_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == set_perturbers_b1) { set_perturbers_b1.removeActionListener(this); process_set_perturbers(); edit_mp(mp.current_minor_planet); } else if (source == set_radius_b1) { set_radius_b1.removeActionListener(this); set_radius_b2.removeActionListener(this); process_set_radius(); edit_mp(mp.current_minor_planet); } else if (source == set_radius_b2) { set_radius_b1.removeActionListener(this); set_radius_b2.removeActionListener(this); process_recalculate_abs_mag(); set_radius(); } else if (source == delete_observation_b1) { delete_observation_b1.removeActionListener(this); delete_observation_b2.removeActionListener(this); delete_observation_b3.removeActionListener(this); delete_observation_b4.removeActionListener(this); process_delete_observation(); format_observations_residuals(); delete_observation(); } else if (source == delete_observation_b2) { delete_observation_b1.removeActionListener(this); delete_observation_b2.removeActionListener(this); delete_observation_b3.removeActionListener(this); delete_observation_b4.removeActionListener(this); delete_observation(); } else if (source == delete_observation_b3) { delete_observation_b1.removeActionListener(this); delete_observation_b2.removeActionListener(this); delete_observation_b3.removeActionListener(this); delete_observation_b4.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == delete_observation_b4) { delete_observation_b1.removeActionListener(this); delete_observation_b2.removeActionListener(this); delete_observation_b3.removeActionListener(this); delete_observation_b4.removeActionListener(this); back5_delete_observation(); delete_observation(); } else if (source == select_duration_b1) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); wait_screen(); collision_duration = 2462502.5; preprocess_check_for_collision(); file_output_check_for_collision(); if ((collision[0][0] + non_event_counter + virtual_impactors[0][0][0]) > 0.0) { check_for_collision(); } else no_events(); } else if (source == select_duration_b2) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); wait_screen(); collision_duration = 2469807.5; preprocess_check_for_collision(); file_output_check_for_collision(); if ((collision[0][0] + non_event_counter + virtual_impactors[0][0][0]) > 0.0) { check_for_collision(); } else no_events(); } else if (source == select_duration_b3) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); wait_screen(); collision_duration = 2478938.75; preprocess_check_for_collision(); file_output_check_for_collision(); if ((collision[0][0] + non_event_counter + virtual_impactors[0][0][0]) > 0.0) { check_for_collision(); } else no_events(); } else if (source == select_duration_b4) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); wait_screen(); collision_duration = 2488070.0; preprocess_check_for_collision(); file_output_check_for_collision(); if ((collision[0][0] + non_event_counter + virtual_impactors[0][0][0]) > 0.0) { check_for_collision(); } else no_events(); } else if (source == select_duration_b5) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); wait_screen(); collision_duration = 2506332.5; preprocess_check_for_collision(); file_output_check_for_collision(); if ((collision[0][0] + non_event_counter + virtual_impactors[0][0][0]) > 0.0) { check_for_collision(); } else no_events(); } else if (source == select_duration_b6) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); wait_screen(); collision_duration = 2524595.0; preprocess_check_for_collision(); file_output_check_for_collision(); if ((collision[0][0] + non_event_counter + virtual_impactors[0][0][0]) > 0.0) { check_for_collision(); } else no_events(); } else if (source == select_duration_b7) { select_duration_b1.removeActionListener(this); select_duration_b2.removeActionListener(this); select_duration_b3.removeActionListener(this); select_duration_b4.removeActionListener(this); select_duration_b5.removeActionListener(this); select_duration_b6.removeActionListener(this); select_duration_b7.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == no_events_b1) { no_events_b1.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == check_for_collision_b1) { check_for_collision_b1.removeActionListener(this); check_for_collision_b2.removeActionListener(this); check_for_collision(); } else if (source == check_for_collision_b2) { check_for_collision_b1.removeActionListener(this); check_for_collision_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_ephemeris_1_b1) { display_ephemeris_1_b1.removeActionListener(this); display_ephemeris_1_b2.removeActionListener(this); preprocess_display_ephemeris(); format_ephemeris(); file_output_display_ephemeris(); display_ephemeris_2(); } else if (source == display_ephemeris_1_b2) { display_ephemeris_1_b1.removeActionListener(this); display_ephemeris_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_ephemeris_2_b1) { display_ephemeris_2_b1.removeActionListener(this); display_ephemeris_2_b2.removeActionListener(this); display_ephemeris_2(); } else if (source == display_ephemeris_2_b2) { display_ephemeris_2_b1.removeActionListener(this); display_ephemeris_2_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == compute_orbit_b1) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); select_observations(); } else if (source == compute_orbit_b2) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); compute_best_fit_1(); } else if (source == compute_orbit_b3) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); compute_residuals_1(); } else if (source == compute_orbit_b4) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); propogate_epoch_1(); } else if (source == compute_orbit_b5) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == compute_orbit_b6) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); sample_obs_MC_1(); } else if (source == compute_orbit_b7) { compute_orbit_b1.removeActionListener(this); compute_orbit_b2.removeActionListener(this); compute_orbit_b3.removeActionListener(this); compute_orbit_b4.removeActionListener(this); compute_orbit_b5.removeActionListener(this); compute_orbit_b6.removeActionListener(this); compute_orbit_b7.removeActionListener(this); stat_ranging_inputs(); } else if (source == propogate_epoch_1_b1) { propogate_epoch_1_b1.removeActionListener(this); propogate_epoch_1_b2.removeActionListener(this); preprocess_propogate_epoch(); file_output_propogate_epoch(); display_orbit(); } else if (source == propogate_epoch_1_b2) { propogate_epoch_1_b1.removeActionListener(this); propogate_epoch_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_state_vector_b2) { display_state_vector_b1.removeActionListener(this); display_state_vector_b2.removeActionListener(this); preprocess_input_orbital_elements(); evaluate_PHA(); display_orbital_elements(); } else if (source == display_orbital_elements_b2) { display_orbital_elements_b1.removeActionListener(this); display_orbital_elements_b2.removeActionListener(this); preprocess_input_orbital_elements(); evaluate_PHA(); display_state_vector(); } else if (source == compute_residuals_1_b1) { compute_residuals_1_b1.removeActionListener(this); compute_residuals_1_b2.removeActionListener(this); mp.get_residuals(residuals,rms_residuals); format_observations_residuals(); file_output_compute_residuals(); compute_residuals_2(); } else if (source == compute_residuals_1_b2) { compute_residuals_1_b1.removeActionListener(this); compute_residuals_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == compute_residuals_2_b1) { compute_residuals_2_b1.removeActionListener(this); compute_residuals_2_b2.removeActionListener(this); compute_residuals_2_b3.removeActionListener(this); compute_residuals_2_b4.removeActionListener(this); residual_counter = reset_residual_counter; compute_residuals_2(); } else if (source == compute_residuals_2_b2) { compute_residuals_2_b1.removeActionListener(this); compute_residuals_2_b2.removeActionListener(this); compute_residuals_2_b3.removeActionListener(this); compute_residuals_2_b4.removeActionListener(this); compute_residuals_2(); } else if (source == compute_residuals_2_b3) { compute_residuals_2_b1.removeActionListener(this); compute_residuals_2_b2.removeActionListener(this); compute_residuals_2_b3.removeActionListener(this); compute_residuals_2_b4.removeActionListener(this); display_physical_properties(); } else if (source == compute_residuals_2_b4) { compute_residuals_2_b1.removeActionListener(this); compute_residuals_2_b2.removeActionListener(this); compute_residuals_2_b3.removeActionListener(this); compute_residuals_2_b4.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == compute_best_fit_1_b1) { compute_best_fit_1_b1.removeActionListener(this); compute_best_fit_1_b2.removeActionListener(this); preprocess_compute_best_fit(); file_output_compute_best_fit(); compute_residuals_2(); } else if (source == compute_best_fit_1_b2) { compute_best_fit_1_b1.removeActionListener(this); compute_best_fit_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == select_observations_b1) { select_observations_b1.removeActionListener(this); select_observations_b2.removeActionListener(this); postprocess_select_observations(); preprocess_two_body(); select_method(); } else if (source == select_observations_b2) { select_observations_b1.removeActionListener(this); select_observations_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == select_method_b1) { select_method_b1.removeActionListener(this); select_method_b2.removeActionListener(this); select_method_b3.removeActionListener(this); select_method_b4.removeActionListener(this); select_method_b5.removeActionListener(this); two_body_method = "Gauss"; two_body_epoch_time = mp.gauss_method(two_body_Lx,two_body_Ly,two_body_Lz,two_body_x,two_body_y,two_body_z,two_body_time1,two_body_time2,two_body_time3,two_body_r,two_body_rprime); postprocess_initial_orbit(); display_initial_orbit(); } else if (source == select_method_b2) { select_method_b1.removeActionListener(this); select_method_b2.removeActionListener(this); select_method_b3.removeActionListener(this); select_method_b4.removeActionListener(this); select_method_b5.removeActionListener(this); two_body_method = "conditioned Gauss"; set_a(); } else if (source == select_method_b3) { select_method_b1.removeActionListener(this); select_method_b2.removeActionListener(this); select_method_b3.removeActionListener(this); select_method_b4.removeActionListener(this); select_method_b5.removeActionListener(this); two_body_method = "Laplace"; two_body_epoch_time = mp.laplace_method(two_body_Lx,two_body_Ly,two_body_Lz,two_body_x,two_body_y,two_body_z,two_body_time1,two_body_time2,two_body_time3,two_body_r,two_body_rprime); postprocess_initial_orbit(); display_initial_orbit(); } else if (source == select_method_b4) { select_method_b1.removeActionListener(this); select_method_b2.removeActionListener(this); select_method_b3.removeActionListener(this); select_method_b4.removeActionListener(this); select_method_b5.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == select_method_b5) { select_method_b1.removeActionListener(this); select_method_b2.removeActionListener(this); select_method_b3.removeActionListener(this); select_method_b4.removeActionListener(this); select_method_b5.removeActionListener(this); two_body_method = "Herget"; set_rhos(); } else if (source == set_rhos_b1) { set_rhos_b1.removeActionListener(this); set_rhos_b2.removeActionListener(this); postprocess_set_rhos(); preprocess_herget(two_body_Lx,two_body_Ly,two_body_Lz,two_body_x,two_body_y,two_body_z,two_body_times); mp.hergets_method(two_body_Lx, two_body_Ly, two_body_Lz, two_body_x, two_body_y, two_body_z, two_body_times, two_body_rho1, two_body_rho2); preprocess_compute_herget_best_fit(); postprocess_herget_orbit(); display_herget_orbit(); } else if (source == set_rhos_b2) { set_rhos_b1.removeActionListener(this); set_rhos_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_herget_orbit_b1) { display_herget_orbit_b1.removeActionListener(this); display_herget_orbit_b2.removeActionListener(this); display_herget_orbit_b3.removeActionListener(this); display_herget_orbit_b4.removeActionListener(this); display_herget_orbit_b5.removeActionListener(this); display_herget_orbit_b6.removeActionListener(this); mp.write_data_to_disk(mp.current_minor_planet); edit_mp(mp.current_minor_planet); } else if (source == display_herget_orbit_b2) { display_herget_orbit_b1.removeActionListener(this); display_herget_orbit_b2.removeActionListener(this); display_herget_orbit_b3.removeActionListener(this); display_herget_orbit_b4.removeActionListener(this); display_herget_orbit_b5.removeActionListener(this); display_herget_orbit_b6.removeActionListener(this); set_rhos_ls.setState(true); preprocess_compute_herget_best_fit(); postprocess_herget_orbit(); display_herget_orbit(); } else if (source == display_herget_orbit_b3) { display_herget_orbit_b1.removeActionListener(this); display_herget_orbit_b2.removeActionListener(this); display_herget_orbit_b3.removeActionListener(this); display_herget_orbit_b4.removeActionListener(this); display_herget_orbit_b5.removeActionListener(this); display_herget_orbit_b6.removeActionListener(this); two_body_method = "Herget"; set_rhos(); } else if (source == display_herget_orbit_b4) { display_herget_orbit_b1.removeActionListener(this); display_herget_orbit_b2.removeActionListener(this); display_herget_orbit_b3.removeActionListener(this); display_herget_orbit_b4.removeActionListener(this); display_herget_orbit_b5.removeActionListener(this); display_herget_orbit_b6.removeActionListener(this); select_observations(); } else if (source == display_herget_orbit_b5) { display_herget_orbit_b1.removeActionListener(this); display_herget_orbit_b2.removeActionListener(this); display_herget_orbit_b3.removeActionListener(this); display_herget_orbit_b4.removeActionListener(this); display_herget_orbit_b5.removeActionListener(this); display_herget_orbit_b6.removeActionListener(this); select_observations(); } else if (source == display_herget_orbit_b6) { display_herget_orbit_b1.removeActionListener(this); display_herget_orbit_b2.removeActionListener(this); display_herget_orbit_b3.removeActionListener(this); display_herget_orbit_b4.removeActionListener(this); display_herget_orbit_b5.removeActionListener(this); display_herget_orbit_b6.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == set_a_b1) { set_a_b1.removeActionListener(this); set_a_b2.removeActionListener(this); postprocess_set_a(); two_body_epoch_time = mp.conditioned_gauss(two_body_recipa,two_body_Lx,two_body_Ly,two_body_Lz,two_body_x,two_body_y,two_body_z,two_body_time1,two_body_time2,two_body_time3,two_body_r,two_body_rprime); postprocess_initial_orbit(); display_initial_orbit(); } else if (source == set_a_b2) { set_a_b1.removeActionListener(this); set_a_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_initial_orbit_b1) { display_initial_orbit_b1.removeActionListener(this); display_initial_orbit_b2.removeActionListener(this); display_initial_orbit_b3.removeActionListener(this); display_initial_orbit_b4.removeActionListener(this); display_initial_orbit_b5.removeActionListener(this); display_initial_orbit_b6.removeActionListener(this); accept_orbit(); edit_mp(mp.current_minor_planet); } else if (source == display_initial_orbit_b2) { display_initial_orbit_b1.removeActionListener(this); display_initial_orbit_b2.removeActionListener(this); display_initial_orbit_b3.removeActionListener(this); display_initial_orbit_b4.removeActionListener(this); display_initial_orbit_b5.removeActionListener(this); display_initial_orbit_b6.removeActionListener(this); two_body_method = "differential correction"; mp.differential_correction(two_body_r,two_body_rprime,two_body_epoch_time,two_body_Lx,two_body_Ly,two_body_Lz,two_body_x,two_body_y,two_body_z,two_body_time1,two_body_time2,two_body_time3); postprocess_initial_orbit(); display_initial_orbit(); } else if (source == display_initial_orbit_b3) { display_initial_orbit_b1.removeActionListener(this); display_initial_orbit_b2.removeActionListener(this); display_initial_orbit_b3.removeActionListener(this); display_initial_orbit_b4.removeActionListener(this); display_initial_orbit_b5.removeActionListener(this); display_initial_orbit_b6.removeActionListener(this); set_a(); } else if (source == display_initial_orbit_b4) { display_initial_orbit_b1.removeActionListener(this); display_initial_orbit_b2.removeActionListener(this); display_initial_orbit_b3.removeActionListener(this); display_initial_orbit_b4.removeActionListener(this); display_initial_orbit_b5.removeActionListener(this); display_initial_orbit_b6.removeActionListener(this); select_method(); } else if (source == display_initial_orbit_b5) { display_initial_orbit_b1.removeActionListener(this); display_initial_orbit_b2.removeActionListener(this); display_initial_orbit_b3.removeActionListener(this); display_initial_orbit_b4.removeActionListener(this); display_initial_orbit_b5.removeActionListener(this); display_initial_orbit_b6.removeActionListener(this); select_observations(); } else if (source == display_initial_orbit_b6) { display_initial_orbit_b1.removeActionListener(this); display_initial_orbit_b2.removeActionListener(this); display_initial_orbit_b3.removeActionListener(this); display_initial_orbit_b4.removeActionListener(this); display_initial_orbit_b5.removeActionListener(this); display_initial_orbit_b6.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == designate_mp_b1) { designate_mp_b1.removeActionListener(this); process_designate_mp(); edit_mp(mp.current_minor_planet); } else if (source == display_physical_properties_b1) { display_physical_properties_b1.removeActionListener(this); display_physical_properties_b2.removeActionListener(this); preprocess_input_orbital_elements(); evaluate_PHA(); display_orbital_elements(); } else if (source == display_physical_properties_b2) { display_physical_properties_b1.removeActionListener(this); display_physical_properties_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == compare_observations_1_b1) { compare_observations_1_b1.removeActionListener(this); compare_observations_1_b2.removeActionListener(this); mpc_catalog_reader(3); file_output_MPC_compare(); candidate_pointer = 0; display_candidates(); } else if (source == compare_observations_1_b2) { compare_observations_1_b1.removeActionListener(this); compare_observations_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_candidates_b1) { display_candidates_b1.removeActionListener(this); display_candidates_b2.removeActionListener(this); display_candidates_b3.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_candidates_b2) { display_candidates_b1.removeActionListener(this); display_candidates_b2.removeActionListener(this); display_candidates_b3.removeActionListener(this); candidate_pointer = candidate_pointer - 10; display_candidates(); } else if (source == display_candidates_b3) { display_candidates_b1.removeActionListener(this); display_candidates_b2.removeActionListener(this); display_candidates_b3.removeActionListener(this); candidate_pointer = candidate_pointer + 10; display_candidates(); } else if (source == sample_obs_MC_1_b1) { sample_obs_MC_1_b1.removeActionListener(this); sample_obs_MC_1_b2.removeActionListener(this); preprocess_MC_orbit(); display_obs_MC_1(); } else if (source == sample_obs_MC_1_b2) { sample_obs_MC_1_b1.removeActionListener(this); sample_obs_MC_1_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_obs_MC_1_b1) { display_obs_MC_1_b1.removeActionListener(this); display_obs_MC_1_b2.removeActionListener(this); display_obs_MC_1_b3.removeActionListener(this); display_obs_MC_1_b4.removeActionListener(this); display_obs_MC_1_b5.removeActionListener(this); display_obs_MC_1_b6.removeActionListener(this); qvse(); gp.run(); display_obs_MC_1(); } else if (source == display_obs_MC_1_b2) { display_obs_MC_1_b1.removeActionListener(this); display_obs_MC_1_b2.removeActionListener(this); display_obs_MC_1_b3.removeActionListener(this); display_obs_MC_1_b4.removeActionListener(this); display_obs_MC_1_b5.removeActionListener(this); display_obs_MC_1_b6.removeActionListener(this); qvsi(); gp.run(); display_obs_MC_1(); } else if (source == display_obs_MC_1_b3) { display_obs_MC_1_b1.removeActionListener(this); display_obs_MC_1_b2.removeActionListener(this); display_obs_MC_1_b3.removeActionListener(this); display_obs_MC_1_b4.removeActionListener(this); display_obs_MC_1_b5.removeActionListener(this); display_obs_MC_1_b6.removeActionListener(this); qvsw(); gp.run(); display_obs_MC_1(); } else if (source == display_obs_MC_1_b4) { display_obs_MC_1_b1.removeActionListener(this); display_obs_MC_1_b2.removeActionListener(this); display_obs_MC_1_b3.removeActionListener(this); display_obs_MC_1_b4.removeActionListener(this); display_obs_MC_1_b5.removeActionListener(this); display_obs_MC_1_b6.removeActionListener(this); qvsomega(); gp.run(); display_obs_MC_1(); } else if (source == display_obs_MC_1_b5) { display_obs_MC_1_b1.removeActionListener(this); display_obs_MC_1_b2.removeActionListener(this); display_obs_MC_1_b3.removeActionListener(this); display_obs_MC_1_b4.removeActionListener(this); display_obs_MC_1_b5.removeActionListener(this); display_obs_MC_1_b6.removeActionListener(this); qvsm(); gp.run(); display_obs_MC_1(); } else if (source == display_obs_MC_1_b6) { display_obs_MC_1_b1.removeActionListener(this); display_obs_MC_1_b2.removeActionListener(this); display_obs_MC_1_b3.removeActionListener(this); display_obs_MC_1_b4.removeActionListener(this); display_obs_MC_1_b5.removeActionListener(this); display_obs_MC_1_b6.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_ephemeris_1_b1) { display_ephemeris_1_b1.removeActionListener(this); display_ephemeris_1_b2.removeActionListener(this); display_ephemeris_1_b3.removeActionListener(this); preprocess_display_ephemeris(); format_ephemeris(); file_output_display_ephemeris(); display_ephemeris_2(); } else if (source == display_ephemeris_1_b2) { display_ephemeris_1_b1.removeActionListener(this); display_ephemeris_1_b2.removeActionListener(this); display_ephemeris_1_b3.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == display_ephemeris_1_b3) { display_ephemeris_1_b1.removeActionListener(this); display_ephemeris_1_b2.removeActionListener(this); display_ephemeris_1_b3.removeActionListener(this); preprocess_MC_ephemeris(); if (MC_ephem_counter > 1) { MC_ephem_display_counter ++; ravsdec(MC_ephem_display_counter); gp.run(); MC_ephem_toggle_display(); } else { ravsdec(1); gp.run(); edit_mp(mp.current_minor_planet); } } else if (source == MC_ephem_toggle_display_b1) { MC_ephem_toggle_display_b1.removeActionListener(this); MC_ephem_toggle_display_b2.removeActionListener(this); MC_ephem_display_counter ++; ravsdec(MC_ephem_display_counter); gp.run(); if (MC_ephem_display_counter < MC_ephem_counter) MC_ephem_toggle_display(); else edit_mp(mp.current_minor_planet); } else if (source == MC_ephem_toggle_display_b2) { MC_ephem_toggle_display_b1.removeActionListener(this); MC_ephem_toggle_display_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } else if (source == stat_ranging_inputs_b1) { stat_ranging_inputs_b1.removeActionListener(this); stat_ranging_inputs_b2.removeActionListener(this); preprocess_SR_orbit(); if (!SR_flag) display_obs_MC_1(); else stat_ranging_inputs(); } else if (source == stat_ranging_inputs_b2) { stat_ranging_inputs_b1.removeActionListener(this); stat_ranging_inputs_b2.removeActionListener(this); edit_mp(mp.current_minor_planet); } } public void buildConstraints(GridBagConstraints gbc, int gx, int gy, int gw, int gh, int wx, int wy, int component_fill, int component_anchor) { gbc.gridx = gx; gbc.gridy = gy; gbc.gridwidth = gw; gbc.gridheight = gh; gbc.weightx = wx; gbc.weighty = wy; gbc.fill = component_fill; gbc.anchor = component_anchor; } void level_one_menu() { /* This method creates the level one menu. It reuses the existing pane, which must be cleared and retitled. */ int i = 0; pane.removeAll(); setTitle("Level One Menu"); /* Define a layout manager for the pane */ GridBagLayout level_one_menu_layout = new GridBagLayout(); GridBagConstraints level_one_menu_constraints = new GridBagConstraints(); pane.setLayout(level_one_menu_layout); /* Set the font and color for the pane */ Font font_f = new Font("monospaced",Font.PLAIN,12); /* Read the list of minor planets for use on this screen */ mp.read_mp_list_from_disk(); /* Clear the text field and choice lists, so that their contents from a previous call don't reappear */ level_one_menu_tf1.setText(""); level_one_menu_cl1.removeAllItems(); level_one_menu_cl2.removeAllItems(); /* Add constraints to level_one_menu_blank1, then add it to pane */ JLabel level_one_menu_blank1 = new JLabel(" "); buildConstraints(level_one_menu_constraints,0,0,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank1,level_one_menu_constraints); level_one_menu_blank1.setFont(font_f); pane.add(level_one_menu_blank1); /* Add constraints to level_one_menu_blank2, then add it to pane */ JLabel level_one_menu_blank2 = new JLabel(" "); buildConstraints(level_one_menu_constraints,1,0,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_blank2,level_one_menu_constraints); level_one_menu_blank2.setFont(font_f); pane.add(level_one_menu_blank2); /* Add constraints to level_one_menu_blank3, then add it to pane */ JLabel level_one_menu_blank3 = new JLabel(" "); buildConstraints(level_one_menu_constraints,2,0,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank3,level_one_menu_constraints); level_one_menu_blank3.setFont(font_f); pane.add(level_one_menu_blank3); /* Add constraints to level_one_menu_blank4, then add it to pane */ JLabel level_one_menu_blank4 = new JLabel(" "); buildConstraints(level_one_menu_constraints,0,1,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank4,level_one_menu_constraints); level_one_menu_blank4.setFont(font_f); pane.add(level_one_menu_blank4); /* Add constraints to level_one_menu_blank5, then add it to pane */ JLabel level_one_menu_blank5 = new JLabel(" "); buildConstraints(level_one_menu_constraints,1,1,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_blank5,level_one_menu_constraints); level_one_menu_blank5.setFont(font_f); pane.add(level_one_menu_blank5); /* Add constraints to level_one_menu_blank6, then add it to pane */ JLabel level_one_menu_blank6 = new JLabel(" "); buildConstraints(level_one_menu_constraints,2,1,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank6,level_one_menu_constraints); level_one_menu_blank6.setFont(font_f); pane.add(level_one_menu_blank6); /* Add constraints to level_one_menu_b1, add a listener, then add it to pane */ buildConstraints(level_one_menu_constraints,0,2,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_b1,level_one_menu_constraints); level_one_menu_b1.addActionListener(this); level_one_menu_b1.setFont(font_f); pane.add(level_one_menu_b1); /* Add constraints to level_one_menu_selection1, then add it to pane */ JLabel level_one_menu_selection1 = new JLabel(" Create a new minor planet"); buildConstraints(level_one_menu_constraints,1,2,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_selection1,level_one_menu_constraints); level_one_menu_selection1.setFont(font_f); pane.add(level_one_menu_selection1); /* Add constraints to level_one_menu_tf1, then add it to pane */ buildConstraints(level_one_menu_constraints,2,2,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_tf1,level_one_menu_constraints); level_one_menu_tf1.setFont(font_f); pane.add(level_one_menu_tf1); /* Add constraints to level_one_menu_b2, add a listener, then add it to pane */ buildConstraints(level_one_menu_constraints,0,3,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_b2,level_one_menu_constraints); level_one_menu_b2.addActionListener(this); level_one_menu_b2.setFont(font_f); pane.add(level_one_menu_b2); /* Add constraints to level_one_menu_selection2, then add it to pane */ JLabel level_one_menu_selection2 = new JLabel(" Edit an existing minor planet"); buildConstraints(level_one_menu_constraints,1,3,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_selection2,level_one_menu_constraints); level_one_menu_selection2.setFont(font_f); pane.add(level_one_menu_selection2); /* Add constraints to level_one_menu_cl1, add the existing minor planets as choices, then add it to pane */ buildConstraints(level_one_menu_constraints,2,3,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_cl1,level_one_menu_constraints); level_one_menu_cl1.setFont(font_f); for (i=1;i<=mp.number_of_minor_planets;i++) level_one_menu_cl1.addItem(mp.mp_list[i]); pane.add(level_one_menu_cl1); /* Add constraints to level_one_menu_b3, add a listener, then add it to pane */ buildConstraints(level_one_menu_constraints,0,4,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_b3,level_one_menu_constraints); level_one_menu_b3.addActionListener(this); level_one_menu_b3.setFont(font_f); pane.add(level_one_menu_b3); /* Add constraints to level_one_menu_selection3, then add it to pane */ JLabel level_one_menu_selection3 = new JLabel(" Delete an existing minor planet"); buildConstraints(level_one_menu_constraints,1,4,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_selection3,level_one_menu_constraints); level_one_menu_selection3.setFont(font_f); pane.add(level_one_menu_selection3); /* Add constraints to level_one_menu_cl2, add the existing minor planets as choices, then add it to pane */ buildConstraints(level_one_menu_constraints,2,4,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_cl2,level_one_menu_constraints); level_one_menu_cl2.setFont(font_f); for (i=1;i<=mp.number_of_minor_planets;i++) level_one_menu_cl2.addItem(mp.mp_list[i]); pane.add(level_one_menu_cl2); /* Add constraints to level_one_menu_blank7, then add it to pane */ JLabel level_one_menu_blank7 = new JLabel(" "); buildConstraints(level_one_menu_constraints,0,5,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank7,level_one_menu_constraints); level_one_menu_blank7.setFont(font_f); pane.add(level_one_menu_blank7); /* Add constraints to level_one_menu_blank8, then add it to pane */ JLabel level_one_menu_blank8 = new JLabel(" "); buildConstraints(level_one_menu_constraints,1,5,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_blank8,level_one_menu_constraints); level_one_menu_blank8.setFont(font_f); pane.add(level_one_menu_blank8); /* Add constraints to level_one_menu_blank9, then add it to pane */ JLabel level_one_menu_blank9 = new JLabel(" "); buildConstraints(level_one_menu_constraints,2,5,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank9,level_one_menu_constraints); level_one_menu_blank9.setFont(font_f); pane.add(level_one_menu_blank9); /* Add constraints to level_one_menu_blank10, then add it to pane */ JLabel level_one_menu_blank10 = new JLabel(" "); buildConstraints(level_one_menu_constraints,0,6,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank10,level_one_menu_constraints); level_one_menu_blank10.setFont(font_f); pane.add(level_one_menu_blank10); /* Add constraints to level_one_menu_blank11, then add it to pane */ JLabel level_one_menu_blank11 = new JLabel(" "); buildConstraints(level_one_menu_constraints,1,6,1,1,10,14,GridBagConstraints.NONE,GridBagConstraints.WEST); level_one_menu_layout.setConstraints(level_one_menu_blank11,level_one_menu_constraints); level_one_menu_blank11.setFont(font_f); pane.add(level_one_menu_blank11); /* Add constraints to level_one_menu_blank12, then add it to pane */ JLabel level_one_menu_blank12 = new JLabel(" "); buildConstraints(level_one_menu_constraints,2,6,1,1,45,14,GridBagConstraints.NONE,GridBagConstraints.EAST); level_one_menu_layout.setConstraints(level_one_menu_blank12,level_one_menu_constraints); level_one_menu_blank12.setFont(font_f); pane.add(level_one_menu_blank12); setContentPane(pane); repaint(); } void add_mp(String selection) { /* This method adds a new minor planet to mp_list. It reuses the existing pane, which must be cleared and retitled. */ int i = 0, code = 0; String offspring = ""; pane.removeAll(); setTitle("Add a minor planet"); /* Define a layout manager for the pane */ GridBagLayout add_mp_layout = new GridBagLayout(); GridBagConstraints add_mp_constraints = new GridBagConstraints(); pane.setLayout(add_mp_layout); /* Set the font and color for the pane */ Font font_f = new Font("monospaced",Font.PLAIN,12); /* Check the name of the new minor planet to be sure it is a legal file name; if not, modify it accordingly. */ for (i=0;i<=(selection.length()-1);i++) { code = (int)selection.charAt(i); if (((code > 47) && (code < 58)) || ((code > 64) && (code < 91)) || ((code > 96) && (code < 123))) offspring = offspring + selection.charAt(i); } selection = offspring; mp.current_minor_planet = offspring; /* Add the selected minor planet to mp_list, and write the updated list to disk */ mp.add_minor_planet_to_list(selection); mp.write_mp_list_to_disk(); /* Add constraints to add_mp_blank1, then add it to pane */ JLabel add_mp_blank1 = new JLabel(" "); buildConstraints(add_mp_constraints,0,0,1,1,50,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); add_mp_layout.setConstraints(add_mp_blank1,add_mp_constraints); add_mp_blank1.setFont(font_f); pane.add(add_mp_blank1); /* Add constraints to add_mp_blank2, then add it to pane */ JLabel add_mp_blank2 = new JLabel(" "); buildConstraints(add_mp_constraints,1,0,1,1,50,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); add_mp_layout.setConstraints(add_mp_blank2,add_mp_constraints); add_mp_blank2.setFont(font_f); pane.add(add_mp_blank2); /* Add constraints to add_mp_blank3, then add it to pane */ JLabel add_mp_blank3 = new JLabel(" "); buildConstraints(add_mp_constraints,0,1,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); add_mp_layout.setConstraints(add_mp_blank3,add_mp_constraints); add_mp_blank3.setFont(font_f); pane.add(add_mp_blank3); /* Add constraints to add_mp_response1, then add it to pane */ JLabel add_mp_response1 = new JLabel(("Minor planet " + selection + " has been added.")); buildConstraints(add_mp_constraints,0,2,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); add_mp_layout.setConstraints(add_mp_response1,add_mp_constraints); add_mp_response1.setFont(font_f); pane.add(add_mp_response1); /* Add constraints to add_mp_blank4, then add it to pane */ JLabel add_mp_blank4 = new JLabel(" "); buildConstraints(add_mp_constraints,0,3,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); add_mp_layout.setConstraints(add_mp_blank4,add_mp_constraints); add_mp_blank4.setFont(font_f); pane.add(add_mp_blank4); /* Add constraints to add_mp_b1, add a listener, then add it to pane */ buildConstraints(add_mp_constraints,0,4,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.EAST); add_mp_layout.setConstraints(add_mp_b1,add_mp_constraints); add_mp_b1.addActionListener(this); add_mp_b1.setFont(font_f); pane.add(add_mp_b1); /* Add constraints to add_mp_response2, then add it to pane */ JLabel add_mp_response2 = new JLabel((" Edit this new minor planet")); buildConstraints(add_mp_constraints,1,4,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.WEST); add_mp_layout.setConstraints(add_mp_response2,add_mp_constraints); add_mp_response2.setFont(font_f); pane.add(add_mp_response2); /* Add constraints to add_mp_b2, add a listener, then add it to pane */ buildConstraints(add_mp_constraints,0,5,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.EAST); add_mp_layout.setConstraints(add_mp_b2,add_mp_constraints); add_mp_b2.addActionListener(this); add_mp_b2.setFont(font_f); pane.add(add_mp_b2); /* Add constraints to add_mp_response3, then add it to pane */ JLabel add_mp_response3 = new JLabel((" Return to the Level One Menu")); buildConstraints(add_mp_constraints,1,5,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.WEST); add_mp_layout.setConstraints(add_mp_response3,add_mp_constraints); add_mp_response3.setFont(font_f); pane.add(add_mp_response3); /* Add constraints to add_mp_b3, add a listener, then add it to pane */ buildConstraints(add_mp_constraints,0,6,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.EAST); add_mp_layout.setConstraints(add_mp_b3,add_mp_constraints); add_mp_b3.addActionListener(this); add_mp_b3.setFont(font_f); pane.add(add_mp_b3); /* Add constraints to add_mp_response4, then add it to pane */ JLabel add_mp_response4 = new JLabel((" Execute an Expedited Comparison")); buildConstraints(add_mp_constraints,1,6,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.WEST); add_mp_layout.setConstraints(add_mp_response4,add_mp_constraints); add_mp_response4.setFont(font_f); pane.add(add_mp_response4); /* Add constraints to add_mp_blank5, then add it to pane */ JLabel add_mp_blank5 = new JLabel(" "); buildConstraints(add_mp_constraints,0,7,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); add_mp_layout.setConstraints(add_mp_blank5,add_mp_constraints); add_mp_blank5.setFont(font_f); pane.add(add_mp_blank5); setContentPane(pane); repaint(); } void delete_mp(String selection) { /* This method deletes a new minor planet from mp_list. It reuses the existing pane, which must be cleared and retitled. */ int i = 0; pane.removeAll(); setTitle("Delete a minor planet"); /* Define a layout manager for the pane */ GridBagLayout delete_mp_layout = new GridBagLayout(); GridBagConstraints delete_mp_constraints = new GridBagConstraints(); pane.setLayout(delete_mp_layout); /* Set the font and color for the pane */ Font font_f = new Font("monospaced",Font.PLAIN,12); /* Delete the selected minor planet from mp_list, and write the updated list to disk */ mp.remove_minor_planet_from_list(selection); mp.write_mp_list_to_disk(); /* Add constraints to delete_mp_blank1, then add it to pane */ JLabel delete_mp_blank1 = new JLabel(" "); buildConstraints(delete_mp_constraints,0,0,1,1,50,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_blank1,delete_mp_constraints); delete_mp_blank1.setFont(font_f); pane.add(delete_mp_blank1); /* Add constraints to delete_mp_blank2, then add it to pane */ JLabel delete_mp_blank2 = new JLabel(" "); buildConstraints(delete_mp_constraints,1,0,1,1,50,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_blank2,delete_mp_constraints); delete_mp_blank2.setFont(font_f); pane.add(delete_mp_blank2); /* Add constraints to delete_mp_blank3, then add it to pane */ JLabel delete_mp_blank3 = new JLabel(" "); buildConstraints(delete_mp_constraints,0,1,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_blank3,delete_mp_constraints); delete_mp_blank3.setFont(font_f); pane.add(delete_mp_blank3); /* Add constraints to delete_mp_response1, then add it to pane */ JLabel delete_mp_response1 = new JLabel(("Minor planet " + selection + " has been deleted.")); buildConstraints(delete_mp_constraints,0,2,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_response1,delete_mp_constraints); delete_mp_response1.setFont(font_f); pane.add(delete_mp_response1); /* Add constraints to delete_mp_blank4, then add it to pane */ JLabel delete_mp_blank4 = new JLabel(" "); buildConstraints(delete_mp_constraints,0,3,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_blank4,delete_mp_constraints); delete_mp_blank4.setFont(font_f); pane.add(delete_mp_blank4); /* Add constraints to delete_mp_blank6, then add it to pane */ JLabel delete_mp_blank6 = new JLabel(" "); buildConstraints(delete_mp_constraints,0,4,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_blank6,delete_mp_constraints); delete_mp_blank6.setFont(font_f); pane.add(delete_mp_blank6); /* Add constraints to delete_mp_b1, add a listener, then add it to pane */ buildConstraints(delete_mp_constraints,0,5,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.EAST); delete_mp_layout.setConstraints(delete_mp_b1,delete_mp_constraints); delete_mp_b1.addActionListener(this); delete_mp_b1.setFont(font_f); pane.add(delete_mp_b1); /* Add constraints to delete_mp_response3, then add it to pane */ JLabel delete_mp_response3 = new JLabel((" Return to the Level One Menu")); buildConstraints(delete_mp_constraints,1,5,1,1,0,14,GridBagConstraints.NONE,GridBagConstraints.WEST); delete_mp_layout.setConstraints(delete_mp_response3,delete_mp_constraints); delete_mp_response3.setFont(font_f); pane.add(delete_mp_response3); /* Add constraints to delete_mp_blank5, then add it to pane */ JLabel delete_mp_blank5 = new JLabel(" "); buildConstraints(delete_mp_constraints,0,6,2,1,0,14,GridBagConstraints.NONE,GridBagConstraints.CENTER); delete_mp_layout.setConstraints(delete_mp_blank5,delete_mp_constraints); delete_mp_blank5.setFont(font_f); pane.add(delete_mp_blank5); setContentPane(pane); repaint(); } void edit_mp(String selection) { /* This method provides choices for editing the mp.current_minor_planet. It reuses the existing pane, which must be cleared and retitled. */ int i = 0, j = 0, k = 0; pane.removeAll(); setTitle("Level Two Menu - minor planet " + mp.current_minor_planet); /* Define a layout manager for the pane */ GridBagLayout edit_mp_layout = new GridBagLayout(); GridBagConstraints edit_mp_constraints = new GridBagConstraints(); pane.setLayout(edit_mp_layout); /* Set the font and color for the pane */ Font font_f = new Font("monospaced",Font.PLAIN,12); /* Before reading the data file of the selected minor planet, clear all attribute variables. For instance, if we have been working on a minor planet with a great many observations, and then move to a new minor planet with few or no observations, the later observations of the previous minor planet will remain in the arrays. More seriously, if the new minor planet does not yet have a calculated orbit, it will "inherit" the state vector of the previous minor planet. By clearing all attribute variables before reading the data file, we preserve the integrity of each minor planet's data. */ mp.comet_identifier = false; mp.epoch_time = 0.0; for (j=0;j<=3;j++) { mp.epoch_r[j] = 0.0; mp.epoch_rprime[j] = 0.0; mp.A1_A2_DT[j] = 0.0; } for (j=1;j<=8;j++) { for (k=1;k<=8;k++) mp.big_p[j][k] = 0.0; } mp.absolute_magnitude_H = 0; mp.slope_parameter_G = 0; mp.comet_absolute_magnitude = 0; mp.comet_slope_parameter = 0; mp.number_of_optical_observations = 0; mp.number_of_delay_observations = 0; mp.number_of_doppler_observations = 0; for (i=0;i<=8000;i++) { mp.observation_type[i] = 0; mp.incremental_state_vector_epoch[i] = 0.0; for (j=1;j<=3;j++) { mp.incremental_state_vector_r[i][j] = 0.0; mp.incremental_state_vector_rprime[i][j] = 0.0; } mp.optical_ra[i] = 0.0; mp.ra_dev[i] = 0.0; mp.optical_dec[i] = 0.0; mp.dec_dev[i] = 0.0; mp.optical_time[i] = 0.0; mp.visual_magnitude[i] = 0; mp.visual_magnitude_dev[i] = 0; mp.observation_geocentric[i] = false; mp.observation_latitude[i] = 0.0; mp.observation_longitude[i] = 0.0; mp.observation_altitude[i] = 0.0; for (j=1;j<=7;j++) mp.observation_EOP[i][j] = 0.0; for (j=1;j<=3;j++) { mp.observation_r[i][j] = 0.0; mp.observation_rprime[i][j] = 0.0; } mp.radar_delay[i] = 0.0; mp.delay_dev[i] = 0.0; mp.radar_delay_receiver_time[i] = 0.0; mp.radar_delay_receiver_latitude[i] = 0.0; mp.radar_delay_receiver_longitude[i] = 0.0; mp.radar_delay_receiver_altitude[i] = 0.0; for (j=1;j<=7;j++) mp.radar_delay_receiver_EOP[i][j] = 0.0; mp.radar_delay_receiver_tdb_minus_utc[i] = 0.0; for (j=1;j<=3;j++) { mp.radar_delay_receiver_r[i][j] = 0.0; mp.radar_delay_receiver_rprime[i][j] = 0.0; } mp.radar_delay_transmitter_latitude[i] = 0.0; mp.radar_delay_transmitter_longitude[i] = 0.0; mp.radar_delay_transmitter_altitude[i] = 0.0; for (j=1;j<=7;j++) mp.radar_delay_transmitter_EOP[i][j] = 0.0; mp.radar_delay_transmitter_tdb_minus_utc[i] = 0.0; mp.radar_delay_transmitter_frequency[i] = 0.0; mp.radar_doppler[i] = 0.0; mp.doppler_dev[i] = 0.0; mp.radar_doppler_receiver_time[i] = 0.0; mp.radar_doppler_receiver_latitude[i] = 0.0; mp.radar_doppler_receiver_longitude[i] = 0.0; mp.radar_doppler_receiver_altitude[i] = 0.0; for (j=1;j<=7;j++) mp.radar_doppler_receiver_EOP[i][j] = 0.0; mp.radar_doppler_receiver_tdb_minus_utc[i] = 0.0; for (j=1;j<=3;j++) { mp.radar_doppler_receiver_r[i][j] = 0.0; mp.radar_doppler_receiver_rprime[i][j] = 0.0; } mp.radar_doppler_transmitter_latitude[i] = 0.0; mp.radar_doppler_transmitter_longitude[i] = 0.0; mp.radar_doppler_transmitter_altitude[i] = 0.0; for (j=1;j<=7;j++) mp.radar_doppler_transmitter_EOP[i][j] = 0.0; mp.radar_doppler_transmitter_tdb_minus_utc[i] = 0.0; mp.radar_doppler_transmitter_frequency[i] = 0.0; } mp.minor_planet_radius = 0.0; /* The selected minor planet has already been made the current_minor_planet; read that minor planet's data from disk */ mp.read_data_from_disk(selection); /* Add constraints to edit_mp_b11, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,0,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b11,edit_mp_constraints); edit_mp_b11.addActionListener(this); edit_mp_b11.setFont(font_f); pane.add(edit_mp_b11); /* Add constraints to edit_mp_selection11, then add it to pane */ JLabel edit_mp_selection11 = new JLabel((" Designate " + mp.current_minor_planet + " as comet or asteroid")); buildConstraints(edit_mp_constraints,1,0,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection11,edit_mp_constraints); edit_mp_selection11.setFont(font_f); pane.add(edit_mp_selection11); /* Add constraints to edit_mp_b1, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,1,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b1,edit_mp_constraints); edit_mp_b1.addActionListener(this); edit_mp_b1.setFont(font_f); pane.add(edit_mp_b1); /* Add constraints to edit_mp_selection1, then add it to pane */ JLabel edit_mp_selection1 = new JLabel((" Add a new observation")); buildConstraints(edit_mp_constraints,1,1,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection1,edit_mp_constraints); edit_mp_selection1.setFont(font_f); pane.add(edit_mp_selection1); /* Add constraints to edit_mp_b2, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,2,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b2,edit_mp_constraints); edit_mp_b2.addActionListener(this); edit_mp_b2.setFont(font_f); pane.add(edit_mp_b2); /* Add constraints to edit_mp_selection2, then add it to pane */ JLabel edit_mp_selection2 = new JLabel((" Review/Delete existing observations")); buildConstraints(edit_mp_constraints,1,2,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection2,edit_mp_constraints); edit_mp_selection2.setFont(font_f); pane.add(edit_mp_selection2); /* Add constraints to edit_mp_b3, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,3,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b3,edit_mp_constraints); edit_mp_b3.addActionListener(this); edit_mp_b3.setFont(font_f); pane.add(edit_mp_b3); /* Add constraints to edit_mp_selection3, then add it to pane */ JLabel edit_mp_selection3 = new JLabel((" Compute/Evaluate/Propogate the orbit of this minor planet")); buildConstraints(edit_mp_constraints,1,3,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection3,edit_mp_constraints); edit_mp_selection3.setFont(font_f); pane.add(edit_mp_selection3); /* Add constraints to edit_mp_b4, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,4,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b4,edit_mp_constraints); edit_mp_b4.addActionListener(this); edit_mp_b4.setFont(font_f); pane.add(edit_mp_b4); /* Add constraints to edit_mp_selection4, then add it to pane */ JLabel edit_mp_selection4 = new JLabel((" Display current orbit")); buildConstraints(edit_mp_constraints,1,4,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection4,edit_mp_constraints); edit_mp_selection4.setFont(font_f); pane.add(edit_mp_selection4); /* Add constraints to edit_mp_b5, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,5,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b5,edit_mp_constraints); edit_mp_b5.addActionListener(this); edit_mp_b5.setFont(font_f); pane.add(edit_mp_b5); /* Add constraints to edit_mp_selection5, then add it to pane */ JLabel edit_mp_selection5 = new JLabel((" Manually specify an orbit for this minor planet")); buildConstraints(edit_mp_constraints,1,5,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection5,edit_mp_constraints); edit_mp_selection5.setFont(font_f); pane.add(edit_mp_selection5); /* Add constraints to edit_mp_b13, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,6,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b13,edit_mp_constraints); edit_mp_b13.addActionListener(this); edit_mp_b13.setFont(font_f); pane.add(edit_mp_b13); /* Add constraints to edit_mp_selection13, then add it to pane */ JLabel edit_mp_selection13 = new JLabel(" Import a minor planet from the MPCORBcr or COMET catalogs"); buildConstraints(edit_mp_constraints,1,6,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection13,edit_mp_constraints); edit_mp_selection13.setFont(font_f); pane.add(edit_mp_selection13); /* Add constraints to edit_mp_b12, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,7,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b12,edit_mp_constraints); edit_mp_b12.addActionListener(this); edit_mp_b12.setFont(font_f); pane.add(edit_mp_b12); /* Add constraints to edit_mp_selection12, then add it to pane */ JLabel edit_mp_selection12 = new JLabel((" Compare observations to positions of known minor planets")); buildConstraints(edit_mp_constraints,1,7,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection12,edit_mp_constraints); edit_mp_selection12.setFont(font_f); pane.add(edit_mp_selection12); /* Add constraints to edit_mp_b6, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,8,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b6,edit_mp_constraints); edit_mp_b6.addActionListener(this); edit_mp_b6.setFont(font_f); pane.add(edit_mp_b6); /* Add constraints to edit_mp_selection6, then add it to pane */ JLabel edit_mp_selection6 = new JLabel((" Generate an optical ephemeris")); buildConstraints(edit_mp_constraints,1,8,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection6,edit_mp_constraints); edit_mp_selection6.setFont(font_f); pane.add(edit_mp_selection6); /* Add constraints to edit_mp_b7, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,9,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b7,edit_mp_constraints); edit_mp_b7.addActionListener(this); edit_mp_b7.setFont(font_f); pane.add(edit_mp_b7); /* Add constraints to edit_mp_selection7, then add it to pane */ JLabel edit_mp_selection7 = new JLabel((" Check for collisions and/or near misses")); buildConstraints(edit_mp_constraints,1,9,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection7,edit_mp_constraints); edit_mp_selection7.setFont(font_f); pane.add(edit_mp_selection7); /* Add constraints to edit_mp_b8, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,10,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b8,edit_mp_constraints); edit_mp_b8.addActionListener(this); edit_mp_b8.setFont(font_f); pane.add(edit_mp_b8); /* Add constraints to edit_mp_selection8, then add it to pane */ JLabel edit_mp_selection8 = new JLabel((" Change the number of perturbing bodies for integrator")); buildConstraints(edit_mp_constraints,1,10,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection8,edit_mp_constraints); edit_mp_selection8.setFont(font_f); pane.add(edit_mp_selection8); /* Add constraints to edit_mp_b9, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,11,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b9,edit_mp_constraints); edit_mp_b9.addActionListener(this); edit_mp_b9.setFont(font_f); pane.add(edit_mp_b9); /* Add constraints to edit_mp_selection9, then add it to pane */ JLabel edit_mp_selection9 = new JLabel((" Specify the radius/visual brightness parameters")); buildConstraints(edit_mp_constraints,1,11,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection9,edit_mp_constraints); edit_mp_selection9.setFont(font_f); pane.add(edit_mp_selection9); /* Add constraints to edit_mp_blank3, then add it to pane */ JLabel edit_mp_blank3 = new JLabel(" "); buildConstraints(edit_mp_constraints,0,12,2,1,0,8,GridBagConstraints.NONE,GridBagConstraints.CENTER); edit_mp_layout.setConstraints(edit_mp_blank3,edit_mp_constraints); edit_mp_blank3.setFont(font_f); pane.add(edit_mp_blank3); /* Add constraints to edit_mp_b10, add a listener, then add it to pane */ buildConstraints(edit_mp_constraints,0,13,1,1,70,8,GridBagConstraints.NONE,GridBagConstraints.EAST); edit_mp_layout.setConstraints(edit_mp_b10,edit_mp_constraints); edit_mp_b10.addActionListener(this); edit_mp_b10.setFont(font_f); pane.add(edit_mp_b10); /* Add constraints to edit_mp_selection10, then add it to pane */ JLabel edit_mp_selection10 = new JLabel((" Return to the Level One Menu")); buildConstraints(edit_mp_constraints,1,13,1,1,30,8,GridBagConstraints.NONE,GridBagConstraints.WEST); edit_mp_layout.setConstraints(edit_mp_selection10,edit_mp_constraints); edit_mp_selection10.setFont(font_f); pane.add(edit_mp_selection10); /* Add constraints to edit_mp_blank4, then add it to pane */ JLabel edit_mp_blank4 = new JLabel(" "); buildConstraints(edit_mp_constraints,0,14,2,1,0,8,GridBagConstraints.NONE,GridBagConstraints.CENTER); edit_mp_layout.setConstraints(edit_mp_blank4,edit_mp_constraints); edit_mp_blank4.setFont(font_f); pane.add(edit_mp_blank4); setContentPane(pane); repaint(); } void add_obs() { /* This method allows the user to select between adding an optical or radar observation. It reuses the existing pane, which must be cleared and retitled. */ int i = 0; pane.removeAll(); setTitle("minor planet " + mp.current_minor_planet); /* Define a layout manager for the pane */ GridBagLayout add_obs_layout = new GridBagLayout(); GridBagConstraints add_obs_constraints = new GridBagConstraints(); pane.setLayout(add_obs_layout); /* Set the font and color for the pane */ Font font_f = new Font("monospaced",Font.PLAIN,12); /* Add constraints to add_obs_blank1, then add it to pane */ JLabel add_obs_blank1 = new JLabel(" "); buildConstraints(add_obs_constraints,0,0,1,1,60,14,GridBagConstraints.NONE,GridBagCo