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

  1. import java.awt.Button;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Dialog;
  6. import java.awt.Dimension;
  7. import java.awt.Event;
  8. import java.awt.Font;
  9. import java.awt.FontMetrics;
  10. import java.awt.Frame;
  11. import java.awt.Graphics;
  12. import java.awt.Image;
  13. import java.awt.LayoutManager;
  14. import java.awt.Panel;
  15. import java.awt.Window;
  16.  
  17. class OCswhere extends Dialog {
  18.    Font font = new Font("helvetica", 0, 11);
  19.    // $FF: renamed from: fm java.awt.FontMetrics
  20.    FontMetrics field_0;
  21.    private String msg = "Specify folder location for the supporting script files.  NOTE: Supporting script files must be uploaded to the same relative directory on the web server.";
  22.    private OCAgrid xyGrid;
  23.    // $FF: renamed from: d java.awt.Dimension
  24.    Dimension field_1;
  25.    // $FF: renamed from: ld java.awt.Dimension
  26.    Dimension field_2;
  27.    // $FF: renamed from: bp java.awt.Panel
  28.    Panel field_3;
  29.    Button select;
  30.    Button cancel;
  31.    private Image text;
  32.    private Graphics g_text;
  33.    private boolean paint_called;
  34.    String orig_value = "";
  35.    int win_width;
  36.    int win_height;
  37.  
  38.    private void initxyGrid() {
  39.       this.field_1 = ((Component)this).size();
  40.       this.xyGrid = new OCAgrid();
  41.       ((Dialog)this).setTitle("Specify Script Folder");
  42.       String[] var1 = new String[1];
  43.       String[] var2 = new String[1];
  44.       int[] var3 = new int[1];
  45.       boolean[] var4 = new boolean[1];
  46.       var1[0] = "Script Folder";
  47.       var3[0] = 20;
  48.       var4[0] = true;
  49.       var2[0] = ACutila.scriptFolder;
  50.       this.xyGrid.populateGrid(var1, var2, var3, var4);
  51.       this.xyGrid.setBackgroundColor(ACutilb.windowColor);
  52.    }
  53.  
  54.    OCswhere(Frame var1, boolean var2) {
  55.       super(var1, false);
  56.       ((Dialog)this).setResizable(false);
  57.       this.initxyGrid();
  58.       this.win_width = 300;
  59.       this.win_height = 154;
  60.       Dimension var3 = ((Window)this).getToolkit().getScreenSize();
  61.       int var4 = (var3.width - this.win_width) / 2;
  62.       int var5 = (var3.height - this.win_height) / 2;
  63.       ((Component)this).reshape(var4, var5, this.win_width, this.win_height);
  64.       ((Container)this).setLayout((LayoutManager)null);
  65.       this.select = new Button("Set Default");
  66.       this.select.reshape(9, 122, 81, 22);
  67.       this.select.setFont(this.font);
  68.       this.cancel = new Button("OK");
  69.       this.cancel.reshape(94, 122, 81, 22);
  70.       this.cancel.setFont(this.font);
  71.       ((Container)this).add(this.select);
  72.       ((Container)this).add(this.cancel);
  73.       this.xyGrid.reshape(10, 90, this.win_width - 20, 40);
  74.       ((Container)this).add(this.xyGrid);
  75.       ((Dialog)this).show();
  76.    }
  77.  
  78.    public void paint(Graphics var1) {
  79.       this.paintIt(var1);
  80.    }
  81.  
  82.    public synchronized void paintIt(Graphics var1) {
  83.       try {
  84.          if (!this.paint_called) {
  85.             this.text = ((Component)this).createImage(this.win_width - 10, 60);
  86.             this.g_text = this.text.getGraphics();
  87.             this.g_text.setColor(ACutilb.windowColor);
  88.             this.g_text.fillRect(0, 0, this.win_width - 10, 60);
  89.             this.paint_called = true;
  90.             this.drawMsg();
  91.          } else {
  92.             var1.drawImage(this.text, 5, 25, this);
  93.          }
  94.       } catch (Exception var2) {
  95.       }
  96.    }
  97.  
  98.    public void drawMsg() {
  99.       Dimension var1 = new Dimension(this.text.getWidth(this), this.text.getHeight(this));
  100.       ACutila.drawTextOverImage(this.g_text, var1, this.msg, this.font, Color.black, 5, 1, 1, ACutilb.windowColor, 0, false);
  101.       this.paintIt(((Component)this).getGraphics());
  102.    }
  103.  
  104.    public boolean handleEvent(Event var1) {
  105.       if (var1.id == 201) {
  106.          ((Window)this).dispose();
  107.          return true;
  108.       } else if (var1.id == 9103) {
  109.          OCRunWindow var2 = new OCRunWindow();
  110.          var2.folderDialog((OCAgrid)var1.target, new Integer((String)var1.arg));
  111.          return true;
  112.       } else {
  113.          if (var1.id == 1001) {
  114.             if (var1.target == this.select) {
  115.                ACutila.scriptFolder = "<same>";
  116.                this.xyGrid.setGridValue(0, "<same>");
  117.                return true;
  118.             }
  119.  
  120.             if (var1.target == this.cancel) {
  121.                ((Window)this).dispose();
  122.                return true;
  123.             }
  124.          } else if (var1.id == 901) {
  125.             if (this.xyGrid.getGridValue(0).equals("")) {
  126.                this.xyGrid.setGridValue(0, "<same>");
  127.             }
  128.  
  129.             ACutila.scriptFolder = this.xyGrid.getGridValue(0);
  130.             return true;
  131.          }
  132.  
  133.          return super.handleEvent(var1);
  134.       }
  135.    }
  136. }
  137.