home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2003 January / maximum-cd-2003-01.iso / Software / Utilities / JPerk / jperk.exe / _SETUP.1 / FadeText.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-03-17  |  12.0 KB  |  656 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Dimension;
  5. import java.awt.Event;
  6. import java.awt.Font;
  7. import java.awt.FontMetrics;
  8. import java.awt.Graphics;
  9. import java.awt.Image;
  10. import java.awt.Polygon;
  11. import java.net.MalformedURLException;
  12. import java.net.URL;
  13. import java.util.StringTokenizer;
  14. import java.util.Vector;
  15.  
  16. public class FadeText extends Applet implements Runnable {
  17.    Thread m_SlidingM;
  18.    Image off2;
  19.    Image off;
  20.    Graphics g_off;
  21.    Graphics g_off2;
  22.    Font font;
  23.    // $FF: renamed from: fm java.awt.FontMetrics
  24.    FontMetrics field_0;
  25.    URL goURL;
  26.    // $FF: renamed from: d java.awt.Dimension
  27.    Dimension field_1;
  28.    int font_style;
  29.    int center_x;
  30.    int m_num_msg;
  31.    // $FF: renamed from: k int
  32.    int field_2;
  33.    boolean gSok;
  34.    boolean mouse_in;
  35.    boolean bad_descrips;
  36.    boolean first_pass = true;
  37.    boolean multi_line;
  38.    private int m_size = 24;
  39.    private int m_delay = 2000;
  40.    private String m_messagefont = "Arial";
  41.    private boolean m_bold;
  42.    private boolean m_italic;
  43.    private String[] m_msg;
  44.    private Color[] m_cur_textcolor;
  45.    private Color[] m_cur_bgcolor;
  46.    private Color m_bgcolor;
  47.    private Color m_textcolor;
  48.    private int[] m_cur_size;
  49.    private int[] m_cur_delay;
  50.    private String[] m_cur_desturl;
  51.    private String m_desturl;
  52.    private String m_loadwhere;
  53.    private String[] m_cur_loadwhere;
  54.    private boolean m_xcenter;
  55.    private int m_xoffset;
  56.    private boolean[] m_cur_xcenter;
  57.    private int m_b_thick;
  58.    private int[] m_cur_b_thick;
  59.    private Color m_b_color;
  60.    private Color[] m_cur_b_color;
  61.    private int[] m_cur_color_jump;
  62.    private int m_color_jump;
  63.    private int m_color_delay;
  64.    private int[] m_cur_color_delay;
  65.  
  66.    public void start() {
  67.       if (this.m_SlidingM == null) {
  68.          this.m_SlidingM = new Thread(this);
  69.          this.m_SlidingM.start();
  70.       }
  71.  
  72.    }
  73.  
  74.    public void stop() {
  75.       if (this.m_SlidingM != null) {
  76.          this.m_SlidingM.stop();
  77.          this.m_SlidingM = null;
  78.       }
  79.  
  80.    }
  81.  
  82.    public boolean mouseExit(Event e, int x, int y) {
  83.       this.mouse_in = false;
  84.       return true;
  85.    }
  86.  
  87.    public boolean mouseEnter(Event e, int x, int y) {
  88.       this.mouse_in = true;
  89.       return true;
  90.    }
  91.  
  92.    public boolean mouseUp(Event e, int x, int y) {
  93.       if (this.mouse_in && this.m_cur_desturl[this.field_2] != null) {
  94.          try {
  95.             this.goURL = new URL(this.m_cur_desturl[this.field_2]);
  96.          } catch (MalformedURLException var6) {
  97.          }
  98.  
  99.          ((Applet)this).getAppletContext().showDocument(this.goURL, this.m_cur_loadwhere[this.field_2]);
  100.       }
  101.  
  102.       return true;
  103.    }
  104.  
  105.    public void run() {
  106.       while(true) {
  107.          try {
  108.             this.DrawSlide(((Component)this).getGraphics());
  109.          } catch (InterruptedException var3) {
  110.             this.stop();
  111.          }
  112.       }
  113.    }
  114.  
  115.    public FadeText() {
  116.       this.m_bgcolor = Color.white;
  117.       this.m_textcolor = Color.black;
  118.       this.m_loadwhere = "_self";
  119.       this.m_xcenter = true;
  120.       this.m_xoffset = 5;
  121.       this.m_b_color = Color.black;
  122.       this.m_color_jump = 1;
  123.    }
  124.  
  125.    public Color ConvertColor(String temp) {
  126.       int r = 0;
  127.       int g = 0;
  128.       int b = 0;
  129.       temp.trim();
  130.       StringTokenizer st = new StringTokenizer(temp, ",");
  131.       if (st.countTokens() > 3) {
  132.          return Color.black;
  133.       } else {
  134.          while(st.hasMoreTokens()) {
  135.             r = Integer.parseInt(st.nextToken().trim());
  136.             g = Integer.parseInt(st.nextToken().trim());
  137.             b = Integer.parseInt(st.nextToken().trim());
  138.          }
  139.  
  140.          StringTokenizer var9 = null;
  141.          if (r > 255) {
  142.             r = 255;
  143.          }
  144.  
  145.          if (g > 255) {
  146.             g = 255;
  147.          }
  148.  
  149.          if (b > 255) {
  150.             b = 255;
  151.          }
  152.  
  153.          Color ctemp = new Color(r, g, b);
  154.          return ctemp;
  155.       }
  156.    }
  157.  
  158.    public String[] MessageParser(String temp) {
  159.       Vector v_the = new Vector();
  160.       String s_build = "";
  161.       int s_length = 0;
  162.       String s_temp = "";
  163.       boolean first_run = true;
  164.       boolean last_line = false;
  165.       temp.trim();
  166.  
  167.       for(StringTokenizer st = new StringTokenizer(temp, " "); st.hasMoreTokens(); first_run = false) {
  168.          s_temp = st.nextToken();
  169.          if (s_temp != null) {
  170.          }
  171.  
  172.          s_length += this.field_0.stringWidth(s_temp + " ");
  173.          if (s_length < this.field_1.width - (this.m_cur_b_thick[this.field_2] * 2 + this.m_xoffset * 2)) {
  174.             if (first_run) {
  175.                s_build = s_temp;
  176.             } else {
  177.                s_build = s_build + " " + s_temp;
  178.             }
  179.  
  180.             last_line = true;
  181.          } else {
  182.             v_the.addElement(s_build);
  183.             if (!st.hasMoreTokens()) {
  184.                v_the.addElement(s_temp);
  185.             } else {
  186.                s_length = this.field_0.stringWidth(s_temp + " ");
  187.                s_build = s_temp;
  188.             }
  189.  
  190.             last_line = false;
  191.          }
  192.       }
  193.  
  194.       if (last_line) {
  195.          v_the.addElement(s_build);
  196.       }
  197.  
  198.       String[] the_string = new String[v_the.size()];
  199.       v_the.copyInto(the_string);
  200.       return the_string;
  201.    }
  202.  
  203.    public void init() {
  204.       String crstr = "Fading Messages, Copyright (c) 1997 OpenCube Technologies - Freeware";
  205.       this.field_1 = ((Component)this).size();
  206.       int i = 0;
  207.       String param = ((Applet)this).getParameter("Notice");
  208.       if (param != null && param.equals(crstr)) {
  209.          this.gSok = true;
  210.       }
  211.  
  212.       param = ((Applet)this).getParameter("loadwhere");
  213.       if (param != null) {
  214.          this.m_loadwhere = param;
  215.       }
  216.  
  217.       param = ((Applet)this).getParameter("desturl");
  218.       if (param != null) {
  219.          this.m_desturl = param;
  220.       }
  221.  
  222.       param = ((Applet)this).getParameter("delay");
  223.       if (param != null) {
  224.          this.m_delay = Integer.parseInt(param);
  225.       }
  226.  
  227.       param = ((Applet)this).getParameter("colordelay");
  228.       if (param != null) {
  229.          this.m_color_delay = Integer.parseInt(param);
  230.       }
  231.  
  232.       param = ((Applet)this).getParameter("colorjump");
  233.       if (param != null) {
  234.          this.m_delay = Integer.parseInt(param);
  235.       }
  236.  
  237.       param = ((Applet)this).getParameter("size");
  238.       if (param != null) {
  239.          this.m_size = Integer.parseInt(param);
  240.       }
  241.  
  242.       param = ((Applet)this).getParameter("xoffset");
  243.       if (param != null) {
  244.          this.m_xoffset = Integer.parseInt(param);
  245.       }
  246.  
  247.       param = ((Applet)this).getParameter("borderthickness");
  248.       if (param != null) {
  249.          this.m_b_thick = Integer.parseInt(param);
  250.       }
  251.  
  252.       param = ((Applet)this).getParameter("font");
  253.       if (param != null) {
  254.          this.m_messagefont = param;
  255.       }
  256.  
  257.       param = ((Applet)this).getParameter("textcolor");
  258.       if (param != null) {
  259.          this.m_textcolor = this.ConvertColor(param);
  260.       }
  261.  
  262.       param = ((Applet)this).getParameter("bgcolor");
  263.       if (param != null) {
  264.          this.m_bgcolor = this.ConvertColor(param);
  265.          ((Component)this).setBackground(this.m_bgcolor);
  266.       } else {
  267.          this.m_bgcolor = Color.white;
  268.          ((Component)this).setBackground(this.m_bgcolor);
  269.       }
  270.  
  271.       param = ((Applet)this).getParameter("bordercolor");
  272.       if (param != null) {
  273.          this.m_b_color = this.ConvertColor(param);
  274.       }
  275.  
  276.       param = ((Applet)this).getParameter("italic");
  277.       if (param != null) {
  278.          this.m_italic = Boolean.valueOf(param);
  279.       }
  280.  
  281.       param = ((Applet)this).getParameter("centertext");
  282.       if (param != null) {
  283.          this.m_xcenter = Boolean.valueOf(param);
  284.       }
  285.  
  286.       param = ((Applet)this).getParameter("bold");
  287.       if (param != null) {
  288.          this.m_bold = Boolean.valueOf(param);
  289.       }
  290.  
  291.       if (this.m_bold) {
  292.          ++this.font_style;
  293.       }
  294.  
  295.       if (this.m_italic) {
  296.          this.font_style += 2;
  297.       }
  298.  
  299.       while(((Applet)this).getParameter("desc" + i) != null) {
  300.          ++i;
  301.          ++this.m_num_msg;
  302.       }
  303.  
  304.       if (this.m_num_msg < 1) {
  305.          this.m_num_msg = 1;
  306.          this.bad_descrips = true;
  307.       }
  308.  
  309.       this.m_msg = new String[this.m_num_msg];
  310.       this.m_cur_textcolor = new Color[this.m_num_msg];
  311.       this.m_cur_bgcolor = new Color[this.m_num_msg];
  312.       this.m_cur_size = new int[this.m_num_msg];
  313.       this.m_cur_delay = new int[this.m_num_msg];
  314.       this.m_cur_desturl = new String[this.m_num_msg];
  315.       this.m_cur_loadwhere = new String[this.m_num_msg];
  316.       this.m_cur_xcenter = new boolean[this.m_num_msg];
  317.       this.m_cur_b_color = new Color[this.m_num_msg];
  318.       this.m_cur_b_thick = new int[this.m_num_msg];
  319.       this.m_cur_color_jump = new int[this.m_num_msg];
  320.       this.m_cur_color_delay = new int[this.m_num_msg];
  321.  
  322.       for(int var32 = 0; var32 < this.m_num_msg; ++var32) {
  323.          param = ((Applet)this).getParameter("desc" + var32);
  324.          if (param != null) {
  325.             this.m_msg[var32] = new String(param);
  326.          } else {
  327.             this.m_msg[var32] = new String(" ");
  328.          }
  329.  
  330.          param = ((Applet)this).getParameter("textcolor" + var32);
  331.          if (param != null) {
  332.             this.m_cur_textcolor[var32] = this.ConvertColor(param);
  333.          } else {
  334.             this.m_cur_textcolor[var32] = this.m_textcolor;
  335.          }
  336.  
  337.          param = ((Applet)this).getParameter("bgcolor" + var32);
  338.          if (param != null) {
  339.             this.m_cur_bgcolor[var32] = this.ConvertColor(param);
  340.          } else {
  341.             this.m_cur_bgcolor[var32] = this.m_bgcolor;
  342.          }
  343.  
  344.          param = ((Applet)this).getParameter("size" + var32);
  345.          if (param != null) {
  346.             this.m_cur_size[var32] = Integer.parseInt(param);
  347.          } else {
  348.             this.m_cur_size[var32] = this.m_size;
  349.          }
  350.  
  351.          param = ((Applet)this).getParameter("colorjump" + var32);
  352.          if (param != null) {
  353.             this.m_cur_color_jump[var32] = Integer.parseInt(param);
  354.          } else {
  355.             this.m_cur_color_jump[var32] = this.m_color_jump;
  356.          }
  357.  
  358.          param = ((Applet)this).getParameter("delay" + var32);
  359.          if (param != null) {
  360.             this.m_cur_delay[var32] = Integer.parseInt(param);
  361.          } else {
  362.             this.m_cur_delay[var32] = this.m_delay;
  363.          }
  364.  
  365.          param = ((Applet)this).getParameter("colordelay" + var32);
  366.          if (param != null) {
  367.             this.m_cur_color_delay[var32] = Integer.parseInt(param);
  368.          } else {
  369.             this.m_cur_color_delay[var32] = this.m_color_delay;
  370.          }
  371.  
  372.          param = ((Applet)this).getParameter("desturl" + var32);
  373.          if (param != null) {
  374.             this.m_cur_desturl[var32] = param;
  375.          } else {
  376.             this.m_cur_desturl[var32] = this.m_desturl;
  377.          }
  378.  
  379.          param = ((Applet)this).getParameter("loadwhere" + var32);
  380.          if (param != null) {
  381.             this.m_cur_loadwhere[var32] = param;
  382.          } else {
  383.             this.m_cur_loadwhere[var32] = this.m_loadwhere;
  384.          }
  385.  
  386.          param = ((Applet)this).getParameter("centertext" + var32);
  387.          if (param != null) {
  388.             this.m_cur_xcenter[var32] = Boolean.valueOf(param);
  389.          } else {
  390.             this.m_cur_xcenter[var32] = this.m_xcenter;
  391.          }
  392.  
  393.          param = ((Applet)this).getParameter("bordercolor" + var32);
  394.          if (param != null) {
  395.             this.m_cur_b_color[var32] = this.ConvertColor(param);
  396.          } else {
  397.             this.m_cur_b_color[var32] = this.m_b_color;
  398.          }
  399.  
  400.          param = ((Applet)this).getParameter("borderthickness" + var32);
  401.          if (param != null) {
  402.             this.m_cur_b_thick[var32] = Integer.parseInt(param);
  403.          } else {
  404.             this.m_cur_b_thick[var32] = this.m_b_thick;
  405.          }
  406.       }
  407.  
  408.       if (this.bad_descrips) {
  409.          this.m_msg[0] = "Must include 'desc0' tag at a minimum in order for this applet to function.";
  410.          this.m_cur_delay[0] = 30000;
  411.       }
  412.  
  413.       ((Component)this).setFont(this.font = new Font(this.m_messagefont, this.font_style, this.m_size));
  414.       this.field_0 = ((Component)this).getFontMetrics(this.font);
  415.       this.off = ((Component)this).createImage(this.field_1.width, this.field_1.height);
  416.       this.g_off = this.off.getGraphics();
  417.       this.g_off.setFont(this.font = new Font(this.m_messagefont, this.font_style, this.m_size));
  418.    }
  419.  
  420.    public void paint(Graphics g) {
  421.       g.drawImage(this.off, 0, 0, this);
  422.    }
  423.  
  424.    public void DrawSlide(Graphics g) {
  425.       int i = 0;
  426.       double y_pos = (double)0.0F;
  427.       double y_ratio = (double)this.field_1.height / (double)this.field_1.width;
  428.       new Polygon();
  429.       String[] v_message = new String[0];
  430.       int message_height = 0;
  431.       if (!this.gSok) {
  432.          int y = (this.field_1.height - this.m_size) / 2 + this.m_size;
  433.          g.drawString("Invalid 'Notice' Param", 0, y);
  434.          this.g_off.drawString("Invalid 'Notice' Param", 0, y);
  435.       } else {
  436.          for(this.field_2 = 0; this.field_2 < this.m_num_msg; ++this.field_2) {
  437.             this.g_off.setFont(this.font = new Font(this.m_messagefont, this.font_style, this.m_cur_size[this.field_2]));
  438.             this.field_0 = ((Component)this).getFontMetrics(this.font);
  439.             int y = this.field_1.height / 2 + (this.field_0.getAscent() + this.field_0.getLeading()) / 2;
  440.             if (this.field_0.stringWidth(this.m_msg[this.field_2]) > this.field_1.width - (this.m_cur_b_thick[this.field_2] * 2 + this.m_xoffset * 2)) {
  441.                this.multi_line = true;
  442.                v_message = this.MessageParser(this.m_msg[this.field_2]);
  443.                this.g_off.setColor(this.m_cur_bgcolor[this.field_2]);
  444.                this.g_off.fillRect(0, 0, this.field_1.width, this.field_1.height);
  445.                if (this.m_cur_b_thick[this.field_2] > 0) {
  446.                   this.g_off.setColor(this.m_cur_b_color[this.field_2]);
  447.                   if (this.m_cur_b_thick[this.field_2] == 1) {
  448.                      this.g_off.drawRect(0, 0, this.field_1.width - 1, this.field_1.height - 1);
  449.                   } else {
  450.                      Polygon var28 = new Polygon();
  451.                      var28.addPoint(0, 0);
  452.                      var28.addPoint(this.field_1.width, 0);
  453.                      var28.addPoint(this.field_1.width, this.field_1.height);
  454.                      var28.addPoint(0, this.field_1.height);
  455.                      var28.addPoint(0, 0);
  456.                      var28.addPoint(this.m_cur_b_thick[this.field_2], this.m_cur_b_thick[this.field_2]);
  457.                      var28.addPoint(this.field_1.width - this.m_cur_b_thick[this.field_2], this.m_cur_b_thick[this.field_2]);
  458.                      var28.addPoint(this.field_1.width - this.m_cur_b_thick[this.field_2], this.field_1.height - this.m_cur_b_thick[this.field_2]);
  459.                      var28.addPoint(this.m_cur_b_thick[this.field_2], this.field_1.height - this.m_cur_b_thick[this.field_2]);
  460.                      var28.addPoint(this.m_cur_b_thick[this.field_2], this.m_cur_b_thick[this.field_2]);
  461.                      this.g_off.fillPolygon(var28);
  462.                   }
  463.                }
  464.  
  465.                this.g_off.setColor(this.m_cur_textcolor[this.field_2]);
  466.                message_height = this.field_0.getHeight() * v_message.length;
  467.                if (message_height > this.field_1.height - this.m_cur_b_thick[this.field_2] * 2) {
  468.                   this.g_off.setFont(this.font = new Font(this.m_messagefont, this.font_style, 12));
  469.                   this.g_off.drawString("Error - Cannot Fit, Please Resize", this.field_1.width / 2 - this.field_0.stringWidth("Error - Cannot Fit, Please Resize") / 2, y);
  470.                   this.g_off.setFont(this.font = new Font(this.m_messagefont, this.font_style, this.m_size));
  471.                } else {
  472.                   int message_start = this.field_1.height / 2 - message_height / 2;
  473.  
  474.                   for(int l = 0; l < v_message.length; ++l) {
  475.                      this.g_off.setColor(this.m_cur_textcolor[this.field_2]);
  476.                      if (this.m_cur_xcenter[this.field_2]) {
  477.                         this.g_off.drawString(v_message[l], this.field_1.width / 2 - this.field_0.stringWidth(v_message[l]) / 2, message_start + (l + 1) * this.field_0.getHeight());
  478.                      } else {
  479.                         this.g_off.drawString(v_message[l], this.m_xoffset + this.m_cur_b_thick[this.field_2], message_start + (l + 1) * this.field_0.getHeight());
  480.                      }
  481.                   }
  482.                }
  483.             } else {
  484.                this.multi_line = false;
  485.                if (this.m_cur_xcenter[this.field_2]) {
  486.                   this.center_x = this.field_1.width / 2 - this.field_0.stringWidth(this.m_msg[this.field_2]) / 2;
  487.                } else {
  488.                   this.center_x = this.m_xoffset + this.m_cur_b_thick[this.field_2];
  489.                }
  490.  
  491.                this.g_off.setColor(this.m_cur_bgcolor[this.field_2]);
  492.                this.g_off.fillRect(0, 0, this.field_1.width, this.field_1.height);
  493.                if (this.m_cur_b_thick[this.field_2] > 0) {
  494.                   this.g_off.setColor(this.m_cur_b_color[this.field_2]);
  495.                   if (this.m_cur_b_thick[this.field_2] == 1) {
  496.                      this.g_off.drawRect(0, 0, this.field_1.width - 1, this.field_1.height - 1);
  497.                   } else {
  498.                      Polygon frame = new Polygon();
  499.                      frame.addPoint(0, 0);
  500.                      frame.addPoint(this.field_1.width, 0);
  501.                      frame.addPoint(this.field_1.width, this.field_1.height);
  502.                      frame.addPoint(0, this.field_1.height);
  503.                      frame.addPoint(0, 0);
  504.                      frame.addPoint(this.m_cur_b_thick[this.field_2], this.m_cur_b_thick[this.field_2]);
  505.                      frame.addPoint(this.field_1.width - this.m_cur_b_thick[this.field_2], this.m_cur_b_thick[this.field_2]);
  506.                      frame.addPoint(this.field_1.width - this.m_cur_b_thick[this.field_2], this.field_1.height - this.m_cur_b_thick[this.field_2]);
  507.                      frame.addPoint(this.m_cur_b_thick[this.field_2], this.field_1.height - this.m_cur_b_thick[this.field_2]);
  508.                      frame.addPoint(this.m_cur_b_thick[this.field_2], this.m_cur_b_thick[this.field_2]);
  509.                      this.g_off.fillPolygon(frame);
  510.                   }
  511.                }
  512.  
  513.                this.g_off.setColor(this.m_cur_textcolor[this.field_2]);
  514.                this.g_off.drawString(this.m_msg[this.field_2], this.center_x, y);
  515.             }
  516.  
  517.             int fade_jumps = 0;
  518.             boolean fade_up = false;
  519.             int max_r = this.m_cur_textcolor[this.field_2].getRed();
  520.             int max_g = this.m_cur_textcolor[this.field_2].getGreen();
  521.             int max_b = this.m_cur_textcolor[this.field_2].getBlue();
  522.             int maxb_r = this.m_cur_bgcolor[this.field_2].getRed();
  523.             int maxb_g = this.m_cur_bgcolor[this.field_2].getGreen();
  524.             int maxb_b = this.m_cur_bgcolor[this.field_2].getBlue();
  525.             if (max_r + max_g + max_b > maxb_r + maxb_g + maxb_b) {
  526.                fade_up = true;
  527.             } else {
  528.                fade_up = false;
  529.             }
  530.  
  531.             fade_jumps = 255;
  532.  
  533.             for(int var25 = 0; var25 < fade_jumps; var25 += this.m_cur_color_jump[this.field_2]) {
  534.                try {
  535.                   Thread.sleep((long)this.m_cur_color_delay[this.field_2]);
  536.                } catch (InterruptedException var24) {
  537.                }
  538.  
  539.                if (fade_up) {
  540.                   if (maxb_r < max_r) {
  541.                      maxb_r += this.m_cur_color_jump[this.field_2];
  542.                   }
  543.  
  544.                   if (maxb_g < max_g) {
  545.                      maxb_g += this.m_cur_color_jump[this.field_2];
  546.                   }
  547.  
  548.                   if (maxb_b < max_b) {
  549.                      maxb_b += this.m_cur_color_jump[this.field_2];
  550.                   }
  551.  
  552.                   Color fade = new Color(maxb_r, maxb_g, maxb_b);
  553.                   this.g_off.setColor(fade);
  554.                } else {
  555.                   if (maxb_r > max_r) {
  556.                      maxb_r -= this.m_cur_color_jump[this.field_2];
  557.                   }
  558.  
  559.                   if (maxb_g > max_g) {
  560.                      maxb_g -= this.m_cur_color_jump[this.field_2];
  561.                   }
  562.  
  563.                   if (maxb_b > max_b) {
  564.                      maxb_b -= this.m_cur_color_jump[this.field_2];
  565.                   }
  566.  
  567.                   Color fade = new Color(maxb_r, maxb_g, maxb_b);
  568.                   this.g_off.setColor(fade);
  569.                }
  570.  
  571.                if (this.multi_line) {
  572.                   int message_start = this.field_1.height / 2 - message_height / 2;
  573.  
  574.                   for(int l = 0; l < v_message.length; ++l) {
  575.                      if (this.m_cur_xcenter[this.field_2]) {
  576.                         this.g_off.drawString(v_message[l], this.field_1.width / 2 - this.field_0.stringWidth(v_message[l]) / 2, message_start + (l + 1) * this.field_0.getHeight());
  577.                      } else {
  578.                         this.g_off.drawString(v_message[l], this.m_xoffset + this.m_cur_b_thick[this.field_2], message_start + (l + 1) * this.field_0.getHeight());
  579.                      }
  580.                   }
  581.                } else {
  582.                   this.g_off.drawString(this.m_msg[this.field_2], this.center_x, y);
  583.                }
  584.  
  585.                g.drawImage(this.off, 0, 0, this);
  586.             }
  587.  
  588.             maxb_r = this.m_cur_bgcolor[this.field_2].getRed();
  589.             maxb_g = this.m_cur_bgcolor[this.field_2].getGreen();
  590.             maxb_b = this.m_cur_bgcolor[this.field_2].getBlue();
  591.  
  592.             try {
  593.                Thread.sleep((long)this.m_cur_delay[this.field_2]);
  594.             } catch (InterruptedException var23) {
  595.             }
  596.  
  597.             for(int var26 = 0; var26 < fade_jumps; var26 += this.m_cur_color_jump[this.field_2]) {
  598.                try {
  599.                   Thread.sleep((long)this.m_cur_color_delay[this.field_2]);
  600.                } catch (InterruptedException var22) {
  601.                }
  602.  
  603.                if (fade_up) {
  604.                   if (max_r > maxb_r) {
  605.                      max_r -= this.m_cur_color_jump[this.field_2];
  606.                   }
  607.  
  608.                   if (max_g > maxb_g) {
  609.                      max_g -= this.m_cur_color_jump[this.field_2];
  610.                   }
  611.  
  612.                   if (max_b > maxb_b) {
  613.                      max_b -= this.m_cur_color_jump[this.field_2];
  614.                   }
  615.  
  616.                   Color fade = new Color(max_r, max_g, max_b);
  617.                   this.g_off.setColor(fade);
  618.                } else {
  619.                   if (max_r < maxb_r) {
  620.                      max_r += this.m_cur_color_jump[this.field_2];
  621.                   }
  622.  
  623.                   if (max_g < maxb_g) {
  624.                      max_g += this.m_cur_color_jump[this.field_2];
  625.                   }
  626.  
  627.                   if (max_b < maxb_b) {
  628.                      max_b += this.m_cur_color_jump[this.field_2];
  629.                   }
  630.  
  631.                   Color fade = new Color(max_r, max_g, max_b);
  632.                   this.g_off.setColor(fade);
  633.                }
  634.  
  635.                if (this.multi_line) {
  636.                   int message_start = this.field_1.height / 2 - message_height / 2;
  637.  
  638.                   for(int l = 0; l < v_message.length; ++l) {
  639.                      if (this.m_cur_xcenter[this.field_2]) {
  640.                         this.g_off.drawString(v_message[l], this.field_1.width / 2 - this.field_0.stringWidth(v_message[l]) / 2, message_start + (l + 1) * this.field_0.getHeight());
  641.                      } else {
  642.                         this.g_off.drawString(v_message[l], this.m_xoffset + this.m_cur_b_thick[this.field_2], message_start + (l + 1) * this.field_0.getHeight());
  643.                      }
  644.                   }
  645.                } else {
  646.                   this.g_off.drawString(this.m_msg[this.field_2], this.center_x, y);
  647.                }
  648.  
  649.                g.drawImage(this.off, 0, 0, this);
  650.             }
  651.          }
  652.  
  653.       }
  654.    }
  655. }
  656.