home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 June / INTERNET92.ISO / pc / software / windows / building / visual_dhtml / visualdhtmlwin9x_nt.exe / OCAgrid.___ (.txt) < prev    next >
Encoding:
Java Class File  |  2001-10-19  |  27.1 KB  |  2,613 lines

  1. import java.awt.Color;
  2. import java.awt.Component;
  3. import java.awt.Container;
  4. import java.awt.Dialog;
  5. import java.awt.Dimension;
  6. import java.awt.Event;
  7. import java.awt.Font;
  8. import java.awt.FontMetrics;
  9. import java.awt.Graphics;
  10. import java.awt.Image;
  11. import java.awt.LayoutManager;
  12. import java.awt.Menu;
  13. import java.awt.MenuItem;
  14. import java.awt.Panel;
  15. import java.awt.PopupMenu;
  16. import java.awt.Scrollbar;
  17. import java.awt.Window;
  18.  
  19. public class OCAgrid extends Panel implements Runnable {
  20.    public int ibDistY = 3;
  21.    private Thread goauto;
  22.    private int hdx = 0;
  23.    private int hdy = 0;
  24.    private int hsy = 0;
  25.    private boolean hdown = false;
  26.    private int lastnewpos = -1;
  27.    private int orighmpos = 0;
  28.    private int curDSX = 0;
  29.    private int hlorig = -1;
  30.    private int hlnew = -1;
  31.    private String hlstring = "";
  32.    private boolean isError = false;
  33.    private boolean isRedo;
  34.    private String orig_val = "";
  35.    private boolean reExSet = false;
  36.    private boolean button_down = false;
  37.    private boolean first_sb_run = true;
  38.    private boolean populated = false;
  39.    private boolean paint_called = false;
  40.    private Color bgColor = new Color(220, 220, 220);
  41.    private Event the_e = null;
  42.    private int exOffHeight;
  43.    private int exBitHeight = 17;
  44.    private int exBoxHeight = 12;
  45.    private int cur_exOffHeight = 0;
  46.    private int cur_exHL = -1;
  47.    private int exMouseY = 0;
  48.    private int bitHeight;
  49.    private int cursorPos = 0;
  50.    private int curButton = -1;
  51.    // $FF: renamed from: d java.awt.Dimension
  52.    private Dimension field_0;
  53.    private int offHeight = 0;
  54.    private boolean use_sb = false;
  55.    private int sb_width = 13;
  56.    // $FF: renamed from: sb java.awt.Scrollbar
  57.    private Scrollbar field_1;
  58.    private int scroll_y;
  59.    private int old_scrolly;
  60.    private boolean sb_scrollsmooth;
  61.    private int sb_smoothjump = 2;
  62.    private int cur_cpos = 0;
  63.    private int m_jump_size = 4;
  64.    private int exOnKey = -1;
  65.    private Font font = new Font("Helvetica", 0, 11);
  66.    // $FF: renamed from: fm java.awt.FontMetrics
  67.    private FontMetrics field_2;
  68.    private Font efont = new Font("Helvetica", 1, 11);
  69.    private FontMetrics efm;
  70.    // $FF: renamed from: ts java.awt.Image
  71.    private Image field_3;
  72.    private Graphics g_ts;
  73.    // $FF: renamed from: ib java.awt.Image
  74.    private Image field_4;
  75.    private Graphics g_ib;
  76.    // $FF: renamed from: ex java.awt.Image
  77.    private Image field_5;
  78.    private Graphics g_ex;
  79.    boolean first_run = true;
  80.    boolean mouse_in = false;
  81.    private int lmargin = 6;
  82.    private int exRMargin = 5;
  83.    private int inputHeight = 15;
  84.    private boolean inputHeightFixed = false;
  85.    private boolean maxTitleWidthFixed = false;
  86.    private int maxTitleLength = 0;
  87.    private int col_width1;
  88.    private int col_startx1;
  89.    private int col_width2;
  90.    private int col_startx2;
  91.    private int[] ib_starty;
  92.    private int ib_active = -1;
  93.    public String[] m_title;
  94.    public String[] m_values;
  95.    public String[] m_exTitle;
  96.    private int[] m_exID;
  97.    private int[] m_exTitleCount;
  98.    private int[] ex_starty;
  99.    private boolean[] ex_isExpanded;
  100.    private int[] ex_ibStartIndex;
  101.    private int[] ex_ibStarty;
  102.    private int arrow_rightmargin = 6;
  103.    private static Color exBoxColor = new Color(220, 220, 220);
  104.    private static Color arrowColor = new Color(51, 51, 51);
  105.    private static Color arrowHLColor = new Color(51, 51, 51);
  106.    private static Color boxTextColor = new Color(51, 51, 51);
  107.    private static Color activeArrowColor = new Color(51, 51, 51);
  108.    private static Color itemboxColor = new Color(220, 220, 220);
  109.    private static Image arD;
  110.    private static Image arU;
  111.    private static Image arHL;
  112.    private static Image arUHL;
  113.    private static Image arErase;
  114.    private static Graphics g_arrow;
  115.    private boolean[] m_static;
  116.    private int[] m_type;
  117.    private boolean expander;
  118.  
  119.    public boolean mouseEnter(Event var1, int var2, int var3) {
  120.       return true;
  121.    }
  122.  
  123.    public boolean gotFocus(Event var1, Object var2) {
  124.       ACutila.curGrid = this;
  125.       return super.gotFocus(var1, var2);
  126.    }
  127.  
  128.    private void exCheckKeyDown() {
  129.       if (this.exOnKey < this.m_exTitleCount.length) {
  130.          this.stop();
  131.          if (this.cur_exHL != this.exOnKey) {
  132.             this.undoHLEX(this.exOnKey);
  133.          } else {
  134.             this.hlEX(this.exOnKey, false);
  135.          }
  136.  
  137.          if (this.ex_isExpanded[this.exOnKey]) {
  138.             int var1 = this.exOnKey;
  139.             this.exOnKey = -1;
  140.             this.moveToInputBox(this.ex_ibStartIndex[var1], -1);
  141.             return;
  142.          }
  143.  
  144.          if (this.exOnKey != this.m_exTitleCount.length - 1) {
  145.             ++this.exOnKey;
  146.             this.start();
  147.             this.exKeyScroll(this.exOnKey);
  148.          }
  149.       }
  150.  
  151.    }
  152.  
  153.    public boolean lostFocus(Event var1, Object var2) {
  154.       ACutila.curGrid = null;
  155.  
  156.       try {
  157.          this.undoActiveIB();
  158.          if (this.expander && this.exOnKey > -1) {
  159.             this.stop();
  160.             this.undoHLEX(this.exOnKey);
  161.             this.paintIt();
  162.             this.exOnKey = -1;
  163.          }
  164.  
  165.          return true;
  166.       } catch (Exception var3) {
  167.          return true;
  168.       }
  169.    }
  170.  
  171.    private synchronized void exUpdateInputBox(int var1, int var2, Event var3) {
  172.       if (var2 == 10) {
  173.          if (var1 > -1) {
  174.             if (this.ex_isExpanded[var1]) {
  175.                this.retractItem(var1);
  176.                return;
  177.             }
  178.  
  179.             this.expandItem(var1);
  180.             return;
  181.          }
  182.       } else if (var2 == 9) {
  183.          if (!var3.shiftDown()) {
  184.             this.exCheckKeyDown();
  185.             return;
  186.          }
  187.  
  188.          this.exCheckKeyUp();
  189.          return;
  190.       }
  191.  
  192.    }
  193.  
  194.    public void setMaxTitleWidth(int var1) {
  195.       this.maxTitleWidthFixed = true;
  196.       this.maxTitleLength = var1;
  197.    }
  198.  
  199.    private void checkKeyUp(int var1) {
  200.       if (this.expander && var1 >= 0 && var1 - 1 == this.ex_ibStartIndex[this.m_exID[var1]] - 1) {
  201.          this.undoActiveIB();
  202.          this.exOnKey = this.m_exID[var1];
  203.          this.start();
  204.          this.exKeyScroll(this.exOnKey);
  205.       } else {
  206.          if (var1 > 0) {
  207.             this.moveToInputBox(var1 - 1, -1);
  208.          }
  209.  
  210.       }
  211.    }
  212.  
  213.    private void undoActiveIB() {
  214.       this.stop();
  215.       if (this.curButton > -1 && !this.m_static[this.curButton]) {
  216.          this.undoButton(this.curButton);
  217.          this.paintIt();
  218.          this.curButton = -1;
  219.       }
  220.  
  221.       if (this.ib_active > -1) {
  222.          this.hlorig = -1;
  223.          this.hlnew = -1;
  224.          this.hlstring = "";
  225.          this.drawOffString(this.ib_active, false, 0, false);
  226.          this.paintIt();
  227.          this.validateEntry(this.ib_active);
  228.          if (!this.m_values[this.ib_active].equals(this.orig_val)) {
  229.             this.validateEntry(this.ib_active);
  230.             this.the_e.id = 901;
  231.             this.the_e.arg = (new Integer(this.ib_active)).toString();
  232.             super.postEvent(this.the_e);
  233.          }
  234.  
  235.          this.ib_active = -1;
  236.       }
  237.  
  238.    }
  239.  
  240.    private synchronized void exKeySmall(int var1, int var2) {
  241.       if (this.ex_isExpanded[var1]) {
  242.          g_arrow = arErase.getGraphics();
  243.          g_arrow.setColor(exBoxColor);
  244.          g_arrow.fillRect(0, 0, arUHL.getWidth(this), arUHL.getHeight(this));
  245.          g_arrow.setColor(activeArrowColor);
  246.          int var7 = (8 - var2) / 2;
  247.          if (var2 > 0) {
  248.             int var8 = var7;
  249.             int var9 = 4;
  250.  
  251.             for(int var10 = var2; var10 >= 0; var10 -= 2) {
  252.                g_arrow.drawLine(var8, var9, var8 + var10, var9);
  253.                --var9;
  254.                ++var8;
  255.             }
  256.          }
  257.  
  258.          this.g_ex.drawImage(arErase, this.arrow_rightmargin, this.ex_starty[var1] + 4, this);
  259.       } else {
  260.          g_arrow = arErase.getGraphics();
  261.          g_arrow.setColor(exBoxColor);
  262.          g_arrow.fillRect(0, 0, arUHL.getWidth(this), arUHL.getHeight(this));
  263.          g_arrow.setColor(activeArrowColor);
  264.          int var3 = (8 - var2) / 2;
  265.          if (var2 > 0) {
  266.             int var4 = var3;
  267.             int var5 = 0;
  268.  
  269.             for(int var6 = var2; var6 >= 0; var6 -= 2) {
  270.                g_arrow.drawLine(var4, var5, var4 + var6, var5);
  271.                ++var5;
  272.                ++var4;
  273.             }
  274.          }
  275.  
  276.          this.g_ex.drawImage(arErase, this.arrow_rightmargin, this.ex_starty[var1] + 4, this);
  277.       }
  278.    }
  279.  
  280.    public boolean preCheckDataChange() {
  281.       if (this.ib_active > -1 && !this.m_values[this.ib_active].equals(this.orig_val)) {
  282.          this.validateEntry(this.ib_active);
  283.          return true;
  284.       } else {
  285.          return false;
  286.       }
  287.    }
  288.  
  289.    private void figureAndDrawButton(int var1) {
  290.       if (this.m_type[var1] != 2 && this.m_type[var1] != 200 && this.m_type[var1] != 201) {
  291.          this.drawButton(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var1], this.inputHeight - 1, this.inputHeight - 1, 1);
  292.       } else {
  293.          this.drawSpinner(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var1], this.inputHeight - 1, 6, 1, true);
  294.          this.drawSpinner(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var1] + this.inputHeight / 2, this.inputHeight - 1, 6, 1, false);
  295.       }
  296.    }
  297.  
  298.    private synchronized void exUpdateInputBoxAction(int var1, int var2, Event var3) {
  299.       if (var2 == 1004) {
  300.          if (var3.shiftDown()) {
  301.             this.exGoToIndex(-1);
  302.          } else {
  303.             this.exCheckKeyUp();
  304.          }
  305.       } else {
  306.          if (var2 == 1005) {
  307.             if (var3.shiftDown()) {
  308.                this.exGoToIndex(-2);
  309.                return;
  310.             }
  311.  
  312.             this.exCheckKeyDown();
  313.          }
  314.  
  315.       }
  316.    }
  317.  
  318.    private void undoButton(int var1) {
  319.       this.g_ts.setColor(this.bgColor);
  320.       this.g_ts.fillRect(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var1], this.inputHeight, this.inputHeight);
  321.       this.paintToEX(var1);
  322.    }
  323.  
  324.    public void setBackgroundColor(Color var1) {
  325.       this.bgColor = var1;
  326.    }
  327.  
  328.    private void setDropListGlobals() {
  329.       ((Component)this).location();
  330.    }
  331.  
  332.    public void preKill() {
  333.       this.stop();
  334.       this.goauto = null;
  335.       this.paint_called = false;
  336.    }
  337.  
  338.    public void setInputHeight(int var1) {
  339.       this.inputHeight = var1;
  340.       this.inputHeightFixed = true;
  341.       this.paintIt();
  342.    }
  343.  
  344.    private int checkYExpandMouse(int var1) {
  345.       for(int var2 = 0; var2 < this.ex_starty.length; ++var2) {
  346.          if (var1 >= this.ex_starty[var2] + this.scroll_y && var1 <= this.ex_starty[var2] + this.exBoxHeight + this.scroll_y) {
  347.             return var2;
  348.          }
  349.       }
  350.  
  351.       return -1;
  352.    }
  353.  
  354.    public synchronized void drawOffString(int var1, boolean var2, int var3, boolean var4) {
  355.       this.g_ib.setColor(Color.white);
  356.       this.g_ib.fillRect(0, 0, this.col_width2, this.inputHeight);
  357.       this.g_ib.setColor(Color.black);
  358.       this.g_ib.drawLine(0, 0, this.col_width2, 0);
  359.       this.g_ib.drawLine(0, this.inputHeight - 1, this.col_width2, this.inputHeight - 1);
  360.       this.g_ib.setColor(Color.black);
  361.       int var5 = this.field_2.stringWidth(this.m_values[var1]);
  362.       if (var5 > this.col_width2 - 1) {
  363.          if (var4) {
  364.             int var6 = this.field_2.stringWidth(this.m_values[var1].substring(0, this.cursorPos));
  365.             boolean var7 = false;
  366.             if (var6 + this.curDSX >= this.col_width2) {
  367.                this.curDSX = this.col_width2 - var6;
  368.                var7 = true;
  369.             }
  370.  
  371.             if (var6 + this.curDSX <= 0) {
  372.                this.curDSX = -var6 + 1;
  373.                var7 = true;
  374.             }
  375.  
  376.             if (this.curDSX == 0) {
  377.                this.curDSX = 1;
  378.             }
  379.  
  380.             this.g_ib.drawString(this.m_values[var1], this.curDSX, this.field_2.getHeight() - 3);
  381.          } else {
  382.             this.g_ib.drawString(this.m_values[var1], 1, this.field_2.getHeight() - 3);
  383.          }
  384.       } else {
  385.          this.curDSX = 0;
  386.          this.g_ib.drawString(this.m_values[var1], 1, this.field_2.getHeight() - 3);
  387.       }
  388.  
  389.       if (this.hlorig > -1 && this.hlnew > -1) {
  390.          if (this.hlnew == this.hlorig) {
  391.             this.hlnew = -1;
  392.             this.hlorig = -1;
  393.             this.hlstring = "";
  394.          } else {
  395.             this.g_ib.setColor(new Color(102, 102, 102));
  396.             int var10 = this.hlnew;
  397.             if (this.hlorig < this.hlnew) {
  398.                var10 = this.hlorig;
  399.             }
  400.  
  401.             int var14 = this.curDSX;
  402.             if (this.curDSX != 0) {
  403.                --var14;
  404.             }
  405.  
  406.             int var8 = this.field_2.stringWidth(this.m_values[var1].substring(0, var10)) + 1 + var14;
  407.             int var9 = this.field_2.stringWidth(this.hlstring) - 1;
  408.             this.g_ib.fillRect(var8, 1, var9, this.inputHeight - 2);
  409.             this.g_ib.setColor(new Color(255, 255, 153));
  410.             this.g_ib.drawString(this.hlstring, var8, this.field_2.getHeight() - 3);
  411.             this.g_ib.setColor(new Color(0, 0, 0));
  412.             this.g_ib.drawRect(var8 - 1, 0, var9 + 1, this.inputHeight - 1);
  413.             this.g_ib.setColor(Color.black);
  414.          }
  415.       }
  416.  
  417.       if (var2) {
  418.          int var11 = this.field_2.stringWidth(this.m_values[var1].substring(0, this.cursorPos));
  419.          if (var5 > this.col_width2 - 1) {
  420.             var11 = var11 + this.curDSX - 1;
  421.          }
  422.  
  423.          if (var3 == 0) {
  424.             this.g_ib.drawLine(var11, 1, var11, this.inputHeight - 2);
  425.          } else if (var3 == 1) {
  426.             this.g_ib.drawLine(var11, 6, var11, this.inputHeight - 7);
  427.          } else if (var3 == 2) {
  428.             this.g_ib.drawLine(var11, 4, var11, this.inputHeight - 5);
  429.          } else if (var3 == 3) {
  430.             this.g_ib.drawLine(var11, 2, var11, this.inputHeight - 3);
  431.          }
  432.       }
  433.  
  434.       this.g_ts.drawImage(this.field_4, this.col_startx2, this.ib_starty[var1], this);
  435.       this.paintToEX(var1);
  436.    }
  437.  
  438.    public int getSubMenuField() {
  439.       for(int var1 = 0; var1 < this.m_values.length; ++var1) {
  440.          if (this.m_type[var1] == 101 || this.m_type[var1] == 100) {
  441.             return var1;
  442.          }
  443.       }
  444.  
  445.       return -1;
  446.    }
  447.  
  448.    public boolean getIsColorField() {
  449.       return this.ib_active > -1 && this.m_type[this.ib_active] == 3;
  450.    }
  451.  
  452.    public void reshape(int var1, int var2, int var3, int var4) {
  453.       if (var3 * var4 > 0) {
  454.          this.field_0 = new Dimension(var3, var4);
  455.          this.reDoGrid();
  456.          super.reshape(var1, var2, var3, var4);
  457.       }
  458.    }
  459.  
  460.    public boolean mouseExit(Event var1, int var2, int var3) {
  461.       this.exMouseY = -1;
  462.       this.undoExHL();
  463.       return true;
  464.    }
  465.  
  466.    private void DrawGrid() {
  467.       this.col_width1 = this.getMaxTitleLength() + 10;
  468.       this.col_startx1 = this.lmargin;
  469.       if (!this.expander) {
  470.          if (this.use_sb) {
  471.             this.col_width2 = this.field_0.width - this.lmargin - this.exRMargin - this.inputHeight - this.col_width1 - this.sb_width + 1;
  472.          } else {
  473.             this.col_width2 = this.field_0.width - this.lmargin - this.exRMargin - this.inputHeight - this.col_width1 + 1;
  474.          }
  475.       } else {
  476.          this.exRMargin = 5;
  477.          if (this.exOffHeight - 1 > this.field_0.height) {
  478.             this.col_width2 = this.field_0.width - this.lmargin - this.exRMargin - this.inputHeight - this.col_width1 - this.sb_width + 1;
  479.          } else {
  480.             this.col_width2 = this.field_0.width - this.lmargin - this.exRMargin - this.inputHeight - this.col_width1 + 1;
  481.          }
  482.       }
  483.  
  484.       if (this.col_width2 <= 0) {
  485.          this.col_width2 = 1;
  486.       }
  487.  
  488.       this.col_startx2 = this.lmargin + this.col_width1;
  489.       this.field_4 = ((Component)this).createImage(this.col_width2, this.inputHeight);
  490.       this.g_ib = this.field_4.getGraphics();
  491.       this.g_ib.setFont(this.font);
  492.       int var1 = this.field_2.getHeight();
  493.       this.bitHeight = this.field_2.getHeight() + this.ibDistY;
  494.  
  495.       for(int var2 = 0; var2 < this.m_title.length; ++var2) {
  496.          this.g_ts.setColor(Color.white);
  497.          this.ib_starty[var2] = var1 - this.field_2.getHeight() + 2;
  498.          this.g_ts.fillRect(this.col_startx2, this.ib_starty[var2], this.col_width2, this.inputHeight);
  499.          this.g_ts.setColor(Color.black);
  500.          this.g_ts.drawRect(this.col_startx2 - 1, this.ib_starty[var2], this.col_width2 + 1, this.inputHeight - 1);
  501.          if (this.m_title[var2] != null && this.m_title[var2] != "") {
  502.             this.g_ts.setColor(itemboxColor);
  503.             this.g_ts.fillRect(this.lmargin - 2, this.ib_starty[var2], this.col_startx2 - this.lmargin, this.inputHeight);
  504.             this.g_ts.setColor(Color.black);
  505.             this.g_ts.drawString(this.m_title[var2], this.lmargin, var1 - 1);
  506.          } else {
  507.             this.g_ts.setColor(Color.black);
  508.          }
  509.  
  510.          this.g_ts.clipRect(this.col_startx2, this.ib_starty[var2], this.col_width2, this.inputHeight);
  511.          if (this.m_values[var2] != null) {
  512.             this.g_ts.drawString(this.m_values[var2], this.col_startx2 + 1, var1 - 1);
  513.          } else {
  514.             this.m_values[var2] = "";
  515.          }
  516.  
  517.          this.g_ts = this.field_3.getGraphics();
  518.          this.g_ts.setFont(this.font);
  519.          var1 += this.bitHeight;
  520.          if (this.m_static[var2]) {
  521.             this.figureAndDrawButton(var2);
  522.          }
  523.       }
  524.  
  525.       if (this.expander) {
  526.          this.createArrows();
  527.          this.exRMargin = 5;
  528.          if (this.use_sb) {
  529.             this.exRMargin += this.sb_width;
  530.          }
  531.  
  532.          var1 = this.efm.getHeight();
  533.  
  534.          for(int var6 = 0; var6 < this.m_exTitle.length; ++var6) {
  535.             this.ex_starty[var6] = var1 - this.efm.getHeight() + 3;
  536.             this.g_ex.setColor(exBoxColor);
  537.             this.g_ex.fillRect(3, this.ex_starty[var6] - 1, this.field_0.width - this.exRMargin - 1, this.exBoxHeight + 2);
  538.             this.g_ex.setColor(boxTextColor);
  539.             this.g_ex.drawString(this.m_exTitle[var6], 18, this.ex_starty[var6] + this.efm.getHeight() - 4);
  540.             this.g_ex.setColor(arrowColor);
  541.             this.g_ex.drawImage(arU, this.arrow_rightmargin, this.ex_starty[var6] + 4, this);
  542.             var1 += this.exBitHeight;
  543.             if (!this.reExSet) {
  544.                int var3 = 2;
  545.  
  546.                for(int var4 = this.ex_ibStartIndex[var6]; var4 < this.ex_ibStartIndex[var6] + this.m_exTitleCount[var6]; ++var4) {
  547.                   this.ex_ibStarty[var4] = var3 + (this.m_exID[var4] + 1) * this.exBitHeight;
  548.                   var3 += this.bitHeight;
  549.                }
  550.             }
  551.          }
  552.       }
  553.  
  554.       this.paintIt();
  555.    }
  556.  
  557.    public void reDoGrid() {
  558.       if (!this.first_run) {
  559.          this.isRedo = true;
  560.          if (this.ib_active > -1 || this.exOnKey > -1) {
  561.             this.stop();
  562.          }
  563.  
  564.          if (!this.expander) {
  565.             this.first_run = true;
  566.             if (this.scroll_y + this.offHeight + 3 < this.field_0.height) {
  567.                if (this.offHeight < this.field_0.height) {
  568.                   this.scroll_y = 0;
  569.                } else {
  570.                   this.scroll_y = -this.offHeight - 3 + this.field_0.height;
  571.                }
  572.             }
  573.  
  574.             this.paintIt();
  575.             if (this.use_sb) {
  576.                this.setScrollBar();
  577.             }
  578.          } else {
  579.             this.first_run = true;
  580.             this.reExSet = true;
  581.             if (this.scroll_y + this.cur_exOffHeight < this.field_0.height) {
  582.                if (this.cur_exOffHeight < this.field_0.height) {
  583.                   this.scroll_y = 0;
  584.                } else {
  585.                   this.scroll_y = -this.cur_exOffHeight + this.field_0.height;
  586.                }
  587.             }
  588.  
  589.             this.paintIt();
  590.             this.reExSet = false;
  591.             if (this.use_sb) {
  592.                this.setEXScrollBar();
  593.             }
  594.          }
  595.  
  596.          if (this.ib_active > -1) {
  597.             this.figureAndDrawButton(this.ib_active);
  598.          }
  599.  
  600.          if (this.ib_active > -1 || this.exOnKey > -1) {
  601.             this.start();
  602.          }
  603.  
  604.          this.isRedo = false;
  605.       }
  606.    }
  607.  
  608.    private boolean moveToInputBoxUpdate() {
  609.       if (this.ib_active > -1) {
  610.          try {
  611.             if (!this.m_values[this.ib_active].equals(this.orig_val)) {
  612.                this.validateEntry(this.ib_active);
  613.                this.the_e.id = 901;
  614.                this.the_e.arg = (new Integer(this.ib_active)).toString();
  615.                super.postEvent(this.the_e);
  616.             }
  617.          } catch (Exception var1) {
  618.             return false;
  619.          }
  620.  
  621.          this.stop();
  622.          this.drawOffString(this.ib_active, false, 0, false);
  623.       }
  624.  
  625.       return true;
  626.    }
  627.  
  628.    public boolean mouseUp(Event var1, int var2, int var3) {
  629.       this.hdown = false;
  630.       if (var2 >= this.col_startx2 + this.col_width2 + 1 && var2 <= this.col_startx2 + this.col_width2 + this.inputHeight - 1) {
  631.          this.clickedButton(var3, 1);
  632.       }
  633.  
  634.       return true;
  635.    }
  636.  
  637.    public void updateType(String var1, int var2) {
  638.       for(int var3 = 0; var3 < this.m_type.length; ++var3) {
  639.          if (this.m_type[var3] == var2) {
  640.             this.m_values[var3] = var1;
  641.             this.drawOffString(var3, false, 0, false);
  642.          }
  643.       }
  644.  
  645.       this.paintIt();
  646.    }
  647.  
  648.    private synchronized void paintIt() {
  649.       if (this.paint_called) {
  650.          Graphics var1 = ((Component)this).getGraphics();
  651.          if (this.first_run) {
  652.             ((Component)this).setBackground(this.bgColor);
  653.             if (!this.reExSet) {
  654.                this.figureGridHeight();
  655.             } else {
  656.                this.decideSBUsage();
  657.             }
  658.  
  659.             this.field_3 = ((Component)this).createImage(this.field_0.width, this.offHeight);
  660.             this.g_ts = this.field_3.getGraphics();
  661.             this.g_ts.setFont(this.font);
  662.             this.field_2 = ((Component)this).getFontMetrics(this.font);
  663.             this.g_ts.setColor(this.bgColor);
  664.             this.g_ts.fillRect(0, 0, this.field_0.width, this.offHeight);
  665.             if (this.expander) {
  666.                this.field_5 = ((Component)this).createImage(this.field_0.width, this.exOffHeight);
  667.                this.g_ex = this.field_5.getGraphics();
  668.                this.g_ex.setFont(this.efont);
  669.                this.efm = ((Component)this).getFontMetrics(this.efont);
  670.                this.g_ex.setColor(this.bgColor);
  671.                this.g_ex.fillRect(0, 0, this.field_0.width, this.exOffHeight);
  672.             }
  673.  
  674.             this.first_run = false;
  675.             if (this.populated) {
  676.                this.DrawGrid();
  677.             }
  678.  
  679.             if (this.reExSet) {
  680.                for(int var2 = 0; var2 < this.ex_isExpanded.length; ++var2) {
  681.                   if (this.ex_isExpanded[var2]) {
  682.                      this.initExpand(var2, false);
  683.                   }
  684.                }
  685.  
  686.                this.decideSBUsage();
  687.             }
  688.  
  689.             if (this.first_sb_run) {
  690.                if (this.use_sb) {
  691.                   this.field_1 = new Scrollbar();
  692.                   this.field_1.reshape(this.field_0.width - this.sb_width, 0, this.sb_width, this.field_0.height);
  693.                   this.field_1.setBackground(Color.gray);
  694.                   ((Container)this).add(this.field_1);
  695.                   this.first_sb_run = false;
  696.                }
  697.             } else if (!this.use_sb) {
  698.                ((Container)this).remove(this.field_1);
  699.                this.field_1 = null;
  700.                this.first_sb_run = true;
  701.             } else {
  702.                this.field_1.reshape(this.field_0.width - this.sb_width, 0, this.sb_width, this.field_0.height);
  703.             }
  704.  
  705.             if (this.use_sb) {
  706.                if (!this.isRedo) {
  707.                   if (!this.expander) {
  708.                      this.field_1.setValues(0, this.field_0.height, 0, this.offHeight);
  709.                   } else {
  710.                      this.field_1.setValues(0, this.field_0.height, 0, this.cur_exOffHeight);
  711.                   }
  712.                }
  713.  
  714.                this.field_1.setLineIncrement(this.inputHeight + 2);
  715.                this.field_1.setPageIncrement(this.field_0.height);
  716.             }
  717.  
  718.             if (!this.reExSet && this.expander) {
  719.                for(int var3 = 0; var3 < this.ex_isExpanded.length; ++var3) {
  720.                   this.ex_isExpanded[var3] = true;
  721.                   this.initExpand(var3, true);
  722.                }
  723.  
  724.                this.setEXScrollBar();
  725.                return;
  726.             }
  727.          } else {
  728.             if (!this.expander) {
  729.                var1.drawImage(this.field_3, 0, this.scroll_y, this);
  730.                return;
  731.             }
  732.  
  733.             var1.drawImage(this.field_5, 0, this.scroll_y, this);
  734.          }
  735.  
  736.       }
  737.    }
  738.  
  739.    public void setValues(String[] var1) {
  740.       this.m_values = var1;
  741.       this.paintInputBoxes();
  742.    }
  743.  
  744.    private void paintInputBox(int var1) {
  745.       if (!this.first_run) {
  746.          this.drawOffString(var1, false, 0, false);
  747.          this.paintIt();
  748.       }
  749.  
  750.    }
  751.  
  752.    private synchronized boolean exActivateInputBox(int var1, int var2) {
  753.       for(int var3 = 0; var3 < this.m_title.length; ++var3) {
  754.          if (this.ex_isExpanded[this.m_exID[var3]] && var2 > this.ex_ibStarty[var3] + this.scroll_y && var2 < this.ex_ibStarty[var3] + this.inputHeight + this.scroll_y) {
  755.             ((Component)this).requestFocus();
  756.             this.moveToInputBox(var3, var1);
  757.             this.hsy = this.ex_ibStarty[var3];
  758.             this.hdown = true;
  759.             this.hdx = var1;
  760.             this.hdy = var2;
  761.             return true;
  762.          }
  763.       }
  764.  
  765.       return false;
  766.    }
  767.  
  768.    public synchronized boolean moveToInputBox(int var1, int var2) {
  769.       if (this.ib_active == var1) {
  770.          if (var2 > -1) {
  771.             this.stop();
  772.             this.hlorig = -1;
  773.             this.hlnew = -1;
  774.             this.hlstring = "";
  775.             this.cursorPos = this.figureCusorPosFromMouseClick(var2, var1);
  776.             this.orighmpos = this.cursorPos;
  777.             this.drawOffString(var1, false, 0, true);
  778.             this.start();
  779.          } else {
  780.             this.stop();
  781.             this.hlorig = 0;
  782.             this.hlnew = this.m_values[var1].length();
  783.             this.hlstring = this.m_values[var1];
  784.             this.cursorPos = this.m_values[var1].length();
  785.             this.drawOffString(var1, false, 0, true);
  786.             this.start();
  787.          }
  788.  
  789.          return true;
  790.       } else {
  791.          this.curDSX = 0;
  792.          if (this.expander) {
  793.             if (this.exOnKey > -1) {
  794.                this.stop();
  795.                this.undoHLEX(this.exOnKey);
  796.                this.exOnKey = -1;
  797.             }
  798.  
  799.             if (!this.ex_isExpanded[this.m_exID[var1]]) {
  800.                this.moveToInputBoxUpdate();
  801.                return false;
  802.             }
  803.          }
  804.  
  805.          if (!this.moveToInputBoxUpdate()) {
  806.             return false;
  807.          } else {
  808.             if (this.hlorig > -1) {
  809.                this.hlorig = -1;
  810.                this.hlnew = -1;
  811.                this.hlstring = "";
  812.             }
  813.  
  814.             if (this.ib_active > -1) {
  815.                this.cursorPos = 0;
  816.                this.drawOffString(this.ib_active, false, 0, true);
  817.             }
  818.  
  819.             if (var2 > -1) {
  820.                this.cursorPos = this.figureCusorPosFromMouseClick(var2, var1);
  821.                this.orighmpos = this.cursorPos;
  822.             } else {
  823.                this.hlorig = 0;
  824.                this.hlnew = this.m_values[var1].length();
  825.                this.hlstring = this.m_values[var1];
  826.                this.cursorPos = this.m_values[var1].length();
  827.             }
  828.  
  829.             this.drawOffString(var1, false, 0, true);
  830.             this.figureAndDrawButton(var1);
  831.             if (this.curButton > -1 && !this.m_static[this.curButton]) {
  832.                this.undoButton(this.curButton);
  833.             }
  834.  
  835.             this.paintIt();
  836.             this.curButton = var1;
  837.             this.ib_active = var1;
  838.             this.orig_val = this.m_values[this.ib_active];
  839.             if (!this.expander) {
  840.                if (this.ib_starty[var1] + this.inputHeight > Math.abs(this.scroll_y - this.field_0.height)) {
  841.                   this.scrollIt(602, false);
  842.                } else if (this.ib_starty[var1] < Math.abs(this.scroll_y)) {
  843.                   this.scrollIt(601, false);
  844.                }
  845.             } else if (this.ex_ibStarty[var1] + this.inputHeight > Math.abs(this.scroll_y - this.field_0.height)) {
  846.                this.scrollIt(602, false);
  847.             } else if (this.ex_ibStarty[var1] < Math.abs(this.scroll_y)) {
  848.                this.scrollIt(601, false);
  849.             }
  850.  
  851.             this.start();
  852.             return true;
  853.          }
  854.       }
  855.    }
  856.  
  857.    private int figureFirstInputBox() {
  858.       for(int var1 = 0; var1 < this.ib_starty.length; ++var1) {
  859.          if (this.ib_starty[var1] > Math.abs(this.scroll_y)) {
  860.             return var1;
  861.          }
  862.       }
  863.  
  864.       return -1;
  865.    }
  866.  
  867.    public boolean mouseDown(Event var1, int var2, int var3) {
  868.       if (var1.modifiers == 4) {
  869.          PopupMenu var7 = new PopupMenu("pu - dnm - additem");
  870.          MenuItem[] var5 = new MenuItem[]{new MenuItem("Help"), new MenuItem("-"), new MenuItem("Undo"), new MenuItem("-"), new MenuItem("Cut"), new MenuItem("Copy"), new MenuItem("Paste"), new MenuItem("Delete")};
  871.  
  872.          for(int var6 = 0; var6 < var5.length; ++var6) {
  873.             ((Menu)var7).add(var5[var6]);
  874.          }
  875.  
  876.          if (this.ib_active < 0) {
  877.             var5[0].disable();
  878.          }
  879.  
  880.          ((Component)this).add(var7);
  881.          var7.show(this, var2, var3);
  882.          return true;
  883.       } else if (var1.clickCount > 1 && this.ib_active > -1 && this.m_type[this.ib_active] != 2) {
  884.          this.activateButton(this.ib_active, this.ib_active);
  885.          return true;
  886.       } else {
  887.          if (this.expander) {
  888.             if (this.use_sb && var2 < this.field_0.width - this.sb_width - 2 || !this.use_sb) {
  889.                int var4 = this.checkYExpandMouse(var3);
  890.                if (var4 != -1) {
  891.                   ((Component)this).requestFocus();
  892.                   if (this.ex_isExpanded[var4]) {
  893.                      this.retractItem(var4);
  894.                   } else {
  895.                      this.expandItem(var4);
  896.                   }
  897.  
  898.                   return true;
  899.                }
  900.  
  901.                if (var2 >= this.col_startx2 && var2 <= this.col_startx2 + this.col_width2) {
  902.                   this.exActivateInputBox(var2, var3);
  903.                   return true;
  904.                }
  905.  
  906.                if (var2 >= this.col_startx2 + this.col_width2 + 1 && var2 <= this.col_startx2 + this.col_width2 + this.inputHeight - 1) {
  907.                   this.clickedButton(var3, 0);
  908.                }
  909.  
  910.                if (var2 >= this.col_startx1 && var2 <= this.col_startx1 + this.col_width1 - 3) {
  911.                   this.exActivateInputBox(-1, var3);
  912.                   return true;
  913.                }
  914.             }
  915.          } else {
  916.             if (var2 >= this.col_startx2 && var2 <= this.col_startx2 + this.col_width2) {
  917.                this.activateInputBox(var2, var3, true);
  918.                return true;
  919.             }
  920.  
  921.             if (var2 >= this.col_startx2 + this.col_width2 + 1 && var2 <= this.col_startx2 + this.col_width2 + this.inputHeight - 1) {
  922.                this.activateInputBox(var2, var3, false);
  923.                this.clickedButton(var3, 0);
  924.             }
  925.  
  926.             if (var2 >= this.col_startx1 && var2 <= this.col_startx1 + this.col_width1 - 3) {
  927.                this.activateInputBox(-1, var3, false);
  928.             }
  929.          }
  930.  
  931.          return true;
  932.       }
  933.    }
  934.  
  935.    private void checkKeyDown(int var1) {
  936.       if (this.expander && var1 < this.ex_ibStartIndex[this.ex_ibStartIndex.length - 1] && var1 > -1 && var1 + 1 == this.ex_ibStartIndex[this.m_exID[var1]] + this.m_exTitleCount[this.m_exID[var1]]) {
  937.          this.undoActiveIB();
  938.          this.exOnKey = this.m_exID[var1 + 1];
  939.          this.start();
  940.          this.exKeyScroll(this.exOnKey);
  941.       } else {
  942.          if (var1 < this.m_values.length - 1) {
  943.             this.moveToInputBox(var1 + 1, -1);
  944.          }
  945.  
  946.       }
  947.    }
  948.  
  949.    private void drawButton(int var1, int var2, int var3, int var4, int var5) {
  950.       this.g_ts.setColor(Color.lightGray);
  951.       if (var5 == 1) {
  952.          this.g_ts.fillRect(var1 + 2, var2 + 2, var3 - 2, var4 - 2);
  953.       } else {
  954.          this.g_ts.fillRect(var1 + 1, var2 + 1, var3 - 1, var4 - 1);
  955.       }
  956.  
  957.       if (var5 == 1) {
  958.          this.g_ts.setColor(Color.lightGray);
  959.          this.g_ts.drawRect(var1 + 1, var2 + 1, var3 - 1, var4 - 1);
  960.          this.g_ts.setColor(Color.gray);
  961.          this.g_ts.drawLine(var1 + 1, var2 + var4 - 1, var1 + var3 - 1, var2 + var4 - 1);
  962.          this.g_ts.drawLine(var1 + var3 - 1, var2 + 1, var1 + var3 - 1, var2 + var4 - 1);
  963.          this.g_ts.setColor(Color.white);
  964.          this.g_ts.drawRect(var1, var2, var3, var4);
  965.          this.g_ts.setColor(Color.black);
  966.          this.g_ts.drawLine(var1, var2 + var4, var1 + var3, var2 + var4);
  967.          this.g_ts.drawLine(var1 + var3, var2, var1 + var3, var2 + var4);
  968.          int var8 = 2;
  969.          int var9 = 0;
  970.  
  971.          do {
  972.             this.g_ts.fillRect(var8 + var1, var2 + 8, 2, 2);
  973.             var8 += 3;
  974.             ++var9;
  975.          } while(var9 < 3);
  976.  
  977.       } else {
  978.          this.g_ts.setColor(Color.gray);
  979.          this.g_ts.drawRect(var1, var2, var3, var4);
  980.          int var6 = 3;
  981.          int var7 = 0;
  982.  
  983.          do {
  984.             this.g_ts.fillRect(var6 + var1, var2 + 9, 2, 2);
  985.             var6 += 3;
  986.             ++var7;
  987.          } while(var7 < 3);
  988.  
  989.       }
  990.    }
  991.  
  992.    public void run() {
  993.       if (this.ib_active > -1) {
  994.          this.drawOffString(this.ib_active, true, 0, true);
  995.          this.paintIt();
  996.  
  997.          try {
  998.             Thread.sleep(500L);
  999.          } catch (InterruptedException var17) {
  1000.          }
  1001.       } else if (this.expander && this.exOnKey > -1) {
  1002.          this.hlEX(this.exOnKey, true);
  1003.          this.paintIt();
  1004.  
  1005.          try {
  1006.             Thread.sleep(1000L);
  1007.          } catch (InterruptedException var16) {
  1008.          }
  1009.       }
  1010.  
  1011.       while(true) {
  1012.          while(this.ib_active <= -1) {
  1013.             if (this.expander && this.exOnKey > -1) {
  1014.                int var1 = 6;
  1015.  
  1016.                do {
  1017.                   this.exKeySmall(this.exOnKey, var1);
  1018.                   this.paintIt();
  1019.  
  1020.                   try {
  1021.                      Thread.sleep(25L);
  1022.                   } catch (InterruptedException var15) {
  1023.                   }
  1024.  
  1025.                   var1 -= 2;
  1026.                } while(var1 > 0);
  1027.  
  1028.                this.exKeySmall(this.exOnKey, 0);
  1029.                this.paintIt();
  1030.  
  1031.                try {
  1032.                   Thread.sleep(500L);
  1033.                } catch (InterruptedException var14) {
  1034.                }
  1035.  
  1036.                var1 = 2;
  1037.  
  1038.                do {
  1039.                   this.exKeySmall(this.exOnKey, var1);
  1040.                   this.paintIt();
  1041.  
  1042.                   try {
  1043.                      Thread.sleep(25L);
  1044.                   } catch (InterruptedException var13) {
  1045.                   }
  1046.  
  1047.                   var1 += 2;
  1048.                } while(var1 < 8);
  1049.  
  1050.                this.hlEX(this.exOnKey, true);
  1051.                this.paintIt();
  1052.  
  1053.                try {
  1054.                   Thread.sleep(400L);
  1055.                } catch (InterruptedException var12) {
  1056.                }
  1057.             }
  1058.  
  1059.             try {
  1060.                Thread.sleep(100L);
  1061.             } catch (InterruptedException var11) {
  1062.             }
  1063.          }
  1064.  
  1065.          this.drawOffString(this.ib_active, true, 3, true);
  1066.          this.paintIt();
  1067.  
  1068.          try {
  1069.             Thread.sleep(25L);
  1070.          } catch (InterruptedException var10) {
  1071.          }
  1072.  
  1073.          this.drawOffString(this.ib_active, true, 2, true);
  1074.          this.paintIt();
  1075.  
  1076.          try {
  1077.             Thread.sleep(25L);
  1078.          } catch (InterruptedException var9) {
  1079.          }
  1080.  
  1081.          this.drawOffString(this.ib_active, true, 1, true);
  1082.          this.paintIt();
  1083.  
  1084.          try {
  1085.             Thread.sleep(25L);
  1086.          } catch (InterruptedException var8) {
  1087.          }
  1088.  
  1089.          this.drawOffString(this.ib_active, false, 0, true);
  1090.          this.paintIt();
  1091.  
  1092.          try {
  1093.             Thread.sleep(400L);
  1094.          } catch (InterruptedException var7) {
  1095.          }
  1096.  
  1097.          this.drawOffString(this.ib_active, true, 1, true);
  1098.          this.paintIt();
  1099.  
  1100.          try {
  1101.             Thread.sleep(25L);
  1102.          } catch (InterruptedException var6) {
  1103.          }
  1104.  
  1105.          this.drawOffString(this.ib_active, true, 2, true);
  1106.          this.paintIt();
  1107.  
  1108.          try {
  1109.             Thread.sleep(25L);
  1110.          } catch (InterruptedException var5) {
  1111.          }
  1112.  
  1113.          this.drawOffString(this.ib_active, true, 3, true);
  1114.          this.paintIt();
  1115.  
  1116.          try {
  1117.             Thread.sleep(25L);
  1118.          } catch (InterruptedException var4) {
  1119.          }
  1120.  
  1121.          this.drawOffString(this.ib_active, true, 0, true);
  1122.          this.paintIt();
  1123.  
  1124.          try {
  1125.             Thread.sleep(500L);
  1126.          } catch (InterruptedException var3) {
  1127.          }
  1128.  
  1129.          try {
  1130.             Thread.sleep(100L);
  1131.          } catch (InterruptedException var2) {
  1132.          }
  1133.       }
  1134.    }
  1135.  
  1136.    private void validateEntry(int var1) {
  1137.       if (this.m_type[var1] == 2) {
  1138.          if (!this.m_values[var1].toLowerCase().equals("<default>")) {
  1139.             if (this.m_values[var1] == null || this.m_values[var1].equals("")) {
  1140.                this.validateBad();
  1141.                return;
  1142.             }
  1143.  
  1144.             char[] var6 = new char[this.m_values[var1].length()];
  1145.             this.m_values[var1].getChars(0, this.m_values[var1].length(), var6, 0);
  1146.  
  1147.             for(int var3 = 0; var3 < var6.length; ++var3) {
  1148.                if (!Character.isDigit(var6[var3]) && var6[var3] != '-') {
  1149.                   this.validateBad();
  1150.                   return;
  1151.                }
  1152.             }
  1153.          }
  1154.  
  1155.       } else if (this.m_type[var1] == 33) {
  1156.          if (!this.m_values[var1].toLowerCase().equals("<default>")) {
  1157.             if (this.m_values[var1] == null || this.m_values[var1].equals("")) {
  1158.                this.validateBad();
  1159.                return;
  1160.             }
  1161.  
  1162.             String var5 = this.m_values[var1].toLowerCase();
  1163.             if (!var5.equals("false") && !var5.equals("true")) {
  1164.                this.validateBad();
  1165.                return;
  1166.             }
  1167.          }
  1168.  
  1169.       } else if (this.m_type[var1] == 20) {
  1170.          if (this.m_values[var1] == null || this.m_values[var1].equals("")) {
  1171.             this.validateBad();
  1172.          }
  1173.       } else if (this.m_type[var1] == 20) {
  1174.          if (this.m_values[var1] == null || this.m_values[var1].equals("")) {
  1175.             this.validateBad();
  1176.          }
  1177.       } else if (this.m_type[var1] == 3) {
  1178.          if (!this.m_values[var1].toLowerCase().equals("<default>")) {
  1179.             if (this.m_values[var1] == null || this.m_values[var1].equals("")) {
  1180.                this.validateBad();
  1181.                return;
  1182.             }
  1183.  
  1184.             if (!this.m_values[var1].substring(0, 1).equals("#") || this.m_values[var1].length() > 7) {
  1185.                this.validateBad();
  1186.                return;
  1187.             }
  1188.          }
  1189.  
  1190.       } else {
  1191.          if (this.m_type[var1] == 200) {
  1192.             int var4 = Integer.parseInt(this.m_values[var1]);
  1193.             if (var4 > 255 || var4 < 0) {
  1194.                if (var4 > 255) {
  1195.                   this.m_values[var1] = (new Integer(255)).toString();
  1196.                } else {
  1197.                   this.m_values[var1] = (new Integer(0)).toString();
  1198.                }
  1199.  
  1200.                this.cursorPos = this.m_values[var1].length();
  1201.                this.drawOffString(this.ib_active, false, 0, true);
  1202.                this.paintIt();
  1203.                return;
  1204.             }
  1205.          } else if (this.m_type[var1] == 201) {
  1206.             int var2 = Integer.parseInt(this.m_values[var1]);
  1207.             if (var2 < 1) {
  1208.                this.m_values[var1] = (new Integer(1)).toString();
  1209.                this.cursorPos = this.m_values[var1].length();
  1210.             }
  1211.          }
  1212.  
  1213.       }
  1214.    }
  1215.  
  1216.    public boolean handleEvent(Event var1) {
  1217.       if (var1.id == 401) {
  1218.          if (this.ib_active > -1) {
  1219.             this.stop();
  1220.             this.updateInputBox(this.ib_active, var1.key, var1);
  1221.             this.start();
  1222.          } else {
  1223.             this.exUpdateInputBox(this.exOnKey, var1.key, var1);
  1224.          }
  1225.  
  1226.          return true;
  1227.       } else if (var1.id == 403) {
  1228.          if (this.ib_active > -1) {
  1229.             this.stop();
  1230.             this.updateInputBoxAction(this.ib_active, var1.key, var1);
  1231.             this.start();
  1232.          } else {
  1233.             this.exUpdateInputBoxAction(this.ib_active, var1.key, var1);
  1234.          }
  1235.  
  1236.          return true;
  1237.       } else {
  1238.          if (var1.id == 1001) {
  1239.             String var2 = (String)var1.arg;
  1240.             byte var3 = 0;
  1241.             if (var2.equals("Help")) {
  1242.                if (this.ib_active > -1) {
  1243.                   super.postEvent(new Event(this, 9401, this.m_title[this.ib_active].toLowerCase() + ".htm"));
  1244.                }
  1245.  
  1246.                return true;
  1247.             }
  1248.  
  1249.             if (var2.equals("Undo")) {
  1250.                var3 = 27;
  1251.             } else if (var2.equals("Copy")) {
  1252.                var3 = 3;
  1253.             } else if (var2.equals("Paste")) {
  1254.                var3 = 22;
  1255.             } else if (var2.equals("Cut")) {
  1256.                var3 = 24;
  1257.             } else if (var2.equals("Delete")) {
  1258.                var3 = 127;
  1259.             }
  1260.  
  1261.             if (this.ib_active > -1) {
  1262.                this.stop();
  1263.                this.updateInputBox(this.ib_active, var3, var1);
  1264.                this.start();
  1265.             }
  1266.          }
  1267.  
  1268.          if (var1.target == this.field_1) {
  1269.             this.scrollIt(var1.id, true);
  1270.          }
  1271.  
  1272.          return super.handleEvent(var1);
  1273.       }
  1274.    }
  1275.  
  1276.    private void hlEX(int var1, boolean var2) {
  1277.       if (var2) {
  1278.          this.exKeySmall(var1, 8);
  1279.       } else if (this.ex_isExpanded[var1]) {
  1280.          this.g_ex.drawImage(arUHL, this.arrow_rightmargin, this.ex_starty[var1] + 4, this);
  1281.       } else {
  1282.          this.g_ex.drawImage(arHL, this.arrow_rightmargin, this.ex_starty[var1] + 4, this);
  1283.       }
  1284.    }
  1285.  
  1286.    private void clickedButton(int var1, int var2) {
  1287.       int var3 = 0;
  1288.  
  1289.       for(int var4 = 0; var4 < this.m_title.length; ++var4) {
  1290.          if (this.expander) {
  1291.             if (!this.ex_isExpanded[this.m_exID[var4]]) {
  1292.                continue;
  1293.             }
  1294.  
  1295.             var3 = this.ex_ibStarty[var4];
  1296.          } else {
  1297.             var3 = this.ib_starty[var4];
  1298.          }
  1299.  
  1300.          if (var1 > var3 + this.scroll_y && var1 < var3 + this.inputHeight + this.scroll_y && this.curButton == var4) {
  1301.             if (this.m_type[var4] != 2 && this.m_type[var4] != 200 && this.m_type[var4] != 201) {
  1302.                this.drawButton(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var4], this.inputHeight - 1, this.inputHeight - 1, var2);
  1303.             } else if (var1 < var3 + this.inputHeight / 2 + this.scroll_y) {
  1304.                this.changeSpinner(var4, true, var2);
  1305.             } else {
  1306.                this.changeSpinner(var4, false, var2);
  1307.             }
  1308.  
  1309.             this.button_down = true;
  1310.             if (this.expander) {
  1311.                this.paintToEX(var4);
  1312.             }
  1313.  
  1314.             this.paintIt();
  1315.             if (var2 == 1) {
  1316.                this.activateButton(var4, this.ib_active);
  1317.                this.button_down = false;
  1318.             }
  1319.          }
  1320.       }
  1321.  
  1322.    }
  1323.  
  1324.    public boolean mouseMove(Event var1, int var2, int var3) {
  1325.       this.exMouseY = var3;
  1326.       if (this.expander) {
  1327.          if ((!this.use_sb || var2 >= this.field_0.width - this.sb_width - 2) && this.use_sb) {
  1328.             if (this.use_sb) {
  1329.                this.exMouseY = -1;
  1330.             }
  1331.  
  1332.             this.undoExHL();
  1333.          } else {
  1334.             this.checkEXMouseMove(var3);
  1335.          }
  1336.       }
  1337.  
  1338.       return true;
  1339.    }
  1340.  
  1341.    private void setEXScrollBar() {
  1342.       if (this.use_sb) {
  1343.          if (this.scroll_y <= this.cur_exOffHeight) {
  1344.             this.field_1.setValues(Math.abs(this.scroll_y), this.field_0.height, 0, this.cur_exOffHeight);
  1345.             return;
  1346.          }
  1347.  
  1348.          this.field_1.setValues(this.cur_exOffHeight, this.field_0.height, 0, this.cur_exOffHeight);
  1349.       }
  1350.  
  1351.    }
  1352.  
  1353.    public void stop() {
  1354.       if (this.goauto != null) {
  1355.          this.goauto.stop();
  1356.          this.goauto = null;
  1357.       }
  1358.  
  1359.    }
  1360.  
  1361.    private void paintInputBoxes() {
  1362.       if (!this.first_run) {
  1363.          for(int var1 = 0; var1 < this.m_values.length; ++var1) {
  1364.             this.drawOffString(var1, false, 0, false);
  1365.          }
  1366.  
  1367.          this.paintIt();
  1368.       }
  1369.  
  1370.    }
  1371.  
  1372.    private int figureCusorPosFromMouseClick(int var1, int var2) {
  1373.       int var3 = var1 - this.col_startx2 + Math.abs(this.curDSX);
  1374.  
  1375.       for(int var4 = 0; var4 <= this.m_values[var2].length(); ++var4) {
  1376.          if (var3 <= this.field_2.stringWidth(this.m_values[var2].substring(0, var4))) {
  1377.             int var5 = var4 - 1;
  1378.             if (var5 > -1) {
  1379.                return var5;
  1380.             }
  1381.  
  1382.             return 0;
  1383.          }
  1384.       }
  1385.  
  1386.       return this.m_values[var2].length();
  1387.    }
  1388.  
  1389.    private void initExpand(int var1, boolean var2) {
  1390.       int var3 = 0;
  1391.       int var4 = this.m_exTitleCount[var1] * this.bitHeight;
  1392.       int var5 = this.ex_starty[var1] + this.exBitHeight - 3;
  1393.       int var6 = this.ex_ibStartIndex[var1] * this.bitHeight;
  1394.       this.g_ex.clipRect(0, var5, this.field_0.width, this.exOffHeight - var5);
  1395.       Image var7 = ((Component)this).createImage(this.field_0.width, this.exOffHeight - var5);
  1396.       Graphics var8 = var7.getGraphics();
  1397.       var8.drawImage(this.field_5, 0, -var5, this);
  1398.       var3 = var5 + var4;
  1399.       this.g_ex.drawImage(this.field_3, 0, var3 - var4 - var6, this);
  1400.       this.g_ex.drawImage(var7, 0, var3, this);
  1401.       ((Component)this).getGraphics().drawImage(this.field_5, 0, this.scroll_y, this);
  1402.       this.g_ex = this.field_5.getGraphics();
  1403.       if (var2) {
  1404.          for(int var12 = var1 + 1; var12 < this.ex_starty.length; ++var12) {
  1405.             this.ex_starty[var12] += var4;
  1406.  
  1407.             for(int var10 = this.ex_ibStartIndex[var12]; var10 < this.ex_ibStartIndex[var12] + this.m_exTitleCount[var12]; ++var10) {
  1408.                this.ex_ibStarty[var10] += var4;
  1409.             }
  1410.          }
  1411.  
  1412.          this.cur_exOffHeight += var4;
  1413.       } else {
  1414.          for(int var9 = var1 + 1; var9 < this.ex_starty.length; ++var9) {
  1415.             this.ex_starty[var9] += var4;
  1416.          }
  1417.  
  1418.       }
  1419.    }
  1420.  
  1421.    public int getMaxTitleLength() {
  1422.       int var1 = 0;
  1423.       if (this.maxTitleWidthFixed) {
  1424.          var1 = this.maxTitleLength;
  1425.       } else {
  1426.          for(int var2 = 0; var2 < this.m_title.length; ++var2) {
  1427.             if (this.field_2.stringWidth(this.m_title[var2]) > var1) {
  1428.                var1 = this.field_2.stringWidth(this.m_title[var2]);
  1429.             }
  1430.          }
  1431.       }
  1432.  
  1433.       return var1;
  1434.    }
  1435.  
  1436.    public void populateGrid(String[] var1, String[] var2, int[] var3) {
  1437.       this.m_title = var1;
  1438.       this.m_type = var3;
  1439.       this.m_values = var2;
  1440.       this.ib_starty = new int[this.m_title.length];
  1441.       this.m_static = new boolean[this.m_title.length];
  1442.       this.populated = true;
  1443.    }
  1444.  
  1445.    public void populateGrid(String[] var1, String[] var2, int[] var3, boolean[] var4) {
  1446.       this.m_title = var1;
  1447.       this.m_type = var3;
  1448.       this.m_values = var2;
  1449.       this.m_static = var4;
  1450.       this.ib_starty = new int[this.m_title.length];
  1451.       this.populated = true;
  1452.    }
  1453.  
  1454.    public void populateGrid(String[] var1, String[] var2, int[] var3, String[] var4) {
  1455.       this.m_title = var1;
  1456.       this.m_type = var3;
  1457.       this.m_values = var2;
  1458.       this.m_exTitle = var4;
  1459.       this.ib_starty = new int[this.m_title.length];
  1460.       this.m_static = new boolean[this.m_title.length];
  1461.       this.m_exID = new int[this.m_title.length];
  1462.       this.ex_ibStarty = new int[this.m_title.length];
  1463.       this.m_exTitleCount = new int[var4.length];
  1464.       this.ex_starty = new int[var4.length];
  1465.       this.ex_isExpanded = new boolean[var4.length];
  1466.       this.ex_ibStartIndex = new int[var4.length];
  1467.  
  1468.       for(int var5 = 0; var5 < this.m_exID.length; ++var5) {
  1469.          int var6 = this.m_title[var5].indexOf("|");
  1470.          if (var6 > 0) {
  1471.             if (var6 < this.m_title[var5].length() - 1) {
  1472.                this.m_exID[var5] = Integer.parseInt(this.m_title[var5].substring(0, var6));
  1473.                this.m_title[var5] = this.m_title[var5].substring(var6 + 1);
  1474.                if (this.m_exID[var5] < this.m_exTitleCount.length) {
  1475.                   int var10002 = this.m_exTitleCount[this.m_exID[var5]]++;
  1476.                }
  1477.             } else {
  1478.                this.m_exID[var5] = 0;
  1479.             }
  1480.          } else {
  1481.             this.m_exID[var5] = 0;
  1482.          }
  1483.       }
  1484.  
  1485.       int var7 = 0;
  1486.  
  1487.       for(int var8 = 0; var8 < this.m_exTitleCount.length; ++var8) {
  1488.          this.ex_ibStartIndex[var8] = var7;
  1489.          var7 += this.m_exTitleCount[var8];
  1490.       }
  1491.  
  1492.       this.populated = true;
  1493.       this.expander = true;
  1494.       this.lmargin = 23;
  1495.    }
  1496.  
  1497.    private void undoHLEX(int var1) {
  1498.       if (this.ex_isExpanded[var1]) {
  1499.          this.g_ex.drawImage(arU, this.arrow_rightmargin, this.ex_starty[var1] + 4, this);
  1500.       } else {
  1501.          this.g_ex.drawImage(arD, this.arrow_rightmargin, this.ex_starty[var1] + 4, this);
  1502.       }
  1503.    }
  1504.  
  1505.    private void checkEXMouseMove(int var1) {
  1506.       int var2 = this.checkYExpandMouse(var1);
  1507.       if (var2 != -1) {
  1508.          if (!this.first_run && this.cur_exHL != var2) {
  1509.             if (this.cur_exHL > -1) {
  1510.                this.undoHLEX(this.cur_exHL);
  1511.             }
  1512.  
  1513.             if (var2 != this.exOnKey) {
  1514.                this.hlEX(var2, false);
  1515.             }
  1516.  
  1517.             this.cur_exHL = var2;
  1518.             this.paintIt();
  1519.             return;
  1520.          }
  1521.       } else {
  1522.          if (this.cur_exHL != -1 && this.exOnKey != this.cur_exHL) {
  1523.             this.undoHLEX(this.cur_exHL);
  1524.             this.paintIt();
  1525.          }
  1526.  
  1527.          this.cur_exHL = -1;
  1528.       }
  1529.  
  1530.    }
  1531.  
  1532.    public void setGridValue(int var1, String var2) {
  1533.       this.m_values[var1] = var2;
  1534.       this.paintInputBox(var1);
  1535.       ACutila.anythingChanged = true;
  1536.       this.the_e.id = 901;
  1537.       this.the_e.arg = (new Integer(var1)).toString();
  1538.       super.postEvent(this.the_e);
  1539.    }
  1540.  
  1541.    public String getGridValue(int var1) {
  1542.       return this.m_values[var1];
  1543.    }
  1544.  
  1545.    public void start() {
  1546.       if (this.goauto == null) {
  1547.          this.goauto = new Thread(this);
  1548.          this.goauto.start();
  1549.       }
  1550.  
  1551.    }
  1552.  
  1553.    public void setGridValues(String[] var1) {
  1554.       for(int var2 = 0; var2 < var1.length; ++var2) {
  1555.          this.m_values[var2] = var1[var2];
  1556.          this.paintInputBox(var2);
  1557.       }
  1558.  
  1559.       ACutila.anythingChanged = true;
  1560.    }
  1561.  
  1562.    private void decideSBUsage() {
  1563.       if (!this.expander) {
  1564.          if (this.offHeight > this.field_0.height) {
  1565.             this.use_sb = true;
  1566.          } else {
  1567.             this.use_sb = false;
  1568.          }
  1569.       } else if (this.exOffHeight > this.field_0.height) {
  1570.          this.use_sb = true;
  1571.       } else {
  1572.          this.use_sb = false;
  1573.       }
  1574.    }
  1575.  
  1576.    private void changeSpinner(int var1, boolean var2, int var3) {
  1577.       this.stop();
  1578.       this.hlorig = -1;
  1579.       this.hlnew = -1;
  1580.       this.hlstring = "";
  1581.       if (var2) {
  1582.          this.drawSpinner(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var1], this.inputHeight - 1, 6, var3, true);
  1583.          if (var3 == 1) {
  1584.             try {
  1585.                this.m_values[var1] = (new Integer(Integer.parseInt(this.m_values[var1]) + 1)).toString();
  1586.             } catch (NumberFormatException var4) {
  1587.                this.m_values[var1] = (new Integer(0)).toString();
  1588.             }
  1589.  
  1590.             ACutila.anythingChanged = true;
  1591.             this.validateEntry(var1);
  1592.             this.cursorPos = this.m_values[var1].length();
  1593.             this.drawOffString(var1, false, 0, true);
  1594.             this.the_e.id = 901;
  1595.             this.the_e.arg = (new Integer(var1)).toString();
  1596.             super.postEvent(this.the_e);
  1597.          }
  1598.       } else {
  1599.          this.drawSpinner(this.col_width2 + this.col_startx2 + 1, this.ib_starty[var1] + this.inputHeight / 2, this.inputHeight - 1, 6, var3, false);
  1600.          if (var3 == 1) {
  1601.             this.m_values[var1] = (new Integer(Integer.parseInt(this.m_values[var1]) - 1)).toString();
  1602.             ACutila.anythingChanged = true;
  1603.             this.validateEntry(var1);
  1604.             this.cursorPos = this.m_values[var1].length();
  1605.             this.drawOffString(var1, false, 0, true);
  1606.             this.the_e.id = 901;
  1607.             this.the_e.arg = (new Integer(var1)).toString();
  1608.             super.postEvent(this.the_e);
  1609.          }
  1610.       }
  1611.  
  1612.       this.start();
  1613.    }
  1614.  
  1615.    private void drawSpinner(int var1, int var2, int var3, int var4, int var5, boolean var6) {
  1616.       this.g_ts.setColor(Color.lightGray);
  1617.       if (var5 == 1) {
  1618.          this.g_ts.fillRect(var1 + 2, var2 + 2, var3 - 2, var4 - 2);
  1619.       } else {
  1620.          this.g_ts.fillRect(var1 + 1, var2 + 1, var3 - 1, var4 - 1);
  1621.       }
  1622.  
  1623.       if (var5 == 1) {
  1624.          this.g_ts.setColor(Color.lightGray);
  1625.          this.g_ts.drawRect(var1 + 1, var2 + 1, var3 - 1, var4 - 1);
  1626.          this.g_ts.setColor(Color.gray);
  1627.          this.g_ts.drawLine(var1 + 1, var2 + var4 - 1, var1 + var3 - 1, var2 + var4 - 1);
  1628.          this.g_ts.drawLine(var1 + var3 - 1, var2 + 1, var1 + var3 - 1, var2 + var4 - 1);
  1629.          this.g_ts.setColor(Color.white);
  1630.          this.g_ts.drawRect(var1, var2, var3, var4);
  1631.          this.g_ts.setColor(Color.black);
  1632.          this.g_ts.drawLine(var1, var2 + var4, var1 + var3, var2 + var4);
  1633.          this.g_ts.drawLine(var1 + var3, var2, var1 + var3, var2 + var4);
  1634.          if (var6) {
  1635.             this.g_ts.drawLine(var1 + var3 / 2, var2 + 2, var1 + var3 / 2, var2 + 2);
  1636.             this.g_ts.drawLine(var1 + var3 / 2 - 1, var2 + 3, var1 + var3 / 2 + 1, var2 + 3);
  1637.          } else {
  1638.             this.g_ts.drawLine(var1 + var3 / 2 - 1, var2 + 2, var1 + var3 / 2 + 1, var2 + 2);
  1639.             this.g_ts.drawLine(var1 + var3 / 2, var2 + 3, var1 + var3 / 2, var2 + 3);
  1640.          }
  1641.       } else {
  1642.          this.g_ts.setColor(Color.gray);
  1643.          this.g_ts.drawRect(var1, var2, var3, var4);
  1644.          if (var6) {
  1645.             this.g_ts.drawLine(1 + var1 + var3 / 2, 1 + var2 + 2, 1 + var1 + var3 / 2, 1 + var2 + 2);
  1646.             this.g_ts.drawLine(1 + var1 + var3 / 2 - 1, 1 + var2 + 3, 1 + var1 + var3 / 2 + 1, 1 + var2 + 3);
  1647.          } else {
  1648.             this.g_ts.drawLine(1 + var1 + var3 / 2 - 1, var2 + 3, 1 + var1 + var3 / 2 + 1, var2 + 3);
  1649.             this.g_ts.drawLine(1 + var1 + var3 / 2, var2 + 4, 1 + var1 + var3 / 2, var2 + 4);
  1650.          }
  1651.       }
  1652.    }
  1653.  
  1654.    private void showValidationErrorDialog() {
  1655.       OCDialog var1 = new OCDialog(ACgldat.iface, false);
  1656.       ((Dialog)var1).setTitle("Validation Error");
  1657.       ((Window)var1).toFront();
  1658.       var1.setMessage("The value entered for this field is incorrectly formated. To fix the error try using the build button to set a correctly formated value for this field.");
  1659.       ((Dialog)var1).show();
  1660.    }
  1661.  
  1662.    private synchronized boolean activateInputBox(int var1, int var2, boolean var3) {
  1663.       for(int var4 = 0; var4 < this.m_title.length; ++var4) {
  1664.          if (var2 > this.ib_starty[var4] + this.scroll_y && var2 < this.ib_starty[var4] + this.inputHeight + this.scroll_y) {
  1665.             ((Component)this).requestFocus();
  1666.             this.moveToInputBox(var4, var1);
  1667.             this.hsy = this.ib_starty[var4];
  1668.             if (var3) {
  1669.                this.hdown = true;
  1670.                this.hdx = var1;
  1671.                this.hdy = var2;
  1672.             }
  1673.  
  1674.             return true;
  1675.          }
  1676.       }
  1677.  
  1678.       return false;
  1679.    }
  1680.  
  1681.    private synchronized void updateInputBox(int var1, int var2, Event var3) {
  1682.       ACutila.anythingChanged = true;
  1683.       String var4 = (new Character((char)var2)).toString();
  1684.       if (var2 == 8) {
  1685.          if (this.cursorPos <= 0) {
  1686.             return;
  1687.          }
  1688.  
  1689.          this.m_values[var1] = this.m_values[var1].substring(0, this.cursorPos - 1) + this.m_values[var1].substring(this.cursorPos);
  1690.          this.cursorPos += -1;
  1691.       } else if (var2 == 10) {
  1692.          if (var1 < this.m_values.length - 1) {
  1693.             this.moveToInputBox(var1 + 1, -1);
  1694.             return;
  1695.          }
  1696.  
  1697.          this.validateEntry(var1);
  1698.       } else if (var2 == 127) {
  1699.          if (!this.delHighlight(var1)) {
  1700.          }
  1701.  
  1702.          if (this.cursorPos < this.m_values[var1].length()) {
  1703.             this.m_values[var1] = this.m_values[var1].substring(0, this.cursorPos) + this.m_values[var1].substring(this.cursorPos + 1);
  1704.          }
  1705.       } else {
  1706.          if (var2 == 9) {
  1707.             if (!var3.shiftDown()) {
  1708.                this.checkKeyDown(var1);
  1709.                return;
  1710.             }
  1711.  
  1712.             this.checkKeyUp(var1);
  1713.             return;
  1714.          }
  1715.  
  1716.          if (var2 == 27) {
  1717.             this.hlorig = -1;
  1718.             this.hlnew = -1;
  1719.             this.hlstring = "";
  1720.             this.m_values[var1] = this.orig_val;
  1721.             this.cursorPos = this.orig_val.length();
  1722.          } else {
  1723.             if (var2 == 3) {
  1724.                OCclip var9 = new OCclip();
  1725.                var9.setClipContent(this.hlstring);
  1726.                return;
  1727.             }
  1728.  
  1729.             if (var2 == 22) {
  1730.                OCclip var5 = new OCclip();
  1731.                String var6 = "";
  1732.                this.delHighlight(var1);
  1733.                var6 = this.m_values[var1].substring(this.cursorPos);
  1734.                String var7 = this.m_values[var1].substring(0, this.cursorPos) + var5.getClipContent();
  1735.                this.m_values[var1] = var7 + var6;
  1736.                this.cursorPos = var7.length();
  1737.             } else if (var2 == 24) {
  1738.                OCclip var8 = new OCclip();
  1739.                var8.setClipContent(this.hlstring);
  1740.                this.delHighlight(var1);
  1741.             } else {
  1742.                this.delHighlight(var1);
  1743.                if (this.m_values[var1].length() > 0) {
  1744.                   this.m_values[var1] = this.m_values[var1].substring(0, this.cursorPos) + var4 + this.m_values[var1].substring(this.cursorPos);
  1745.                   ++this.cursorPos;
  1746.                } else {
  1747.                   this.m_values[var1] = var4;
  1748.                   this.cursorPos = 1;
  1749.                }
  1750.             }
  1751.          }
  1752.       }
  1753.  
  1754.       this.drawOffString(var1, true, 0, true);
  1755.       this.paintIt();
  1756.    }
  1757.  
  1758.    private void exCheckKeyUp() {
  1759.       if (this.exOnKey > 0) {
  1760.          this.stop();
  1761.          if (this.cur_exHL != this.exOnKey) {
  1762.             this.undoHLEX(this.exOnKey);
  1763.          } else {
  1764.             this.hlEX(this.exOnKey, false);
  1765.          }
  1766.  
  1767.          if (this.ex_isExpanded[this.exOnKey - 1]) {
  1768.             int var1 = this.exOnKey;
  1769.             this.exOnKey = -1;
  1770.             this.moveToInputBox(this.ex_ibStartIndex[var1 - 1] + this.m_exTitleCount[var1 - 1] - 1, -1);
  1771.             return;
  1772.          }
  1773.  
  1774.          this.exOnKey += -1;
  1775.          this.start();
  1776.          this.exKeyScroll(this.exOnKey);
  1777.       }
  1778.  
  1779.    }
  1780.  
  1781.    public void setibDistY(int var1) {
  1782.       this.ibDistY = var1;
  1783.    }
  1784.  
  1785.    public int figureCompHeight() {
  1786.       return this.m_type.length * 18;
  1787.    }
  1788.  
  1789.    public void autoInputHeight(boolean var1) {
  1790.       this.inputHeightFixed = var1;
  1791.       if (!this.inputHeightFixed) {
  1792.          this.inputHeight = this.field_2.getHeight();
  1793.          this.paintIt();
  1794.       }
  1795.  
  1796.    }
  1797.  
  1798.    public void activateButton(int var1, int var2) {
  1799.       if (this.m_type[var1] == 151) {
  1800.          this.the_e.id = 9098;
  1801.          this.the_e.arg = (new Integer(var2)).toString();
  1802.          super.postEvent(this.the_e);
  1803.       } else if (this.m_type[var1] == 101) {
  1804.          this.the_e.id = 9100;
  1805.          this.the_e.arg = (new Integer(var2)).toString();
  1806.          super.postEvent(this.the_e);
  1807.       } else if (this.m_type[var1] == 100) {
  1808.          this.the_e.id = 9099;
  1809.          this.the_e.arg = (new Integer(var2)).toString();
  1810.          super.postEvent(this.the_e);
  1811.       } else if (this.m_type[var1] == 10) {
  1812.          this.the_e.id = 9101;
  1813.          this.the_e.arg = "defgrid";
  1814.          super.postEvent(this.the_e);
  1815.       } else if (this.m_type[var1] == 11) {
  1816.          this.the_e.id = 9101;
  1817.          this.the_e.arg = "specgrid";
  1818.          super.postEvent(this.the_e);
  1819.       } else if (this.m_type[var1] != 7 && this.m_type[var1] != 8) {
  1820.          if (this.m_type[var1] == 20) {
  1821.             this.the_e.id = 9103;
  1822.             this.the_e.arg = (new Integer(var2)).toString();
  1823.             super.postEvent(this.the_e);
  1824.          } else if (this.m_type[var1] == 3) {
  1825.             this.the_e.id = 9104;
  1826.             this.the_e.arg = (new Integer(var2)).toString();
  1827.             super.postEvent(this.the_e);
  1828.          } else if (this.m_type[var1] == 31) {
  1829.             this.setDropListGlobals();
  1830.             this.the_e.id = 9105;
  1831.             this.the_e.arg = (new Integer(var2)).toString();
  1832.             super.postEvent(this.the_e);
  1833.          } else if (this.m_type[var1] >= 50 && this.m_type[var1] < 54) {
  1834.             this.the_e.id = 9106;
  1835.             this.the_e.arg = (new Integer(var2)).toString();
  1836.             super.postEvent(this.the_e);
  1837.          } else if (this.m_type[var1] == 33) {
  1838.             this.the_e.id = 9107;
  1839.             this.the_e.arg = (new Integer(var2)).toString();
  1840.             super.postEvent(this.the_e);
  1841.          } else if (this.m_type[var1] == 37) {
  1842.             this.the_e.id = 9108;
  1843.             this.the_e.arg = (new Integer(var2)).toString();
  1844.             super.postEvent(this.the_e);
  1845.          } else if (this.m_type[var1] == 41) {
  1846.             this.the_e.id = 9109;
  1847.             this.the_e.arg = (new Integer(var2)).toString();
  1848.             super.postEvent(this.the_e);
  1849.          } else if (this.m_type[var1] == 42) {
  1850.             this.the_e.id = 9111;
  1851.             this.the_e.arg = (new Integer(var2)).toString();
  1852.             super.postEvent(this.the_e);
  1853.          } else if (this.m_type[var1] == 43) {
  1854.             this.the_e.id = 9112;
  1855.             this.the_e.arg = (new Integer(var2)).toString();
  1856.             super.postEvent(this.the_e);
  1857.          } else if (this.m_type[var1] == 44) {
  1858.             this.the_e.id = 9113;
  1859.             this.the_e.arg = (new Integer(var2)).toString();
  1860.             super.postEvent(this.the_e);
  1861.          } else {
  1862.             if (this.m_type[var1] == 32) {
  1863.                this.the_e.id = 9110;
  1864.                this.the_e.arg = (new Integer(var2)).toString();
  1865.                super.postEvent(this.the_e);
  1866.             }
  1867.  
  1868.          }
  1869.       } else {
  1870.          this.the_e.id = 9102;
  1871.          this.the_e.arg = (new Integer(var2)).toString();
  1872.          super.postEvent(this.the_e);
  1873.       }
  1874.    }
  1875.  
  1876.    private int figureGridHeight() {
  1877.       this.offHeight = (this.field_2.getHeight() + this.ibDistY) * this.m_title.length + 2;
  1878.       if (this.expander) {
  1879.          this.cur_exOffHeight = this.exBitHeight * this.m_exTitle.length + 2;
  1880.          this.exOffHeight = this.offHeight + this.cur_exOffHeight;
  1881.       }
  1882.  
  1883.       this.decideSBUsage();
  1884.       return this.offHeight;
  1885.    }
  1886.  
  1887.    private boolean delHighlight(int var1) {
  1888.       if (this.hlorig > -1) {
  1889.          int var2 = this.hlorig;
  1890.          int var3 = this.hlnew;
  1891.          if (this.hlorig > this.hlnew) {
  1892.             var2 = this.hlnew;
  1893.             var3 = this.hlorig;
  1894.          }
  1895.  
  1896.          this.m_values[var1] = this.m_values[var1].substring(0, var2) + this.m_values[var1].substring(var3);
  1897.          this.cursorPos = var2;
  1898.          this.hlorig = -1;
  1899.          this.hlnew = -1;
  1900.          this.hlstring = "";
  1901.          return true;
  1902.       } else {
  1903.          return false;
  1904.       }
  1905.    }
  1906.  
  1907.    private synchronized void updateInputBoxAction(int var1, int var2, Event var3) {
  1908.       if (var2 == 1006) {
  1909.          if (this.cursorPos > 0) {
  1910.             this.cursorPos += -1;
  1911.             if (var3.shiftDown()) {
  1912.                if (this.hlorig < 0) {
  1913.                   this.hlorig = this.cursorPos + 1;
  1914.                }
  1915.  
  1916.                this.hlnew = this.cursorPos;
  1917.                if (this.hlorig == this.hlnew) {
  1918.                   this.hlorig = -1;
  1919.                   this.hlnew = -1;
  1920.                   this.hlstring = "";
  1921.                } else {
  1922.                   int var4 = this.hlorig;
  1923.                   int var5 = this.hlnew;
  1924.                   if (this.hlorig > this.hlnew) {
  1925.                      var4 = this.hlnew;
  1926.                      var5 = this.hlorig;
  1927.                   }
  1928.  
  1929.                   this.hlstring = this.m_values[var1].substring(var4, var5);
  1930.                }
  1931.             } else {
  1932.                this.hlorig = -1;
  1933.                this.hlnew = -1;
  1934.                this.hlstring = "";
  1935.             }
  1936.          } else if (!var3.shiftDown()) {
  1937.             this.hlorig = -1;
  1938.             this.hlnew = -1;
  1939.             this.hlstring = "";
  1940.          }
  1941.       } else if (var2 == 1007) {
  1942.          if (this.cursorPos < this.m_values[var1].length()) {
  1943.             ++this.cursorPos;
  1944.             if (var3.shiftDown()) {
  1945.                if (this.hlorig < 0) {
  1946.                   this.hlorig = this.cursorPos - 1;
  1947.                }
  1948.  
  1949.                this.hlnew = this.cursorPos;
  1950.                if (this.hlorig == this.hlnew) {
  1951.                   this.hlorig = -1;
  1952.                   this.hlnew = -1;
  1953.                   this.hlstring = "";
  1954.                } else {
  1955.                   int var6 = this.hlorig;
  1956.                   int var9 = this.hlnew;
  1957.                   if (this.hlorig > this.hlnew) {
  1958.                      var6 = this.hlnew;
  1959.                      var9 = this.hlorig;
  1960.                   }
  1961.  
  1962.                   this.hlstring = this.m_values[var1].substring(var6, var9);
  1963.                }
  1964.             } else {
  1965.                this.hlorig = -1;
  1966.                this.hlnew = -1;
  1967.                this.hlstring = "";
  1968.             }
  1969.          } else if (!var3.shiftDown()) {
  1970.             this.hlorig = -1;
  1971.             this.hlnew = -1;
  1972.             this.hlstring = "";
  1973.          }
  1974.       } else {
  1975.          if (var2 == 1004) {
  1976.             if (var3.shiftDown() && this.m_type[var1] == 2) {
  1977.                this.changeSpinner(var1, true, 1);
  1978.                return;
  1979.             }
  1980.  
  1981.             this.checkKeyUp(var1);
  1982.             return;
  1983.          }
  1984.  
  1985.          if (var2 == 1005) {
  1986.             if (var3.shiftDown() && this.m_type[var1] == 2) {
  1987.                this.changeSpinner(var1, false, 1);
  1988.                return;
  1989.             }
  1990.  
  1991.             this.checkKeyDown(var1);
  1992.             return;
  1993.          }
  1994.  
  1995.          if (var2 == 1000) {
  1996.             if (var3.shiftDown()) {
  1997.                if (this.hlorig < 0) {
  1998.                   this.hlorig = this.cursorPos;
  1999.                }
  2000.  
  2001.                this.hlnew = 0;
  2002.                this.hlstring = this.m_values[var1].substring(this.hlnew, this.hlorig);
  2003.             } else {
  2004.                this.hlorig = -1;
  2005.                this.hlnew = -1;
  2006.                this.hlstring = "";
  2007.             }
  2008.  
  2009.             this.cursorPos = 0;
  2010.          } else if (var2 == 1001) {
  2011.             if (var3.shiftDown()) {
  2012.                if (this.hlorig < 0) {
  2013.                   this.hlorig = this.cursorPos;
  2014.                }
  2015.  
  2016.                this.hlnew = this.m_values[var1].length();
  2017.                this.hlstring = this.m_values[var1].substring(this.hlorig, this.hlnew);
  2018.             } else {
  2019.                this.hlorig = -1;
  2020.                this.hlnew = -1;
  2021.                this.hlstring = "";
  2022.             }
  2023.  
  2024.             this.cursorPos = this.m_values[var1].length();
  2025.          } else {
  2026.             if (var2 == 1002) {
  2027.                this.scrollIt(603, false);
  2028.                int var8 = this.figureFirstInputBox();
  2029.                if (var8 > -1) {
  2030.                   this.moveToInputBox(var8, -1);
  2031.                }
  2032.  
  2033.                return;
  2034.             }
  2035.  
  2036.             if (var2 == 1003) {
  2037.                this.scrollIt(604, false);
  2038.                int var7 = this.figureFirstInputBox();
  2039.                if (var7 > -1) {
  2040.                   this.moveToInputBox(var7, -1);
  2041.                }
  2042.  
  2043.                return;
  2044.             }
  2045.  
  2046.             if (var2 == 1008) {
  2047.                super.postEvent(new Event(this, 9401, this.m_title[var1].toLowerCase() + ".htm"));
  2048.                return;
  2049.             }
  2050.          }
  2051.       }
  2052.  
  2053.       this.drawOffString(var1, true, 0, true);
  2054.       this.paintIt();
  2055.    }
  2056.  
  2057.    OCAgrid() {
  2058.       this.field_2 = ((Component)this).getFontMetrics(this.font);
  2059.       this.efm = ((Component)this).getFontMetrics(this.efont);
  2060.       this.inputHeight = this.field_2.getHeight() + 1;
  2061.       this.the_e = new Event(this, 900, this);
  2062.       ((Container)this).setLayout((LayoutManager)null);
  2063.    }
  2064.  
  2065.    public void paint(Graphics var1) {
  2066.       this.paint_called = true;
  2067.       this.paintIt();
  2068.    }
  2069.  
  2070.    public void scrollIt(int var1, boolean var2) {
  2071.       boolean var3 = false;
  2072.       if (var1 != 602 && var1 != 601 && var1 != 605) {
  2073.          if (var1 == 604 || var1 == 603) {
  2074.             if (var2) {
  2075.                this.scroll_y = -this.field_1.getValue();
  2076.             } else if (var1 == 604) {
  2077.                this.scroll_y = -(this.field_1.getValue() + this.field_0.height);
  2078.                this.field_1.setValue(this.field_1.getValue() + this.field_0.height);
  2079.             } else if (var1 == 603) {
  2080.                this.scroll_y = -(this.field_1.getValue() - this.field_0.height);
  2081.                this.field_1.setValue(this.field_1.getValue() - this.field_0.height);
  2082.             }
  2083.  
  2084.             var3 = true;
  2085.          }
  2086.       } else {
  2087.          if (var2) {
  2088.             this.scroll_y = -this.field_1.getValue();
  2089.          } else {
  2090.             int var4 = this.field_1.getLineIncrement();
  2091.             if (var1 == 602) {
  2092.                int var5 = 0;
  2093.                if (!this.expander) {
  2094.                   var5 = var4 * this.ib_active - (this.field_0.height - var4 - 2);
  2095.                } else if (this.ib_active > -1) {
  2096.                   var5 = this.ex_ibStarty[this.ib_active] - (this.field_0.height - var4);
  2097.                } else {
  2098.                   var5 = this.ex_starty[this.exOnKey] - (this.field_0.height - var4 + 1);
  2099.                }
  2100.  
  2101.                this.scroll_y = -var5;
  2102.                this.field_1.setValue(var5);
  2103.             } else if (var1 == 601) {
  2104.                int var8 = 0;
  2105.                if (!this.expander) {
  2106.                   var8 = var4 * this.ib_active;
  2107.                } else if (this.ib_active > -1) {
  2108.                   var8 = this.ex_ibStarty[this.ib_active] - 2;
  2109.                } else {
  2110.                   var8 = this.ex_starty[this.exOnKey] - 3;
  2111.                }
  2112.  
  2113.                this.scroll_y = -var8;
  2114.                this.field_1.setValue(var8);
  2115.             }
  2116.          }
  2117.  
  2118.          var3 = true;
  2119.       }
  2120.  
  2121.       if (var3) {
  2122.          if (this.scroll_y >= 0) {
  2123.             this.scroll_y = 0;
  2124.          } else if (!this.expander) {
  2125.             if (this.scroll_y + this.offHeight < this.field_0.height) {
  2126.                this.scroll_y = -this.offHeight + this.field_0.height;
  2127.             }
  2128.          } else if (this.scroll_y + this.cur_exOffHeight < this.field_0.height) {
  2129.             this.scroll_y = -this.cur_exOffHeight + this.field_0.height;
  2130.          }
  2131.  
  2132.          this.paintIt();
  2133.          var3 = false;
  2134.       }
  2135.  
  2136.       this.old_scrolly = this.scroll_y;
  2137.    }
  2138.  
  2139.    public void resize(Dimension var1) {
  2140.       if (var1.width * var1.height > 0) {
  2141.          this.reDoGrid();
  2142.          super.resize(var1);
  2143.       }
  2144.    }
  2145.  
  2146.    public void resize(int var1, int var2) {
  2147.       if (var1 * var2 > 0) {
  2148.          this.field_0 = new Dimension(var1, var2);
  2149.          this.reDoGrid();
  2150.          super.resize(var1, var2);
  2151.       }
  2152.    }
  2153.  
  2154.    private void paintToEX(int var1) {
  2155.       if (this.expander && this.ex_isExpanded[this.m_exID[var1]]) {
  2156.          int var2 = this.m_exTitleCount[this.m_exID[var1]] * this.bitHeight;
  2157.          int var3 = this.ex_starty[this.m_exID[var1]] + this.exBitHeight - 3;
  2158.          this.g_ex.clipRect(0, var3, this.field_0.width, var2);
  2159.          this.g_ex.drawImage(this.field_3, 0, var3 - this.ex_ibStartIndex[this.m_exID[var1]] * this.bitHeight, this);
  2160.          this.g_ex = this.field_5.getGraphics();
  2161.       }
  2162.  
  2163.    }
  2164.  
  2165.    private synchronized void retractItem(int var1) {
  2166.       this.undoActiveIB();
  2167.       if (this.exOnKey > -1) {
  2168.          this.stop();
  2169.          if (this.exOnKey != var1) {
  2170.             this.undoHLEX(this.exOnKey);
  2171.          }
  2172.  
  2173.          this.exOnKey = -1;
  2174.       }
  2175.  
  2176.       boolean var2 = false;
  2177.       int var3 = this.m_exTitleCount[var1] * this.bitHeight;
  2178.       int var4 = this.ex_starty[var1] + this.exBitHeight - 3;
  2179.       if (this.ex_starty[var1] + this.exBitHeight * 2 > Math.abs(this.scroll_y - this.field_0.height)) {
  2180.          int var5 = -(this.ex_starty[var1] + this.exBitHeight * 2) + this.field_0.height;
  2181.          if (var5 < this.scroll_y) {
  2182.             for(int var19 = this.scroll_y; var19 > var5; var19 -= 2) {
  2183.                this.scroll_y = var19;
  2184.                this.paintIt();
  2185.  
  2186.                try {
  2187.                   Thread.sleep(10L);
  2188.                } catch (InterruptedException var18) {
  2189.                }
  2190.             }
  2191.          }
  2192.       }
  2193.  
  2194.       Graphics var24 = ((Component)this).getGraphics();
  2195.       var24.clipRect(0, this.ex_starty[var1] + this.exBitHeight - 3 + this.scroll_y, this.field_0.width, this.field_0.height);
  2196.       Image var6 = ((Component)this).createImage(this.field_0.width, this.exOffHeight - var4 + this.m_jump_size);
  2197.       Graphics var7 = var6.getGraphics();
  2198.       int var8 = -this.ib_starty[this.ex_ibStartIndex[var1]];
  2199.       var7.drawImage(this.field_3, 0, var8 + this.m_jump_size, this);
  2200.       int var9 = 0;
  2201.       if (var1 < this.ex_starty.length - 1) {
  2202.          var9 = this.ex_starty[var1 + 1];
  2203.          var7.clipRect(0, var3 + this.m_jump_size, this.field_0.width, var6.getHeight(this) - (var3 + this.m_jump_size));
  2204.          var7.drawImage(this.field_5, 0, var3 - var9 + this.m_jump_size + 1, this);
  2205.       }
  2206.  
  2207.       int var10 = this.ex_starty[var1] + this.exBitHeight;
  2208.  
  2209.       for(int var20 = -(this.m_jump_size + 1); var20 > -var3 - this.m_jump_size; var20 -= this.m_jump_size) {
  2210.          var24.drawImage(var6, 0, var20 + var10 + this.scroll_y, this);
  2211.  
  2212.          try {
  2213.             Thread.sleep(10L);
  2214.          } catch (InterruptedException var17) {
  2215.          }
  2216.       }
  2217.  
  2218.       if (this.m_jump_size > 1) {
  2219.          var24.drawImage(var6, 0, -var3 - this.m_jump_size + var10 + this.scroll_y - 1, this);
  2220.       }
  2221.  
  2222.       int var11 = -var3 - this.m_jump_size + var10 - 1;
  2223.       this.g_ex.clipRect(0, var10 - 1, this.field_0.width, this.field_5.getHeight(this) - var10 + 1);
  2224.       this.g_ex.drawImage(var6, 0, var11, this);
  2225.  
  2226.       for(int var12 = var1 + 1; var12 < this.ex_starty.length; ++var12) {
  2227.          this.ex_starty[var12] -= var3;
  2228.  
  2229.          for(int var13 = this.ex_ibStartIndex[var12]; var13 < this.ex_ibStartIndex[var12] + this.m_exTitleCount[var12]; ++var13) {
  2230.             this.ex_ibStarty[var13] -= var3;
  2231.          }
  2232.       }
  2233.  
  2234.       this.g_ex = this.field_5.getGraphics();
  2235.       this.g_ex.setColor(this.bgColor);
  2236.       int var26 = this.ex_starty[this.ex_starty.length - 1] + this.exBitHeight;
  2237.       if (this.ex_isExpanded[this.ex_starty.length - 1] && this.ex_starty.length - 1 != var1) {
  2238.          var26 += this.m_exTitleCount[this.ex_starty.length - 1] * this.bitHeight;
  2239.       }
  2240.  
  2241.       this.g_ex.fillRect(0, var26, this.field_0.width, var3);
  2242.       if (this.cur_exOffHeight - var3 >= this.field_0.height) {
  2243.          int var27 = -this.ex_starty[var1] + 3;
  2244.          if (var27 < -(this.cur_exOffHeight - var3 + 2) + this.field_0.height) {
  2245.             var27 = -(this.cur_exOffHeight - var3 + 2) + this.field_0.height + 2;
  2246.          }
  2247.  
  2248.          if (var27 < this.scroll_y) {
  2249.             for(int var22 = this.scroll_y; var22 > var27; var22 -= 2) {
  2250.                this.scroll_y = var22;
  2251.                this.paintIt();
  2252.  
  2253.                try {
  2254.                   Thread.sleep(10L);
  2255.                } catch (InterruptedException var16) {
  2256.                }
  2257.             }
  2258.          } else {
  2259.             for(int var21 = this.scroll_y; var21 < var27; var21 += 2) {
  2260.                this.scroll_y = var21;
  2261.                this.paintIt();
  2262.  
  2263.                try {
  2264.                   Thread.sleep(10L);
  2265.                } catch (InterruptedException var15) {
  2266.                }
  2267.             }
  2268.          }
  2269.  
  2270.          this.scroll_y = var27;
  2271.          this.paintIt();
  2272.       } else {
  2273.          byte var28 = 0;
  2274.  
  2275.          for(int var23 = this.scroll_y; var23 < var28; var23 += 2) {
  2276.             this.scroll_y = var23;
  2277.             this.paintIt();
  2278.  
  2279.             try {
  2280.                Thread.sleep(10L);
  2281.             } catch (InterruptedException var14) {
  2282.             }
  2283.          }
  2284.  
  2285.          this.scroll_y = var28;
  2286.          this.paintIt();
  2287.       }
  2288.  
  2289.       this.ex_isExpanded[var1] = false;
  2290.       this.cur_exOffHeight -= var3;
  2291.       this.hlEX(var1, true);
  2292.       this.checkEXMouseMove(this.exMouseY);
  2293.       this.paintIt();
  2294.       this.setEXScrollBar();
  2295.       this.exOnKey = var1;
  2296.       this.start();
  2297.    }
  2298.  
  2299.    private void undoExHL() {
  2300.       if (this.expander && this.cur_exHL != -1) {
  2301.          if (this.exOnKey != this.cur_exHL) {
  2302.             this.undoHLEX(this.cur_exHL);
  2303.             this.paintIt();
  2304.          }
  2305.  
  2306.          this.cur_exHL = -1;
  2307.       }
  2308.  
  2309.    }
  2310.  
  2311.    private synchronized void expandItem(int var1) {
  2312.       this.undoActiveIB();
  2313.       if (this.exOnKey > -1) {
  2314.          this.stop();
  2315.          if (this.exOnKey != var1) {
  2316.             this.undoHLEX(this.exOnKey);
  2317.          }
  2318.  
  2319.          this.exOnKey = -1;
  2320.       }
  2321.  
  2322.       System.gc();
  2323.       boolean var2 = false;
  2324.       int var3 = this.m_exTitleCount[var1] * this.bitHeight;
  2325.       int var4 = this.ex_starty[var1] + this.exBitHeight - 3;
  2326.       if (this.cur_exOffHeight + var3 >= this.field_0.height) {
  2327.          int var5 = -this.ex_starty[var1] + 3;
  2328.          if (var5 < -(this.cur_exOffHeight + var3 + 2) + this.field_0.height) {
  2329.             var5 = -(this.cur_exOffHeight + var3 + 2) + this.field_0.height + 2;
  2330.          }
  2331.  
  2332.          if (var5 < this.scroll_y) {
  2333.             for(int var16 = this.scroll_y; var16 > var5; var16 -= 2) {
  2334.                this.scroll_y = var16;
  2335.                this.paintIt();
  2336.  
  2337.                try {
  2338.                   Thread.sleep(10L);
  2339.                } catch (InterruptedException var14) {
  2340.                }
  2341.             }
  2342.          } else {
  2343.             for(int var15 = this.scroll_y; var15 < var5; var15 += 2) {
  2344.                this.scroll_y = var15;
  2345.                this.paintIt();
  2346.  
  2347.                try {
  2348.                   Thread.sleep(10L);
  2349.                } catch (InterruptedException var13) {
  2350.                }
  2351.             }
  2352.          }
  2353.  
  2354.          this.scroll_y = var5;
  2355.          this.paintIt();
  2356.       }
  2357.  
  2358.       int var10000 = this.ex_ibStartIndex[var1];
  2359.       Graphics var18 = ((Component)this).getGraphics();
  2360.       var18.clipRect(0, this.ex_starty[var1] + this.exBitHeight - 3 + this.scroll_y, this.field_0.width, this.field_0.height);
  2361.       Image var6 = ((Component)this).createImage(this.field_0.width, this.exOffHeight - var4 + this.m_jump_size);
  2362.       Graphics var7 = var6.getGraphics();
  2363.       int var8 = -this.ib_starty[this.ex_ibStartIndex[var1]];
  2364.       int var9 = this.ex_starty[var1] + this.exBitHeight;
  2365.       var7.drawImage(this.field_3, 0, var8 + this.m_jump_size, this);
  2366.       var7.clipRect(0, var3 + this.m_jump_size, this.field_0.width, var6.getHeight(this) - (var3 + this.m_jump_size));
  2367.       var7.drawImage(this.field_5, 0, var3 - var9 + this.m_jump_size + 1, this);
  2368.  
  2369.       for(int var17 = -var3 - this.m_jump_size; var17 < -(this.m_jump_size + 1); var17 += this.m_jump_size) {
  2370.          var18.drawImage(var6, 0, var17 + var9 + this.scroll_y, this);
  2371.  
  2372.          try {
  2373.             Thread.sleep(10L);
  2374.          } catch (InterruptedException var12) {
  2375.          }
  2376.       }
  2377.  
  2378.       if (this.m_jump_size > 1) {
  2379.          var18.drawImage(var6, 0, var9 + this.scroll_y - this.m_jump_size - 1, this);
  2380.       }
  2381.  
  2382.       this.g_ex.clipRect(0, var9 - 1, this.field_0.width, this.field_5.getHeight(this) - var9 + 1);
  2383.       this.g_ex.drawImage(var6, 0, var9 - (this.m_jump_size + 1), this);
  2384.       this.g_ex = this.field_5.getGraphics();
  2385.  
  2386.       for(int var10 = var1 + 1; var10 < this.ex_starty.length; ++var10) {
  2387.          this.ex_starty[var10] += var3;
  2388.  
  2389.          for(int var11 = this.ex_ibStartIndex[var10]; var11 < this.ex_ibStartIndex[var10] + this.m_exTitleCount[var10]; ++var11) {
  2390.             this.ex_ibStarty[var11] += var3;
  2391.          }
  2392.       }
  2393.  
  2394.       this.ex_isExpanded[var1] = true;
  2395.       this.cur_exOffHeight += var3;
  2396.       this.hlEX(var1, true);
  2397.       this.checkEXMouseMove(this.exMouseY);
  2398.       this.paintIt();
  2399.       this.setEXScrollBar();
  2400.       this.exOnKey = var1;
  2401.       this.start();
  2402.    }
  2403.  
  2404.    private void exGoToIndex(int var1) {
  2405.       int var2 = -1;
  2406.       if (this.expander) {
  2407.          var2 = this.exOnKey;
  2408.          if (var1 == -1) {
  2409.             --var2;
  2410.          } else if (var1 == -2) {
  2411.             ++var2;
  2412.          } else if (var1 >= 0) {
  2413.             var2 = var1;
  2414.          } else {
  2415.             var2 = 0;
  2416.          }
  2417.  
  2418.          if (this.exOnKey > -1 && this.exOnKey != var2 && var2 >= 0 && var2 < this.m_exTitleCount.length) {
  2419.             this.stop();
  2420.             if (this.cur_exHL != this.exOnKey) {
  2421.                this.undoHLEX(this.exOnKey);
  2422.             } else {
  2423.                this.hlEX(this.exOnKey, false);
  2424.             }
  2425.  
  2426.             this.exOnKey = -1;
  2427.          }
  2428.  
  2429.          if (var2 >= 0 && var2 < this.m_exTitleCount.length) {
  2430.             this.exOnKey = var2;
  2431.             this.start();
  2432.             this.exKeyScroll(this.exOnKey);
  2433.          }
  2434.       }
  2435.  
  2436.    }
  2437.  
  2438.    public int getCurIB() {
  2439.       return this.ib_active;
  2440.    }
  2441.  
  2442.    private void createArrows() {
  2443.       byte var1 = 11;
  2444.       byte var2 = 8;
  2445.       arD = ((Component)this).createImage(var1, var2);
  2446.       arU = ((Component)this).createImage(var1, var2);
  2447.       arHL = ((Component)this).createImage(var1, var2);
  2448.       arErase = ((Component)this).createImage(var1, var2);
  2449.       arUHL = ((Component)this).createImage(var1, var2);
  2450.       g_arrow = arErase.getGraphics();
  2451.       g_arrow.setColor(exBoxColor);
  2452.       g_arrow.fillRect(0, 0, var1, var2);
  2453.       g_arrow = arD.getGraphics();
  2454.       g_arrow.setColor(exBoxColor);
  2455.       g_arrow.fillRect(0, 0, var1, var2);
  2456.       g_arrow.setColor(arrowColor);
  2457.       int var3 = 0;
  2458.       int var4 = 0;
  2459.       int var5 = 8;
  2460.  
  2461.       do {
  2462.          g_arrow.drawLine(var3, var4, var3 + var5, var4);
  2463.          ++var4;
  2464.          ++var3;
  2465.          var5 -= 2;
  2466.       } while(var5 >= 0);
  2467.  
  2468.       g_arrow = arHL.getGraphics();
  2469.       g_arrow.setColor(exBoxColor);
  2470.       g_arrow.fillRect(0, 0, var1, var2);
  2471.       g_arrow.setColor(arrowHLColor);
  2472.       var3 = 0;
  2473.       var4 = 0;
  2474.       var5 = 8;
  2475.  
  2476.       do {
  2477.          g_arrow.drawLine(var3, var4, var3 + var5, var4);
  2478.          ++var4;
  2479.          ++var3;
  2480.          var5 -= 2;
  2481.       } while(var5 >= 0);
  2482.  
  2483.       g_arrow = arU.getGraphics();
  2484.       g_arrow.setColor(exBoxColor);
  2485.       g_arrow.fillRect(0, 0, var1, var2);
  2486.       g_arrow.setColor(arrowColor);
  2487.       var3 = 0;
  2488.       var4 = 4;
  2489.       var5 = 8;
  2490.  
  2491.       do {
  2492.          g_arrow.drawLine(var3, var4, var3 + var5, var4);
  2493.          --var4;
  2494.          ++var3;
  2495.          var5 -= 2;
  2496.       } while(var5 >= 0);
  2497.  
  2498.       g_arrow = arUHL.getGraphics();
  2499.       g_arrow.setColor(exBoxColor);
  2500.       g_arrow.fillRect(0, 0, var1, var2);
  2501.       g_arrow.setColor(arrowHLColor);
  2502.       var3 = 0;
  2503.       var4 = 4;
  2504.       var5 = 8;
  2505.  
  2506.       do {
  2507.          g_arrow.drawLine(var3, var4, var3 + var5, var4);
  2508.          --var4;
  2509.          ++var3;
  2510.          var5 -= 2;
  2511.       } while(var5 >= 0);
  2512.  
  2513.    }
  2514.  
  2515.    private void setScrollBar() {
  2516.       if (this.scroll_y <= this.offHeight) {
  2517.          this.field_1.setValues(Math.abs(this.scroll_y), this.field_0.height, 0, this.offHeight);
  2518.       } else {
  2519.          this.field_1.setValues(this.offHeight, this.field_0.height, 0, this.offHeight);
  2520.       }
  2521.    }
  2522.  
  2523.    private void exKeyScroll(int var1) {
  2524.       if (this.ex_starty[var1] < Math.abs(this.scroll_y)) {
  2525.          this.scrollIt(601, false);
  2526.       } else {
  2527.          if (this.ex_starty[var1] + this.inputHeight > Math.abs(this.scroll_y - this.field_0.height)) {
  2528.             this.scrollIt(602, false);
  2529.          }
  2530.  
  2531.       }
  2532.    }
  2533.  
  2534.    public Dimension getMinimumSize() {
  2535.       return new Dimension(50, 50);
  2536.    }
  2537.  
  2538.    public Dimension getPreferredSize() {
  2539.       return new Dimension(50, 50);
  2540.    }
  2541.  
  2542.    private void validateBad() {
  2543.       this.showValidationErrorDialog();
  2544.       this.isError = true;
  2545.       this.m_values[this.ib_active] = this.orig_val;
  2546.       this.cursorPos = this.orig_val.length();
  2547.       this.drawOffString(this.ib_active, false, 0, true);
  2548.       this.paintIt();
  2549.    }
  2550.  
  2551.    public boolean mouseDrag(Event var1, int var2, int var3) {
  2552.       if (this.hdown) {
  2553.          int var9 = this.hsy + this.scroll_y;
  2554.          int var10 = var9 + this.inputHeight;
  2555.          if (var3 >= var9 - 10 && var3 <= var10 + 10) {
  2556.             int var11 = this.figureCusorPosFromMouseClick(var2, this.ib_active);
  2557.             if (var11 != this.lastnewpos) {
  2558.                this.stop();
  2559.                int var7 = this.orighmpos;
  2560.                int var8 = var11;
  2561.                if (this.orighmpos > var11) {
  2562.                   var7 = var11;
  2563.                   var8 = this.orighmpos;
  2564.                }
  2565.  
  2566.                this.hlorig = var7;
  2567.                this.hlnew = var8;
  2568.                if (var8 <= this.m_values[this.ib_active].length() && var7 > -1 && var8 > -1) {
  2569.                   this.hlstring = this.m_values[this.ib_active].substring(var7, var8);
  2570.                } else {
  2571.                   this.hlstring = "";
  2572.                }
  2573.  
  2574.                this.cursorPos = var11;
  2575.                this.drawOffString(this.ib_active, true, 0, true);
  2576.                this.paintIt();
  2577.                this.start();
  2578.             }
  2579.  
  2580.             this.lastnewpos = var11;
  2581.          }
  2582.  
  2583.          return true;
  2584.       } else {
  2585.          if (this.curButton > -1) {
  2586.             int var4 = this.inputHeight;
  2587.             int var5 = this.col_startx2 + this.col_width2 + 1;
  2588.             int var6 = this.ib_starty[this.curButton] + this.scroll_y;
  2589.             if (this.expander) {
  2590.                var6 = this.ex_ibStarty[this.curButton] + this.scroll_y;
  2591.             }
  2592.  
  2593.             if (var2 >= var5 && var2 <= var5 + var4 && var3 >= var6 && var3 <= var6 + var4) {
  2594.                if (!this.button_down) {
  2595.                   if (this.m_type[this.curButton] != 2 && this.m_type[this.curButton] != 200 && this.m_type[this.curButton] != 201) {
  2596.                      this.drawButton(this.col_width2 + this.col_startx2 + 1, this.ib_starty[this.curButton], this.inputHeight - 1, this.inputHeight - 1, 0);
  2597.                   }
  2598.  
  2599.                   this.button_down = true;
  2600.                   this.paintIt();
  2601.                }
  2602.             } else if (this.button_down) {
  2603.                this.figureAndDrawButton(this.curButton);
  2604.                this.button_down = false;
  2605.                this.paintIt();
  2606.             }
  2607.          }
  2608.  
  2609.          return true;
  2610.       }
  2611.    }
  2612. }
  2613.