Ejemplo n.º 1
0
    public void addEntry(AirspaceEntry entry) {
      entry.getEditor().addEditListener(this);
      this.getModel().addEntry(entry);
      this.updateShapeIntersection();

      this.getApp().getAirspaceLayer().addRenderable(entry.getAirspace());
      this.getApp().getWwd().redraw();
    }
Ejemplo n.º 2
0
 protected AirspaceEntry getEntryFor(Airspace airspace) {
   for (AirspaceEntry entry : this.getModel().getEntries()) {
     if (entry.getAirspace() == airspace) {
       return entry;
     }
   }
   return null;
 }
Ejemplo n.º 3
0
    public void removeEntry(AirspaceEntry entry) {
      entry.getEditor().removeEditListener(this);

      if (this.getSelectedEntry() == entry) {
        this.selectEntry(null, true);
      }

      this.getModel().removeEntry(entry);
      this.updateShapeIntersection();

      this.getApp().getAirspaceLayer().removeRenderable(entry.getAirspace());
      this.getApp().getWwd().redraw();
    }
Ejemplo n.º 4
0
    protected void updateShapeIntersection() {
      AirspaceEntry selected = this.getSelectedEntry();

      if (selected != null) {
        boolean hasIntersection = false;
        for (AirspaceEntry entry : this.getModel().getEntries()) {
          if (entry != selected) {
            boolean intersecting =
                this.areShapesIntersecting(entry.getAirspace(), selected.getAirspace());
            if (intersecting) hasIntersection = true;

            entry.setIntersecting(intersecting);
          }
        }

        selected.setIntersecting(hasIntersection);
      } else {
        for (AirspaceEntry entry : this.getModel().getEntries()) {
          entry.setIntersecting(false);
        }
      }
    }