Exemple #1
0
 private void addILSModelToRunway(ILSModel ilsModel, String runway) {
   for (int i = runwayAL.size() - 1; i >= 0; i--) {
     RunwayModel runwayModel = (RunwayModel) runwayAL.get(i);
     String runwayName = runwayModel.getNumber();
     if (runwayModel.getDesignator().length() > 0 && !runwayModel.getDesignator().equals("NONE"))
       runwayName =
           (new StringBuilder())
               .append(runwayName)
               .append(" ")
               .append(runwayModel.getDesignator())
               .toString();
     else if (runwayModel.getPrimaryDesignator().length() > 0
         && !runwayModel.getPrimaryDesignator().equals("NONE"))
       runwayName =
           (new StringBuilder())
               .append(runwayName)
               .append(" ")
               .append(runwayModel.getPrimaryDesignator())
               .toString();
     if (runway.equals(runwayName)) {
       runwayModel.addILSModel(ilsModel);
       return;
     }
   }
 }
Exemple #2
0
 public void addILSModel(ILSModel ilsModel) {
   int i = runwayAL.size() - 1;
   if (i >= 0) {
     RunwayModel runwayModel = (RunwayModel) runwayAL.get(i);
     String runwayName = runwayModel.getNumber();
     if (runwayModel.getDesignator().length() > 0 && !runwayModel.getDesignator().equals("NONE"))
       runwayName =
           (new StringBuilder())
               .append(runwayName)
               .append(" ")
               .append(runwayModel.getDesignator())
               .toString();
     else if (runwayModel.getPrimaryDesignator().length() > 0
         && !runwayModel.getPrimaryDesignator().equals("NONE"))
       runwayName =
           (new StringBuilder())
               .append(runwayName)
               .append(" ")
               .append(runwayModel.getPrimaryDesignator())
               .toString();
     ilsModel.setRunway(runwayName);
     runwayModel.addILSModel(ilsModel);
     return;
   } else {
     return;
   }
 }
Exemple #3
0
  public ArrayList getILSDMEModels() {
    ArrayList arrayList = new ArrayList();
    for (int i = runwayAL.size() - 1; i >= 0; i--) {
      RunwayModel runwayModel = (RunwayModel) runwayAL.get(i);
      for (int j = runwayModel.getILSAL().size() - 1; j >= 0; j--)
        if (((ILSModel) runwayModel.getILSAL().get(j)).getDMEModel() != null)
          arrayList.add(((ILSModel) runwayModel.getILSAL().get(j)).getDMEModel());
    }

    return arrayList;
  }
Exemple #4
0
 public void addRunwayModel(RunwayModel runwayModel) {
   if (!runwayAL.contains(runwayModel)) {
     runwayAL.add(runwayModel);
     runwayModel.addPropertyChangeListener(this);
     firePropertyChange(
         "RunwayAdded", new Integer(runwayAL.size() - 1), new Integer(runwayAL.size()));
   }
 }
