home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 183 / dpcs0503.iso / Extras / Content / Images / StockObjects / objects / java / coalesce / Coalesce.class (.txt) next >
Encoding:
Java Class File  |  1998-10-22  |  16.8 KB  |  687 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Event;
  5. import java.awt.Font;
  6. import java.awt.FontMetrics;
  7. import java.awt.Graphics;
  8. import java.awt.Image;
  9. import java.awt.image.ImageObserver;
  10. import java.net.MalformedURLException;
  11. import java.net.URL;
  12. import java.util.Hashtable;
  13.  
  14. public class Coalesce extends Applet implements Runnable {
  15.    protected char[] separated;
  16.    protected char[][] separateda;
  17.    protected Thread StringThread;
  18.    protected int[] xlocation;
  19.    protected int[][] xlocationa;
  20.    protected int[] xwidth;
  21.    protected int[][] xwidtha;
  22.    protected boolean threadSuspended = false;
  23.    protected int chardelay;
  24.    protected int rundelay;
  25.    protected boolean endofstring = false;
  26.    protected int total_width;
  27.    protected int[] total_widtha;
  28.    protected boolean thread_running;
  29.    protected Color app_bg_color;
  30.    protected Image offScreen;
  31.    protected Graphics offGC;
  32.    protected int applet_width;
  33.    protected int applet_height;
  34.    protected int app_height;
  35.    protected int app_width;
  36.    protected String bgimage_file;
  37.    protected Image bgimage;
  38.    protected boolean tile;
  39.    protected int bgimage_height;
  40.    protected int bgimage_width;
  41.    protected Image tiled_bgimage;
  42.    protected Graphics bg_g;
  43.    // $FF: renamed from: tx java.lang.String
  44.    protected String field_0;
  45.    protected String[] txa;
  46.    protected int xoffset;
  47.    protected int yoffset;
  48.    protected Color textcolor;
  49.    protected boolean horizcenter;
  50.    protected boolean vertcenter;
  51.    protected Font font;
  52.    protected FontMetrics fontmetrics;
  53.    protected boolean underline;
  54.    protected int width;
  55.    protected int[] widtha;
  56.    protected int height;
  57.    protected int ascent;
  58.    protected int descent;
  59.    protected int txcount;
  60.    protected int Index;
  61.    protected int[] xval;
  62.    protected int[] yval;
  63.    protected boolean coalescing = true;
  64.    protected int steps;
  65.    Hashtable colors;
  66.  
  67.    public void init() {
  68.       this.app_bg_color = this.GetParmToColor("AppBGColor", (Color)null);
  69.       this.txcount = this.GetParmToInt("TextCount", 0);
  70.       this.field_0 = this.GetParmToString("Text", "");
  71.       this.xoffset = this.GetParmToInt("XOffset", 0);
  72.       this.yoffset = this.GetParmToInt("YOffset", -1);
  73.       this.textcolor = this.GetParmToColor("TextColor", (Color)null);
  74.       this.horizcenter = this.GetParmToBoolean("HorizCenter", false);
  75.       this.vertcenter = this.GetParmToBoolean("VertCenter", false);
  76.       this.font = this.GetParmToFont("Font", "Style", "PointSize");
  77.       if (this.txcount > 0) {
  78.          this.txa = new String[this.txcount];
  79.       }
  80.  
  81.       for(int var1 = 0; var1 < this.txcount; ++var1) {
  82.          this.txa[var1] = this.GetParmToString("Text" + (var1 + 1), "");
  83.       }
  84.  
  85.       this.chardelay = this.GetParmToInt("DelayBetweenChars", 20);
  86.       this.rundelay = this.GetParmToInt("DelayBetweenRuns", 3000);
  87.       this.tile = this.GetParmToBoolean("AppTile", false);
  88.       this.bgimage_file = this.GetParmToString("AppBGImage", (String)null);
  89.       if (this.bgimage_file != null) {
  90.          this.bgimage = this.process(((Applet)this).getDocumentBase(), this.bgimage_file, false);
  91.          this.prepareImage(this.bgimage);
  92.          this.bgimage_width = this.getWidth(this.bgimage, this);
  93.          this.bgimage_height = this.getHeight(this.bgimage, this);
  94.       }
  95.  
  96.       ((Component)this).setFont(this.font);
  97.       this.fontmetrics = ((Component)this).getFontMetrics(this.font);
  98.       this.width = this.fontmetrics.stringWidth(this.field_0);
  99.       this.height = this.fontmetrics.getHeight();
  100.       this.ascent = this.fontmetrics.getMaxAscent();
  101.       this.descent = this.fontmetrics.getDescent();
  102.       if (this.txcount > 0) {
  103.          this.widtha = new int[this.txcount];
  104.       }
  105.  
  106.       for(int var3 = 0; var3 < this.txcount; ++var3) {
  107.          this.widtha[var3] = this.fontmetrics.stringWidth(this.txa[var3]);
  108.       }
  109.  
  110.       if (this.app_bg_color != null) {
  111.          ((Component)this).setBackground(this.app_bg_color);
  112.       } else {
  113.          this.app_bg_color = ((Component)this).getBackground();
  114.       }
  115.  
  116.       if (this.textcolor != null) {
  117.          ((Component)this).setForeground(this.textcolor);
  118.       } else {
  119.          this.textcolor = ((Component)this).getForeground();
  120.       }
  121.  
  122.       this.separated = new char[this.field_0.length()];
  123.       this.xlocation = new int[this.field_0.length()];
  124.       this.xwidth = new int[this.field_0.length()];
  125.       if (this.txcount > 0) {
  126.          this.separateda = new char[this.txcount][];
  127.          this.xlocationa = new int[this.txcount][];
  128.          this.xwidtha = new int[this.txcount][];
  129.       }
  130.  
  131.       for(int var4 = 0; var4 < this.txcount; ++var4) {
  132.          this.separateda[var4] = new char[this.txa[var4].length()];
  133.          this.xlocationa[var4] = new int[this.txa[var4].length()];
  134.          this.xwidtha[var4] = new int[this.txa[var4].length()];
  135.          this.txa[var4].getChars(0, this.txa[var4].length(), this.separateda[var4], 0);
  136.       }
  137.  
  138.       this.field_0.getChars(0, this.field_0.length(), this.separated, 0);
  139.       if (this.txcount > 0) {
  140.          this.total_widtha = new int[this.txcount];
  141.       }
  142.  
  143.       for(int var5 = 0; var5 < this.txcount; ++var5) {
  144.          this.total_widtha[var5] = 0;
  145.       }
  146.  
  147.       for(int var6 = 0; var6 < this.txcount; ++var6) {
  148.          for(int var2 = 0; var2 < this.txa[var6].length(); ++var2) {
  149.             this.xwidtha[var6][var2] = this.fontmetrics.charWidth(this.separateda[var6][var2]);
  150.             int[] var10000 = this.total_widtha;
  151.             var10000[var6] += this.xwidtha[var6][var2];
  152.             if (var2 + 1 < this.txa[var6].length()) {
  153.                this.xlocationa[var6][var2 + 1] = this.total_widtha[var6];
  154.             }
  155.          }
  156.       }
  157.  
  158.       this.total_width = 0;
  159.  
  160.       for(int var7 = 0; var7 < this.field_0.length(); ++var7) {
  161.          this.xwidth[var7] = this.fontmetrics.charWidth(this.separated[var7]);
  162.          this.total_width += this.xwidth[var7];
  163.          if (var7 + 1 < this.field_0.length()) {
  164.             this.xlocation[var7 + 1] = this.total_width;
  165.          }
  166.       }
  167.  
  168.       this.offScreen = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
  169.       this.offGC = this.offScreen.getGraphics();
  170.       this.offGC.setFont(this.font);
  171.       this.steps = this.GetParmToInt("Steps", 50);
  172.       this.xval = new int[this.field_0.length()];
  173.       this.yval = new int[this.field_0.length()];
  174.       this.calc_new_random();
  175.    }
  176.  
  177.    public void paint(Graphics var1) {
  178.       if (this.applet_width != ((Component)this).size().width || this.applet_height != ((Component)this).size().height) {
  179.          this.applet_width = ((Component)this).size().width;
  180.          this.applet_height = ((Component)this).size().height;
  181.          this.offScreen = ((Component)this).createImage(this.applet_width, this.applet_height);
  182.          this.offGC = this.offScreen.getGraphics();
  183.          this.offGC.setFont(this.font);
  184.       }
  185.  
  186.       if (this.horizcenter) {
  187.          this.xoffset = ((Component)this).size().width / 2 - this.total_width / 2;
  188.       }
  189.  
  190.       if (this.vertcenter) {
  191.          this.yoffset = ((Component)this).size().height / 2 + this.ascent / 3;
  192.       } else if (this.yoffset == -1) {
  193.          this.yoffset = this.height - this.descent;
  194.       }
  195.  
  196.       this.offGC.setColor(((Component)this).getBackground());
  197.       this.offGC.fillRect(0, 0, this.applet_width, this.applet_height);
  198.       this.tilebackground(this.offGC);
  199.       if (this.Index == 0) {
  200.          this.offGC.setColor(((Component)this).getBackground());
  201.          this.offGC.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  202.       }
  203.  
  204.       this.offGC.setColor(((Component)this).getBackground());
  205.       this.offGC.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  206.       this.tilebackground(this.offGC);
  207.       this.offGC.setColor(((Component)this).getForeground());
  208.  
  209.       for(int var2 = 0; var2 < this.field_0.length(); ++var2) {
  210.          this.offGC.drawChars(this.separated, var2, 1, this.calcval(this.xval[var2], this.xoffset + this.xlocation[var2], this.Index, this.steps), this.calcval(this.yval[var2], this.yoffset, this.Index, this.steps));
  211.       }
  212.  
  213.       var1.drawImage(this.offScreen, 0, 0, this);
  214.    }
  215.  
  216.    public void run() {
  217.       while(this.StringThread != null) {
  218.          if (this.coalescing) {
  219.             ++this.Index;
  220.             if (this.Index > this.steps) {
  221.                this.Index = this.steps;
  222.                this.calc_new_random();
  223.                this.coalescing = false;
  224.                this.StringThread = null;
  225.             }
  226.          } else {
  227.             --this.Index;
  228.             if (this.Index < 0) {
  229.                this.Index = 0;
  230.                this.coalescing = true;
  231.                this.StringThread = null;
  232.             }
  233.          }
  234.  
  235.          ((Component)this).repaint();
  236.  
  237.          try {
  238.             Thread.sleep((long)this.chardelay);
  239.          } catch (InterruptedException var1) {
  240.          }
  241.       }
  242.  
  243.    }
  244.  
  245.    public int calcval(int var1, int var2, int var3, int var4) {
  246.       int var5;
  247.       if (var1 == var2) {
  248.          var5 = var1;
  249.       } else if (var1 > var2) {
  250.          var5 = var1 - (var1 - var2) * var3 / var4;
  251.       } else {
  252.          var5 = var1 + (var2 - var1) * var3 / var4;
  253.       }
  254.  
  255.       return var5;
  256.    }
  257.  
  258.    public synchronized boolean mouseEnter(Event var1, int var2, int var3) {
  259.       if (this.StringThread == null) {
  260.          this.StringThread = new Thread(this);
  261.          this.StringThread.start();
  262.       } else {
  263.          this.coalescing = true;
  264.       }
  265.  
  266.       return true;
  267.    }
  268.  
  269.    public synchronized boolean mouseExit(Event var1, int var2, int var3) {
  270.       if (this.StringThread == null) {
  271.          this.StringThread = new Thread(this);
  272.          this.StringThread.start();
  273.       } else {
  274.          this.coalescing = false;
  275.       }
  276.  
  277.       return true;
  278.    }
  279.  
  280.    public boolean keyDown(Event var1, int var2) {
  281.       if (var2 == 102) {
  282.          this.chardelay = (int)((double)this.chardelay * 0.9);
  283.          if (this.chardelay < 10) {
  284.             this.chardelay = 10;
  285.          }
  286.  
  287.          ((Applet)this).getAppletContext().showStatus("Setting image delay to: " + this.chardelay);
  288.       } else if (var2 == 115) {
  289.          if (this.chardelay < 10) {
  290.             ++this.chardelay;
  291.          } else {
  292.             this.chardelay = (int)((double)this.chardelay * 1.1);
  293.          }
  294.  
  295.          ((Applet)this).getAppletContext().showStatus("Setting image delay to: " + this.chardelay);
  296.       }
  297.  
  298.       return true;
  299.    }
  300.  
  301.    public void start() {
  302.       this.Index = 0;
  303.    }
  304.  
  305.    public void calc_new_random() {
  306.       for(int var1 = 0; var1 < this.field_0.length(); ++var1) {
  307.          this.xval[var1] = (int)(Math.random() * (double)1000.0F % (double)((Component)this).size().width);
  308.          this.yval[var1] = (int)(Math.random() * (double)1000.0F % (double)((Component)this).size().height);
  309.       }
  310.  
  311.    }
  312.  
  313.    public void update(Graphics var1) {
  314.       this.paint(var1);
  315.    }
  316.  
  317.    public void stop() {
  318.       if (this.StringThread != null) {
  319.          this.StringThread.stop();
  320.       }
  321.  
  322.       this.StringThread = null;
  323.    }
  324.  
  325.    protected void tilebackground(Graphics var1) {
  326.       if (this.bgimage != null) {
  327.          if (!this.isImagePrepared(this.bgimage)) {
  328.             this.loadImageAndWait(this.bgimage);
  329.          }
  330.  
  331.          if (this.app_width != ((Component)this).size().width || this.app_height != ((Component)this).size().height) {
  332.             this.app_width = ((Component)this).size().width;
  333.             this.app_height = ((Component)this).size().height;
  334.             this.tiled_bgimage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
  335.             this.bg_g = this.tiled_bgimage.getGraphics();
  336.             this.bg_g.setColor(this.app_bg_color);
  337.             this.bg_g.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  338.             if (this.tile) {
  339.                for(int var2 = -this.bgimage_height; var2 < this.app_height; var2 += this.bgimage_height) {
  340.                   for(int var3 = -this.bgimage_width; var3 < this.app_width; var3 += this.bgimage_width) {
  341.                      this.bg_g.drawImage(this.bgimage, var3 + 2, var2 + 2, this);
  342.                   }
  343.                }
  344.             } else {
  345.                this.bg_g.drawImage(this.bgimage, 0, 0, this);
  346.             }
  347.          }
  348.  
  349.          if (this.tiled_bgimage != null) {
  350.             var1.drawImage(this.tiled_bgimage, 0, 0, this);
  351.          }
  352.  
  353.       }
  354.    }
  355.  
  356.    public int GetParmToInt(String var1, int var2) {
  357.       String var3 = ((Applet)this).getParameter(var1);
  358.       return var3 == null ? var2 : Integer.parseInt(var3);
  359.    }
  360.  
  361.    public String GetParmToString(String var1, String var2) {
  362.       String var3 = ((Applet)this).getParameter(var1);
  363.       return var3 == null ? var2 : var3;
  364.    }
  365.  
  366.    public boolean GetParmToBoolean(String var1, boolean var2) {
  367.       String var3 = ((Applet)this).getParameter(var1);
  368.       return var3 == null ? var2 : var3.equalsIgnoreCase("true");
  369.    }
  370.  
  371.    public Color GetParmToColor(String var1, Color var2) {
  372.       String var4 = ((Applet)this).getParameter(var1);
  373.       if (var4 == null) {
  374.          return var2;
  375.       } else {
  376.          try {
  377.             if (var4.charAt(0) == '#') {
  378.                char[] var5 = new char[var4.length()];
  379.                var4.getChars(0, var4.length(), var5, 0);
  380.                new Color(Integer.parseInt(new String(var5, 1, var4.length() - 1), 16));
  381.                return new Color(Integer.parseInt(new String(var5, 1, var4.length() - 1), 16));
  382.             } else {
  383.                Color var3 = new Color(Integer.parseInt(var4, 16));
  384.                return var3;
  385.             }
  386.          } catch (NumberFormatException var7) {
  387.             String var6 = this.getColor(var4);
  388.             if (var6 != null) {
  389.                return new Color(Integer.parseInt(var6, 16));
  390.             } else {
  391.                System.out.println("Bad color specification: " + ((Throwable)var7).getMessage());
  392.                return null;
  393.             }
  394.          }
  395.       }
  396.    }
  397.  
  398.    public URL GetParmToURL(String var1) {
  399.       Object var2 = null;
  400.       String var3 = ((Applet)this).getParameter(var1);
  401.       if (var3 == null) {
  402.          return null;
  403.       } else {
  404.          try {
  405.             var7 = new URL(var3);
  406.          } catch (MalformedURLException var6) {
  407.             var7 = null;
  408.          }
  409.  
  410.          if (var7 == null) {
  411.             try {
  412.                var7 = new URL(((Applet)this).getDocumentBase(), var3);
  413.             } catch (MalformedURLException var5) {
  414.                var7 = null;
  415.             }
  416.          }
  417.  
  418.          if (var7 == null) {
  419.             try {
  420.                var7 = new URL(((Applet)this).getCodeBase(), var3);
  421.             } catch (MalformedURLException var4) {
  422.                var7 = null;
  423.             }
  424.          }
  425.  
  426.          if (var7 == null) {
  427.             System.out.println("Unable to load URL: " + var3);
  428.          }
  429.  
  430.          return var7;
  431.       }
  432.    }
  433.  
  434.    public Font GetParmToFont(String var1, String var2, String var3) {
  435.       int var6 = -1;
  436.       Font var9 = ((Component)this).getFont();
  437.       String var4 = ((Applet)this).getParameter(var1);
  438.       if (var4 == null) {
  439.          var4 = var9.getName();
  440.       }
  441.  
  442.       String var5 = ((Applet)this).getParameter(var2);
  443.       if (var5 == null) {
  444.          var6 = var9.getStyle();
  445.       }
  446.  
  447.       if (!var4.equalsIgnoreCase("TimesRoman") && !var4.equalsIgnoreCase("Helvetica") && !var4.equalsIgnoreCase("Courier") && !var4.equalsIgnoreCase("Dialog") && !var4.equalsIgnoreCase("DialogInput") && !var4.equalsIgnoreCase("ZapfDingbats")) {
  448.          var4 = var9.getName();
  449.       }
  450.  
  451.       if (var6 == -1) {
  452.          if (var5.equalsIgnoreCase("bold")) {
  453.             var6 = 1;
  454.          } else if (var5.equalsIgnoreCase("italic")) {
  455.             var6 = 2;
  456.          } else if (var5.equalsIgnoreCase("bolditalic")) {
  457.             var6 = 3;
  458.          } else {
  459.             var6 = 0;
  460.          }
  461.       }
  462.  
  463.       String var10 = ((Applet)this).getParameter(var3);
  464.       int var7;
  465.       if (var10 == null) {
  466.          var7 = var9.getSize();
  467.       } else {
  468.          try {
  469.             var7 = Integer.parseInt(var10);
  470.          } catch (NumberFormatException var11) {
  471.             var7 = var9.getSize();
  472.             System.out.println("NumberformatException: " + var10);
  473.          }
  474.       }
  475.  
  476.       Font var8 = new Font(var4, var6, var7);
  477.       return var8;
  478.    }
  479.  
  480.    public String getColor(String var1) {
  481.       if (this.colors == null) {
  482.          this.createHashTable();
  483.       }
  484.  
  485.       return (String)this.colors.get(var1);
  486.    }
  487.  
  488.    public void createHashTable() {
  489.       if (this.colors == null) {
  490.          this.colors = new Hashtable(650);
  491.          this.colors.put("aliceblue", "f0f8ff");
  492.          this.colors.put("antiquewhite", "faebd7");
  493.          this.colors.put("aquamarine", "7fffd4");
  494.          this.colors.put("azure", "f0ffff");
  495.          this.colors.put("beige", "f5f5dc");
  496.          this.colors.put("bisque", "ffe4c4");
  497.          this.colors.put("black", "000000");
  498.          this.colors.put("blanchedalmond", "ffebcd");
  499.          this.colors.put("blue", "0000ff");
  500.          this.colors.put("blueviolet", "8a2be2");
  501.          this.colors.put("brown", "a52a2a");
  502.          this.colors.put("burlywood", "deb887");
  503.          this.colors.put("cadetblue", "5f9ea0");
  504.          this.colors.put("chartreuse", "7fff00");
  505.          this.colors.put("chocolate", "d2691e");
  506.          this.colors.put("coral", "ff7f50");
  507.          this.colors.put("cornflowerblue", "6495ed");
  508.          this.colors.put("cornsilk", "fff8dc");
  509.          this.colors.put("cyan", "00ffff");
  510.          this.colors.put("darkgoldenrod", "b8860b");
  511.          this.colors.put("darkgreen", "006400");
  512.          this.colors.put("darkkhaki", "bdb76b");
  513.          this.colors.put("darkolivegreen", "556b2f");
  514.          this.colors.put("darkorange", "ff8c00");
  515.          this.colors.put("darkorchid", "9932cc");
  516.          this.colors.put("darksalmon", "e9967a");
  517.          this.colors.put("darkseagreen", "8fbc8f");
  518.          this.colors.put("darkslateblue", "483d8b");
  519.          this.colors.put("darkslategray", "2f4f4f");
  520.          this.colors.put("darkslategrey", "2f4f4f");
  521.          this.colors.put("darkturquoise", "00ced1");
  522.          this.colors.put("darkviolet", "9400d3");
  523.          this.colors.put("deeppink", "ff1493");
  524.          this.colors.put("deepskyblue", "00bfff");
  525.          this.colors.put("dimgray", "696969");
  526.          this.colors.put("dimgrey", "696969");
  527.          this.colors.put("dodgerblue", "1e90ff");
  528.          this.colors.put("firebrick", "b22222");
  529.          this.colors.put("floralwhite", "fffaf0");
  530.          this.colors.put("forestgreen", "228b22");
  531.          this.colors.put("green", "00ff00");
  532.          this.colors.put("gainsboro", "dcdcdc");
  533.          this.colors.put("ghostwhite", "f8f8ff");
  534.          this.colors.put("gold", "ffd700");
  535.          this.colors.put("goldenrod", "daa520");
  536.          this.colors.put("gray", "bebebe");
  537.          this.colors.put("honeydew", "f0fff0");
  538.          this.colors.put("hotpink", "ff69b4");
  539.          this.colors.put("indianred", "cd5c5c");
  540.          this.colors.put("ivory", "fffff0");
  541.          this.colors.put("khaki", "f0e68c");
  542.          this.colors.put("lavender", "e6e6fa");
  543.          this.colors.put("lavenderblush", "fff0f5");
  544.          this.colors.put("lawngreen", "7cfc00");
  545.          this.colors.put("lemonchiffon", "fffacd");
  546.          this.colors.put("lightblue", "add8e6");
  547.          this.colors.put("lightcoral", "f08080");
  548.          this.colors.put("lightcyan", "e0ffff");
  549.          this.colors.put("lightgoldenrod", "eedd82");
  550.          this.colors.put("lightgoldenrodyellow", "fafad2");
  551.          this.colors.put("lightgray", "d3d3d3");
  552.          this.colors.put("lightgrey", "d3d3d3");
  553.          this.colors.put("lightpink", "ffb6c1");
  554.          this.colors.put("lightsalmon", "ffa07a");
  555.          this.colors.put("lightseagreen", "20b2aa");
  556.          this.colors.put("lightskyblue", "87cefa");
  557.          this.colors.put("lightslateblue", "8470ff");
  558.          this.colors.put("lightslategray", "778899");
  559.          this.colors.put("lightslategrey", "778899");
  560.          this.colors.put("lightsteelblue", "b0c4de");
  561.          this.colors.put("lightyellow", "ffffe0");
  562.          this.colors.put("limegreen", "32cd32");
  563.          this.colors.put("linen", "faf0e6");
  564.          this.colors.put("magenta", "ff00ff");
  565.          this.colors.put("maroon", "b03060");
  566.          this.colors.put("mediumaquamarine", "66cdaa");
  567.          this.colors.put("mediumblue", "0000cd");
  568.          this.colors.put("mediumorchid", "ba55d3");
  569.          this.colors.put("mediumpurple", "9370db");
  570.          this.colors.put("mediumseagreen", "3cb371");
  571.          this.colors.put("mediumslateblue", "7b68ee");
  572.          this.colors.put("mediumspringgreen", "00fa9a");
  573.          this.colors.put("mediumturquoise", "48d1cc");
  574.          this.colors.put("mediumvioletred", "c71585");
  575.          this.colors.put("midnightblue", "191970");
  576.          this.colors.put("mintcream", "f5fffa");
  577.          this.colors.put("mistyrose", "ffe4e1");
  578.          this.colors.put("moccasin", "ffe4b5");
  579.          this.colors.put("navajowhite", "ffdead");
  580.          this.colors.put("navy", "000080");
  581.          this.colors.put("navyblue", "000080");
  582.          this.colors.put("oldlace", "fdf5e6");
  583.          this.colors.put("olivedrab", "6b8e23");
  584.          this.colors.put("orange", "ffa500");
  585.          this.colors.put("orangered", "ff4500");
  586.          this.colors.put("orchid", "da70d6");
  587.          this.colors.put("palegoldenrod", "eee8aa");
  588.          this.colors.put("palegreen", "98fb98");
  589.          this.colors.put("paleturquoise", "afeeee");
  590.          this.colors.put("palevioletred", "db7093");
  591.          this.colors.put("papayawhip", "ffefd5");
  592.          this.colors.put("peachpuff", "ffdab9");
  593.          this.colors.put("peru", "cd853f");
  594.          this.colors.put("pink", "ffc0cb");
  595.          this.colors.put("plum", "dda0dd");
  596.          this.colors.put("powderblue", "b0e0e6");
  597.          this.colors.put("purple", "a020f0");
  598.          this.colors.put("red", "ff0000");
  599.          this.colors.put("rosybrown", "bc8f8f");
  600.          this.colors.put("royalblue", "4169e1");
  601.          this.colors.put("saddlebrown", "8b4513");
  602.          this.colors.put("salmon", "fa8072");
  603.          this.colors.put("sandybrown", "f4a460");
  604.          this.colors.put("seagreen", "2e8b57");
  605.          this.colors.put("seashell", "fff5ee");
  606.          this.colors.put("sienna", "a0522d");
  607.          this.colors.put("skyblue", "87ceeb");
  608.          this.colors.put("slateblue", "6a5acd");
  609.          this.colors.put("slategray", "708090");
  610.          this.colors.put("slategrey", "708090");
  611.          this.colors.put("snow", "fffafa");
  612.          this.colors.put("springgreen", "00ff7f");
  613.          this.colors.put("steelblue", "4682b4");
  614.          this.colors.put("tan", "d2b48c");
  615.          this.colors.put("thistle", "d8bfd8");
  616.          this.colors.put("tomato", "ff6347");
  617.          this.colors.put("turquoise", "40e0d0");
  618.          this.colors.put("violet", "ee82ee");
  619.          this.colors.put("violetred", "d02090");
  620.          this.colors.put("wheat", "f5deb3");
  621.          this.colors.put("white", "ffffff");
  622.          this.colors.put("whitesmoke", "f5f5f5");
  623.          this.colors.put("yellow", "ffff00");
  624.          this.colors.put("yellowgreen", "9acd32");
  625.       }
  626.    }
  627.  
  628.    public Image process(URL var1, String var2, boolean var3) {
  629.       if (var2 == null) {
  630.          return null;
  631.       } else {
  632.          Image var4 = ((Applet)this).getImage(var1, var2);
  633.          if (var3) {
  634.             this.loadImageAndWait(var4);
  635.          }
  636.  
  637.          return var4;
  638.       }
  639.    }
  640.  
  641.    public boolean isImagePrepared(Image var1) {
  642.       boolean var2 = ((Component)this).prepareImage(var1, this);
  643.       return var2;
  644.    }
  645.  
  646.    public void prepareImage(Image var1) {
  647.       ((Component)this).prepareImage(var1, this);
  648.    }
  649.  
  650.    public synchronized void loadImageAndWait(Image var1) {
  651.       boolean var3 = ((Component)this).prepareImage(var1, this);
  652.       if (!var3) {
  653.          while((((Component)this).checkImage(var1, this) & 32) == 0) {
  654.             try {
  655.                this.wait(100L);
  656.             } catch (InterruptedException var4) {
  657.             }
  658.          }
  659.       }
  660.  
  661.    }
  662.  
  663.    public synchronized int getWidth(Image var1, ImageObserver var2) {
  664.       int var3;
  665.       while((var3 = var1.getWidth(var2)) == -1) {
  666.          try {
  667.             this.wait(100L);
  668.          } catch (InterruptedException var4) {
  669.          }
  670.       }
  671.  
  672.       return var3;
  673.    }
  674.  
  675.    public synchronized int getHeight(Image var1, ImageObserver var2) {
  676.       int var3;
  677.       while((var3 = var1.getHeight(var2)) == -1) {
  678.          try {
  679.             this.wait(100L);
  680.          } catch (InterruptedException var4) {
  681.          }
  682.       }
  683.  
  684.       return var3;
  685.    }
  686. }
  687.