home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / JDesignerPro / Jdp3_0.exe / data1.cab / Program_Files / JDPAboutBox.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-09  |  4.7 KB  |  146 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.Frame;
  9. import java.awt.Graphics;
  10. import java.awt.Image;
  11. import java.awt.Rectangle;
  12. import java.awt.Toolkit;
  13. import java.awt.Window;
  14. import java.awt.image.ImageObserver;
  15.  
  16. public class JDPAboutBox extends Dialog {
  17.    JDPUser user;
  18.    JDPImageLoader imageLoader;
  19.    Image thisImage;
  20.    Image offscreen;
  21.    Rectangle offscreensize;
  22.    // $FF: renamed from: gr java.awt.Graphics
  23.    Graphics field_0;
  24.    JDPButton okButton;
  25.  
  26.    public void paint(Graphics var1) {
  27.       Rectangle var2 = ((Component)this).bounds();
  28.       if (this.offscreen == null || var2.width != this.offscreensize.width || var2.height != this.offscreensize.height) {
  29.          if (var2.width < 10) {
  30.             var2.width = 10;
  31.          }
  32.  
  33.          if (var2.height < 10) {
  34.             var2.height = 10;
  35.          }
  36.  
  37.          this.offscreen = ((Component)this).createImage(var2.width, var2.height);
  38.          this.offscreensize = var2;
  39.          this.field_0 = this.offscreen.getGraphics();
  40.       }
  41.  
  42.       if (this.imageLoader != null && this.imageLoader.getImageReady()) {
  43.          this.thisImage = this.imageLoader.thisImage;
  44.       }
  45.  
  46.       this.field_0.setColor(((Component)this).getBackground());
  47.       this.field_0.fillRect(0, 0, ((Component)this).bounds().width, ((Component)this).bounds().height);
  48.       if (this.thisImage != null) {
  49.          this.field_0.drawImage(this.thisImage, 9, 30, (ImageObserver)null);
  50.       }
  51.  
  52.       this.field_0.setFont(new Font("Helvetica", 0, 11));
  53.       this.field_0.setColor(Color.black);
  54.       this.field_0.drawString("JDesignerPro " + JDesignerPro.actualversion + " Enterprise Edition.", 126, 42);
  55.       this.field_0.drawString("Copyright ┬⌐ 1995-1999 BulletProof Corporation.", 126, 80);
  56.       this.field_0.drawString("All rights reserved.", 125, 94);
  57.       this.field_0.drawString("www: http://www.bulletproof.com.", 126, 140);
  58.       this.field_0.drawString("ph: (800)505-0105  (305)682-8187.", 126, 154);
  59.       this.field_0.drawString("email: sales@bulletproof.com.", 126, 168);
  60.       this.field_0.drawString("This product is licensed under these terms:", 126, 193);
  61.       if (JDesignerPro.JDPLicensed) {
  62.          this.field_0.drawString("Fully Licensed.", 130, 215);
  63.          this.field_0.drawString("Domain: " + this.user.JDesignerPro.JDPDomain, 130, 229);
  64.       } else {
  65.          this.field_0.drawString("90 day free trial.", 130, 215);
  66.          this.field_0.drawString(Integer.toString(this.user.JDesignerPro.daysRemaining) + " trial days remaining.", 130, 229);
  67.       }
  68.  
  69.       this.field_0.setFont(new Font("Helvetica", 0, 10));
  70.       this.field_0.drawString("Warning: This computer program is protected by copyright law and", 10, 280);
  71.       this.field_0.drawString("international treaties. Unauthorized reproduction or distribution of this", 10, 292);
  72.       this.field_0.drawString("program, or any portion of it, may result in severe civil or criminal", 10, 304);
  73.       this.field_0.drawString("penalties, and will be prosecuted to the maximum", 10, 316);
  74.       this.field_0.drawString("extent possible under the law.", 10, 328);
  75.       this.field_0.setColor(JDPUtils.darker(((Component)this).getBackground()));
  76.       this.field_0.drawLine(125, 200, ((Component)this).bounds().width - 13, 200);
  77.       this.field_0.drawLine(125, 200, 125, 256);
  78.       this.field_0.drawLine(9, 265, ((Component)this).bounds().width - 13, 265);
  79.       this.field_0.setColor(JDPUtils.brighter(((Component)this).getBackground()));
  80.       this.field_0.drawLine(125, 256, ((Component)this).bounds().width - 13, 256);
  81.       this.field_0.drawLine(((Component)this).bounds().width - 13, 200, ((Component)this).bounds().width - 13, 256);
  82.       this.field_0.drawLine(9, 266, ((Component)this).bounds().width - 13, 266);
  83.       this.field_0.setColor(Color.black);
  84.       this.field_0.drawLine(126, 201, ((Component)this).bounds().width - 14, 201);
  85.       this.field_0.drawLine(126, 201, 126, 255);
  86.       if (this.thisImage != null) {
  87.          if (JDesignerPro.executable) {
  88.             this.okButton.reshape(((Component)this).bounds().width - 87, ((Component)this).bounds().height - 35, 75, 23);
  89.          } else {
  90.             this.okButton.reshape(((Component)this).bounds().width - 87, ((Component)this).bounds().height - 50, 75, 23);
  91.          }
  92.  
  93.          this.okButton.show();
  94.          var1.drawImage(this.offscreen, 0, 0, (ImageObserver)null);
  95.       }
  96.  
  97.    }
  98.  
  99.    JDPAboutBox(JDPUser var1, String var2) {
  100.       super((Frame)(var1.jdpMainWindow == null ? new Frame() : var1.jdpMainWindow), var2, false);
  101.       this.user = var1;
  102.       ((Component)this).setBackground(JDPUtils.getControlColor());
  103.       ((Dialog)this).setResizable(false);
  104.       this.imageLoader = new JDPImageLoader(var1, this, "Images/About.JPG");
  105.       (new Thread(this.imageLoader)).start();
  106.       this.okButton = new JDPButton("OK");
  107.       short var3 = 380;
  108.       int var4 = 350;
  109.       if (!JDesignerPro.executable) {
  110.          var4 += 30;
  111.       }
  112.  
  113.       if (var1.cust != null) {
  114.          ((Component)this).reshape(var1.cust.winx1 + (var1.cust.winx2 - var3) / 2, var1.cust.winy1 + (var1.cust.winy2 - var4) / 2, var3, var4);
  115.       } else {
  116.          Dimension var5 = Toolkit.getDefaultToolkit().getScreenSize();
  117.          ((Component)this).reshape((var5.width - var3) / 2, (var5.height - var4) / 2, var3, var4);
  118.       }
  119.  
  120.       ((Container)this).add(this.okButton);
  121.       this.okButton.hide();
  122.       ((Dialog)this).show();
  123.    }
  124.  
  125.    public void layout() {
  126.       ((Component)this).repaint();
  127.    }
  128.  
  129.    public boolean handleEvent(Event var1) {
  130.       switch (var1.id) {
  131.          case 201:
  132.             ((Window)this).dispose();
  133.             return true;
  134.          case 1001:
  135.             if (var1.target.equals(this.okButton)) {
  136.                ((Window)this).dispose();
  137.                return true;
  138.             }
  139.  
  140.             return false;
  141.          default:
  142.             return false;
  143.       }
  144.    }
  145. }
  146.