import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.PixelGrabber;

public class Class179 {

   int anInt2165;
   static final String aString2166 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ÄËÏÖÜäëïöüÿßÁÀÉÈÍÌÓÒÚÙáàéèíìóòúùÂÊÎÔÛâêîôûÆæãÃõÕçÇ";
   static int[] anIntArray2167 = new int[256];
   boolean aBool2168 = false;
   Class171[] aClass171Array2169;
   int[] anIntArray2170;
   int[] anIntArray2171 = new int[4];
   int anInt2172;
   static int anInt2173 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ÄËÏÖÜäëïöüÿßÁÀÉÈÍÌÓÒÚÙáàéèíìóòúùÂÊÎÔÛâêîôûÆæãÃõÕçÇ".length();


   void method3167(Class545 var1, String var2, int var3, int var4, int var5, boolean var6) {
      int var7 = this.method3171(var2) / 2;
      var1.qa(this.anIntArray2171);
      if(var3 - var7 <= this.anIntArray2171[2]) {
         if(var3 + var7 >= this.anIntArray2171[0]) {
            if(var4 - this.anInt2165 <= this.anIntArray2171[3]) {
               if(var4 + this.anInt2172 >= this.anIntArray2171[1]) {
                  this.method3173(var1, var2, this.anIntArray2171, var3 - var7, var4, var5, var6);
               }
            }
         }
      }
   }

   int method3168() {
      return this.anInt2172 - 1;
   }

   int method3169() {
      return this.anInt2165;
   }

   int method3170() {
      return this.anInt2172 - 1;
   }

   int method3171(String var1) {
      int var2 = 0;

      for(int var3 = 0; var3 < var1.length(); ++var3) {
         int var4 = anIntArray2167[var1.charAt(var3)];
         var2 += this.anIntArray2170[var4];
      }

      return var2;
   }

   int method3172(String var1) {
      int var2 = 0;

      for(int var3 = 0; var3 < var1.length(); ++var3) {
         int var4 = anIntArray2167[var1.charAt(var3)];
         var2 += this.anIntArray2170[var4];
      }

      return var2;
   }

   void method3173(Class545 var1, String var2, int[] var3, int var4, int var5, int var6, boolean var7) {
      if(var6 == 0) {
         var7 = false;
      }

      var6 |= -16777216;

      for(int var8 = 0; var8 < var2.length(); ++var8) {
         int var9 = anIntArray2167[var2.charAt(var8)];
         if(var7) {
            this.aClass171Array2169[var9].method2927(var4 + 1, var5 + 1, 0, -16777216, 1);
         }

         this.aClass171Array2169[var9].method2927(var4, var5, 0, var6, 1);
         var4 += this.anIntArray2170[var9];
      }

   }

   static {
      for(int var0 = 0; var0 < 256; ++var0) {
         int var1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ÄËÏÖÜäëïöüÿßÁÀÉÈÍÌÓÒÚÙáàéèíìóòúùÂÊÎÔÛâêîôûÆæãÃõÕçÇ".indexOf(var0);
         if(var1 == -1) {
            var1 = 74;
         }

         anIntArray2167[var0] = var1;
      }

   }

   int method3174(String var1) {
      int var2 = 0;

      for(int var3 = 0; var3 < var1.length(); ++var3) {
         int var4 = anIntArray2167[var1.charAt(var3)];
         var2 += this.anIntArray2170[var4];
      }

      return var2;
   }

   int method3175() {
      return this.anInt2165;
   }

   int method3176() {
      return this.anInt2165;
   }

   void method3177(Class545 var1, String var2, int var3, int var4, int var5, boolean var6) {
      int var7 = this.method3171(var2) / 2;
      var1.qa(this.anIntArray2171);
      if(var3 - var7 <= this.anIntArray2171[2]) {
         if(var3 + var7 >= this.anIntArray2171[0]) {
            if(var4 - this.anInt2165 <= this.anIntArray2171[3]) {
               if(var4 + this.anInt2172 >= this.anIntArray2171[1]) {
                  this.method3173(var1, var2, this.anIntArray2171, var3 - var7, var4, var5, var6);
               }
            }
         }
      }
   }

   int method3178() {
      return this.anInt2165;
   }

   int method3179() {
      return this.anInt2172 - 1;
   }

   int method3180(String var1) {
      int var2 = 0;

      for(int var3 = 0; var3 < var1.length(); ++var3) {
         int var4 = anIntArray2167[var1.charAt(var3)];
         var2 += this.anIntArray2170[var4];
      }

      return var2;
   }

   void method3181(Class545 var1, Font var2, FontMetrics var3, char var4, int var5, boolean var6) {
      int var7 = var3.charWidth(var4);
      int var8 = var7;
      if(var6) {
         try {
            if(var4 == 47) {
               var6 = false;
            }

            if(var4 == 102 || var4 == 116 || var4 == 119 || var4 == 118 || var4 == 107 || var4 == 120 || var4 == 121 || var4 == 65 || var4 == 86 || var4 == 87) {
               ++var7;
            }
         } catch (Exception var21) {
            ;
         }
      }

      int var9 = var3.getMaxAscent();
      int var10 = var3.getMaxAscent() + var3.getMaxDescent();
      int var11 = var3.getHeight();
      Image var12 = Class572.aCanvas7591.createImage(var7, var10);
      Graphics var13 = var12.getGraphics();
      var13.setColor(Color.black);
      var13.fillRect(0, 0, var7, var10);
      var13.setColor(Color.white);
      var13.setFont(var2);
      var13.drawString(var4 + "", 0, var9);
      if(var6) {
         var13.drawString(var4 + "", 1, var9);
      }

      int[] var14 = new int[var7 * var10];
      PixelGrabber var15 = new PixelGrabber(var12, 0, 0, var7, var10, var14, 0, var7);

      try {
         var15.grabPixels();
      } catch (Exception var20) {
         ;
      }

      var12.flush();
      var12 = null;
      int var16 = 0;

      int var17;
      label62:
      for(var17 = 0; var17 < var10; ++var17) {
         for(int var18 = 0; var18 < var7; ++var18) {
            int var19 = var14[var18 + var17 * var7];
            if((var19 & 16777215) != 0) {
               var16 = var17;
               break label62;
            }
         }
      }

      for(var17 = 0; var17 < var14.length; ++var17) {
         if((var14[var17] & 16777215) == 0) {
            var14[var17] = 0;
         }
      }

      this.anInt2165 = var9 - var16;
      this.anInt2172 = var11;
      this.anIntArray2170[var5] = var8;
      this.aClass171Array2169[var5] = var1.method11599(var14, 0, var7, var7, var10, 98312473);
   }

