home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 27 / CDROM27.iso / share / wnt / jig / data1.cab / Program_Executable_Files / lib / jig.jar / BrowserOptions.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-19  |  16.3 KB  |  901 lines

  1. import java.awt.Button;
  2. import java.awt.Checkbox;
  3. import java.awt.Choice;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Dialog;
  7. import java.awt.Event;
  8. import java.awt.FlowLayout;
  9. import java.awt.Frame;
  10. import java.awt.GridBagConstraints;
  11. import java.awt.GridBagLayout;
  12. import java.awt.Image;
  13. import java.awt.Label;
  14. import java.awt.Panel;
  15. import java.awt.TextField;
  16. import java.awt.Toolkit;
  17. import java.awt.Window;
  18. import java.io.File;
  19. import java.io.FileInputStream;
  20. import java.io.FileNotFoundException;
  21. import java.io.FileOutputStream;
  22. import java.io.IOException;
  23. import java.io.StringWriter;
  24. import java.util.Enumeration;
  25. import java.util.Hashtable;
  26. import java.util.Locale;
  27. import java.util.Properties;
  28. import java.util.ResourceBundle;
  29.  
  30. class BrowserOptions extends Dialog {
  31.    Frame parent;
  32.    static Properties sectionDict = null;
  33.    Button setButton;
  34.    Button addButton;
  35.    Button delButton;
  36.    Button helpButton;
  37.    Button modifyButton;
  38.    TextField compileField;
  39.    TextField compilerField;
  40.    TextField debugField;
  41.    TextField javaField;
  42.    TextField importsField;
  43.    Choice spacesField;
  44.    TextField grepField;
  45.    TextField htmlBrowserField;
  46.    TextField appletOptionField;
  47.    TextField destinationField;
  48.    TextField optionalClasspathField;
  49.    TextField documentField;
  50.    Choice userDirField;
  51.    Choice otherOptionsField;
  52.    Checkbox transcriptField;
  53.    Checkbox autoSaveField;
  54.    Checkbox suggestUpdateField;
  55.    static String document = "";
  56.    static String documenter = "javadoc";
  57.    static String compiler = "javac";
  58.    static String debugger = "jdb";
  59.    static String interpreter = "java";
  60.    static String compile = "-g";
  61.    static String debug = "";
  62.    static String java = "";
  63.    static String imports = "java.awt.* java.io.*";
  64.    static String htmlBrowser = "";
  65.    static String destination = "";
  66.    static String optionalClasspath = "";
  67.    static String appletOption = "";
  68.    static String jigHome = "";
  69.    static int spaces;
  70.    static boolean test;
  71.    static String grep = "grep32";
  72.    static String userDir = "";
  73.    static String appletViewer = "appletViewer";
  74.    static String iniFileName = "jig.properties";
  75.    static String reFilename = "re.properties";
  76.    static boolean transcript = true;
  77.    static boolean autoSave = true;
  78.    static boolean suggestUpdate = true;
  79.    static boolean testRecord;
  80.    static Image iconImage = null;
  81.    static String[] specialSystem = new String[10];
  82.    static Properties regularExpressions = null;
  83.    static ResourceBundle messages;
  84.    static String languageCode = "en";
  85.    static String countryCode = "US";
  86.    static boolean htmlBrowserValid;
  87.    static Hashtable otherOptions = null;
  88.    static String[] otherOptionsList = new String[]{"appletViewer", "compiler", "countryCode", "debugger", "documenter", "grep", "interpreter", "languageCode", "specialSystem0", "specialSystem1", "specialSystem2", "specialSystem3", "specialSystem4", "specialSystem5", "specialSystem6", "specialSystem7", "specialSystem8", "specialSystem9"};
  89.  
  90.    BrowserOptions(Frame var1, String var2) {
  91.       super(var1, var2, false);
  92.       this.parent = var1;
  93.       GridBagLayout var3 = new GridBagLayout();
  94.       GridBagConstraints var4 = new GridBagConstraints();
  95.       ((Container)this).setLayout(var3);
  96.       var4.fill = 1;
  97.       var4.gridwidth = 0;
  98.       var4.weighty = (double)1.0F;
  99.       var4.anchor = 13;
  100.       Panel var5 = new Panel();
  101.       ((Container)var5).setLayout(new FlowLayout(2));
  102.       var3.setConstraints(var5, var4);
  103.       Panel var6 = new Panel();
  104.       ((Container)var6).setLayout(new FlowLayout(2));
  105.       var3.setConstraints(var6, var4);
  106.       Panel var7 = new Panel();
  107.       ((Container)var7).setLayout(new FlowLayout(2));
  108.       var3.setConstraints(var7, var4);
  109.       Panel var8 = new Panel();
  110.       ((Container)var8).setLayout(new FlowLayout(2));
  111.       var3.setConstraints(var8, var4);
  112.       Panel var9 = new Panel();
  113.       ((Container)var9).setLayout(new FlowLayout(2));
  114.       var3.setConstraints(var9, var4);
  115.       Panel var10 = new Panel();
  116.       ((Container)var10).setLayout(new FlowLayout(2));
  117.       var3.setConstraints(var10, var4);
  118.       Panel var11 = new Panel();
  119.       ((Container)var11).setLayout(new FlowLayout(2));
  120.       var3.setConstraints(var11, var4);
  121.       Panel var12 = new Panel();
  122.       ((Container)var12).setLayout(new FlowLayout(2));
  123.       var3.setConstraints(var12, var4);
  124.       Panel var13 = new Panel();
  125.       ((Container)var13).setLayout(new FlowLayout(1));
  126.       var3.setConstraints(var13, var4);
  127.       Panel var14 = new Panel();
  128.       ((Container)var14).setLayout(new FlowLayout(1));
  129.       var3.setConstraints(var14, var4);
  130.       Panel var15 = new Panel();
  131.       ((Container)var15).setLayout(new FlowLayout(2));
  132.       var3.setConstraints(var15, var4);
  133.       Panel var16 = new Panel();
  134.       ((Container)var16).setLayout(new FlowLayout(1));
  135.       var3.setConstraints(var16, var4);
  136.       Panel var17 = new Panel();
  137.       ((Container)var17).setLayout(new FlowLayout(2));
  138.       var3.setConstraints(var17, var4);
  139.       Panel var18 = new Panel();
  140.       ((Container)var18).setLayout(new FlowLayout(2));
  141.       var3.setConstraints(var18, var4);
  142.       ((Container)var5).add(new Label(messages.getString("CompileOpt") + " ", 2));
  143.       ((Container)var5).add(this.compileField = new TextField(compile, 40));
  144.       ((Container)var15).add(new Label(messages.getString("DocumentOp") + " ", 2));
  145.       ((Container)var15).add(this.documentField = new TextField(document, 40));
  146.       ((Container)var6).add(new Label(messages.getString("DebugOptio") + " ", 2));
  147.       ((Container)var6).add(this.debugField = new TextField(debug, 40));
  148.       ((Container)var7).add(new Label(messages.getString("JavaOption") + " ", 2));
  149.       ((Container)var7).add(this.javaField = new TextField(java, 40));
  150.       ((Container)var8).add(new Label(messages.getString("Imports") + " ", 2));
  151.       ((Container)var8).add(this.importsField = new TextField(imports, 40));
  152.       ((Container)var9).add(new Label(messages.getString("Grep") + " ", 2));
  153.       ((Container)var9).add(this.grepField = new TextField(grep, 40));
  154.       ((Container)var10).add(new Label(messages.getString("HTMLBrowser") + " ", 2));
  155.       ((Container)var10).add(this.htmlBrowserField = new TextField(htmlBrowser, 40));
  156.       ((Container)var11).add(new Label(messages.getString("OptionalCl") + " ", 2));
  157.       ((Container)var11).add(this.optionalClasspathField = new TextField(optionalClasspath, 40));
  158.       ((Container)var18).add(new Label(messages.getString("Destination") + " ", 2));
  159.       ((Container)var18).add(this.destinationField = new TextField(destination, 40));
  160.       ((Container)var12).add(new Label(messages.getString("AppletViewe") + " ", 2));
  161.       ((Container)var12).add(this.appletOptionField = new TextField(appletOption, 40));
  162.       ((Container)var13).add(this.transcriptField = new Checkbox(messages.getString("UseTranscr"), transcript));
  163.       ((Container)var13).add(this.autoSaveField = new Checkbox(messages.getString("UseAutoSav"), autoSave));
  164.       ((Container)var13).add(this.suggestUpdateField = new Checkbox(messages.getString("SuggestUpdate"), suggestUpdate));
  165.       ((Container)var16).add(new Label(messages.getString("PackageRoo") + " ", 2));
  166.       ((Container)var16).add(this.userDirField = new Choice());
  167.       this.addButton = new Button(messages.getString("Add"));
  168.       ((Container)var16).add(this.addButton);
  169.       this.delButton = new Button(messages.getString("Delete"));
  170.       ((Container)var16).add(this.delButton);
  171.       if (!userDir.equals("")) {
  172.          this.userDirField.add(userDir);
  173.       }
  174.  
  175.       String var19 = "";
  176.  
  177.       for(int var20 = 0; var19 != null; ++var20) {
  178.          var19 = (String)sectionDict.get(var20 > 0 ? "userDirectory" + Integer.toString(var20) : "userDirectory");
  179.          if (var19 != null && !var19.equals(userDir)) {
  180.             this.userDirField.add(var19);
  181.          }
  182.       }
  183.  
  184.       ((Container)var14).add(new Label(messages.getString("FormatSpac") + " ", 2));
  185.       ((Container)var14).add(this.spacesField = new Choice());
  186.       this.spacesField.add(messages.getString("Tab"));
  187.       this.spacesField.add("2");
  188.       this.spacesField.add("4");
  189.       this.spacesField.add("6");
  190.       this.spacesField.add("8");
  191.       this.spacesField.add("10");
  192.       if (spaces == 0) {
  193.          this.spacesField.select(messages.getString("Tab"));
  194.       } else {
  195.          this.spacesField.select(String.valueOf(spaces).trim());
  196.       }
  197.  
  198.       ((Container)var14).add(new Label(messages.getString("OtherOption") + " ", 2));
  199.       ((Container)var14).add(this.otherOptionsField = new Choice());
  200.       this.modifyButton = new Button(messages.getString("Modify"));
  201.       ((Container)var14).add(this.modifyButton);
  202.  
  203.       for(int var21 = 0; var21 < otherOptionsList.length; ++var21) {
  204.          this.otherOptionsField.add(otherOptionsList[var21]);
  205.       }
  206.  
  207.       ((Container)var17).add(new Label(messages.getString("Compiler") + " ", 2));
  208.       ((Container)var17).add(this.compilerField = new TextField(compiler, 40));
  209.       ((Container)this).add(var10);
  210.       ((Container)this).add(var8);
  211.       ((Container)this).add(var11);
  212.       ((Container)this).add(var18);
  213.       ((Container)this).add(var12);
  214.       ((Container)this).add(var5);
  215.       ((Container)this).add(var6);
  216.       ((Container)this).add(var7);
  217.       ((Container)this).add(var15);
  218.       ((Container)this).add(var13);
  219.       ((Container)this).add(var14);
  220.       ((Container)this).add(var16);
  221.       Panel var22 = new Panel();
  222.       ((Container)var22).setLayout(new FlowLayout(1));
  223.       var3.setConstraints(var22, var4);
  224.       this.setButton = new Button(messages.getString("OK"));
  225.       ((Container)var22).add(this.setButton);
  226.       ((Container)var22).add(new Button(messages.getString("Cancel")));
  227.       this.helpButton = new Button(messages.getString("Help"));
  228.       ((Container)var22).add(this.helpButton);
  229.       ((Container)this).add(var22);
  230.       loadOtherOptions();
  231.       ((Component)this).setSize(400, 500);
  232.       ((Window)this).pack();
  233.       ((Dialog)this).show();
  234.    }
  235.  
  236.    public boolean action(Event var1, Object var2) {
  237.       if (var1.target == this.helpButton) {
  238.          File var12 = new File((!jigHome.equals("") ? jigHome : System.getProperty("user.dir")) + System.getProperty("file.separator") + "JigOptions.hlp");
  239.          if (var12.exists()) {
  240.             new InformationDialog(new Frame(), var12);
  241.          }
  242.  
  243.          return true;
  244.       } else if (var1.target == this.modifyButton) {
  245.          Frame var10002 = this.parent;
  246.          String var10003 = messages.getString("ModifyOption") + " " + this.otherOptionsField.getSelectedItem();
  247.          String var10004 = messages.getString("EnterTheNewV");
  248.          String var10 = this.otherOptionsField.getSelectedItem();
  249.          QueryDialog var11 = new QueryDialog(var10002, var10003, var10004, (String)otherOptions.get(var10));
  250.          String var14 = var11.getText();
  251.          if (var14 != null) {
  252.             String var15 = this.otherOptionsField.getSelectedItem();
  253.             otherOptions.put(var15, var14);
  254.          }
  255.  
  256.          return true;
  257.       } else if (var1.target == this.addButton) {
  258.          QueryDialog var9 = new QueryDialog(this.parent, messages.getString("AddUserDir"), messages.getString("EnterTheNewU"));
  259.          String var13 = var9.getText();
  260.          if (var13 != null) {
  261.             File var5 = new File(var13);
  262.             if (!var5.isDirectory()) {
  263.                new InformationDialog(this.parent, messages.getString("TheUserDir") + " " + var13 + messages.getString("IsNotaVali"));
  264.                return true;
  265.             }
  266.  
  267.             this.userDirField.add(var13);
  268.             this.userDirField.select(var13);
  269.          }
  270.  
  271.          if (this.userDirField.getItemCount() > 1) {
  272.             this.delButton.setEnabled(true);
  273.          }
  274.  
  275.          return true;
  276.       } else if (var1.target == this.delButton) {
  277.          if (this.userDirField.getItemCount() > 1) {
  278.             this.userDirField.remove(this.userDirField.getSelectedIndex());
  279.          }
  280.  
  281.          if (this.userDirField.getItemCount() == 1) {
  282.             this.delButton.setEnabled(false);
  283.          }
  284.  
  285.          return true;
  286.       } else {
  287.          if (var1.target == this.setButton) {
  288.             compile = this.compileField.getText();
  289.             document = this.documentField.getText();
  290.             debug = this.debugField.getText();
  291.             java = this.javaField.getText();
  292.             imports = this.importsField.getText();
  293.             grep = this.grepField.getText();
  294.             if (this.spacesField.getSelectedItem().equals(messages.getString("Tab"))) {
  295.                spaces = Integer.parseInt("0");
  296.             } else {
  297.                spaces = Integer.parseInt(this.spacesField.getSelectedItem());
  298.             }
  299.  
  300.             optionalClasspath = this.optionalClasspathField.getText();
  301.             destination = this.destinationField.getText();
  302.             appletOption = this.appletOptionField.getText();
  303.             htmlBrowser = this.htmlBrowserField.getText();
  304.             transcript = this.transcriptField.getState();
  305.             autoSave = this.autoSaveField.getState();
  306.             suggestUpdate = this.suggestUpdateField.getState();
  307.             saveOtherOptions();
  308.             if (htmlBrowser.equals("")) {
  309.                htmlBrowserValid = false;
  310.             } else {
  311.                Object var3 = null;
  312.                String var6;
  313.                if (!htmlBrowser.endsWith(".exe") && !htmlBrowser.endsWith(".EXE")) {
  314.                   var6 = htmlBrowser + ".exe";
  315.                } else {
  316.                   var6 = htmlBrowser;
  317.                }
  318.  
  319.                File var4 = new File(var6);
  320.                if (var4.exists()) {
  321.                   htmlBrowserValid = true;
  322.                } else {
  323.                   htmlBrowserValid = false;
  324.                }
  325.             }
  326.  
  327.             if (!userDir.equals(this.userDirField.getSelectedItem())) {
  328.                userDir = this.userDirField.getSelectedItem();
  329.                if (userDir == null) {
  330.                   userDir = "";
  331.                }
  332.  
  333.                if (this.parent instanceof BrowserView && this.parent.getTitle().startsWith(AboutBrowser.systemName)) {
  334.                   this.parent.setCursor(3);
  335.                   BrowserView var7 = (BrowserView)this.parent;
  336.                   if (var7.testDiscard()) {
  337.                      var7.model.reinit();
  338.                   }
  339.  
  340.                   this.parent.setCursor(0);
  341.                }
  342.             }
  343.  
  344.             this.save();
  345.             if (test) {
  346.                System.err.println("compiler: " + compiler);
  347.                System.err.println("compile: " + compile);
  348.                System.err.println("debug: " + debug);
  349.                System.err.println("java: " + java);
  350.                System.err.println("imports: " + imports);
  351.                System.err.println(messages.getString("Grep") + " " + grep);
  352.                System.err.println("spaces: " + spaces);
  353.                System.err.println("userDir: " + userDir);
  354.                System.exit(0);
  355.             } else if (this.parent instanceof BrowserView) {
  356.                BrowserView var8 = (BrowserView)this.parent;
  357.                var8.updateState();
  358.             }
  359.          }
  360.  
  361.          if (var1.target instanceof Button) {
  362.             ((Window)this).dispose();
  363.             if (test) {
  364.                System.exit(0);
  365.             }
  366.          }
  367.  
  368.          return true;
  369.       }
  370.    }
  371.  
  372.    public static void main(String[] var0) {
  373.       test = true;
  374.       init();
  375.       Frame var1 = new Frame();
  376.       var1.setIconImage(iconImage);
  377.       new BrowserOptions(var1, messages.getString("JIGBrowser"));
  378.    }
  379.  
  380.    public static int spaces() {
  381.       return spaces;
  382.    }
  383.  
  384.    public static String compile() {
  385.       return compile;
  386.    }
  387.  
  388.    public static String debug() {
  389.       return debug;
  390.    }
  391.  
  392.    public static String java() {
  393.       return java;
  394.    }
  395.  
  396.    public boolean handleEvent(Event var1) {
  397.       switch (var1.id) {
  398.          case 201:
  399.             ((Window)this).dispose();
  400.          default:
  401.             return super.handleEvent(var1);
  402.       }
  403.    }
  404.  
  405.    public static String imports() {
  406.       return imports;
  407.    }
  408.  
  409.    public static String grep() {
  410.       return grep.trim();
  411.    }
  412.  
  413.    void setProperty(String var1, String var2) {
  414.       Properties var3 = System.getProperties();
  415.       ((Hashtable)var3).put(var1, var2);
  416.       System.setProperties(var3);
  417.    }
  418.  
  419.    public static String delimiter() {
  420.       return System.getProperty("file.separator");
  421.    }
  422.  
  423.    public static char delimiterChar() {
  424.       String var0 = System.getProperty("file.separator");
  425.       return var0.charAt(0);
  426.    }
  427.  
  428.    void save() {
  429.       sectionDict.put("documenter", documenter);
  430.       sectionDict.put("compiler", compiler);
  431.       sectionDict.put("debugger", debugger);
  432.       sectionDict.put("interpreter", interpreter);
  433.       sectionDict.put("compileFlags", compile);
  434.       sectionDict.put("documentFlags", document);
  435.       sectionDict.put("debugFlags", debug);
  436.       sectionDict.put("javaFlags", java);
  437.       sectionDict.put("evaluationImports", imports);
  438.       sectionDict.put("spaces", String.valueOf(spaces));
  439.       sectionDict.put("grep", grep);
  440.       sectionDict.put("userDirectory", userDir);
  441.       sectionDict.put("htmlBrowser", htmlBrowser);
  442.       sectionDict.put("appletViewer", appletViewer);
  443.       sectionDict.put("destination", destination);
  444.       sectionDict.put("optionalClasspath", optionalClasspath);
  445.       sectionDict.put("appletOptions", appletOption);
  446.       sectionDict.put("languageCode", languageCode);
  447.       sectionDict.put("countryCode", countryCode);
  448.       sectionDict.put("transcript", transcript ? "true" : "false");
  449.       sectionDict.put("autoSave", autoSave ? "true" : "false");
  450.       sectionDict.put("suggestUpdate", suggestUpdate ? "true" : "false");
  451.  
  452.       for(int var1 = 0; var1 < 10; ++var1) {
  453.          if (specialSystem[var1] == null) {
  454.             specialSystem[var1] = "";
  455.          }
  456.  
  457.          sectionDict.put("system" + var1, specialSystem[var1]);
  458.       }
  459.  
  460.       if (this.userDirField.getItemCount() > 0) {
  461.          this.userDirField.remove(this.userDirField.getSelectedIndex());
  462.       }
  463.  
  464.       for(int var2 = 0; var2 < this.userDirField.getItemCount(); ++var2) {
  465.          sectionDict.put("userDirectory" + (var2 + 1), this.userDirField.getItem(var2));
  466.       }
  467.  
  468.       writeIni((!jigHome.equals("") ? jigHome : System.getProperty("user.dir")) + System.getProperty("file.separator") + iniFileName);
  469.    }
  470.  
  471.    static void init() {
  472.       parseIni((!jigHome.equals("") ? jigHome : System.getProperty("user.dir")) + System.getProperty("file.separator") + iniFileName);
  473.       Object var0 = null;
  474.       if (sectionDict != null) {
  475.          String var3 = (String)sectionDict.get("documenter");
  476.          if (var3 != null) {
  477.             documenter = var3;
  478.          }
  479.  
  480.          var3 = (String)sectionDict.get("compiler");
  481.          if (var3 != null) {
  482.             compiler = var3;
  483.          }
  484.  
  485.          var3 = (String)sectionDict.get("debugger");
  486.          if (var3 != null) {
  487.             debugger = var3;
  488.          }
  489.  
  490.          var3 = (String)sectionDict.get("interpreter");
  491.          if (var3 != null) {
  492.             interpreter = var3;
  493.          }
  494.  
  495.          var3 = (String)sectionDict.get("compileFlags");
  496.          if (var3 != null) {
  497.             compile = var3;
  498.          }
  499.  
  500.          var3 = (String)sectionDict.get("documentFlags");
  501.          if (var3 != null) {
  502.             document = var3;
  503.          }
  504.  
  505.          var3 = (String)sectionDict.get("debugFlags");
  506.          if (var3 != null) {
  507.             debug = var3;
  508.          }
  509.  
  510.          var3 = (String)sectionDict.get("javaFlags");
  511.          if (var3 != null) {
  512.             java = var3;
  513.          }
  514.  
  515.          var3 = (String)sectionDict.get("evaluationImports");
  516.          if (var3 != null) {
  517.             imports = var3;
  518.          }
  519.  
  520.          var3 = (String)sectionDict.get("spaces");
  521.          if (var3 != null) {
  522.             spaces = Double.valueOf(var3).intValue();
  523.          }
  524.  
  525.          var3 = (String)sectionDict.get("grep");
  526.          if (var3 != null) {
  527.             grep = var3;
  528.          }
  529.  
  530.          var3 = (String)sectionDict.get("userDirectory");
  531.          if (var3 != null) {
  532.             userDir = var3;
  533.          }
  534.  
  535.          var3 = (String)sectionDict.get("destination");
  536.          if (var3 != null) {
  537.             destination = var3;
  538.          }
  539.  
  540.          var3 = (String)sectionDict.get("optionalClasspath");
  541.          if (var3 != null) {
  542.             optionalClasspath = var3;
  543.          }
  544.  
  545.          var3 = (String)sectionDict.get("htmlBrowser");
  546.          if (var3 != null) {
  547.             htmlBrowser = var3;
  548.          }
  549.  
  550.          if (htmlBrowser.equals("")) {
  551.             htmlBrowserValid = false;
  552.          } else {
  553.             Object var1 = null;
  554.             String var27;
  555.             if (!htmlBrowser.endsWith(".exe") && !htmlBrowser.endsWith(".EXE")) {
  556.                var27 = htmlBrowser + ".exe";
  557.             } else {
  558.                var27 = htmlBrowser;
  559.             }
  560.  
  561.             File var2 = new File(var27);
  562.             if (var2.exists()) {
  563.                htmlBrowserValid = true;
  564.             } else {
  565.                htmlBrowserValid = false;
  566.             }
  567.          }
  568.  
  569.          var3 = (String)sectionDict.get("appletViewer");
  570.          if (var3 != null) {
  571.             appletViewer = var3;
  572.          }
  573.  
  574.          var3 = (String)sectionDict.get("appletOptions");
  575.          if (var3 != null) {
  576.             appletOption = var3;
  577.          }
  578.  
  579.          var3 = (String)sectionDict.get("languageCode");
  580.          if (var3 != null) {
  581.             languageCode = var3;
  582.          }
  583.  
  584.          var3 = (String)sectionDict.get("countryCode");
  585.          if (var3 != null) {
  586.             countryCode = var3;
  587.          }
  588.  
  589.          var3 = (String)sectionDict.get("transcript");
  590.          if (var3 != null) {
  591.             if (var3.equalsIgnoreCase("true")) {
  592.                transcript = true;
  593.             } else {
  594.                transcript = false;
  595.             }
  596.          }
  597.  
  598.          var3 = (String)sectionDict.get("autoSave");
  599.          if (var3 != null) {
  600.             if (var3.equalsIgnoreCase("true")) {
  601.                autoSave = true;
  602.             } else {
  603.                autoSave = false;
  604.             }
  605.          }
  606.  
  607.          var3 = (String)sectionDict.get("suggestUpdate");
  608.          if (var3 != null) {
  609.             if (var3.equalsIgnoreCase("true")) {
  610.                suggestUpdate = true;
  611.             } else {
  612.                suggestUpdate = false;
  613.             }
  614.          }
  615.  
  616.          var3 = (String)sectionDict.get("test");
  617.          if (var3 != null) {
  618.             if (var3.equalsIgnoreCase("true")) {
  619.                testRecord = true;
  620.             } else {
  621.                testRecord = false;
  622.             }
  623.          }
  624.  
  625.          for(int var28 = 0; var28 < 10; ++var28) {
  626.             var3 = (String)sectionDict.get("system" + var28);
  627.             if (var3 != null) {
  628.                specialSystem[var28] = var3;
  629.             } else {
  630.                specialSystem[var28] = "";
  631.             }
  632.          }
  633.  
  634.          messages = ResourceBundle.getBundle("locale", new Locale(languageCode, countryCode));
  635.          iconImage = Toolkit.getDefaultToolkit().getImage((!jigHome.equals("") ? jigHome : System.getProperty("user.dir")) + System.getProperty("file.separator") + "jig32.gif");
  636.          AboutBrowser.loadLicenseFile();
  637.          LoadREFile();
  638.       }
  639.    }
  640.  
  641.    public static void parseIni(String var0) {
  642.       sectionDict = new Properties();
  643.  
  644.       try {
  645.          FileInputStream var1 = new FileInputStream(var0);
  646.          sectionDict.load(var1);
  647.          var1.close();
  648.       } catch (FileNotFoundException var2) {
  649.          System.err.println("Load ini file: " + var2);
  650.       } catch (IOException var3) {
  651.          System.err.println("Load ini file: " + var3);
  652.       }
  653.    }
  654.  
  655.    public static void writeIni(String var0) {
  656.       try {
  657.          FileOutputStream var1 = new FileOutputStream(var0);
  658.          sectionDict.save(var1, messages.getString("JIGPropert"));
  659.          var1.close();
  660.       } catch (FileNotFoundException var2) {
  661.          System.err.println("write ini file: " + var2);
  662.       } catch (IOException var3) {
  663.          System.err.println("write ini file: " + var3);
  664.       }
  665.    }
  666.  
  667.    public static String printDict(Hashtable var0) {
  668.       StringWriter var1 = new StringWriter();
  669.       Object var2 = null;
  670.       Object var3 = null;
  671.       Enumeration var4 = var0.keys();
  672.  
  673.       while(var4.hasMoreElements()) {
  674.          String var7;
  675.          var1.write("\n[" + (var7 = (String)var4.nextElement()) + "]\n");
  676.          Hashtable var5 = (Hashtable)var0.get(var7);
  677.          Enumeration var6 = var5.keys();
  678.  
  679.          while(var6.hasMoreElements()) {
  680.             String var8;
  681.             var1.write((var8 = (String)var6.nextElement()) + "=");
  682.             var1.write((String)var5.get(var8) + "\n");
  683.          }
  684.       }
  685.  
  686.       return var1.toString();
  687.    }
  688.  
  689.    public static String GetRootDir() {
  690.       return !jigHome.equals("") ? jigHome : System.getProperty("user.dir");
  691.    }
  692.  
  693.    public static String userDir() {
  694.       return userDir;
  695.    }
  696.  
  697.    public static String compiler() {
  698.       return compiler;
  699.    }
  700.  
  701.    public static Image getIconImage() {
  702.       return iconImage;
  703.    }
  704.  
  705.    static boolean isWindows() {
  706.       if (System.getProperty("os.name").equals("Windows 95")) {
  707.          return true;
  708.       } else {
  709.          return System.getProperty("os.name").equals("Windows NT");
  710.       }
  711.    }
  712.  
  713.    static String specialSystem(int var0) {
  714.       return specialSystem[var0];
  715.    }
  716.  
  717.    private String makeKeyName(String var1, int var2) {
  718.       return var2 > 0 ? var1 + Integer.toString(var2) : var1;
  719.    }
  720.  
  721.    public static String htmlBrowser() {
  722.       return htmlBrowser.trim();
  723.    }
  724.  
  725.    public static String classpath() {
  726.       return !optionalClasspath.equals("") ? optionalClasspath : System.getProperty("java.class.path");
  727.    }
  728.  
  729.    public static String jigHome() {
  730.       return jigHome;
  731.    }
  732.  
  733.    public static void setJigHome(String var0) {
  734.       jigHome = var0;
  735.    }
  736.  
  737.    String iniFileName() {
  738.       return this.iniFileName();
  739.    }
  740.  
  741.    public static void setIniFileName(String var0) {
  742.       iniFileName = var0;
  743.    }
  744.  
  745.    public static String appletViewer() {
  746.       return appletViewer;
  747.    }
  748.  
  749.    public static String appletOption() {
  750.       return appletOption;
  751.    }
  752.  
  753.    public static boolean transcript() {
  754.       return transcript;
  755.    }
  756.  
  757.    public static void LoadREFile() {
  758.       String var0 = (!jigHome.equals("") ? jigHome : System.getProperty("user.dir")) + System.getProperty("file.separator") + reFilename;
  759.  
  760.       try {
  761.          FileInputStream var1 = new FileInputStream(var0);
  762.          regularExpressions = new Properties();
  763.          regularExpressions.load(var1);
  764.          var1.close();
  765.       } catch (IOException var2) {
  766.          System.out.println(var0 + messages.getString("RegularExp") + " " + var2);
  767.       }
  768.    }
  769.  
  770.    public static String getREReferences(String var0) {
  771.       if (var0.length() >= 1 && var0.charAt(var0.length() - 1) == '\\') {
  772.          if (var0.length() >= 2) {
  773.             if (var0.charAt(var0.length() - 2) != '\\') {
  774.                var0 = var0 + "\\";
  775.             }
  776.          } else {
  777.             var0 = var0 + "\\";
  778.          }
  779.       }
  780.  
  781.       return regularExpressions == null ? "" : "\"" + var0 + "\"";
  782.    }
  783.  
  784.    public static String getRESenders(String var0) {
  785.       return regularExpressions == null ? "" : "\"" + regularExpressions.getProperty("senders1") + var0 + regularExpressions.getProperty("senders2") + "\"";
  786.    }
  787.  
  788.    public static String getREReceivers(String var0) {
  789.       return regularExpressions == null ? "" : "\"" + regularExpressions.getProperty("receivers1") + var0 + regularExpressions.getProperty("receivers2") + "\"";
  790.    }
  791.  
  792.    public static String getREExtenders(String var0, String var1, String var2) {
  793.       return regularExpressions == null ? "" : "\"" + regularExpressions.getProperty("extenders1") + var0 + regularExpressions.getProperty("extenders2") + var1 + regularExpressions.getProperty("extenders3") + var2 + regularExpressions.getProperty("extenders4") + "\"";
  794.    }
  795.  
  796.    public static String getREImplementors(String var0, String var1, String var2) {
  797.       return regularExpressions == null ? "" : "\"" + regularExpressions.getProperty("implementors1") + var0 + regularExpressions.getProperty("implementors2") + var1 + regularExpressions.getProperty("implementors3") + var2 + regularExpressions.getProperty("implementors4") + "\"";
  798.    }
  799.  
  800.    public static String getREHierarchy(String var0, String var1) {
  801.       return regularExpressions == null ? "" : "\"" + regularExpressions.getProperty("hierarchy1") + var0 + regularExpressions.getProperty("hierarchy2") + var1 + regularExpressions.getProperty("hierarchy3") + "\"";
  802.    }
  803.  
  804.    public static String getREInterfaces(String var0, String var1) {
  805.       return regularExpressions == null ? "" : "\"" + regularExpressions.getProperty("interfaces1") + var0 + regularExpressions.getProperty("interfaces2") + var1 + regularExpressions.getProperty("interfaces3") + "\"";
  806.    }
  807.  
  808.    private static String reFilename() {
  809.       return reFilename;
  810.    }
  811.  
  812.    static boolean autoSave() {
  813.       return autoSave;
  814.    }
  815.  
  816.    static String document() {
  817.       return document;
  818.    }
  819.  
  820.    static String getString(String var0) {
  821.       return messages.getString(var0);
  822.    }
  823.  
  824.    static boolean test() {
  825.       return testRecord;
  826.    }
  827.  
  828.    public static String debugger() {
  829.       return debugger;
  830.    }
  831.  
  832.    public static String interpreter() {
  833.       return interpreter;
  834.    }
  835.  
  836.    public static String documenter() {
  837.       return documenter;
  838.    }
  839.  
  840.    private String helpFileName() {
  841.       return "JigOptions.hlp";
  842.    }
  843.  
  844.    private static void setOptionField(String var0, String var1) {
  845.       otherOptions.put(var0, var1);
  846.    }
  847.  
  848.    private static String getOptionField(String var0) {
  849.       return (String)otherOptions.get(var0);
  850.    }
  851.  
  852.    static void loadOtherOptions() {
  853.       otherOptions = new Hashtable();
  854.       otherOptions.put("appletViewer", appletViewer);
  855.       otherOptions.put("compiler", compiler);
  856.       otherOptions.put("countryCode", countryCode);
  857.       otherOptions.put("debugger", debugger);
  858.       otherOptions.put("documenter", documenter);
  859.       otherOptions.put("grep", grep);
  860.       otherOptions.put("interpreter", interpreter);
  861.       otherOptions.put("languageCode", languageCode);
  862.  
  863.       for(int var0 = 0; var0 < 10; ++var0) {
  864.          otherOptions.put("specialSystem" + var0, specialSystem[var0]);
  865.       }
  866.  
  867.    }
  868.  
  869.    static void saveOtherOptions() {
  870.       appletViewer = (String)otherOptions.get("appletViewer");
  871.       compiler = (String)otherOptions.get("compiler");
  872.       countryCode = (String)otherOptions.get("countryCode");
  873.       debugger = (String)otherOptions.get("debugger");
  874.       documenter = (String)otherOptions.get("documenter");
  875.       grep = (String)otherOptions.get("grep");
  876.       interpreter = (String)otherOptions.get("interpreter");
  877.       languageCode = (String)otherOptions.get("languageCode");
  878.  
  879.       for(int var0 = 0; var0 < 10; ++var0) {
  880.          specialSystem[var0] = (String)otherOptions.get("specialSystem" + var0);
  881.       }
  882.  
  883.    }
  884.  
  885.    static boolean suggestUpdate() {
  886.       return suggestUpdate;
  887.    }
  888.  
  889.    static String destination() {
  890.       return destination;
  891.    }
  892.  
  893.    static boolean htmlBrowserValid() {
  894.       return htmlBrowserValid;
  895.    }
  896.  
  897.    static void htmlBrowserValid(boolean var0) {
  898.       htmlBrowserValid = var0;
  899.    }
  900. }
  901.