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

  1. import java.awt.Color;
  2. import java.awt.Component;
  3. import java.awt.Container;
  4. import java.awt.Dimension;
  5. import java.awt.Event;
  6. import java.awt.Graphics;
  7. import java.awt.LayoutManager;
  8. import java.awt.Panel;
  9.  
  10. class OCAviewerpan extends Panel {
  11.    private boolean first_run = true;
  12.    private boolean paintCalled = false;
  13.    // $FF: renamed from: d java.awt.Dimension
  14.    Dimension field_0;
  15.    String appClass;
  16.    OCstatus statBar;
  17.    Color bgColor;
  18.    inm app_inm;
  19.    OCVscroll app_ocvscroll;
  20.    slideb app_slideb;
  21.    TDMessage app_tdmessage;
  22.    tsilbg app_tsilbg;
  23.    FadeText app_fadet;
  24.    hscroll app_hscroll;
  25.    slidem app_slidem;
  26.    ime app_ime;
  27.    tscroll app_tscroll;
  28.    mwindow app_mwindow;
  29.    ism app_ism;
  30.    stmenu app_stmenu;
  31.    vtiscroll app_vtiscroll;
  32.    boolean started;
  33.    boolean stopped;
  34.    int appw;
  35.    int apph;
  36.    int appx;
  37.    int appy;
  38.    // $FF: renamed from: sx int
  39.    int field_1;
  40.    // $FF: renamed from: sy int
  41.    int field_2;
  42.    // $FF: renamed from: sw int
  43.    int field_3;
  44.    // $FF: renamed from: sh int
  45.    int field_4;
  46.  
  47.    OCAviewerpan(String var1, int var2, int var3) {
  48.       this.bgColor = Color.gray;
  49.       this.field_1 = 1;
  50.       this.field_4 = 16;
  51.       ((Component)this).setBackground(Color.lightGray);
  52.       ((Container)this).setLayout((LayoutManager)null);
  53.       this.statBar = new OCstatus();
  54.       ((Container)this).add(this.statBar);
  55.       this.appw = var2;
  56.       this.apph = var3;
  57.       this.appClass = var1;
  58.    }
  59.  
  60.    public void paint(Graphics var1) {
  61.       this.paintCalled = true;
  62.       this.paintIt();
  63.    }
  64.  
  65.    public void setBGColor(Color var1) {
  66.       this.bgColor = var1;
  67.       this.paintIt();
  68.    }
  69.  
  70.    public void startApplet() {
  71.       if (!this.started) {
  72.          this.addApplet((String)null, 1);
  73.          this.started = true;
  74.          this.stopped = false;
  75.       }
  76.  
  77.    }
  78.  
  79.    public void stopApplet() {
  80.       if (!this.stopped) {
  81.          this.addApplet((String)null, 2);
  82.          this.stopped = true;
  83.          this.started = false;
  84.       }
  85.  
  86.    }
  87.  
  88.    public void killApplet() {
  89.       this.addApplet((String)null, 3);
  90.    }
  91.  
  92.    private void paintIt() {
  93.       if (this.first_run) {
  94.          this.first_run = false;
  95.       }
  96.  
  97.       if (this.paintCalled) {
  98.          Graphics var1 = ((Component)this).getGraphics();
  99.          byte var2 = 2;
  100.          byte var3 = 2;
  101.          int var4 = this.field_0.width - 4;
  102.          int var5 = this.field_0.height - 4 - (this.field_4 + 4);
  103.          var1.setColor(this.bgColor);
  104.          var1.fillRect(var2, var3, var4, var5);
  105.          var1.setColor(Color.black);
  106.          var1.drawRect(var2 - 1, var3 - 1, var4 + 1, var5 + 1);
  107.          var1.setColor(Color.gray);
  108.          var1.drawRect(var2 - 2, var3 - 2, var4 + 3, var5 + 3);
  109.          var1.drawRect(this.field_1 - 1, this.field_2 - 1, this.field_3 + 1, this.field_4 + 1);
  110.          var1.setColor(Color.lightGray);
  111.          var1.drawLine(var2, var3 + var5, var2 + var4, var3 + var5);
  112.          var1.drawLine(var2 + var4, var3, var2 + var4, var3 + var5);
  113.          var1.setColor(Color.white);
  114.          var1.drawLine(var2 - 1, var3 + var5 + 1, var2 + var4 + 1, var3 + var5 + 1);
  115.          var1.drawLine(var2 + var4 + 1, var3 - 1, var2 + var4 + 1, var3 + var5 + 1);
  116.          var1.drawLine(this.field_1 - 1, this.field_2 + this.field_4, this.field_1 + this.field_3, this.field_2 + this.field_4);
  117.          var1.drawLine(this.field_1 + this.field_3, this.field_2 - 1, this.field_1 + this.field_3, this.field_2 + this.field_4);
  118.       }
  119.    }
  120.  
  121.    public void resize(Dimension var1) {
  122.       this.figureAppPos();
  123.       this.addApplet((String)null, 4);
  124.       super.resize(var1);
  125.    }
  126.  
  127.    public void resize(int var1, int var2) {
  128.       this.field_0 = new Dimension(var1, var2);
  129.       this.figureAppPos();
  130.       this.addApplet((String)null, 4);
  131.       super.resize(var1, var2);
  132.    }
  133.  
  134.    private void figureAppPos() {
  135.       this.appx = (this.field_0.width - this.appw) / 2;
  136.       this.appy = (this.field_0.height - this.apph - (this.field_4 + 4)) / 2;
  137.       this.field_2 = this.field_0.height - this.field_4 - 1;
  138.       this.field_3 = this.field_0.width - 2;
  139.       this.statBar.reshape(this.field_1, this.field_2, this.field_3, this.field_4);
  140.       ACgldat.appBWidth = this.field_0.width - this.appw;
  141.       ACgldat.appBHeight = this.field_0.height - this.apph - this.field_4 - 3;
  142.    }
  143.  
  144.    public void addApplet(String var1) {
  145.       this.addApplet(var1, 0);
  146.    }
  147.  
  148.    private void addApplet(String var1, int var2) {
  149.       if (this.appClass.equalsIgnoreCase("inm")) {
  150.          if (var2 == 0) {
  151.             this.app_inm = new inm();
  152.             this.app_inm.reshape(this.appx, this.appy, this.appw, this.apph);
  153.             ((Container)this).add(this.app_inm);
  154.             this.app_inm.setTag(var1);
  155.             this.app_inm.init();
  156.             return;
  157.          }
  158.  
  159.          if (var2 == 1) {
  160.             this.app_inm.start();
  161.             return;
  162.          }
  163.  
  164.          if (var2 == 2) {
  165.             this.app_inm.stop();
  166.             return;
  167.          }
  168.  
  169.          if (var2 == 3) {
  170.             this.app_inm.stop();
  171.             this.app_inm.destroy();
  172.             return;
  173.          }
  174.  
  175.          if (var2 == 4) {
  176.             this.app_inm.reshape(this.appx, this.appy, this.appw, this.apph);
  177.             return;
  178.          }
  179.       } else if (this.appClass.equalsIgnoreCase("ocvscroll")) {
  180.          if (var2 == 0) {
  181.             this.app_ocvscroll = new OCVscroll();
  182.             this.app_ocvscroll.reshape(30, 30, this.appw, this.apph);
  183.             ((Container)this).add(this.app_ocvscroll);
  184.             this.app_ocvscroll.setTag(var1);
  185.             this.app_ocvscroll.init();
  186.             return;
  187.          }
  188.  
  189.          if (var2 == 1) {
  190.             this.app_ocvscroll.start();
  191.             return;
  192.          }
  193.  
  194.          if (var2 == 2) {
  195.             this.app_ocvscroll.stop();
  196.             return;
  197.          }
  198.  
  199.          if (var2 == 3) {
  200.             this.app_ocvscroll.stop();
  201.             this.app_ocvscroll.destroy();
  202.             return;
  203.          }
  204.  
  205.          if (var2 == 4) {
  206.             this.app_ocvscroll.reshape(this.appx, this.appy, this.appw, this.apph);
  207.             return;
  208.          }
  209.       } else if (this.appClass.equalsIgnoreCase("slideb")) {
  210.          if (var2 == 0) {
  211.             this.app_slideb = new slideb();
  212.             this.app_slideb.reshape(30, 30, this.appw, this.apph);
  213.             ((Container)this).add(this.app_slideb);
  214.             this.app_slideb.setTag(var1);
  215.             this.app_slideb.init();
  216.             return;
  217.          }
  218.  
  219.          if (var2 == 1) {
  220.             this.app_slideb.start();
  221.             return;
  222.          }
  223.  
  224.          if (var2 == 2) {
  225.             this.app_slideb.stop();
  226.             return;
  227.          }
  228.  
  229.          if (var2 == 3) {
  230.             this.app_slideb.stop();
  231.             this.app_slideb.destroy();
  232.             return;
  233.          }
  234.  
  235.          if (var2 == 4) {
  236.             this.app_slideb.reshape(this.appx, this.appy, this.appw, this.apph);
  237.             return;
  238.          }
  239.       } else if (this.appClass.equalsIgnoreCase("tdmessage")) {
  240.          if (var2 == 0) {
  241.             this.app_tdmessage = new TDMessage();
  242.             this.app_tdmessage.reshape(30, 30, this.appw, this.apph);
  243.             ((Container)this).add(this.app_tdmessage);
  244.             this.app_tdmessage.setTag(var1);
  245.             this.app_tdmessage.init();
  246.             return;
  247.          }
  248.  
  249.          if (var2 == 1) {
  250.             this.app_tdmessage.start();
  251.             return;
  252.          }
  253.  
  254.          if (var2 == 2) {
  255.             this.app_tdmessage.stop();
  256.             return;
  257.          }
  258.  
  259.          if (var2 == 3) {
  260.             this.app_tdmessage.stop();
  261.             this.app_tdmessage.destroy();
  262.             return;
  263.          }
  264.  
  265.          if (var2 == 4) {
  266.             this.app_tdmessage.reshape(this.appx, this.appy, this.appw, this.apph);
  267.             return;
  268.          }
  269.       } else if (this.appClass.equalsIgnoreCase("tsilbg")) {
  270.          if (var2 == 0) {
  271.             this.app_tsilbg = new tsilbg();
  272.             this.app_tsilbg.reshape(30, 30, this.appw, this.apph);
  273.             ((Container)this).add(this.app_tsilbg);
  274.             this.app_tsilbg.setTag(var1);
  275.             this.app_tsilbg.init();
  276.             return;
  277.          }
  278.  
  279.          if (var2 == 1) {
  280.             this.app_tsilbg.start();
  281.             return;
  282.          }
  283.  
  284.          if (var2 == 2) {
  285.             this.app_tsilbg.stop();
  286.             return;
  287.          }
  288.  
  289.          if (var2 == 3) {
  290.             this.app_tsilbg.stop();
  291.             this.app_tsilbg.destroy();
  292.             return;
  293.          }
  294.  
  295.          if (var2 == 4) {
  296.             this.app_tsilbg.reshape(this.appx, this.appy, this.appw, this.apph);
  297.             return;
  298.          }
  299.       } else if (this.appClass.equalsIgnoreCase("fadetext")) {
  300.          if (var2 == 0) {
  301.             this.app_fadet = new FadeText();
  302.             this.app_fadet.reshape(30, 30, this.appw, this.apph);
  303.             ((Container)this).add(this.app_fadet);
  304.             this.app_fadet.setTag(var1);
  305.             this.app_fadet.init();
  306.             return;
  307.          }
  308.  
  309.          if (var2 == 1) {
  310.             this.app_fadet.start();
  311.             return;
  312.          }
  313.  
  314.          if (var2 == 2) {
  315.             this.app_fadet.stop();
  316.             return;
  317.          }
  318.  
  319.          if (var2 == 3) {
  320.             this.app_fadet.stop();
  321.             this.app_fadet.destroy();
  322.             return;
  323.          }
  324.  
  325.          if (var2 == 4) {
  326.             this.app_fadet.reshape(this.appx, this.appy, this.appw, this.apph);
  327.             return;
  328.          }
  329.       } else if (this.appClass.equalsIgnoreCase("hscroll")) {
  330.          if (var2 == 0) {
  331.             this.app_hscroll = new hscroll();
  332.             this.app_hscroll.reshape(30, 30, this.appw, this.apph);
  333.             ((Container)this).add(this.app_hscroll);
  334.             this.app_hscroll.setTag(var1);
  335.             this.app_hscroll.init();
  336.             return;
  337.          }
  338.  
  339.          if (var2 == 1) {
  340.             this.app_hscroll.start();
  341.             return;
  342.          }
  343.  
  344.          if (var2 == 2) {
  345.             this.app_hscroll.stop();
  346.             return;
  347.          }
  348.  
  349.          if (var2 == 3) {
  350.             this.app_hscroll.stop();
  351.             this.app_hscroll.destroy();
  352.             return;
  353.          }
  354.  
  355.          if (var2 == 4) {
  356.             this.app_hscroll.reshape(this.appx, this.appy, this.appw, this.apph);
  357.             return;
  358.          }
  359.       } else if (this.appClass.equalsIgnoreCase("slidem")) {
  360.          if (var2 == 0) {
  361.             this.app_slidem = new slidem();
  362.             this.app_slidem.reshape(30, 30, this.appw, this.apph);
  363.             ((Container)this).add(this.app_slidem);
  364.             this.app_slidem.setTag(var1);
  365.             this.app_slidem.init();
  366.             return;
  367.          }
  368.  
  369.          if (var2 == 1) {
  370.             this.app_slidem.start();
  371.             return;
  372.          }
  373.  
  374.          if (var2 == 2) {
  375.             this.app_slidem.stop();
  376.             return;
  377.          }
  378.  
  379.          if (var2 == 3) {
  380.             this.app_slidem.stop();
  381.             this.app_slidem.destroy();
  382.             return;
  383.          }
  384.  
  385.          if (var2 == 4) {
  386.             this.app_slidem.reshape(this.appx, this.appy, this.appw, this.apph);
  387.             return;
  388.          }
  389.       } else if (this.appClass.equalsIgnoreCase("ime")) {
  390.          if (var2 == 0) {
  391.             this.app_ime = new ime();
  392.             this.app_ime.reshape(30, 30, this.appw, this.apph);
  393.             ((Container)this).add(this.app_ime);
  394.             this.app_ime.setTag(var1);
  395.             this.app_ime.init();
  396.             return;
  397.          }
  398.  
  399.          if (var2 == 1) {
  400.             this.app_ime.start();
  401.             return;
  402.          }
  403.  
  404.          if (var2 == 2) {
  405.             this.app_ime.stop();
  406.             return;
  407.          }
  408.  
  409.          if (var2 == 3) {
  410.             this.app_ime.stop();
  411.             this.app_ime.destroy();
  412.             return;
  413.          }
  414.  
  415.          if (var2 == 4) {
  416.             this.app_ime.reshape(this.appx, this.appy, this.appw, this.apph);
  417.             return;
  418.          }
  419.       } else if (this.appClass.equalsIgnoreCase("tscroll")) {
  420.          if (var2 == 0) {
  421.             this.app_tscroll = new tscroll();
  422.             this.app_tscroll.reshape(30, 30, this.appw, this.apph);
  423.             ((Container)this).add(this.app_tscroll);
  424.             this.app_tscroll.setTag(var1);
  425.             this.app_tscroll.init();
  426.             return;
  427.          }
  428.  
  429.          if (var2 == 1) {
  430.             this.app_tscroll.start();
  431.             return;
  432.          }
  433.  
  434.          if (var2 == 2) {
  435.             this.app_tscroll.stop();
  436.             return;
  437.          }
  438.  
  439.          if (var2 == 3) {
  440.             this.app_tscroll.stop();
  441.             this.app_tscroll.destroy();
  442.             return;
  443.          }
  444.  
  445.          if (var2 == 4) {
  446.             this.app_tscroll.reshape(this.appx, this.appy, this.appw, this.apph);
  447.             return;
  448.          }
  449.       } else if (this.appClass.equalsIgnoreCase("mwindow")) {
  450.          if (var2 == 0) {
  451.             this.app_mwindow = new mwindow();
  452.             this.app_mwindow.reshape(30, 30, this.appw, this.apph);
  453.             ((Container)this).add(this.app_mwindow);
  454.             this.app_mwindow.setTag(var1);
  455.             this.app_mwindow.init();
  456.             return;
  457.          }
  458.  
  459.          if (var2 == 1) {
  460.             this.app_mwindow.start();
  461.             return;
  462.          }
  463.  
  464.          if (var2 == 2) {
  465.             this.app_mwindow.stop();
  466.             return;
  467.          }
  468.  
  469.          if (var2 == 3) {
  470.             this.app_mwindow.stop();
  471.             this.app_mwindow.destroy();
  472.             return;
  473.          }
  474.  
  475.          if (var2 == 4) {
  476.             this.app_mwindow.reshape(this.appx, this.appy, this.appw, this.apph);
  477.             return;
  478.          }
  479.       } else if (this.appClass.equalsIgnoreCase("ism")) {
  480.          if (var2 == 0) {
  481.             this.app_ism = new ism();
  482.             this.app_ism.reshape(30, 30, this.appw, this.apph);
  483.             ((Container)this).add(this.app_ism);
  484.             this.app_ism.setTag(var1);
  485.             this.app_ism.init();
  486.             return;
  487.          }
  488.  
  489.          if (var2 == 1) {
  490.             this.app_ism.start();
  491.             return;
  492.          }
  493.  
  494.          if (var2 == 2) {
  495.             this.app_ism.stop();
  496.             return;
  497.          }
  498.  
  499.          if (var2 == 3) {
  500.             this.app_ism.stop();
  501.             this.app_ism.destroy();
  502.             return;
  503.          }
  504.  
  505.          if (var2 == 4) {
  506.             this.app_ism.reshape(this.appx, this.appy, this.appw, this.apph);
  507.             return;
  508.          }
  509.       } else if (this.appClass.equalsIgnoreCase("stmenu")) {
  510.          if (var2 == 0) {
  511.             this.app_stmenu = new stmenu();
  512.             this.app_stmenu.reshape(30, 30, this.appw, this.apph);
  513.             ((Container)this).add(this.app_stmenu);
  514.             this.app_stmenu.setTag(var1);
  515.             this.app_stmenu.init();
  516.             return;
  517.          }
  518.  
  519.          if (var2 == 1) {
  520.             this.app_stmenu.start();
  521.             return;
  522.          }
  523.  
  524.          if (var2 == 2) {
  525.             this.app_stmenu.stop();
  526.             return;
  527.          }
  528.  
  529.          if (var2 == 3) {
  530.             this.app_stmenu.stop();
  531.             this.app_stmenu.destroy();
  532.             return;
  533.          }
  534.  
  535.          if (var2 == 4) {
  536.             this.app_stmenu.reshape(this.appx, this.appy, this.appw, this.apph);
  537.             return;
  538.          }
  539.       } else if (this.appClass.equalsIgnoreCase("vtiscroll")) {
  540.          if (var2 == 0) {
  541.             this.app_vtiscroll = new vtiscroll();
  542.             this.app_vtiscroll.reshape(30, 30, this.appw, this.apph);
  543.             ((Container)this).add(this.app_vtiscroll);
  544.             this.app_vtiscroll.setTag(var1);
  545.             this.app_vtiscroll.init();
  546.             return;
  547.          }
  548.  
  549.          if (var2 == 1) {
  550.             this.app_vtiscroll.start();
  551.             return;
  552.          }
  553.  
  554.          if (var2 == 2) {
  555.             this.app_vtiscroll.stop();
  556.             return;
  557.          }
  558.  
  559.          if (var2 == 3) {
  560.             this.app_vtiscroll.stop();
  561.             this.app_vtiscroll.destroy();
  562.             return;
  563.          }
  564.  
  565.          if (var2 == 4) {
  566.             this.app_vtiscroll.reshape(this.appx, this.appy, this.appw, this.apph);
  567.          }
  568.       }
  569.  
  570.    }
  571.  
  572.    public boolean handleEvent(Event var1) {
  573.       if (var1.id == 9301) {
  574.          this.statBar.setMsg(var1.arg.toString());
  575.          return true;
  576.       } else {
  577.          return super.handleEvent(var1);
  578.       }
  579.    }
  580.  
  581.    public void reshape(int var1, int var2, int var3, int var4) {
  582.       this.field_0 = new Dimension(var3, var4);
  583.       this.figureAppPos();
  584.       this.addApplet((String)null, 4);
  585.       super.reshape(var1, var2, var3, var4);
  586.    }
  587. }
  588.