Example #1
0
  public void draw(Graphics2D g, TaxiwaySection taxiway, AirportVisualisation a) {
    TaxiwayJoin start = null;
    TaxiwayJoin end = null;
    super.toggleQuality(a.quality);
    start = a.findTaxiwayStartJoin(taxiway);
    end = a.findTaxiwayEndJoin(taxiway);

    // First convert the start and end points of the section to JPanel friendly co-ordinates.
    Coord convStart = a.mapAxes(new Coord(start.joinX, start.joinY));
    Coord convEnd = a.mapAxes(new Coord(end.joinX, end.joinY));

    /*
     * Once we have the points, in order to draw the rectangle we need the length, width,
     * orientation, top left corner and rotation point of the taxiway, so that it can be
     * drawn.
     */
    Coord topLeft = a.mapAxes(a.taxiwayTopLeft(taxiway, new Coord(start.joinX, start.joinY)));
    double length = a.taxiwayLength(start, end);
    double orientation = a.taxiwayOrientation(convStart, convEnd);
    double width = taxiway.sectionWidth;

    g.rotate(-orientation, a.getScale() * convStart.x, a.getScale() * convStart.y);

    // Lights
    Color c = Color.GREEN;
    // drawLight(convStart.x-1.5, convStart.y, c, g, a.getScale());
    for (double i = convStart.y + 10; i <= convStart.y + length - 10; i += 10) { // c = Color.GREEN;
      // drawLight(convStart.x-1, i, c, g, a.getScale());  // centrelights
      c = Color.BLUE;
      drawLight(convStart.x - 1 - width / 2, i, c, g, a.getScale()); // edgelights
      drawLight(convStart.x - 1 + width / 2, i, c, g, a.getScale()); // edgelights
    }
    // endLights

    g.rotate(orientation, a.getScale() * convStart.x, a.getScale() * convStart.y);
  }
Example #2
0
 public void specular(float r, float g, float b, float a) {
   lighting.specular(r, g, b, a);
 }
Example #3
0
 public void attenuation(float k0, float k1, float k2) {
   lighting.attenuation(k0, k1, k2);
 }
Example #4
0
 public void ambient(float r, float g, float b, float a) {
   lighting.ambient(r, g, b, a);
 }
Example #5
0
 public void diffuse(float r, float g, float b, float a) {
   lighting.diffuse(r, g, b, a);
 }
Example #6
0
 public void position(float x, float y, float z) {
   lighting.lightPosition(x, y, z, 1.0f);
 }
Example #7
0
 @Override
 public void destroy() throws Exception {
   lighting.destroy();
 }
Example #8
0
 @Override
 public void recover() throws Exception {
   lighting.recover();
 }
Example #9
0
 @Override
 public void use() throws Exception {
   lighting.use();
 }
Example #10
0
 @Override
 public void create() throws Exception {
   lighting.create();
 }