public final Registry getRegistry() {
    if (m_mainRegistry == null) {
      try {
        Registry reg = Registry.loadForClass(JWP.class, rv);
   
        if (reg.sizeOf("USER") == 0) {
          reg.initGroup("USER", new String[][]{
              {"open.blank.default", "true", "boolean"},
              {"max.file.history", "5", "int"},
              {"position.file.toolbar", BorderLayout.NORTH},
              {"position.format.toolbar", BorderLayout.NORTH},
              {"show.file.toolbar", "true", "boolean"},
              {"show.format.toolbar", "true", "boolean"},
              {"default.documents.directory", 
               System.getProperty("user.home") + FS + "documents"}
          });
        }
        
        reg.setProperty("USER", "user.name", 
            System.getProperty("user.name"));
        reg.setProperty("USER", "user.timezone", 
            System.getProperty("user.timezone"));
        reg.setProperty("USER", "user.home", 
            System.getProperty("user.home"));
        reg.setProperty("USER", "temp.directory", 
            System.getProperty("java.io.tmpdir"));
        
        if (reg.sizeOf("MAIN") == 0) {
          reg.initGroup("MAIN", new String[][]{
              {"print.document.enabled", "false", "boolean"},
              {"main.window.w", "650", "int"},
              {"main.window.h", "800", "int"},
              {"main.window.x", "0", "int"},
              {"main.window.y", "0", "int"},
              {"font.sizes.minimum", "6", "int"},
              {"font.sizes.maximum", "150", "int"},
              {"font.sizes.granularity", "2", "int"},
              {"mdi.outline.drag", "true", "boolean"},
              {"main.look&feel", 
                UIManager.getSystemLookAndFeelClassName(),
                "String"},
              {"new.document.title", "New Document", "String"},
              {"default.content.type", Editor.VALID_CONTENT_TYPES[2], "String"}
          });
        }

        if (reg.sizeOf("OPTION") == 0) {
          reg.initGroup("OPTION", new String[][]{
              {"Cut", "true", "boolean"},
              {"Copy", "true", "boolean"},
              {"Paste", "true", "boolean"},
              {"Undo", "true", "boolean"},
              {"Redo", "true", "boolean"},
              {"SelectAll", "true", "boolean"},
              {"SelectNone", "true", "boolean"}});
        }

        if (reg.sizeOf("FONTS") == 0) {
          GraphicsEnvironment ge = 
            GraphicsEnvironment.getLocalGraphicsEnvironment();
          String[] families = ge.getAvailableFontFamilyNames();
          for (int f = 0; f < families.length; f++) {
            if (families[f].indexOf(".") < 0) {
              reg.setProperty("FONTS", families[f], true);
            }
          }
          reg.setProperty("FONTS", "Default", false);
          reg.setProperty("FONTS", "Dialog", false);
          reg.setProperty("FONTS", "DialogInput", false);
          reg.setProperty("FONTS", "Monospaced", false);
          reg.setProperty("FONTS", "SansSerif", false);
          reg.setProperty("FONTS", "Serif", false);
        }

        if (reg.sizeOf("COLOURS") == 0) {
          reg.initGroup("COLOURS", new String[][]{
              {"White", Format.colorToHex(Color.white)},
              {"Black", Format.colorToHex(Color.black)},
              {"Red", Format.colorToHex(Color.red)},
              {"Green", Format.colorToHex(Color.green)},
              {"Blue", Format.colorToHex(Color.blue)},
              {"Orange", Format.colorToHex(Color.orange)},
              {"Dark Gray", Format.colorToHex(Color.darkGray)},
              {"Gray", Format.colorToHex(Color.gray)},
              {"Light Gray", Format.colorToHex(Color.lightGray)},
              {"Cyan", Format.colorToHex(Color.cyan)},
              {"Magenta", Format.colorToHex(Color.magenta)},
              {"Pink", Format.colorToHex(Color.pink)},
              {"Yellow", Format.colorToHex(Color.yellow)}});
        }
        
        m_mainRegistry = reg;
      }
      catch (java.io.IOException ioe0) {
        Code.failed(ioe0);
      }
    }
    return m_mainRegistry;
  }