Examples of addPieceOfFurniture()


Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    Wall wall = new Wall(0, 10, 100, 80, 10);
    home1.addWall(wall);
    FurnitureCatalog catalog = new DefaultFurnitureCatalog();
    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);
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    int tableFilterRowCount = table.getRowCount();
    assertEquals("Home furniture count and row count same",
        homeFurnitureCount - doorsAndWindowsCount, tableFilterRowCount);
   
    // 3. Add a door or window to home
    home.addPieceOfFurniture(new HomePieceOfFurniture(doorOrWindowPiece));
    // Check no row were added in table
    assertEquals("Wrong furniture count in home", homeFurnitureCount + 1, home.getFurniture().size());
    assertEquals("Wrong row count in table", tableFilterRowCount, table.getRowCount());
   
    // 4. Add an other kind of piece to home
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    // Check no row were added in table
    assertEquals("Wrong furniture count in home", homeFurnitureCount + 1, home.getFurniture().size());
    assertEquals("Wrong row count in table", tableFilterRowCount, table.getRowCount());
   
    // 4. Add an other kind of piece to home
    home.addPieceOfFurniture(new HomePieceOfFurniture(otherPiece));
    // Check one row was added in table
    assertEquals("Wrong furniture count in home", homeFurnitureCount + 2, home.getFurniture().size());
    assertEquals("Wrong row count in table", tableFilterRowCount + 1, table.getRowCount());
   
    // 5. Test sort and filter internal buffer of the table
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    // 5. Test sort and filter internal buffer of the table
    furnitureController.sortFurniture(HomePieceOfFurniture.SortableProperty.NAME);
    // Check the alphabetical order of table data
    assertFurnitureIsSortedByName(table, true);
    // Add a door or window and an other kind of piece to home
    home.addPieceOfFurniture(new HomePieceOfFurniture(doorOrWindowPiece));
    home.addPieceOfFurniture(new HomePieceOfFurniture(otherPiece));
    // Check one row was added in sorted table
    assertEquals("Wrong furniture count in home", homeFurnitureCount + 4, home.getFurniture().size());
    assertEquals("Wrong row count in table", tableFilterRowCount + 2, table.getRowCount());
    assertFurnitureIsSortedByName(table, true);
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    furnitureController.sortFurniture(HomePieceOfFurniture.SortableProperty.NAME);
    // Check the alphabetical order of table data
    assertFurnitureIsSortedByName(table, true);
    // Add a door or window and an other kind of piece to home
    home.addPieceOfFurniture(new HomePieceOfFurniture(doorOrWindowPiece));
    home.addPieceOfFurniture(new HomePieceOfFurniture(otherPiece));
    // Check one row was added in sorted table
    assertEquals("Wrong furniture count in home", homeFurnitureCount + 4, home.getFurniture().size());
    assertEquals("Wrong row count in table", tableFilterRowCount + 2, table.getRowCount());
    assertFurnitureIsSortedByName(table, true);
   
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

   
    // 2. Add to home a wall and a piece of furniture
    home.addWall(new Wall(0, 0, 0, 1000, 10));
    HomePieceOfFurniture piece = new HomePieceOfFurniture(
        preferences.getFurnitureCatalog().getCategory(0).getPieceOfFurniture(0));
    home.addPieceOfFurniture(piece);
    piece.setX(500);
    piece.setY(500);
    assertEquals("Incorrect wall count", 1, home.getWalls().size());
    assertEquals("Incorrect furniture count", 1, home.getFurniture().size());
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    // Create a home and add a selected piece of furniture to it
    Home home = new Home();
    PieceOfFurniture firstPiece = preferences.getFurnitureCatalog().
        getCategories().get(0).getFurniture().get(0);
    HomePieceOfFurniture piece1 = new HomePieceOfFurniture(firstPiece);
    home.addPieceOfFurniture(piece1);
    home.setSelectedItems(Arrays.asList(new HomePieceOfFurniture [] {piece1}));

    // 2. Create a home piece of furniture panel to edit piece
    HomeFurnitureController controller = new HomeFurnitureController(home, preferences, viewFactory, contentManager, null);
    // Check values stored by furniture panel components are equal to the ones set
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

        piece1.getDepth(), piece1.getHeight(), piece1.getColor(),
        piece1.isVisible(), piece1.isModelMirrored(), controller);

    // 3. Add a second selected piece to home
    HomePieceOfFurniture piece2 = new HomePieceOfFurniture(firstPiece);
    home.addPieceOfFurniture(piece2);
    piece2.setX(piece1.getX());
    piece2.setY(piece1.getY() + 10);
    piece2.setElevation(piece1.getElevation() + 10);
    piece2.setWidth(piece1.getWidth());
    piece2.setDepth(piece1.getDepth() + 10);
View Full Code Here

Examples of com.eteks.sweethome3d.model.Home.addPieceOfFurniture()

    UserPreferences preferences = new DefaultUserPreferences();
    Home home = new Home();
    PieceOfFurniture firstPiece = preferences.getFurnitureCatalog().
        getCategories().get(0).getFurniture().get(0);
    HomePieceOfFurniture piece1 = new HomePieceOfFurniture(firstPiece);
    home.addPieceOfFurniture(piece1);
    home.setSelectedItems(Arrays.asList(new HomePieceOfFurniture [] {piece1}));
   
    HomeFurnitureController controller = new HomeFurnitureController(home, preferences,
        new SwingViewFactory(), new FileContentManager(preferences), null);
    HomeFurniturePanel furniturePanel =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.