   void method3182(Class545 var1, String var2, int var3, int var4, int var5, boolean var6) {
      int var7 = this.method3171(var2) / 2;
      var1.qa(this.anIntArray2171);
      if(var3 - var7 <= this.anIntArray2171[2]) {
         if(var3 + var7 >= this.anIntArray2171[0]) {
            if(var4 - this.anInt2165 <= this.anIntArray2171[3]) {
               if(var4 + this.anInt2172 >= this.anIntArray2171[1]) {
                  this.method3173(var1, var2, this.anIntArray2171, var3 - var7, var4, var5, var6);
               }
            }
         }
      }
   }

   Class179(Class545 var1, int var2, boolean var3, Component var4) {
      this.aBool2168 = false;
      this.aClass171Array2169 = new Class171[256];
      this.anIntArray2170 = new int[256];
      Font var5 = new Font("Helvetica", var3?1:0, var2);
      FontMetrics var6 = var4.getFontMetrics(var5);

      int var7;
      for(var7 = 0; var7 < anInt2173; ++var7) {
         this.method3181(var1, var5, var6, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ÄËÏÖÜäëïöüÿßÁÀÉÈÍÌÓÒÚÙáàéèíìóòúùÂÊÎÔÛâêîôûÆæãÃõÕçÇ".charAt(var7), var7, false);
      }

      if(var3 && this.aBool2168) {
         this.aBool2168 = false;
         var5 = new Font("Helvetica", 0, var2);
         var6 = var4.getFontMetrics(var5);

         for(var7 = 0; var7 < anInt2173; ++var7) {
            this.method3181(var1, var5, var6, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ÄËÏÖÜäëïöüÿßÁÀÉÈÍÌÓÒÚÙáàéèíìóòúùÂÊÎÔÛâêîôûÆæãÃõÕçÇ".charAt(var7), var7, false);
         }

         if(!this.aBool2168) {
            this.aBool2168 = false;

            for(var7 = 0; var7 < anInt2173; ++var7) {
               this.method3181(var1, var5, var6, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ÄËÏÖÜäëïöüÿßÁÀÉÈÍÌÓÒÚÙáàéèíìóòúùÂÊÎÔÛâêîôûÆæãÃõÕçÇ".charAt(var7), var7, true);
            }
         }
      }

   }

   void method3183(Class545 var1, String var2, int var3, int var4, int var5, boolean var6) {
      int var7 = this.method3171(var2) / 2;
      var1.qa(this.anIntArray2171);
      if(var3 - var7 <= this.anIntArray2171[2]) {
         if(var3 + var7 >= this.anIntArray2171[0]) {
            if(var4 - this.anInt2165 <= this.anIntArray2171[3]) {
               if(var4 + this.anInt2172 >= this.anIntArray2171[1]) {
                  this.method3173(var1, var2, this.anIntArray2171, var3 - var7, var4, var5, var6);
               }
            }
         }
      }
   }

   void method3184(Class545 var1, String var2, int[] var3, int var4, int var5, int var6, boolean var7) {
      if(var6 == 0) {
         var7 = false;
      }

      var6 |= -16777216;

      for(int var8 = 0; var8 < var2.length(); ++var8) {
         int var9 = anIntArray2167[var2.charAt(var8)];
         if(var7) {
            this.aClass171Array2169[var9].method2927(var4 + 1, var5 + 1, 0, -16777216, 1);
         }

         this.aClass171Array2169[var9].method2927(var4, var5, 0, var6, 1);
         var4 += this.anIntArray2170[var9];
      }

   }

   void method3185(Class545 var1, String var2, int var3, int var4, int var5, boolean var6) {
      int var7 = this.method3171(var2) / 2;
      var1.qa(this.anIntArray2171);
      if(var3 - var7 <= this.anIntArray2171[2]) {
         if(var3 + var7 >= this.anIntArray2171[0]) {
            if(var4 - this.anInt2165 <= this.anIntArray2171[3]) {
               if(var4 + this.anInt2172 >= this.anIntArray2171[1]) {
                  this.method3173(var1, var2, this.anIntArray2171, var3 - var7, var4, var5, var6);
               }
            }
         }
      }
   }

   int method3186() {
      return this.anInt2165;
   }

   void method3187(Class545 var1, String var2, int[] var3, int var4, int var5, int var6, boolean var7) {
      if(var6 == 0) {
         var7 = false;
      }

      var6 |= -16777216;

      for(int var8 = 0; var8 < var2.length(); ++var8) {
         int var9 = anIntArray2167[var2.charAt(var8)];
         if(var7) {
            this.aClass171Array2169[var9].method2927(var4 + 1, var5 + 1, 0, -16777216, 1);
         }

         this.aClass171Array2169[var9].method2927(var4, var5, 0, var6, 1);
         var4 += this.anIntArray2170[var9];
      }

   }
}
