home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Extras / Content / Images / StockObjects / objects / java / ticker / Ticker.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-10-22  |  17.0 KB  |  708 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 Ticker 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 cur_xoffset;
  62.    protected int move_dist;
  63.    protected boolean forward = true;
  64.    protected boolean reverse = false;
  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.move_dist = this.GetParmToInt("MoveDist", 5);
  172.       this.reverse = this.GetParmToBoolean("Reverse", false);
  173.       if (this.reverse) {
  174.          this.forward = false;
  175.       }
  176.  
  177.    }
  178.  
  179.    public void paint(Graphics var1) {
  180.       if (this.applet_width != ((Component)this).size().width || this.applet_height != ((Component)this).size().height) {
  181.          this.applet_width = ((Component)this).size().width;
  182.          this.applet_height = ((Component)this).size().height;
  183.          this.offScreen = ((Component)this).createImage(this.applet_width, this.applet_height);
  184.          this.offGC = this.offScreen.getGraphics();
  185.          this.offGC.setFont(this.font);
  186.       }
  187.  
  188.       if (this.horizcenter) {
  189.          this.xoffset = ((Component)this).size().width / 2 - this.total_width / 2;
  190.       }
  191.  
  192.       if (this.vertcenter) {
  193.          this.yoffset = ((Component)this).size().height / 2 + this.ascent / 3;
  194.       } else if (this.yoffset == -1) {
  195.          this.yoffset = this.height - this.descent;
  196.       }
  197.  
  198.       this.offGC.setColor(((Component)this).getBackground());
  199.       this.offGC.fillRect(0, 0, this.applet_width, this.applet_height);
  200.       this.tilebackground(this.offGC);
  201.       if (this.forward) {
  202.          if (this.widtha[this.index] + this.cur_xoffset > 0) {
  203.             this.cur_xoffset -= this.move_dist;
  204.             this.offGC.setColor(((Component)this).getForeground());
  205.             this.offGC.drawString(this.txa[this.index], this.cur_xoffset, this.yoffset);
  206.          } else {
  207.             this.endofstring = true;
  208.          }
  209.       } else if (this.cur_xoffset < ((Component)this).size().width) {
  210.          this.cur_xoffset += this.move_dist;
  211.          this.offGC.setColor(((Component)this).getForeground());
  212.          this.offGC.drawString(this.txa[this.index], this.cur_xoffset, this.yoffset);
  213.       } else {
  214.          this.endofstring = true;
  215.       }
  216.  
  217.       var1.drawImage(this.offScreen, 0, 0, this);
  218.    }
  219.  
  220.    public void run() {
  221.       this.StringThread.setPriority(1);
  222.  
  223.       while(this.StringThread != null) {
  224.          try {
  225.             Thread.sleep((long)this.chardelay);
  226.          } catch (InterruptedException var2) {
  227.          }
  228.  
  229.          if (this.endofstring) {
  230.             if (this.forward) {
  231.                ++this.index;
  232.                if (this.index == this.txcount) {
  233.                   this.index = 0;
  234.                }
  235.             } else {
  236.                --this.index;
  237.                if (this.index < 0) {
  238.                   this.index = this.txcount - 1;
  239.                }
  240.             }
  241.  
  242.             try {
  243.                Thread.sleep((long)this.rundelay);
  244.             } catch (InterruptedException var1) {
  245.             }
  246.  
  247.             if (this.forward) {
  248.                this.cur_xoffset = ((Component)this).size().width;
  249.             } else {
  250.                this.cur_xoffset = -this.widtha[this.index];
  251.             }
  252.  
  253.             this.endofstring = false;
  254.          } else {
  255.             ((Component)this).repaint();
  256.          }
  257.       }
  258.  
  259.    }
  260.  
  261.    public boolean keyDown(Event var1, int var2) {
  262.       if (var2 == 109) {
  263.          ++this.move_dist;
  264.          ((Applet)this).getAppletContext().showStatus("New distance: " + this.move_dist);
  265.          return true;
  266.       } else if (var2 == 108) {
  267.          --this.move_dist;
  268.          if (this.move_dist <= 0) {
  269.             this.move_dist = 1;
  270.          }
  271.  
  272.          ((Applet)this).getAppletContext().showStatus("New distance: " + this.move_dist);
  273.          return true;
  274.       } else {
  275.          if (var2 == 102) {
  276.             this.chardelay = (int)((double)this.chardelay * 0.9);
  277.             if (this.chardelay < 10) {
  278.                this.chardelay = 10;
  279.             }
  280.  
  281.             ((Applet)this).getAppletContext().showStatus("Setting image delay to: " + this.chardelay);
  282.          } else if (var2 == 115) {
  283.             if (this.chardelay < 10) {
  284.                ++this.chardelay;
  285.             } else {
  286.                this.chardelay = (int)((double)this.chardelay * 1.1);
  287.             }
  288.  
  289.             ((Applet)this).getAppletContext().showStatus("Setting image delay to: " + this.chardelay);
  290.          } else if (var2 == 70) {
  291.             this.rundelay = (int)((double)this.rundelay * 0.9);
  292.             if (this.rundelay < 10) {
  293.                this.rundelay = 10;
  294.             }
  295.  
  296.             ((Applet)this).getAppletContext().showStatus("Setting run delay to: " + this.rundelay);
  297.          } else if (var2 == 83) {
  298.             if (this.rundelay < 10) {
  299.                ++this.rundelay;
  300.             } else {
  301.                this.rundelay = (int)((double)this.rundelay * 1.1);
  302.             }
  303.  
  304.             ((Applet)this).getAppletContext().showStatus("Setting run delay to: " + this.rundelay);
  305.          }
  306.  
  307.          return true;
  308.       }
  309.    }
  310.  
  311.    public boolean mouseDown(Event var1, int var2, int var3) {
  312.       if ((var1.modifiers & 1) != 0) {
  313.          this.forward = !this.forward;
  314.       } else if (this.StringThread == null) {
  315.          this.StringThread = new Thread(this);
  316.          this.StringThread.start();
  317.       } else {
  318.          this.StringThread = null;
  319.       }
  320.  
  321.       return true;
  322.    }
  323.  
  324.    public void update(Graphics var1) {
  325.       this.paint(var1);
  326.    }
  327.  
  328.    public void start() {
  329.       if (this.StringThread == null) {
  330.          this.endofstring = false;
  331.          this.cur_xoffset = ((Component)this).size().width;
  332.          this.StringThread = new Thread(this);
  333.          this.StringThread.start();
  334.       }
  335.  
  336.    }
  337.  
  338.    public void stop() {
  339.       if (this.StringThread != null) {
  340.          this.StringThread.stop();
  341.       }
  342.  
  343.       this.StringThread = null;
  344.    }
  345.  
  346.    protected void tilebackground(Graphics var1) {
  347.       if (this.bgimage != null) {
  348.          if (!this.isImagePrepared(this.bgimage)) {
  349.             this.loadImageAndWait(this.bgimage);
  350.          }
  351.  
  352.          if (this.app_width != ((Component)this).size().width || this.app_height != ((Component)this).size().height) {
  353.             this.app_width = ((Component)this).size().width;
  354.             this.app_height = ((Component)this).size().height;
  355.             this.tiled_bgimage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
  356.             this.bg_g = this.tiled_bgimage.getGraphics();
  357.             this.bg_g.setColor(this.app_bg_color);
  358.             this.bg_g.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  359.             if (this.tile) {
  360.                for(int var2 = -this.bgimage_height; var2 < this.app_height; var2 += this.bgimage_height) {
  361.                   for(int var3 = -this.bgimage_width; var3 < this.app_width; var3 += this.bgimage_width) {
  362.                      this.bg_g.drawImage(this.bgimage, var3 + 2, var2 + 2, this);
  363.                   }
  364.                }
  365.             } else {
  366.                this.bg_g.drawImage(this.bgimage, 0, 0, this);
  367.             }
  368.          }
  369.  
  370.          if (this.tiled_bgimage != null) {
  371.             var1.drawImage(this.tiled_bgimage, 0, 0, this);
  372.          }
  373.  
  374.       }
  375.    }
  376.  
  377.    public int GetParmToInt(String var1, int var2) {
  378.       String var3 = ((Applet)this).getParameter(var1);
  379.       return var3 == null ? var2 : Integer.parseInt(var3);
  380.    }
  381.  
  382.    public String GetParmToString(String var1, String var2) {
  383.       String var3 = ((Applet)this).getParameter(var1);
  384.       return var3 == null ? var2 : var3;
  385.    }
  386.  
  387.    public boolean GetParmToBoolean(String var1, boolean var2) {
  388.       String var3 = ((Applet)this).getParameter(var1);
  389.       return var3 == null ? var2 : var3.equalsIgnoreCase("true");
  390.    }
  391.  
  392.    public Color GetParmToColor(String var1, Color var2) {
  393.       String var4 = ((Applet)this).getParameter(var1);
  394.       if (var4 == null) {
  395.          return var2;
  396.       } else {
  397.          try {
  398.             if (var4.charAt(0) == '#') {
  399.                char[] var5 = new char[var4.length()];
  400.                var4.getChars(0, var4.length(), var5, 0);
  401.                new Color(Integer.parseInt(new String(var5, 1, var4.length() - 1), 16));
  402.                return new Color(Integer.parseInt(new String(var5, 1, var4.length() - 1), 16));
  403.             } else {
  404.                Color var3 = new Color(Integer.parseInt(var4, 16));
  405.                return var3;
  406.             }
  407.          } catch (NumberFormatException var7) {
  408.             String var6 = this.getColor(var4);
  409.             if (var6 != null) {
  410.                return new Color(Integer.parseInt(var6, 16));
  411.             } else {
  412.                System.out.println("Bad color specification: " + ((Throwable)var7).getMessage());
  413.                return null;
  414.             }
  415.          }
  416.       }
  417.    }
  418.  
  419.    public URL GetParmToURL(String var1) {
  420.       Object var2 = null;
  421.       String var3 = ((Applet)this).getParameter(var1);
  422.       if (var3 == null) {
  423.          return null;
  424.       } else {
  425.          try {
  426.             var7 = new URL(var3);
  427.          } catch (MalformedURLException var6) {
  428.             var7 = null;
  429.          }
  430.  
  431.          if (var7 == null) {
  432.             try {
  433.                var7 = new URL(((Applet)this).getDocumentBase(), var3);
  434.             } catch (MalformedURLException var5) {
  435.                var7 = null;
  436.             }
  437.          }
  438.  
  439.          if (var7 == null) {
  440.             try {
  441.                var7 = new URL(((Applet)this).getCodeBase(), var3);
  442.             } catch (MalformedURLException var4) {
  443.                var7 = null;
  444.             }
  445.          }
  446.  
  447.          if (var7 == null) {
  448.             System.out.println("Unable to load URL: " + var3);
  449.          }
  450.  
  451.          return var7;
  452.       }
  453.    }
  454.  
  455.    public Font GetParmToFont(String var1, String var2, String var3) {
  456.       int var6 = -1;
  457.       Font var9 = ((Component)this).getFont();
  458.       String var4 = ((Applet)this).getParameter(var1);
  459.       if (var4 == null) {
  460.          var4 = var9.getName();
  461.       }
  462.  
  463.       String var5 = ((Applet)this).getParameter(var2);
  464.       if (var5 == null) {
  465.          var6 = var9.getStyle();
  466.       }
  467.  
  468.       if (!var4.equalsIgnoreCase("TimesRoman") && !var4.equalsIgnoreCase("Helvetica") && !var4.equalsIgnoreCase("Courier") && !var4.equalsIgnoreCase("Dialog") && !var4.equalsIgnoreCase("DialogInput") && !var4.equalsIgnoreCase("ZapfDingbats")) {
  469.          var4 = var9.getName();
  470.       }
  471.  
  472.       if (var6 == -1) {
  473.          if (var5.equalsIgnoreCase("bold")) {
  474.             var6 = 1;
  475.          } else if (var5.equalsIgnoreCase("italic")) {
  476.             var6 = 2;
  477.          } else if (var5.equalsIgnoreCase("bolditalic")) {
  478.             var6 = 3;
  479.          } else {
  480.             var6 = 0;
  481.          }
  482.       }
  483.  
  484.       String var10 = ((Applet)this).getParameter(var3);
  485.       int var7;
  486.       if (var10 == null) {
  487.          var7 = var9.getSize();
  488.       } else {
  489.          try {
  490.             var7 = Integer.parseInt(var10);
  491.          } catch (NumberFormatException var11) {
  492.             var7 = var9.getSize();
  493.             System.out.println("NumberformatException: " + var10);
  494.          }
  495.       }
  496.  
  497.       Font var8 = new Font(var4, var6, var7);
  498.       return var8;
  499.    }
  500.  
  501.    public String getColor(String var1) {
  502.       if (this.colors == null) {
  503.          this.createHashTable();
  504.       }
  505.  
  506.       return (String)this.colors.get(var1);
  507.    }
  508.  
  509.    public void createHashTable() {
  510.       if (this.colors == null) {
  511.          this.colors = new Hashtable(650);
  512.          this.colors.put("aliceblue", "f0f8ff");
  513.          this.colors.put("antiquewhite", "faebd7");
  514.          this.colors.put("aquamarine", "7fffd4");
  515.          this.colors.put("azure", "f0ffff");
  516.          this.colors.put("beige", "f5f5dc");
  517.          this.colors.put("bisque", "ffe4c4");
  518.          this.colors.put("black", "000000");
  519.          this.colors.put("blanchedalmond", "ffebcd");
  520.          this.colors.put("blue", "0000ff");
  521.          this.colors.put("blueviolet", "8a2be2");
  522.          this.colors.put("brown", "a52a2a");
  523.          this.colors.put("burlywood", "deb887");
  524.          this.colors.put("cadetblue", "5f9ea0");
  525.          this.colors.put("chartreuse", "7fff00");
  526.          this.colors.put("chocolate", "d2691e");
  527.          this.colors.put("coral", "ff7f50");
  528.          this.colors.put("cornflowerblue", "6495ed");
  529.          this.colors.put("cornsilk", "fff8dc");
  530.          this.colors.put("cyan", "00ffff");
  531.          this.colors.put("darkgoldenrod", "b8860b");
  532.          this.colors.put("darkgreen", "006400");
  533.          this.colors.put("darkkhaki", "bdb76b");
  534.          this.colors.put("darkolivegreen", "556b2f");
  535.          this.colors.put("darkorange", "ff8c00");
  536.          this.colors.put("darkorchid", "9932cc");
  537.          this.colors.put("darksalmon", "e9967a");
  538.          this.colors.put("darkseagreen", "8fbc8f");
  539.          this.colors.put("darkslateblue", "483d8b");
  540.          this.colors.put("darkslategray", "2f4f4f");
  541.          this.colors.put("darkslategrey", "2f4f4f");
  542.          this.colors.put("darkturquoise", "00ced1");
  543.          this.colors.put("darkviolet", "9400d3");
  544.          this.colors.put("deeppink", "ff1493");
  545.          this.colors.put("deepskyblue", "00bfff");
  546.          this.colors.put("dimgray", "696969");
  547.          this.colors.put("dimgrey", "696969");
  548.          this.colors.put("dodgerblue", "1e90ff");
  549.          this.colors.put("firebrick", "b22222");
  550.          this.colors.put("floralwhite", "fffaf0");
  551.          this.colors.put("forestgreen", "228b22");
  552.          this.colors.put("green", "00ff00");
  553.          this.colors.put("gainsboro", "dcdcdc");
  554.          this.colors.put("ghostwhite", "f8f8ff");
  555.          this.colors.put("gold", "ffd700");
  556.          this.colors.put("goldenrod", "daa520");
  557.          this.colors.put("gray", "bebebe");
  558.          this.colors.put("honeydew", "f0fff0");
  559.          this.colors.put("hotpink", "ff69b4");
  560.          this.colors.put("indianred", "cd5c5c");
  561.          this.colors.put("ivory", "fffff0");
  562.          this.colors.put("khaki", "f0e68c");
  563.          this.colors.put("lavender", "e6e6fa");
  564.          this.colors.put("lavenderblush", "fff0f5");
  565.          this.colors.put("lawngreen", "7cfc00");
  566.          this.colors.put("lemonchiffon", "fffacd");
  567.          this.colors.put("lightblue", "add8e6");
  568.          this.colors.put("lightcoral", "f08080");
  569.          this.colors.put("lightcyan", "e0ffff");
  570.          this.colors.put("lightgoldenrod", "eedd82");
  571.          this.colors.put("lightgoldenrodyellow", "fafad2");
  572.          this.colors.put("lightgray", "d3d3d3");
  573.          this.colors.put("lightgrey", "d3d3d3");
  574.          this.colors.put("lightpink", "ffb6c1");
  575.          this.colors.put("lightsalmon", "ffa07a");
  576.          this.colors.put("lightseagreen", "20b2aa");
  577.          this.colors.put("lightskyblue", "87cefa");
  578.          this.colors.put("lightslateblue", "8470ff");
  579.          this.colors.put("lightslategray", "778899");
  580.          this.colors.put("lightslategrey", "778899");
  581.          this.colors.put("lightsteelblue", "b0c4de");
  582.          this.colors.put("lightyellow", "ffffe0");
  583.          this.colors.put("limegreen", "32cd32");
  584.          this.colors.put("linen", "faf0e6");
  585.          this.colors.put("magenta", "ff00ff");
  586.          this.colors.put("maroon", "b03060");
  587.          this.colors.put("mediumaquamarine", "66cdaa");
  588.          this.colors.put("mediumblue", "0000cd");
  589.          this.colors.put("mediumorchid", "ba55d3");
  590.          this.colors.put("mediumpurple", "9370db");
  591.          this.colors.put("mediumseagreen", "3cb371");
  592.          this.colors.put("mediumslateblue", "7b68ee");
  593.          this.colors.put("mediumspringgreen", "00fa9a");
  594.          this.colors.put("mediumturquoise", "48d1cc");
  595.          this.colors.put("mediumvioletred", "c71585");
  596.          this.colors.put("midnightblue", "191970");
  597.          this.colors.put("mintcream", "f5fffa");
  598.          this.colors.put("mistyrose", "ffe4e1");
  599.          this.colors.put("moccasin", "ffe4b5");
  600.          this.colors.put("navajowhite", "ffdead");
  601.          this.colors.put("navy", "000080");
  602.          this.colors.put("navyblue", "000080");
  603.          this.colors.put("oldlace", "fdf5e6");
  604.          this.colors.put("olivedrab", "6b8e23");
  605.          this.colors.put("orange", "ffa500");
  606.          this.colors.put("orangered", "ff4500");
  607.          this.colors.put("orchid", "da70d6");
  608.          this.colors.put("palegoldenrod", "eee8aa");
  609.          this.colors.put("palegreen", "98fb98");
  610.          this.colors.put("paleturquoise", "afeeee");
  611.          this.colors.put("palevioletred", "db7093");
  612.          this.colors.put("papayawhip", "ffefd5");
  613.          this.colors.put("peachpuff", "ffdab9");
  614.          this.colors.put("peru", "cd853f");
  615.          this.colors.put("pink", "ffc0cb");
  616.          this.colors.put("plum", "dda0dd");
  617.          this.colors.put("powderblue", "b0e0e6");
  618.          this.colors.put("purple", "a020f0");
  619.          this.colors.put("red", "ff0000");
  620.          this.colors.put("rosybrown", "bc8f8f");
  621.          this.colors.put("royalblue", "4169e1");
  622.          this.colors.put("saddlebrown", "8b4513");
  623.          this.colors.put("salmon", "fa8072");
  624.          this.colors.put("sandybrown", "f4a460");
  625.          this.colors.put("seagreen", "2e8b57");
  626.          this.colors.put("seashell", "fff5ee");
  627.          this.colors.put("sienna", "a0522d");
  628.          this.colors.put("skyblue", "87ceeb");
  629.          this.colors.put("slateblue", "6a5acd");
  630.          this.colors.put("slategray", "708090");
  631.          this.colors.put("slategrey", "708090");
  632.          this.colors.put("snow", "fffafa");
  633.          this.colors.put("springgreen", "00ff7f");
  634.          this.colors.put("steelblue", "4682b4");
  635.          this.colors.put("tan", "d2b48c");
  636.          this.colors.put("thistle", "d8bfd8");
  637.          this.colors.put("tomato", "ff6347");
  638.          this.colors.put("turquoise", "40e0d0");
  639.          this.colors.put("violet", "ee82ee");
  640.          this.colors.put("violetred", "d02090");
  641.          this.colors.put("wheat", "f5deb3");
  642.          this.colors.put("white", "ffffff");
  643.          this.colors.put("whitesmoke", "f5f5f5");
  644.          this.colors.put("yellow", "ffff00");
  645.          this.colors.put("yellowgreen", "9acd32");
  646.       }
  647.    }
  648.  
  649.    public Image process(URL var1, String var2, boolean var3) {
  650.       if (var2 == null) {
  651.          return null;
  652.       } else {
  653.          Image var4 = ((Applet)this).getImage(var1, var2);
  654.          if (var3) {
  655.             this.loadImageAndWait(var4);
  656.          }
  657.  
  658.          return var4;
  659.       }
  660.    }
  661.  
  662.    public boolean isImagePrepared(Image var1) {
  663.       boolean var2 = ((Component)this).prepareImage(var1, this);
  664.       return var2;
  665.    }
  666.  
  667.    public void prepareImage(Image var1) {
  668.       ((Component)this).prepareImage(var1, this);
  669.    }
  670.  
  671.    public synchronized void loadImageAndWait(Image var1) {
  672.       boolean var3 = ((Component)this).prepareImage(var1, this);
  673.       if (!var3) {
  674.          while((((Component)this).checkImage(var1, this) & 32) == 0) {
  675.             try {
  676.                this.wait(100L);
  677.             } catch (InterruptedException var4) {
  678.             }
  679.          }
  680.       }
  681.  
  682.    }
  683.  
  684.    public synchronized int getWidth(Image var1, ImageObserver var2) {
  685.       int var3;
  686.       while((var3 = var1.getWidth(var2)) == -1) {
  687.          try {
  688.             this.wait(100L);
  689.          } catch (InterruptedException var4) {
  690.          }
  691.       }
  692.  
  693.       return var3;
  694.    }
  695.  
  696.    public synchronized int getHeight(Image var1, ImageObserver var2) {
  697.       int var3;
  698.       while((var3 = var1.getHeight(var2)) == -1) {
  699.          try {
  700.             this.wait(100L);
  701.          } catch (InterruptedException var4) {
  702.          }
  703.       }
  704.  
  705.       return var3;
  706.    }
  707. }
  708.