GGroundPlotPanel

De Wiki
Aller à : navigation, rechercher

This widget exists since V1.8. It consists in plotting ground tracks above a planisphere represented by an image. To do this, we must:

  • create a GroundTrackDataProvider object in charge of reading tha dat in file(s)
  • then calling the GGroundPlotPanel object

The following example shows how to do it. In order to give an example with several ground tracks (here two) our GroundTrackDataProvider object will be in charge to read a single file then to store read data in two different coordinates list, the second one shifted by 90 degrees from the first one. To see détails of the openDbFile() and scanFile() methods, see specific Fichier:Genius-1.7-tutorials.zip.

    GroundTrackDataProvider prov = new GroundTrackDataProvider() {
 
        @Override
        public List<GCoordinatesData> getData(String fileName) {
          final ArrayList<GCoordinatesData> listOfData = new ArrayList<GCoordinatesData>();
 
          // Open, read and plot trajectory
          openDbFile(fileName);
          ArrayList<Double[]> data1 = scanFile(0, 0.);
          ArrayList<Double[]> data2 = scanFile(0, 90.); // 90 degrees shift
          listOfData.add(new GCoordinatesData("Nominal", data1, Color.RED, null, DEG180, DEG90));
          listOfData.add(new GCoordinatesData("Shifted", data2, Color.GREEN, null, DEG180, DEG90));
 
          return listOfData;
        }
    };
 
    plot = new GGroundPlotPanel(prov);

Then loading data from a file including latitude/longitude, you may obtain this result:


GGroundPlotPanel1.png