home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 June / INTERNET92.ISO / pc / software / windows / building / visual_dhtml / visualdhtmlwin2000.exe / OChelpan.___ (.txt) < prev    next >
Encoding:
Java Class File  |  2001-10-19  |  2.6 KB  |  123 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 OChelpan extends Panel {
  11.    private boolean first_run = true;
  12.    private boolean paintCalled;
  13.    // $FF: renamed from: d java.awt.Dimension
  14.    Dimension field_0;
  15.    OCstatus statBar;
  16.    Color bgColor;
  17.    String startFile;
  18.    wwjba harea;
  19.    int www;
  20.    int wwh;
  21.    int wwx;
  22.    int wwy;
  23.    // $FF: renamed from: sx int
  24.    int field_1;
  25.    // $FF: renamed from: sy int
  26.    int field_2;
  27.    // $FF: renamed from: sw int
  28.    int field_3;
  29.    // $FF: renamed from: sh int
  30.    int field_4;
  31.  
  32.    OChelpan(String var1, int var2, int var3) {
  33.       this.bgColor = Color.gray;
  34.       this.field_1 = 2;
  35.       this.field_4 = 16;
  36.       this.startFile = var1;
  37.       ((Component)this).setBackground(Color.lightGray);
  38.       ((Container)this).setLayout((LayoutManager)null);
  39.       this.statBar = new OCstatus();
  40.       this.harea = new wwjba(this.startFile);
  41.    }
  42.  
  43.    public void paint(Graphics var1) {
  44.       this.paintCalled = true;
  45.       this.paintIt();
  46.    }
  47.  
  48.    public boolean mouseUp(Event var1, int var2, int var3) {
  49.       return true;
  50.    }
  51.  
  52.    private void paintIt() {
  53.       if (this.paintCalled) {
  54.          Graphics var1 = ((Component)this).getGraphics();
  55.          var1.setColor(Color.black);
  56.          var1.drawRect(this.wwx - 1, this.wwy - 1, this.www + 1, this.wwh + 1);
  57.          var1.setColor(Color.gray);
  58.          var1.drawRect(this.wwx - 2, this.wwy - 2, this.www + 3, this.wwh + 3);
  59.          var1.drawRect(this.field_1 - 1, this.field_2 - 1, this.field_3 + 1, this.field_4 + 1);
  60.          var1.setColor(Color.lightGray);
  61.          var1.drawLine(this.wwx, this.wwy + this.wwh, this.wwx + this.www, this.wwy + this.wwh);
  62.          var1.drawLine(this.wwx + this.www, this.wwy, this.wwx + this.www, this.wwy + this.wwh);
  63.          var1.setColor(Color.white);
  64.          var1.drawLine(this.wwx - 1, this.wwy + this.wwh + 1, this.wwx + this.www + 1, this.wwy + this.wwh + 1);
  65.          var1.drawLine(this.wwx + this.www + 1, this.wwy - 1, this.wwx + this.www + 1, this.wwy + this.wwh + 1);
  66.          var1.drawLine(this.field_1 - 1, this.field_2 + this.field_4, this.field_1 + this.field_3, this.field_2 + this.field_4);
  67.          var1.drawLine(this.field_1 + this.field_3, this.field_2 - 1, this.field_1 + this.field_3, this.field_2 + this.field_4);
  68.       }
  69.    }
  70.  
  71.    public void resize(Dimension var1) {
  72.       this.figureLocations();
  73.       super.resize(var1);
  74.    }
  75.  
  76.    public void resize(int var1, int var2) {
  77.       this.field_0 = new Dimension(var1, var2);
  78.       this.figureLocations();
  79.       super.resize(var1, var2);
  80.    }
  81.  
  82.    public boolean mouseDown(Event var1, int var2, int var3) {
  83.       return true;
  84.    }
  85.  
  86.    private void figureLocations() {
  87.       this.wwx = 3;
  88.       this.wwy = 3;
  89.       this.www = this.field_0.width - 6;
  90.       this.wwh = this.field_0.height - this.field_4 - 10;
  91.       this.harea.reshape(this.wwx, this.wwy, this.www, this.wwh);
  92.       this.field_2 = this.field_0.height - this.field_4 - 2;
  93.       this.field_3 = this.field_0.width - 4;
  94.       this.statBar.reshape(this.field_1, this.field_2, this.field_3, this.field_4);
  95.       if (this.first_run) {
  96.          ((Container)this).add(this.harea);
  97.          this.harea.start();
  98.          ((Container)this).add(this.statBar);
  99.          this.first_run = false;
  100.       }
  101.  
  102.    }
  103.  
  104.    public boolean handleEvent(Event var1) {
  105.       if (var1.id == 9402) {
  106.          this.statBar.setMsg(var1.arg.toString());
  107.          return true;
  108.       } else {
  109.          return super.handleEvent(var1);
  110.       }
  111.    }
  112.  
  113.    public boolean mouseDrag(Event var1, int var2, int var3) {
  114.       return true;
  115.    }
  116.  
  117.    public void reshape(int var1, int var2, int var3, int var4) {
  118.       this.field_0 = new Dimension(var3, var4);
  119.       this.figureLocations();
  120.       super.reshape(var1, var2, var3, var4);
  121.    }
  122. }
  123.