Package com.eteks.sweethome3d.io

Examples of com.eteks.sweethome3d.io.HomeFileRecorder


    HomePieceOfFurniture piece = new HomePieceOfFurniture(
        catalog.getCategories().get(0).getFurniture().get(0));
    home1.addPieceOfFurniture(piece);
   
    // 2. Record home in a file named test.sh3d in current directory
    HomeRecorder recorder = new HomeFileRecorder();
    String testFile = new File("test.sh3d").getAbsolutePath();
    recorder.writeHome(home1, testFile);
    // Check test.sh3d file exists
    assertTrue("File test.sh3d doesn't exist", recorder.exists(testFile));
   
    // 3. Read test.sh3d file in a new home
    Home home2 = recorder.readHome(testFile);
    // Compare home content
    assertNotSame("Home not loaded", home1, home2);
    assertEquals("Home wall height",
        home1.getWallHeight(), home2.getWallHeight());
    assertEquals("Home walls wrong count",
View Full Code Here


   */
  @Override
  public HomeRecorder getHomeRecorder() {
    // Initialize homeRecorder lazily
    if (this.homeRecorder == null) {
      this.homeRecorder = new HomeFileRecorder();
    }
    return this.homeRecorder;
  }
View Full Code Here

  @Override
  public HomeRecorder getHomeRecorder(HomeRecorder.Type type) {
    if (type == HomeRecorder.Type.COMPRESSED) {
      // Initialize compressedHomeRecorder lazily
      if (this.compressedHomeRecorder == null) {
        this.compressedHomeRecorder = new HomeFileRecorder(9);
      }
      return this.compressedHomeRecorder;
    } else {
      return super.getHomeRecorder(type);
    }
View Full Code Here

        ContentManager.ContentType.SWEET_HOME_3D, home.getName());   
    if (sh3dName != null) {
      // Export home in a threaded task
      Callable<Void> exportToObjTask = new Callable<Void>() {
            public Void call() throws RecorderException {
              new HomeFileRecorder(9).writeHome(home, sh3dName);
              return null;
            }
          };
      ThreadedTaskController.ExceptionHandler exceptionHandler =
          new ThreadedTaskController.ExceptionHandler() {
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.io.HomeFileRecorder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.