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

  1. import java.awt.Color;
  2. import java.awt.Component;
  3. import java.awt.Dimension;
  4. import java.awt.Event;
  5. import java.awt.Graphics;
  6. import java.awt.Image;
  7. import java.awt.Menu;
  8. import java.awt.MenuItem;
  9. import java.awt.PopupMenu;
  10.  
  11. public class OCdgImg extends OCdg {
  12.    Event the_e;
  13.    private int movingSub = -1;
  14.    private boolean subOn = false;
  15.    boolean movingImageMap = false;
  16.    int movingIcons = -1;
  17.    boolean movingImage = false;
  18.    boolean[] hlimg_status;
  19.    boolean[] simg_status;
  20.    int manip_image = -1;
  21.    int num_images = 0;
  22.    int[] pic_width;
  23.    int[] pic_height;
  24.    int oldx;
  25.    int oldy;
  26.    private String m_bgimage;
  27.    int clickedIndex = -1;
  28.    Image[] suboff;
  29.    Image[] suboff_orig;
  30.    Image[] suboff_origicon;
  31.    Graphics[] g_suboff;
  32.    int maxlevels = 0;
  33.    int[] sub_posx;
  34.    int[] sub_posy;
  35.    int[] sub_oldx;
  36.    int[] sub_oldy;
  37.    int cur_level = 0;
  38.    int eventsubid = -1;
  39.    private Color m_bgcolor;
  40.    private String[] m_imagefile;
  41.    private int[] m_pic_xcord;
  42.    private int[] m_pic_ycord;
  43.    Image[] s_picture;
  44.    Image[] h_picture;
  45.    Image bg_picture;
  46.    APInfo appinfo;
  47.    OCmsl[] subs;
  48.  
  49.    public boolean lostFocus(Event var1, Object var2) {
  50.       return true;
  51.    }
  52.  
  53.    private void moveImage(int var1, int var2) {
  54.       this.m_pic_ycord[this.manip_image] -= this.oldy - var2;
  55.       this.m_pic_xcord[this.manip_image] -= this.oldx - var1;
  56.       if (this.subOn) {
  57.          for(int var3 = 0; var3 < this.subs.length; ++var3) {
  58.             if (this.subs[var3].subOn) {
  59.                this.sub_posx[var3] -= this.oldx - var1;
  60.                this.sub_posy[var3] -= this.oldy - var2;
  61.             }
  62.          }
  63.  
  64.          this.reDraw();
  65.          ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  66.          this.saveOldCoords();
  67.       } else {
  68.          this.reDraw();
  69.          ((OCdg)this).drawAppOff();
  70.       }
  71.  
  72.       ((OCdg)this).paintIt();
  73.       this.the_e.id = 9301;
  74.       this.the_e.arg = "X: " + (new Integer(this.m_pic_xcord[this.manip_image])).toString() + ", Y: " + (new Integer(this.m_pic_ycord[this.manip_image])).toString();
  75.       super.postEvent(this.the_e);
  76.    }
  77.  
  78.    private void moveSub(int var1, int var2) {
  79.       for(int var3 = this.movingSub; var3 < this.subs.length; ++var3) {
  80.          if (this.subs[var3].subOn) {
  81.             this.sub_posx[var3] -= this.oldx - var1;
  82.             this.sub_posy[var3] -= this.oldy - var2;
  83.          }
  84.       }
  85.  
  86.       this.the_e.id = 9301;
  87.       this.the_e.arg = "X: " + (new Integer(this.sub_posx[this.movingSub] - (this.m_pic_xcord[this.manip_image] + super.offimgx))).toString() + ", Y: " + (new Integer(this.sub_posy[this.movingSub] - (this.m_pic_ycord[this.manip_image] + super.offimgy))).toString();
  88.       super.postEvent(this.the_e);
  89.       ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  90.       this.saveOldCoords();
  91.       ((OCdg)this).paintIt();
  92.    }
  93.  
  94.    public void checkClicked_SubItem(int var1, boolean var2) {
  95.       if (this.subs[var1].curHL > -1) {
  96.          if (!this.subs[var1 + 1].subOn) {
  97.             this.setUpSub(this.subs[var1].branchid + "-" + this.subs[var1].curHL, var1 + 1, false);
  98.             if (this.subs[var1 + 1].subOn) {
  99.                this.subs[var1].leaveHL = this.subs[var1].curHL;
  100.                if (var2) {
  101.                   if (this.subs[var1].leaveHL > -1) {
  102.                      this.subs[var1].fdg_hlMenuItem(this.subs[var1].leaveHL, this.g_suboff[var1], true);
  103.                   }
  104.  
  105.                   ((OCdg)this).drawAltOff(this.suboff[var1], this.sub_posx[var1], this.sub_posy[var1], true);
  106.                }
  107.  
  108.                ((OCdg)this).drawAltOff(this.suboff[var1 + 1], this.sub_posx[var1 + 1], this.sub_posy[var1 + 1], true);
  109.                ((OCdg)this).paintIt();
  110.             }
  111.          } else {
  112.             this.turnOffSub(var1 + 1, false);
  113.             if (this.subs[var1].curHL != this.subs[var1].leaveHL) {
  114.                this.setUpSub(this.subs[var1].branchid + "-" + this.subs[var1].curHL, var1 + 1, false);
  115.                if (this.subs[var1 + 1].subOn) {
  116.                   this.subs[var1].leaveHL = this.subs[var1].curHL;
  117.                   this.subs[var1].fdg_undohlMenuItem(this.suboff_orig[var1], this.g_suboff[var1]);
  118.                   if (this.subs[var1].leaveHL > -1) {
  119.                      this.subs[var1].fdg_hlMenuItem(this.subs[var1].leaveHL, this.g_suboff[var1], true);
  120.                   }
  121.                }
  122.             } else {
  123.                this.subs[var1].leaveHL = -1;
  124.             }
  125.  
  126.             this.reDraw();
  127.             ((OCdg)this).drawAppOff();
  128.             ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  129.             ((OCdg)this).paintIt();
  130.          }
  131.       }
  132.  
  133.       this.movingSub = var1;
  134.    }
  135.  
  136.    private void reDraw() {
  137.       super.g_off.setColor(this.m_bgcolor);
  138.       super.g_off.fillRect(0, 0, super.appWidth, super.appHeight);
  139.       if (this.bg_picture != null) {
  140.          super.g_off.drawImage(this.bg_picture, 0, 0, this);
  141.       }
  142.  
  143.       for(int var1 = 0; var1 < this.num_images; ++var1) {
  144.          if (this.simg_status[var1]) {
  145.             super.g_off.drawImage(this.s_picture[var1], this.m_pic_xcord[var1], this.m_pic_ycord[var1], this);
  146.          }
  147.       }
  148.  
  149.       if (this.manip_image > -1) {
  150.          super.g_off.setColor(ACutil.invertColor(this.m_bgcolor));
  151.          super.g_off.drawRect(this.m_pic_xcord[this.manip_image] - 2, this.m_pic_ycord[this.manip_image] - 2, this.pic_width[this.manip_image] + 3, this.pic_height[this.manip_image] + 3);
  152.       }
  153.  
  154.       if (this.subOn) {
  155.          this.drawSub(false);
  156.       }
  157.  
  158.    }
  159.  
  160.    OCdgImg(APInfo var1) {
  161.       this.m_bgcolor = Color.black;
  162.       this.the_e = new Event(this, 960, this);
  163.       this.appinfo = var1;
  164.    }
  165.  
  166.    public void DrawApplet() {
  167.       ACutil var1 = new ACutil();
  168.       if ((this.bg_picture = var1.getDGImage(this.m_bgimage)) != null) {
  169.          super.appWidth = this.bg_picture.getWidth(this);
  170.          super.appHeight = this.bg_picture.getHeight(this);
  171.       } else {
  172.          super.appWidth = 1;
  173.          super.appHeight = 1;
  174.       }
  175.  
  176.       super.off = ((Component)this).createImage(super.appWidth, super.appHeight);
  177.       super.g_off = super.off.getGraphics();
  178.       super.g_off.drawImage(this.bg_picture, 0, 0, this);
  179.  
  180.       for(int var2 = 0; var2 < this.num_images; ++var2) {
  181.          if ((this.s_picture[var2] = var1.getDGImage(this.m_imagefile[var2])) != null) {
  182.             this.simg_status[var2] = true;
  183.             super.g_off.drawImage(this.s_picture[var2], this.m_pic_xcord[var2], this.m_pic_ycord[var2], this);
  184.             this.pic_width[var2] = this.s_picture[var2].getWidth(this);
  185.             this.pic_height[var2] = this.s_picture[var2].getHeight(this);
  186.          }
  187.       }
  188.  
  189.    }
  190.  
  191.    public void updateScrollBarsForSubs() {
  192.       if (this.subOn) {
  193.          ((OCdg)this).checkAltOffScrollBars(this.suboff, this.sub_posx, this.sub_posy, this.subs);
  194.       }
  195.  
  196.    }
  197.  
  198.    public boolean mouseUp(Event var1, int var2, int var3) {
  199.       if (var1.modifiers == 4) {
  200.          return true;
  201.       } else {
  202.          if (this.movingIcons > -1) {
  203.             String var4 = this.subs[this.movingIcons].drag_iposx + "," + this.subs[this.movingIcons].drag_iposy;
  204.             String[] var5 = this.appinfo.getDefValues();
  205.             if (var5.length > 27) {
  206.                var5[27] = var4;
  207.             }
  208.  
  209.             this.appinfo.updateDefParams(var5);
  210.             ACutila.iface.ipan.defgrid.setValues(var5);
  211.             if (this.manip_image > -1) {
  212.                this.updateDisplay(this.manip_image);
  213.             }
  214.  
  215.             this.movingIcons = -1;
  216.          }
  217.  
  218.          if (this.movingSub > -1) {
  219.             int var7 = this.movingSub;
  220.             String var8 = "";
  221.             if (var7 == 0) {
  222.                var8 = (new Integer(this.sub_posx[var7] - (this.m_pic_xcord[this.manip_image] + super.offimgx))).toString() + "," + (new Integer(this.sub_posy[var7] - (this.m_pic_ycord[this.manip_image] + super.offimgy))).toString();
  223.             } else {
  224.                var8 = (new Integer(this.sub_posx[var7] - this.sub_posx[var7 - 1] - this.suboff[var7 - 1].getWidth(this))).toString() + "," + (new Integer(this.sub_posy[var7] - this.sub_posy[var7 - 1])).toString();
  225.             }
  226.  
  227.             String[] var6 = this.appinfo.getSpecMLValues().valueBranchAt(this.subs[var7].branchid + "-0");
  228.             if (var6.length > 0) {
  229.                var6[0] = var8;
  230.             }
  231.  
  232.             this.appinfo.getSpecMLValues().editBranchItem(this.subs[var7].branchid + "-0", var6);
  233.             this.the_e.id = 9941;
  234.             this.the_e.arg = (new Integer(this.sub_posx[this.movingSub] - (this.m_pic_xcord[this.manip_image] + super.offimgx))).toString() + "," + (new Integer(this.sub_posy[this.movingSub] - (this.m_pic_ycord[this.manip_image] + super.offimgy))).toString();
  235.             super.postEvent(this.the_e);
  236.             ((OCdg)this).checkAltOffScrollBars(this.suboff, this.sub_posx, this.sub_posy, this.subs);
  237.             this.movingSub = -1;
  238.             return true;
  239.          } else {
  240.             if (this.manip_image > -1) {
  241.                this.the_e.id = 9201;
  242.                this.the_e.arg = (new Integer(this.m_pic_xcord[this.manip_image])).toString() + "," + (new Integer(this.m_pic_ycord[this.manip_image])).toString();
  243.                super.postEvent(this.the_e);
  244.                ((OCdg)this).checkAltOffScrollBars(this.suboff, this.sub_posx, this.sub_posy, this.subs);
  245.                this.movingImage = false;
  246.             }
  247.  
  248.             if (this.movingImageMap) {
  249.                ((OCdg)this).figureAltScrollBars(0, 0);
  250.                this.movingImageMap = false;
  251.             }
  252.  
  253.             return true;
  254.          }
  255.       }
  256.    }
  257.  
  258.    public void initDefault() {
  259.       String var1 = ((OCdg)this).getParameterDefault("main_imagemap");
  260.       if (var1 != null) {
  261.          this.m_bgimage = var1;
  262.       }
  263.  
  264.    }
  265.  
  266.    private void moveMap(int var1, int var2) {
  267.       ((OCdg)this).eraseAppOff();
  268.       super.offimgx -= this.oldx - var1;
  269.       super.offimgy -= this.oldy - var2;
  270.       ((OCdg)this).drawAppOff();
  271.       ((OCdg)this).paintIt();
  272.    }
  273.  
  274.    public void initSpecifics() {
  275.       boolean var2 = false;
  276.       this.num_images = super.spe_pv.size();
  277.       this.m_imagefile = new String[this.num_images];
  278.       this.m_pic_xcord = new int[this.num_images];
  279.       this.m_pic_ycord = new int[this.num_images];
  280.       this.pic_width = new int[this.num_images];
  281.       this.pic_height = new int[this.num_images];
  282.       this.s_picture = new Image[this.num_images];
  283.       this.h_picture = new Image[this.num_images];
  284.       this.hlimg_status = new boolean[this.num_images];
  285.       this.simg_status = new boolean[this.num_images];
  286.  
  287.       for(int var5 = 0; var5 < this.num_images; ++var5) {
  288.          String var1 = ((OCdg)this).getParameterSpecific("main_switch", var5);
  289.          if (var1 != null) {
  290.             this.m_imagefile[var5] = new String(var1);
  291.          } else {
  292.             this.m_imagefile[var5] = new String("-1");
  293.          }
  294.  
  295.          var1 = ((OCdg)this).getParameterSpecific("s_xy", var5);
  296.          if (var1 != null) {
  297.             int[] var3 = occcord.getIntValues(var1, ",", 2);
  298.             if (var3 != null) {
  299.                this.m_pic_xcord[var5] = var3[0];
  300.                this.m_pic_ycord[var5] = var3[1];
  301.             }
  302.          }
  303.       }
  304.  
  305.    }
  306.  
  307.    private void moveIcons(int var1, int var2) {
  308.       this.subs[this.movingIcons].drag_iposx -= this.oldx - var1;
  309.       this.subs[this.movingIcons].drag_iposy -= this.oldy - var2;
  310.       this.subs[this.movingIcons].fdg_undohlMenuItem(this.suboff_origicon[this.movingIcons], this.g_suboff[this.movingIcons]);
  311.       if (this.subs[this.movingIcons].leaveHL > -1) {
  312.          this.subs[this.movingIcons].fdg_hlMenuItem(this.subs[this.movingIcons].leaveHL, this.g_suboff[this.movingIcons], false);
  313.       }
  314.  
  315.       if (this.subs[this.movingIcons].curHL > -1) {
  316.          this.subs[this.movingIcons].fdg_hlMenuItem(this.subs[this.movingIcons].curHL, this.g_suboff[this.movingIcons], false);
  317.       }
  318.  
  319.       this.subs[this.movingIcons].drawIconsFromDesignGrid(this.g_suboff[this.movingIcons]);
  320.       ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, true);
  321.       ((OCdg)this).paintIt();
  322.    }
  323.  
  324.    public boolean mouseDown(Event var1, int var2, int var3) {
  325.       boolean var4 = false;
  326.       if (var1.modifiers == 4) {
  327.          var4 = true;
  328.       }
  329.  
  330.       ((Component)this).requestFocus();
  331.       this.oldx = var2;
  332.       this.oldy = var3;
  333.  
  334.       for(int var5 = 0; var5 < this.num_images; ++var5) {
  335.          if (this.subOn && this.manip_image == var5) {
  336.             for(int var6 = this.subs.length - 1; var6 > -1; --var6) {
  337.                if (this.subs[var6].subOn) {
  338.                   int var7 = this.sub_posx[var6] + super.scroll_x;
  339.                   int var8 = this.sub_posy[var6] + super.scroll_y;
  340.                   int var9 = var7 + this.suboff[var6].getWidth(this);
  341.                   int var10 = var8 + this.suboff[var6].getHeight(this);
  342.                   if (var3 > var8 && var3 < var10 && var2 > var7 && var2 < var9) {
  343.                      if (!var4) {
  344.                         if (var1.clickCount > 1) {
  345.                            this.movingImage = false;
  346.                            this.movingSub = -1;
  347.                            this.movingIcons = -1;
  348.                            this.eventsubid = var6;
  349.                            this.the_e.id = 9940;
  350.                            String[] var22 = new String[]{(new Integer(var6 + 1)).toString(), this.subs[var6].branchid};
  351.                            this.the_e.arg = var22;
  352.                            super.postEvent(this.the_e);
  353.                            return true;
  354.                         }
  355.  
  356.                         if (this.subs[var6].mouseDownFromDesignGrid(var2, var3, this)) {
  357.                            this.movingIcons = var6;
  358.                            return true;
  359.                         }
  360.  
  361.                         this.checkClicked_SubItem(var6, false);
  362.                         return true;
  363.                      }
  364.  
  365.                      this.eventsubid = var6;
  366.                      this.clickedIndex = this.subs[var6].realHL;
  367.                      PopupMenu var11 = new PopupMenu("pu - dnm - additem");
  368.                      MenuItem[] var12 = new MenuItem[]{new MenuItem("Edit Sub Menu"), new MenuItem("Add Sub Menu"), new MenuItem("-"), new MenuItem("Edit Text"), new MenuItem("Edit / Add Icon"), new MenuItem("-"), new MenuItem("Add Item"), new MenuItem("Insert Item")};
  369.  
  370.                      for(int var13 = 0; var13 < var12.length; ++var13) {
  371.                         ((Menu)var11).add(var12[var13]);
  372.                      }
  373.  
  374.                      ((Component)this).add(var11);
  375.                      var11.show(this, var2, var3);
  376.                      return true;
  377.                   }
  378.                }
  379.             }
  380.          }
  381.       }
  382.  
  383.       for(int var14 = 0; var14 < this.num_images; ++var14) {
  384.          if (var3 > this.m_pic_ycord[var14] + super.scroll_y + super.offimgy && var3 < this.m_pic_ycord[var14] + this.pic_height[var14] + super.scroll_y + super.offimgy && var2 > this.m_pic_xcord[var14] + super.scroll_x + super.offimgx && var2 < this.m_pic_xcord[var14] + this.pic_width[var14] + super.scroll_x + super.offimgx) {
  385.             if (this.manip_image != var14) {
  386.                if (this.subOn) {
  387.                   for(int var16 = 0; var16 < this.subs.length; ++var16) {
  388.                      if (this.subs[var16].subOn) {
  389.                         ((OCdg)this).undoAltOff(this.suboff[var16], this.sub_oldx[var16], this.sub_oldy[var16]);
  390.                         this.subs[var16].subOn = false;
  391.                         this.subs[var16].curHL = -1;
  392.                         this.subs[var16].leaveHL = -1;
  393.                      }
  394.                   }
  395.  
  396.                   this.subOn = false;
  397.                }
  398.  
  399.                this.manip_image = var14;
  400.                this.the_e.id = 9202;
  401.                this.the_e.arg = new Integer(this.manip_image);
  402.                super.postEvent(this.the_e);
  403.                this.setUpSub((new Integer(this.manip_image)).toString(), 0, true);
  404.                if (this.subOn) {
  405.                   this.reDraw();
  406.                   ((OCdg)this).drawAltOff(this.suboff[this.cur_level], this.sub_posx[this.cur_level], this.sub_posy[this.cur_level], false);
  407.                } else {
  408.                   this.reDraw();
  409.                   ((OCdg)this).drawAppOff();
  410.                }
  411.  
  412.                ((OCdg)this).paintIt();
  413.                if (var4) {
  414.                   if (this.subOn) {
  415.                      this.updateScrollBarsForSubs();
  416.                   } else {
  417.                      ((OCdg)this).figureAltScrollBars(0, 0);
  418.                   }
  419.                }
  420.             }
  421.  
  422.             if (!var4) {
  423.                if (var1.clickCount > 1) {
  424.                   this.movingImage = false;
  425.                   this.movingSub = -1;
  426.                   this.movingIcons = -1;
  427.                   this.the_e.id = 1001;
  428.                   this.the_e.arg = "Add / Edit Sub Menus";
  429.                   super.postEvent(this.the_e);
  430.                   return true;
  431.                }
  432.  
  433.                if (!var4) {
  434.                   this.movingIcons = -1;
  435.                   this.movingSub = -1;
  436.                   this.movingImage = true;
  437.                }
  438.  
  439.                return true;
  440.             }
  441.  
  442.             PopupMenu var17 = new PopupMenu("pu - dnm - additem");
  443.             MenuItem[] var19 = new MenuItem[]{new MenuItem("Add / Edit Sub Menus"), new MenuItem("Change Rollover Image")};
  444.  
  445.             for(int var21 = 0; var21 < var19.length; ++var21) {
  446.                ((Menu)var17).add(var19[var21]);
  447.             }
  448.  
  449.             ((Component)this).add(var17);
  450.             var17.show(this, var2, var3);
  451.             return true;
  452.          }
  453.       }
  454.  
  455.       this.movingSub = -1;
  456.       this.movingImage = false;
  457.       this.manip_image = -1;
  458.       ((OCdg)this).figureAltScrollBars(0, 0);
  459.       this.turnOffAllSubs();
  460.       if (var2 > super.offimgx + super.scroll_x && var2 < super.offimgx + super.off.getWidth(this) + super.scroll_x && var3 > super.offimgy + super.scroll_y && var3 < super.offimgy + super.off.getHeight(this) + super.scroll_y) {
  461.          if (!var4) {
  462.             this.movingImageMap = true;
  463.          }
  464.  
  465.          if (var1.clickCount > 1) {
  466.             this.the_e.id = 1001;
  467.             this.the_e.arg = "Change Map Image";
  468.             super.postEvent(this.the_e);
  469.          }
  470.       }
  471.  
  472.       if (var4) {
  473.          PopupMenu var15 = new PopupMenu("pu - dnm - additem");
  474.          MenuItem[] var18 = new MenuItem[]{new MenuItem("Add Rollover Image"), new MenuItem("Change Map Image"), new MenuItem("-"), new MenuItem("Background Color")};
  475.  
  476.          for(int var20 = 0; var20 < var18.length; ++var20) {
  477.             ((Menu)var15).add(var18[var20]);
  478.          }
  479.  
  480.          ((Component)this).add(var15);
  481.          var15.show(this, var2, var3);
  482.       }
  483.  
  484.       return true;
  485.    }
  486.  
  487.    public void updateDisplay(int var1) {
  488.       if (!super.first_run) {
  489.          if (this.manip_image != var1) {
  490.             if (this.simg_status[var1]) {
  491.                this.manip_image = var1;
  492.             } else {
  493.                this.manip_image = -1;
  494.                if (this.subOn) {
  495.                   ((OCdg)this).drawDeleteAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  496.                }
  497.  
  498.                this.subOn = false;
  499.                this.movingSub = -1;
  500.                this.movingImage = false;
  501.             }
  502.  
  503.             if (this.subOn) {
  504.                ((OCdg)this).drawDeleteAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  505.             }
  506.  
  507.             this.setUpSub((new Integer(this.manip_image)).toString(), 0, true);
  508.             this.reDraw();
  509.             ((OCdg)this).drawAppOff();
  510.             if (this.manip_image > -1 && this.subOn) {
  511.                ((OCdg)this).drawAltOff(this.suboff[this.cur_level], this.sub_posx[this.cur_level], this.sub_posy[this.cur_level], false);
  512.             }
  513.          } else {
  514.             ((OCdg)this).drawDeleteAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  515.  
  516.             for(int var2 = 0; var2 < this.subs.length; ++var2) {
  517.                if (this.subs[var2].subOn) {
  518.                   this.setUpSub(this.subs[var2].branchid, this.subs[var2].level, false);
  519.                } else if (var2 == 0) {
  520.                   this.setUpSub((new Integer(this.manip_image)).toString(), 0, true);
  521.                }
  522.  
  523.                if (this.subs[var2].leaveHL > -1 && var2 != this.subs.length - 1 && this.subs[var2 + 1].subOn) {
  524.                   this.subs[var2].fdg_hlMenuItem(this.subs[var2].leaveHL, this.g_suboff[var2], true);
  525.                }
  526.  
  527.                if (this.subs[var2].curHL > -1) {
  528.                   this.subs[var2].fdg_hlMenuItem(this.subs[var2].curHL, this.g_suboff[var2], true);
  529.                }
  530.             }
  531.  
  532.             this.reDraw();
  533.             ((OCdg)this).drawAppOff();
  534.             ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  535.          }
  536.  
  537.          ((OCdg)this).paintIt();
  538.       }
  539.    }
  540.  
  541.    private void saveOldCoords() {
  542.       for(int var1 = 0; var1 < this.sub_posx.length; ++var1) {
  543.          this.sub_oldx[var1] = this.sub_posx[var1];
  544.          this.sub_oldy[var1] = this.sub_posy[var1];
  545.       }
  546.  
  547.    }
  548.  
  549.    public void turnOffSub(int var1, boolean var2) {
  550.       for(int var3 = var1; var3 < this.subs.length; ++var3) {
  551.          if (this.subs[var3].subOn) {
  552.             ((OCdg)this).undoAltOff(this.suboff[var3], this.sub_oldx[var3], this.sub_oldy[var3]);
  553.             this.subs[var3].subOn = false;
  554.             this.subs[var3].leaveHL = -1;
  555.          }
  556.       }
  557.  
  558.       if (var2) {
  559.          this.reDraw();
  560.          ((OCdg)this).drawAppOff();
  561.          ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  562.          ((OCdg)this).paintIt();
  563.       }
  564.  
  565.    }
  566.  
  567.    public void setUpSub(String var1, int var2, boolean var3) {
  568.       if (var3) {
  569.          this.maxlevels = this.appinfo.getSpecMLValues().getMaxLevel();
  570.          this.sub_posx = new int[this.maxlevels];
  571.          this.sub_posy = new int[this.maxlevels];
  572.          this.sub_oldx = new int[this.maxlevels];
  573.          this.sub_oldy = new int[this.maxlevels];
  574.          this.subs = new OCmsl[this.maxlevels];
  575.  
  576.          for(int var4 = 0; var4 < this.maxlevels; ++var4) {
  577.             this.subs[var4] = new OCmsl(true, var4);
  578.          }
  579.  
  580.          this.suboff = new Image[this.maxlevels];
  581.          this.suboff_orig = new Image[this.maxlevels];
  582.          this.suboff_origicon = new Image[this.maxlevels];
  583.          this.g_suboff = new Graphics[this.maxlevels];
  584.       } else {
  585.          int var15 = this.appinfo.getSpecMLValues().getMaxLevel();
  586.          if (var15 != this.maxlevels) {
  587.             int[] var5 = new int[this.maxlevels];
  588.             int[] var6 = new int[this.maxlevels];
  589.             int[] var7 = new int[this.maxlevels];
  590.             int[] var8 = new int[this.maxlevels];
  591.             OCmsl[] var9 = new OCmsl[this.maxlevels];
  592.             Image[] var10 = new Image[this.maxlevels];
  593.             Image[] var11 = new Image[this.maxlevels];
  594.             Image[] var12 = new Image[this.maxlevels];
  595.             Graphics[] var13 = new Graphics[this.maxlevels];
  596.  
  597.             for(int var14 = 0; var14 < this.maxlevels; ++var14) {
  598.                var5[var14] = this.sub_posx[var14];
  599.                var6[var14] = this.sub_posy[var14];
  600.                var7[var14] = this.sub_oldx[var14];
  601.                var8[var14] = this.sub_oldy[var14];
  602.                var9[var14] = this.subs[var14];
  603.                var10[var14] = this.suboff[var14];
  604.                var11[var14] = this.suboff_orig[var14];
  605.                var12[var14] = this.suboff_origicon[var14];
  606.                var13[var14] = this.g_suboff[var14];
  607.             }
  608.  
  609.             this.sub_posx = new int[var15];
  610.             this.sub_posy = new int[var15];
  611.             this.sub_oldx = new int[var15];
  612.             this.sub_oldy = new int[var15];
  613.             this.subs = new OCmsl[var15];
  614.             this.suboff = new Image[var15];
  615.             this.suboff_orig = new Image[var15];
  616.             this.suboff_origicon = new Image[var15];
  617.             this.g_suboff = new Graphics[var15];
  618.  
  619.             for(int var21 = 0; var21 < var15; ++var21) {
  620.                if (var21 < this.maxlevels) {
  621.                   this.sub_posx[var21] = var5[var21];
  622.                   this.sub_posy[var21] = var6[var21];
  623.                   this.sub_oldx[var21] = var7[var21];
  624.                   this.sub_oldy[var21] = var8[var21];
  625.                   this.subs[var21] = var9[var21];
  626.                   this.suboff[var21] = var10[var21];
  627.                   this.suboff_orig[var21] = var11[var21];
  628.                   this.suboff_origicon[var21] = var12[var21];
  629.                   this.g_suboff[var21] = var13[var21];
  630.                } else {
  631.                   this.subs[var21] = new OCmsl(true, var21);
  632.                }
  633.             }
  634.  
  635.             this.maxlevels = var15;
  636.          }
  637.       }
  638.  
  639.       if (this.appinfo.getSpecMLValues().isItem(var1 + "-0")) {
  640.          this.subs[var2].branchid = var1;
  641.          if (var3) {
  642.             this.cur_level = var2;
  643.          }
  644.  
  645.          this.subs[var2].addDefaults(this.appinfo.getDefParamDescs(), this.appinfo.getDefValues());
  646.          this.subs[var2].addSpecifics(this.appinfo.getSpecMLParamDescs(), this.appinfo.getSpecMLValues().valuesAtLevel(var1 + "-0"));
  647.          this.subs[var2].addIcons(this.appinfo.getIconParamDescs(), this.appinfo.getIconValues());
  648.          this.subs[var2].setAppDimensions(1, 1);
  649.          this.subs[var2].level = var2;
  650.          Dimension var16 = this.subs[var2].getMenuImageSize();
  651.          this.suboff[var2] = ((Component)this).createImage(var16.width, var16.height);
  652.          this.g_suboff[var2] = this.suboff[var2].getGraphics();
  653.          this.suboff[var2] = this.subs[var2].getMenuImage(this.suboff[var2], this.g_suboff[var2]);
  654.          this.suboff_origicon[var2] = ((Component)this).createImage(var16.width, var16.height);
  655.          Graphics var17 = this.suboff_origicon[var2].getGraphics();
  656.          var17.drawImage(this.suboff[var2], 0, 0, this);
  657.          this.suboff[var2] = this.subs[var2].getMenuImageIcon(this.suboff[var2], this.g_suboff[var2]);
  658.          this.suboff_orig[var2] = ((Component)this).createImage(var16.width, var16.height);
  659.          var17 = this.suboff_orig[var2].getGraphics();
  660.          var17.drawImage(this.suboff[var2], 0, 0, this);
  661.          String var19 = this.appinfo.getSpecMLValues().valueBranchAt(var1 + "-0")[0];
  662.          int[] var20 = occcord.getIntValues(var19, ",", 2);
  663.          if (var20 != null) {
  664.             this.sub_posx[var2] = var20[0];
  665.             this.sub_posy[var2] = var20[1];
  666.          } else {
  667.             this.sub_posx[var2] = 0;
  668.             this.sub_posy[var2] = 0;
  669.          }
  670.  
  671.          if (var2 < 1) {
  672.             int[] var10000 = this.sub_posx;
  673.             var10000[var2] += this.m_pic_xcord[this.manip_image] + super.offimgx;
  674.             var10000 = this.sub_posy;
  675.             var10000[var2] += this.m_pic_ycord[this.manip_image] + super.offimgy;
  676.          } else {
  677.             int[] var23 = this.sub_posx;
  678.             var23[var2] += this.sub_posx[var2 - 1] + this.suboff[var2 - 1].getWidth(this);
  679.             var23 = this.sub_posy;
  680.             var23[var2] += this.sub_posy[var2 - 1];
  681.          }
  682.  
  683.          this.sub_oldx[var2] = this.sub_posx[var2];
  684.          this.sub_oldy[var2] = this.sub_posy[var2];
  685.          this.subs[var2].subOn = true;
  686.          this.subOn = true;
  687.       } else {
  688.          this.subs[var2].subOn = false;
  689.          this.subOn = false;
  690.       }
  691.    }
  692.  
  693.    public boolean mouseDrag(Event var1, int var2, int var3) {
  694.       if (this.manip_image > -1) {
  695.          if (this.movingIcons > -1) {
  696.             this.moveIcons(var2, var3);
  697.             ACutila.anythingChanged = true;
  698.          } else if (this.movingSub > -1) {
  699.             this.moveSub(var2, var3);
  700.             ACutila.anythingChanged = true;
  701.          } else if (this.movingImage) {
  702.             this.moveImage(var2, var3);
  703.             ACutila.anythingChanged = true;
  704.          }
  705.  
  706.          this.oldx = var2;
  707.          this.oldy = var3;
  708.       } else if (this.movingImageMap) {
  709.          this.moveMap(var2, var3);
  710.          this.oldx = var2;
  711.          this.oldy = var3;
  712.       }
  713.  
  714.       return true;
  715.    }
  716.  
  717.    public void drawSub(boolean var1) {
  718.       for(int var2 = 0; var2 < this.subs.length; ++var2) {
  719.          if (this.subs[var2].subOn) {
  720.             ((OCdg)this).drawAltOff(this.suboff[var2], this.sub_posx[var2], this.sub_posy[var2], var1);
  721.          }
  722.       }
  723.  
  724.    }
  725.  
  726.    public void turnOffAllSubs() {
  727.       if (this.subOn) {
  728.          for(int var1 = 0; var1 < this.subs.length; ++var1) {
  729.             if (this.subs[var1].subOn) {
  730.                ((OCdg)this).undoAltOff(this.suboff[var1], this.sub_oldx[var1], this.sub_oldy[var1]);
  731.                this.subs[var1].subOn = false;
  732.                this.subs[var1].leaveHL = -1;
  733.             }
  734.          }
  735.  
  736.          this.subOn = false;
  737.       }
  738.  
  739.       this.reDraw();
  740.       ((OCdg)this).drawAppOff();
  741.       ((OCdg)this).paintIt();
  742.    }
  743.  
  744.    public void reDrawAltOffs() {
  745.       if (this.subOn) {
  746.          ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, true);
  747.       }
  748.  
  749.    }
  750.  
  751.    public void redoAltOffs() {
  752.       if (this.subOn) {
  753.          for(int var1 = 0; var1 < this.subs.length; ++var1) {
  754.             if (this.subs[var1].subOn) {
  755.                String var2 = this.appinfo.getSpecMLValues().valueBranchAt(this.subs[var1].branchid + "-0")[0];
  756.                int[] var3 = occcord.getIntValues(var2, ",", 2);
  757.                if (var3 != null) {
  758.                   this.sub_posx[var1] = var3[0];
  759.                   this.sub_posy[var1] = var3[1];
  760.                } else {
  761.                   this.sub_posx[var1] = 0;
  762.                   this.sub_posy[var1] = 0;
  763.                }
  764.  
  765.                if (var1 < 1) {
  766.                   int[] var10000 = this.sub_posx;
  767.                   var10000[var1] += this.m_pic_xcord[this.manip_image] + super.scroll_x + super.offimgx;
  768.                   var10000 = this.sub_posy;
  769.                   var10000[var1] += this.m_pic_ycord[this.manip_image] + super.scroll_y + super.offimgy;
  770.                } else {
  771.                   int[] var5 = this.sub_posx;
  772.                   var5[var1] += this.sub_posx[var1 - 1] + this.suboff[var1 - 1].getWidth(this);
  773.                   var5 = this.sub_posy;
  774.                   var5[var1] += this.sub_posy[var1 - 1];
  775.                }
  776.  
  777.                this.sub_oldx[var1] = this.sub_posx[var1];
  778.                this.sub_oldy[var1] = this.sub_posy[var1];
  779.                ((OCdg)this).drawAltOff(this.suboff[var1], this.sub_posx[var1], this.sub_posy[var1], true);
  780.             }
  781.          }
  782.       }
  783.  
  784.    }
  785.  
  786.    public boolean mouseMove(Event var1, int var2, int var3) {
  787.       if (this.subOn) {
  788.          for(int var4 = this.subs.length - 1; var4 > -1; --var4) {
  789.             if (this.subs[var4].subOn) {
  790.                int var5 = this.sub_posx[var4] + super.scroll_x;
  791.                int var6 = this.sub_posy[var4] + super.scroll_y;
  792.                int var7 = this.suboff[var4].getWidth(this);
  793.                int var8 = this.suboff[var4].getHeight(this);
  794.                if (var2 > var5 && var2 < var5 + var7 && var3 > var6 && var3 < var6 + var8) {
  795.                   this.subs[var4].mouseMoveFromDesignGrid(var1, var2, var3, this.suboff[var4], this.g_suboff[var4], this, this.suboff_orig[var4]);
  796.                   return true;
  797.                }
  798.             }
  799.          }
  800.  
  801.          for(int var9 = this.subs.length - 1; var9 > -1; --var9) {
  802.             if (this.subs[var9].curHL != -1) {
  803.                this.subs[var9].fdg_undohlMenuItem(this.suboff_orig[var9], this.g_suboff[var9]);
  804.                this.subs[var9].curHL = -1;
  805.                if (this.subs[var9].leaveHL > -1) {
  806.                   this.subs[var9].fdg_hlMenuItem(this.subs[var9].leaveHL, this.g_suboff[var9], true);
  807.                }
  808.             }
  809.          }
  810.  
  811.          if (this.subOn) {
  812.             ((OCdg)this).drawAltOffMult(this.suboff, this.sub_posx, this.sub_posy, this.sub_oldx, this.sub_oldy, this.subs, false);
  813.             ((OCdg)this).paintIt();
  814.          }
  815.       }
  816.  
  817.       return true;
  818.    }
  819. }
  820.