package com.google.android.m4b.maps.bu;

import android.graphics.Bitmap;
import com.google.android.m4b.maps.j.b;
import com.google.android.m4b.maps.model.GroundOverlayOptions;
import com.google.android.m4b.maps.model.LatLng;
import com.google.android.m4b.maps.model.LatLngBounds;
import com.google.android.m4b.maps.model.internal.BitmapDescriptorParcelable;
import com.google.android.m4b.maps.model.internal.IGroundOverlayDelegate;
import com.google.android.m4b.maps.model.internal.IGroundOverlayDelegate.Stub;
import com.google.common.base.Preconditions;
import java.util.concurrent.atomic.AtomicInteger;

public final class v extends IGroundOverlayDelegate.Stub
  implements bf.a
{
  private static final GroundOverlayOptions a = new GroundOverlayOptions();
  private static AtomicInteger w = new AtomicInteger(0);
  private final String b;
  private final bf c;
  private final cb d;
  private LatLngBounds e;
  private float f;
  private float g;
  private LatLng h;
  private float i;
  private int j;
  private int k;
  private e l;
  private float m;
  private a n;
  private float o;
  private float p;
  private final f q;
  private d r;
  private float s;
  private boolean t;
  private boolean u;
  private by v;

  public v(GroundOverlayOptions paramGroundOverlayOptions, bf parambf, f paramf, d paramd, cb paramcb, by paramby)
  {
    this.c = ((bf)Preconditions.checkNotNull(parambf));
    this.d = ((cb)Preconditions.checkNotNull(paramcb));
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(w.getAndIncrement());
    this.b = String.format("go%d", arrayOfObject);
    this.q = paramf;
    this.r = paramd;
    this.v = paramby;
    boolean bool1;
    if (paramGroundOverlayOptions.getWidth() >= 0.0F)
    {
      bool1 = true;
      Preconditions.checkArgument(bool1, "line width is negative");
      if (paramGroundOverlayOptions.getImage() == null)
        break label382;
    }
    label382: for (boolean bool2 = true; ; bool2 = false)
    {
      Preconditions.checkArgument(bool2, "Options doesn't specify an image");
      this.o = paramGroundOverlayOptions.getAnchorU();
      this.p = paramGroundOverlayOptions.getAnchorV();
      this.t = paramGroundOverlayOptions.isVisible();
      this.s = paramGroundOverlayOptions.getZIndex();
      this.m = paramGroundOverlayOptions.getTransparency();
      this.l = e.a(paramGroundOverlayOptions.getImage());
      this.q.a(this.l);
      this.j = this.q.b(this.l).c().getHeight();
      this.k = this.q.b(this.l).c().getWidth();
      boolean bool3;
      if (paramGroundOverlayOptions.getLocation() == null)
      {
        LatLngBounds localLatLngBounds = paramGroundOverlayOptions.getBounds();
        bool3 = false;
        if (localLatLngBounds == null);
      }
      else
      {
        bool3 = true;
      }
      Preconditions.checkArgument(bool3, "Options doesn't specify a position");
      if (paramGroundOverlayOptions.getBounds() == null)
        break label388;
      this.e = paramGroundOverlayOptions.getBounds();
      j();
      this.i = paramGroundOverlayOptions.getBearing();
      if (paramGroundOverlayOptions.getBearing() != a.getBearing())
        this.d.b(cb.a.aa);
      if (paramGroundOverlayOptions.getTransparency() != a.getTransparency())
        this.d.b(cb.a.af);
      if (paramGroundOverlayOptions.isVisible() != a.isVisible())
        this.d.b(cb.a.ae);
      if (paramGroundOverlayOptions.getZIndex() != a.getZIndex())
        this.d.b(cb.a.ad);
      return;
      bool1 = false;
      break;
    }
    label388: this.h = paramGroundOverlayOptions.getLocation();
    this.f = paramGroundOverlayOptions.getWidth();
    if (paramGroundOverlayOptions.getHeight() != -1.0F);
    for (float f1 = paramGroundOverlayOptions.getHeight(); ; f1 = this.j / this.k * this.f)
    {
      this.g = f1;
      k();
      break;
    }
  }

  private void a(int paramInt)
  {
    try
    {
      if (this.u);
      do
        return;
      while (this.n == null);
      this.n.a(paramInt);
      return;
    }
    finally
    {
    }
  }

  private void j()
  {
    LatLngBounds localLatLngBounds1 = this.e;
    double d1 = localLatLngBounds1.northeast.latitude;
    double d2 = localLatLngBounds1.southwest.latitude;
    double d3 = localLatLngBounds1.northeast.longitude;
    double d4 = localLatLngBounds1.southwest.longitude;
    if (d3 < d4)
      d3 += 360.0D;
    float f1 = this.o;
    float f2 = this.p;
    this.h = new LatLng(d1 * (1.0F - f2) + d2 * f2, d4 * (1.0F - f1) + d3 * f1);
    LatLngBounds localLatLngBounds2 = this.e;
    LatLng localLatLng = this.h;
    double d5 = q.a(localLatLngBounds2.northeast.longitude, localLatLngBounds2.southwest.longitude);
    this.f = ((float)(Math.cos(Math.toRadians(localLatLng.latitude)) * (6371009.0D * Math.toRadians(d5))));
    LatLngBounds localLatLngBounds3 = this.e;
    this.g = ((float)(6371009.0D * Math.toRadians(localLatLngBounds3.northeast.latitude - localLatLngBounds3.southwest.latitude)));
  }

  private void k()
  {
    double d1 = q.a(this.h, this.f);
    double d2 = q.a(this.g);
    double d3 = this.h.latitude + d2 * this.p;
    double d4 = this.h.latitude - d2 * (1.0F - this.p);
    double d5 = this.h.longitude + d1 * (1.0F - this.o);
    this.e = new LatLngBounds(new LatLng(d4, this.h.longitude - d1 * this.o), new LatLng(d3, d5));
  }

  public final void a()
  {
    if (this.n != null)
      this.n.a();
    try
    {
      this.u = true;
      this.q.c(this.l);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void a(a parama)
  {
    this.n = parama;
  }

  public final float b()
  {
    try
    {
      float f1 = this.i;
      return f1;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final LatLngBounds c()
  {
    return this.e;
  }

  public final float d()
  {
    try
    {
      float f1 = this.o;
      return f1;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final float e()
  {
    try
    {
      float f1 = this.p;
      return f1;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final boolean equalsRemote(IGroundOverlayDelegate paramIGroundOverlayDelegate)
  {
    return equals(paramIGroundOverlayDelegate);
  }

  public final float f()
  {
    try
    {
      float f1 = this.m;
      return f1;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final float g()
  {
    return this.s;
  }

  public final float getBearing()
  {
    this.v.a();
    return b();
  }

  public final LatLngBounds getBounds()
  {
    try
    {
      this.v.a();
      LatLngBounds localLatLngBounds = this.e;
      return localLatLngBounds;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final float getHeight()
  {
    this.v.a();
    return this.g;
  }

  public final String getId()
  {
    return this.b;
  }

  public final LatLng getPosition()
  {
    this.v.a();
    return this.h;
  }

  public final float getTransparency()
  {
    this.v.a();
    return f();
  }

  public final float getWidth()
  {
    this.v.a();
    return this.f;
  }

  public final float getZIndex()
  {
    this.v.a();
    return this.s;
  }

  public final boolean h()
  {
    try
    {
      boolean bool = this.t;
      return bool;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final int hashCodeRemote()
  {
    return hashCode();
  }

  public final f.a i()
  {
    try
    {
      f.a locala = this.q.b(this.l);
      return locala;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final boolean isVisible()
  {
    this.v.a();
    return h();
  }

  public final void remove()
  {
    this.v.a();
    this.d.b(cb.a.Z);
    a();
    this.c.b(this);
  }

  public final void setBearing(float paramFloat)
  {
    this.v.a();
    this.d.b(cb.a.aa);
    try
    {
      this.i = paramFloat;
      a(1);
      return;
    }
    finally
    {
    }
  }

  public final void setDimensions(float paramFloat)
  {
    setDimensionsWithHeight(paramFloat, -1.0F);
  }

  public final void setDimensionsWithHeight(float paramFloat1, float paramFloat2)
  {
    this.v.a();
    this.d.b(cb.a.ab);
    try
    {
      this.f = paramFloat1;
      if (paramFloat2 != -1.0F);
      while (true)
      {
        this.g = paramFloat2;
        k();
        a(2);
        return;
        float f1 = this.j;
        int i1 = this.k;
        paramFloat2 = paramFloat1 * (f1 / i1);
      }
    }
    finally
    {
    }
  }

  public final void setImage(b paramb)
  {
    this.v.a();
    this.d.b(cb.a.ag);
    try
    {
      this.q.c(this.l);
      this.l = e.a(paramb);
      this.q.a(this.l);
      this.j = this.q.b(this.l).c().getHeight();
      this.k = this.q.b(this.l).c().getWidth();
      a(4);
      return;
    }
    finally
    {
    }
  }

  public final void setImage2(BitmapDescriptorParcelable paramBitmapDescriptorParcelable)
  {
    this.v.a();
    setImage(this.r.a(paramBitmapDescriptorParcelable));
  }

  public final void setPosition(LatLng paramLatLng)
  {
    this.v.a();
    this.d.b(cb.a.ac);
    try
    {
      this.h = paramLatLng;
      k();
      a(16);
      return;
    }
    finally
    {
    }
  }

  public final void setPositionFromBounds(LatLngBounds paramLatLngBounds)
  {
    this.v.a();
    try
    {
      this.e = paramLatLngBounds;
      j();
      a(16);
      return;
    }
    finally
    {
    }
  }

  public final void setTransparency(float paramFloat)
  {
    this.v.a();
    this.d.b(cb.a.af);
    boolean bool;
    if ((paramFloat >= 0.0F) && (paramFloat <= 1.0F))
      bool = true;
    while (true)
    {
      Preconditions.checkArgument(bool, "Transparency must be in the range [0..1]");
      try
      {
        this.m = paramFloat;
        return;
        bool = false;
      }
      finally
      {
      }
    }
  }

  public final void setVisible(boolean paramBoolean)
  {
    this.v.a();
    this.d.b(cb.a.ae);
    try
    {
      this.t = paramBoolean;
      a(32);
      return;
    }
    finally
    {
    }
  }

  public final void setZIndex(float paramFloat)
  {
    this.v.a();
    this.d.b(cb.a.ad);
    this.s = paramFloat;
    a(8);
  }

  public static abstract interface a
  {
    public abstract void a();

    public abstract void a(int paramInt);
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bu.v
 * JD-Core Version:    0.6.2
 */