home *** CD-ROM | disk | FTP | other *** search
Wrap
package netscape.security; import java.applet.Applet; import java.awt.Button; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Event; import java.awt.Font; import java.awt.Frame; import java.awt.Label; import java.awt.LayoutManager; import java.awt.Scrollbar; import java.net.MalformedURLException; import java.net.URL; import java.util.Vector; class FrmCert extends Frame { Applet applet = GlobalCtxt.getApplet(); Vector lbVec_g; DialogInterface dlgi_g; XYLayout hXYL; Label lbHelpUrl; ImgPanel imgPanelRoot; Button btnCertHelp; Button btnCertClose; ImgPanel imgPnlTop; Label lbCertHead; ImgPanel imgPnlCert; Label lbCertExpire; Label lbCertImgUrl; Label lbCertSerNum; Label lbCertImgBottom; Label lbCertImgTop; Label lbCertImgLeft; Label lbCertImgRight; Label lbCertImgBotLeft; Label lbCertImgTopLeft; Label lbCertImgBotRight; Label lbCertImgTopRight; Label lbCertNATitle; Label lbCertIBTitle; Label lbCertFPrint; ImgPanel imgPnlNAddr; Scrollbar sbCertNAddr; Label lbCertNAddr; ImgPanel imgPnlCertIssuer; Scrollbar sbCertIssuer; Label lbCertIssuer; void btnClose_Clicked(Event var1) { ((Component)this).hide(); } void btnHelp_Clicked(Event var1) { try { String var2 = this.lbHelpUrl.getText(); if (this.applet.getCodeBase() != null) { var2 = this.applet.getCodeBase().toString() + this.lbHelpUrl.getText(); } this.applet.getAppletContext().showDocument(new URL(var2), new String("_blank")); } catch (MalformedURLException var3) { } } FrmCert(DialogInterface var1) { this.dlgi_g = var1; ((Container)this).setLayout((LayoutManager)null); ((Frame)this).addNotify(); ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 570, ((Container)this).insets().top + ((Container)this).insets().bottom + 417); ((Component)this).setBackground(new Color(12632256)); this.lbHelpUrl = new Label("help.html"); this.lbHelpUrl.hide(); this.lbHelpUrl.reshape(((Container)this).insets().left + 348, ((Container)this).insets().top + 348, 65, 18); ((Container)this).add(this.lbHelpUrl); this.imgPanelRoot = new ImgPanel(); this.imgPanelRoot.setLayout((LayoutManager)null); this.imgPanelRoot.reshape(((Container)this).insets().left + 3, ((Container)this).insets().top + 2, 564, 411); ((Container)this).add(this.imgPanelRoot); this.btnCertHelp = new Button("Help"); this.btnCertHelp.reshape(296, 382, 70, 24); this.btnCertHelp.setFont(new Font("TimesRoman", 0, 12)); this.imgPanelRoot.add(this.btnCertHelp); this.btnCertClose = new Button("Close this dialog"); this.btnCertClose.reshape(200, 381, 70, 24); this.btnCertClose.setFont(new Font("TimesRoman", 0, 12)); this.imgPanelRoot.add(this.btnCertClose); this.imgPnlTop = new ImgPanel(); this.imgPnlTop.setLayout((LayoutManager)null); this.imgPnlTop.reshape(12, 5, 535, 60); this.imgPanelRoot.add(this.imgPnlTop); this.lbCertHead = new Label("<b> The java </b> <i> applet </i> was <33> digitally </33> <12> signed </12>with the following certificate. The certificate <i> proves </i> who the applet is from. <b> (Testing multi-font wrapped text) </b>"); this.lbCertHead.hide(); this.lbCertHead.reshape(12, 0, 513, 60); this.lbCertHead.setFont(new Font("TimesRoman", 0, 16)); this.imgPnlTop.add(this.lbCertHead); this.imgPnlCert = new ImgPanel(); this.imgPnlCert.setLayout((LayoutManager)null); this.imgPnlCert.reshape(12, 70, 535, 306); this.imgPnlCert.setBackground(new Color(16777164)); this.imgPanelRoot.add(this.imgPnlCert); this.lbCertExpire = new Label("<b> This Certificate expires October 1998 </b>"); this.lbCertExpire.hide(); this.lbCertExpire.reshape(117, 246, 375, 33); this.lbCertExpire.setFont(new Font("TimesRoman", 1, 18)); this.imgPnlCert.add(this.lbCertExpire); this.lbCertImgUrl = new Label("<img> <tile> cert.gif"); this.lbCertImgUrl.hide(); this.lbCertImgUrl.reshape(440, 266, 88, 23); this.imgPnlCert.add(this.lbCertImgUrl); this.lbCertImgUrl.disable(); this.lbCertSerNum = new Label("<b> Serial Number </b> :02:78:00:03:6B:00:01:02:03:04:05:06"); this.lbCertSerNum.hide(); this.lbCertSerNum.reshape(33, 186, 467, 34); this.lbCertSerNum.setFont(new Font("TimesRoman", 0, 16)); this.imgPnlCert.add(this.lbCertSerNum); this.lbCertImgBottom = new Label("<img> <trows=1> bottom.gif"); this.lbCertImgBottom.hide(); this.lbCertImgBottom.reshape(33, 273, 466, 30); this.imgPnlCert.add(this.lbCertImgBottom); this.lbCertImgTop = new Label("<img> <trows=1> top.gif"); this.lbCertImgTop.hide(); this.lbCertImgTop.reshape(33, 3, 466, 30); this.imgPnlCert.add(this.lbCertImgTop); this.lbCertImgLeft = new Label("<img> <tcols=1> left.gif"); this.lbCertImgLeft.hide(); this.lbCertImgLeft.reshape(3, 31, 30, 242); this.imgPnlCert.add(this.lbCertImgLeft); this.lbCertImgRight = new Label("<img> <tcols=1> right.gif"); this.lbCertImgRight.hide(); this.lbCertImgRight.reshape(499, 31, 30, 242); this.imgPnlCert.add(this.lbCertImgRight); this.lbCertImgBotLeft = new Label("<img> bottomleft.gif"); this.lbCertImgBotLeft.hide(); this.lbCertImgBotLeft.reshape(3, 273, 30, 30); this.imgPnlCert.add(this.lbCertImgBotLeft); this.lbCertImgTopLeft = new Label("<img> topleft.gif"); this.lbCertImgTopLeft.hide(); this.lbCertImgTopLeft.reshape(3, 3, 30, 30); this.imgPnlCert.add(this.lbCertImgTopLeft); this.lbCertImgBotRight = new Label("<img> bottomright.gif"); this.lbCertImgBotRight.hide(); this.lbCertImgBotRight.reshape(499, 273, 30, 30); this.imgPnlCert.add(this.lbCertImgBotRight); this.lbCertImgTopRight = new Label("<img> topright.gif"); this.lbCertImgTopRight.hide(); this.lbCertImgTopRight.reshape(499, 3, 30, 30); this.imgPnlCert.add(this.lbCertImgTopRight); this.lbCertNATitle = new Label("<b> This Certificate belongs to: </b>"); this.lbCertNATitle.hide(); this.lbCertNATitle.reshape(33, 39, 233, 24); this.lbCertNATitle.setFont(new Font("TimesRoman", 0, 16)); this.lbCertNATitle.setBackground(new Color(16777164)); this.imgPnlCert.add(this.lbCertNATitle); this.lbCertIBTitle = new Label("<b> This Certificate was issued by: </b>"); this.lbCertIBTitle.hide(); this.lbCertIBTitle.reshape(266, 38, 233, 24); this.lbCertIBTitle.setFont(new Font("TimesRoman", 0, 16)); this.imgPnlCert.add(this.lbCertIBTitle); this.lbCertFPrint = new Label("<b> Certificate fingerprint: </b> 71:E380:12:F8::70:A8:30:24:2F:E6:DE-12:A9:0F"); this.lbCertFPrint.hide(); this.lbCertFPrint.reshape(33, 217, 467, 36); this.lbCertFPrint.setFont(new Font("TimesRoman", 0, 16)); this.imgPnlCert.add(this.lbCertFPrint); this.imgPnlNAddr = new ImgPanel(); this.imgPnlNAddr.setLayout((LayoutManager)null); this.imgPnlNAddr.reshape(33, 68, 232, 112); this.imgPnlCert.add(this.imgPnlNAddr); this.sbCertNAddr = new Scrollbar(1); this.sbCertNAddr.reshape(216, 3, 14, 105); this.sbCertNAddr.setBackground(new Color(12632256)); this.imgPnlNAddr.add(this.sbCertNAddr); this.lbCertNAddr = new Label("<BW> XYZ Inc, <BR> XYZ <BR> Software New York, <BR> New York, USA <BR> This is a very long <BR> string to <BR> test how <BR> much the <BR> box can take. If you see <BR> "); this.lbCertNAddr.hide(); this.lbCertNAddr.reshape(3, 3, 212, 105); this.lbCertNAddr.setFont(new Font("TimesRoman", 0, 16)); this.lbCertNAddr.setForeground(new Color(0)); this.imgPnlNAddr.add(this.lbCertNAddr); this.imgPnlCertIssuer = new ImgPanel(); this.imgPnlCertIssuer.setLayout((LayoutManager)null); this.imgPnlCertIssuer.reshape(266, 68, 232, 112); this.imgPnlCert.add(this.imgPnlCertIssuer); this.sbCertIssuer = new Scrollbar(1); this.sbCertIssuer.reshape(216, 3, 14, 105); this.sbCertIssuer.setBackground(new Color(12632256)); this.imgPnlCertIssuer.add(this.sbCertIssuer); this.lbCertIssuer = new Label("<BW> Secure Server Certification Authority RSA Data Security, Inc. US."); this.lbCertIssuer.hide(); this.lbCertIssuer.reshape(3, 3, 212, 105); this.lbCertIssuer.setFont(new Font("TimesRoman", 0, 16)); this.imgPnlCertIssuer.add(this.lbCertIssuer); ((Frame)this).setTitle("Netscape [Certificate for ]"); double var2 = (double)0.0F; double var4 = (double)0.0F; double var6 = (double)0.0F; double var8 = (double)0.0F; this.hXYL = new XYLayout(((Component)this).bounds()); ((Container)this).setLayout(this.hXYL); this.hXYL.setHints(this.imgPanelRoot, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)1.0F)); this.hXYL = (XYLayout)this.imgPanelRoot.getLayout(); var6 = (double)0.0F; var2 = (double)0.0F; var8 = (double)1.0F; var4 = 0.2; this.hXYL.setHints(this.imgPnlTop, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, 0.2)); double var12; double var10005 = var12 = var2 + var4; var4 = 0.8; this.hXYL.setHints(this.imgPnlCert, new RszHints(var6, var10005, var8, 0.8)); var6 = (double)0.5F; this.hXYL.setHints(this.btnCertClose, new RszHints((double)0.5F, var12 + var4, (double)0.0F, (double)0.0F, (double)1.0F, (double)0.0F, (double)0.0F, (double)0.0F, (Component)null, (Component)null, (Component)null, (Component)null)); this.hXYL.setHints(this.btnCertHelp, new RszHints(var6, var12 + var4, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F, (double)1.0F, (double)0.0F, (Component)null, (Component)null, (Component)null, (Component)null)); this.hXYL = (XYLayout)this.imgPnlTop.getLayout(); this.hXYL.setHints(this.lbCertHead, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, 0.30000000000000004)); this.hXYL = (XYLayout)this.imgPnlCert.getLayout(); var6 = (double)0.0F; var2 = (double)0.0F; var8 = (double)0.5F; var4 = 0.1; this.hXYL.setHints(this.lbCertNATitle, new RszHints((double)0.0F, (double)0.0F, (double)0.5F, 0.1)); var2 = (double)0.0F; double var10006 = (double)1.0F - var8; var4 = 0.1; this.hXYL.setHints(this.lbCertIBTitle, new RszHints(var8, (double)0.0F, var10006, 0.1)); var10005 = var2 + var4; var8 = (double)0.5F; this.hXYL.setHints(this.imgPnlNAddr, new RszHints(var6, var10005, (double)0.5F, 0.6000000000000001)); XYLayout var10 = (XYLayout)this.imgPnlNAddr.getLayout(); var10.setHints(this.lbCertNAddr, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)1.0F)); var10.setHints(this.sbCertNAddr, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)1.0F)); double var15; var10005 = var15 = var2 + var4; var10006 = (double)1.0F - var8; var4 = 0.6000000000000001; this.hXYL.setHints(this.imgPnlCertIssuer, new RszHints(var8, var10005, var10006, 0.6000000000000001)); var10 = (XYLayout)this.imgPnlCertIssuer.getLayout(); var10.setHints(this.lbCertIssuer, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)1.0F)); var10.setHints(this.sbCertIssuer, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)1.0F)); var10005 = var2 = var15 + var4; var4 = 0.1; this.hXYL.setHints(this.lbCertSerNum, new RszHints(var6, var10005, (double)1.0F, 0.1)); double var17; this.hXYL.setHints(this.lbCertFPrint, new RszHints(var6, var17 = var2 + var4, (double)1.0F, var4)); this.hXYL.setHints(this.lbCertExpire, new RszHints(var6, var17 + var4, (double)1.0F, var4)); this.hXYL.setHints(this.lbCertImgTop, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)0.0F)); this.hXYL.setHints(this.lbCertImgBottom, new RszHints((double)0.0F, (double)1.0F, (double)1.0F, (double)0.0F)); this.hXYL.setHints(this.lbCertImgLeft, new RszHints((double)0.0F, (double)0.0F, (double)0.0F, (double)1.0F)); this.hXYL.setHints(this.lbCertImgRight, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)1.0F)); this.hXYL.setHints(this.lbCertImgTopLeft, new RszHints((double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F)); this.hXYL.setHints(this.lbCertImgTopRight, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)0.0F)); this.hXYL.setHints(this.lbCertImgBotLeft, new RszHints((double)0.0F, (double)1.0F, (double)0.0F, (double)0.0F)); this.hXYL.setHints(this.lbCertImgBotRight, new RszHints((double)1.0F, (double)1.0F, (double)0.0F, (double)0.0F)); if (GlobalCtxt.rszFnSz_g) { ((Frame)this).setResizable(true); } else { ((Frame)this).setResizable(false); } ((Container)this).validate(); } public synchronized void show() { ((Component)this).move(50, 50); super.show(); } public boolean handleEvent(Event var1) { if (var1.id == 201) { ((Component)this).hide(); } if (this.dlgi_g != null && this.dlgi_g.handleEvent(this, var1)) { return true; } else if (var1.target == this.btnCertClose && var1.id == 1001) { this.btnClose_Clicked(var1); return true; } else if (var1.target == this.btnCertHelp && var1.id == 1001) { this.btnHelp_Clicked(var1); return true; } else { return super.handleEvent(var1); } } }