DefaultUserPreferences defaultPreferences = new DefaultUserPreferences();
// Share same language settings
defaultPreferences.setLanguage(getLanguage());
// Fill default patterns catalog
PatternsCatalog patternsCatalog = defaultPreferences.getPatternsCatalog();
setPatternsCatalog(patternsCatalog);
// Read other preferences
setUnit(LengthUnit.valueOf(preferences.get(UNIT,
defaultPreferences.getLengthUnit().name())));
setFurnitureCatalogViewedInTree(preferences.getBoolean(FURNITURE_CATALOG_VIEWED_IN_TREE,
defaultPreferences.isFurnitureCatalogViewedInTree()));
setNavigationPanelVisible(preferences.getBoolean(NAVIGATION_PANEL_VISIBLE,
defaultPreferences.isNavigationPanelVisible()));
setMagnetismEnabled(preferences.getBoolean(MAGNETISM_ENABLED, true));
setRulersVisible(preferences.getBoolean(RULERS_VISIBLE,
defaultPreferences.isRulersVisible()));
setGridVisible(preferences.getBoolean(GRID_VISIBLE,
defaultPreferences.isGridVisible()));
setFurnitureViewedFromTop(preferences.getBoolean(FURNITURE_VIEWED_FROM_TOP,
defaultPreferences.isFurnitureViewedFromTop()));
setFloorColoredOrTextured(preferences.getBoolean(ROOM_FLOOR_COLORED_OR_TEXTURED,
defaultPreferences.isRoomFloorColoredOrTextured()));
try {
setWallPattern(patternsCatalog.getPattern(preferences.get(WALL_PATTERN,
defaultPreferences.getWallPattern().getName())));
} catch (IllegalArgumentException ex) {
// Ensure wall pattern always exists even if new patterns are added in future versions
setWallPattern(defaultPreferences.getWallPattern());
}