Exemple #5
0
 public void addILSModelToRunway(ILSModel ilsModel, RunwayModel runwayModel, boolean primaryEnd) {
   ilsModel.setShouldNotify(false);
   int sizeLength = 0;
   if (runwayModel.getLengthMeasure().equals("M"))
     sizeLength = (int) ((runwayModel.getLength() * 3.28F + 2000F) * runwayModel.getScale());
   else sizeLength = (int) ((runwayModel.getLength() + 2000F) * runwayModel.getScale());
   java.awt.geom.Point2D.Float runwayCP =
       Utilities.getPixelsBetweenPoints(
           runwayModel.getCenterPoint().getLat(),
           runwayModel.getCenterPoint().getLon(),
           runwayModel.getLatLon().getLat(),
           runwayModel.getLatLon().getLon(),
           runwayModel.getScale());
   java.awt.geom.Point2D.Float ilsPoint =
       new java.awt.geom.Point2D.Float(
           (float) runwayCP.getX(),
           (float)
               (runwayCP.getY() - ((double) sizeLength / 2D) * (double) (primaryEnd ? 1 : -1)));
   ilsPoint = Utilities.rotatePoint(runwayCP, ilsPoint, runwayModel.getHeading());
   ilsModel.setLatLon(
       Utilities.getLatLonForPixel(
           runwayModel.getCenterPoint().getLat(),
           runwayModel.getCenterPoint().getLon(),
           ilsPoint.x,
           ilsPoint.y,
           runwayModel.getScale()));
   if (primaryEnd) ilsModel.setEnd("PRIMARY");
   else ilsModel.setEnd("SECONDARY");
   ilsModel.setAlt(runwayModel.getAlt());
   ilsModel.setAltMeasure(runwayModel.getAltMeasure());
   if (primaryEnd) {
     ilsModel.setHeading(runwayModel.getHeading());
   } else {
     float ilsHeading = runwayModel.getHeading() + 180F;
     if (ilsHeading >= 360F) ilsHeading -= 360F;
     ilsModel.setHeading(ilsHeading);
   }
   DMEModel dmeModel = new DMEModel();
   dmeModel.setShouldNotify(false);
   dmeModel.setLatLon((LatLonPoint) ilsModel.getLatLon().clone());
   dmeModel.setAlt(ilsModel.getAlt());
   dmeModel.setAltMeasure(ilsModel.getAltMeasure());
   dmeModel.setShouldNotify(true);
   ilsModel.setDMEModel(dmeModel);
   GlideSlopeModel glideSlopeModel = new GlideSlopeModel();
   glideSlopeModel.setShouldNotify(false);
   glideSlopeModel.setAlt(ilsModel.getAlt());
   glideSlopeModel.setAltMeasure(ilsModel.getAltMeasure());
   ilsModel.setGlideSlopeModel(glideSlopeModel);
   if (runwayModel.getLengthMeasure().equals("M"))
     sizeLength = (int) ((runwayModel.getLength() * 3.28F - 2000F) * runwayModel.getScale());
   else sizeLength = (int) ((runwayModel.getLength() - 2000F) * runwayModel.getScale());
   java.awt.geom.Point2D.Float glideSlopePoint =
       new java.awt.geom.Point2D.Float(
           (float) runwayCP.getX() - 350F * runwayModel.getScale() * (float) (primaryEnd ? 1 : -1),
           (float)
               (runwayCP.getY() - ((double) sizeLength / 2D) * (double) (primaryEnd ? -1 : 1)));
   glideSlopePoint = Utilities.rotatePoint(runwayCP, glideSlopePoint, runwayModel.getHeading());
   glideSlopeModel.setLatLon(
       Utilities.getLatLonForPixel(
           runwayModel.getCenterPoint().getLat(),
           runwayModel.getCenterPoint().getLon(),
           glideSlopePoint.x,
           glideSlopePoint.y,
           runwayModel.getScale()));
   glideSlopeModel.setShouldNotify(true);
   String runwayName = runwayModel.getNumber();
   if (runwayModel.getDesignator().length() > 0 && !runwayModel.getDesignator().equals("NONE"))
     runwayName =
         (new StringBuilder())
             .append(runwayName)
             .append(" ")
             .append(runwayModel.getDesignator())
             .toString();
   else if (runwayModel.getPrimaryDesignator().length() > 0
       && !runwayModel.getPrimaryDesignator().equals("NONE"))
     runwayName =
         (new StringBuilder())
             .append(runwayName)
             .append(" ")
             .append(runwayModel.getPrimaryDesignator())
             .toString();
   ilsModel.setRunway(runwayName);
   runwayModel.addILSModel(ilsModel);
   ilsModel.setShouldNotify(true);
 }
Exemple #6
0
 public void removeRunwayModel(RunwayModel runwayModel) {
   runwayAL.remove(runwayModel);
   runwayModel.removePropertyChangeListener(this);
   firePropertyChange(
       "RunwayRemoved", new Integer(runwayAL.size() + 1), new Integer(runwayAL.size()));
 }