home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / GeoApplets / classes / PropFontIP.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-19  |  2.6 KB  |  70 lines

  1. import java.applet.Applet;
  2. import java.awt.Dimension;
  3. import java.awt.Font;
  4. import java.awt.Graphics;
  5. import java.awt.Toolkit;
  6. import java.net.InetAddress;
  7. import java.net.UnknownHostException;
  8.  
  9. public class PropFontIP extends Applet {
  10.    // $FF: renamed from: i int
  11.    int field_0;
  12.    // $FF: renamed from: j int
  13.    int field_1;
  14.    int plength;
  15.    int flength;
  16.    String[] properties = new String[10];
  17.    Toolkit myToolkit = Toolkit.getDefaultToolkit();
  18.    String[] myFonts;
  19.    int screenResolution;
  20.    // $FF: renamed from: d java.awt.Dimension
  21.    Dimension field_2;
  22.  
  23.    public void init() {
  24.       this.plength = this.properties.length;
  25.       this.flength = this.myFonts.length;
  26.    }
  27.  
  28.    public void paint(Graphics var1) {
  29.       this.properties[0] = "java.version";
  30.       this.properties[1] = "java.vendor";
  31.       this.properties[2] = "java.vendor.url";
  32.       this.properties[3] = "java.class.version";
  33.       this.properties[4] = "os.name";
  34.       this.properties[5] = "os.arch";
  35.       this.properties[6] = "os.version";
  36.       this.properties[7] = "file.separator";
  37.       this.properties[8] = "path.separator";
  38.       this.properties[9] = "line.separator";
  39.  
  40.       for(this.field_0 = 0; this.field_0 < this.plength; ++this.field_0) {
  41.          var1.drawString(this.properties[this.field_0] + " = " + System.getProperty(this.properties[this.field_0]), 20, 20 * (this.field_0 + 1));
  42.       }
  43.  
  44.       var1.drawString("Fonts available:", 20, (this.plength + 1) * 20);
  45.  
  46.       for(this.field_1 = 0; this.field_1 < this.flength - 1; ++this.field_1) {
  47.          var1.setFont(new Font(this.myFonts[this.field_1], 0, 12));
  48.          var1.drawString(this.myFonts[this.field_1], 20, (this.plength + this.field_1 + 2) * 20);
  49.       }
  50.  
  51.       try {
  52.          var1.setFont(new Font(this.myFonts[1], 1, 12));
  53.          InetAddress var2 = InetAddress.getLocalHost();
  54.          var1.drawString("IP: " + var2.getHostAddress(), 20, 20 * (this.plength + this.flength + 3));
  55.          var1.drawString("Hostname: " + var2.getHostName(), 20, 20 * (this.plength + this.flength + 4));
  56.       } catch (UnknownHostException var3) {
  57.          var1.drawString("Error: Unknown host", 20, 20 * (this.plength + this.flength + 3));
  58.       }
  59.  
  60.       var1.drawString("Screen Resolution : " + this.screenResolution, 20, 20 * (this.plength + this.flength + 5));
  61.       var1.drawString("Screen Size : " + this.field_2.width + "X" + this.field_2.height, 20, 20 * (this.plength + this.flength + 6));
  62.    }
  63.  
  64.    public PropFontIP() {
  65.       this.myFonts = this.myToolkit.getFontList();
  66.       this.screenResolution = this.myToolkit.getScreenResolution();
  67.       this.field_2 = this.myToolkit.getScreenSize();
  68.    }
  69. }
  70.