Package com.eteks.sweethome3d.swing

Examples of com.eteks.sweethome3d.swing.SwingViewFactory


    // Check home furniture isn't empty
    assertTrue("Home furniture is empty", homeFurniture.size() > 0);

    // 2. Create a table that displays home furniture with its controller 
    FurnitureController furnitureController =
        new FurnitureController(home, preferences, new SwingViewFactory());
    FurnitureTable table = (FurnitureTable)furnitureController.getView();
   
    // 3. Sort furniture table in alphabetical order of furniture name
    furnitureController.sortFurniture(HomePieceOfFurniture.SortableProperty.NAME);
    // Check the alphabetical order of table data
View Full Code Here


    // Check home furniture isn't empty
    assertTrue("Home furniture is empty", homeFurniture.size() > 0);

    // 2. Create a table that displays home furniture with its controller 
    FurnitureController furnitureController =
        new FurnitureController(home, preferences, new SwingViewFactory());
    FurnitureTable table = (FurnitureTable)furnitureController.getView();
    assertEquals("Home furniture count and row count different", homeFurniture.size(), table.getRowCount());
    // Apply a filter on furniture that refuses pieces that are windows
    table.setFurnitureFilter(new FurnitureFilter() {
        public boolean include(Home home, HomePieceOfFurniture piece) {         
View Full Code Here

  private FurnitureController  furnitureController;
  private FurnitureTable       furnitureTable;

  @Override
  protected void setUp() {
    this.viewFactory = new SwingViewFactory();
    this.preferences = new DefaultUserPreferences();
    this.preferences.setFurnitureCatalogViewedInTree(true);
    this.home = new Home();
    this.homeController =
        new HomeController(this.home, this.preferences, viewFactory);
View Full Code Here

    }
    return rectangle;
  }
 
  public static void main(String [] args) {
    ViewFactory viewFactory = new SwingViewFactory();
    UserPreferences preferences = new DefaultUserPreferences();
    Home home = new Home();
    new ControllerTest(home, preferences, viewFactory);
  }
View Full Code Here

      public String showSaveDialog(View parentView, String dialogTitle, ContentType contentType, String name) {
        return null;
      }     
    };
    Home home = new Home();
    ViewFactory viewFactory = new SwingViewFactory();   
    final HomeController controller = new HomeController(home, preferences, viewFactory, contentManager);
    final JComponent homeView = (JComponent)controller.getView();

    // 1. Create a frame that displays a home view
    JFrame frame = new JFrame("Background Image Wizard Test");   
View Full Code Here

  /**
   * Tests home export to OBJ format.
   */
  public void testHomeExportToOBJ() throws RecorderException {
    // 1. Create an empty home and a 3D controller
    ViewFactory viewFactory = new SwingViewFactory();
    UserPreferences preferences = new DefaultUserPreferences();
    Home home = new Home();
    HomeController homeController =
        new HomeController(home, preferences, viewFactory);
   
View Full Code Here

      this.preferences = new DefaultUserPreferences() {
          @Override
          public void write() throws RecorderException {
          }
        };
      ViewFactory viewFactory = new SwingViewFactory();
      FileContentManager contentManager = new FileContentManager(this.preferences);
      this.homeController = new HomeController(this.home, this.preferences, viewFactory, contentManager);
      setRootPane((JRootPane)this.homeController.getView());
      pack();
    }
View Full Code Here

public class WallPanelTest extends TestCase {
  public void testHomePieceOfFurniturePanel() throws NoSuchFieldException, IllegalAccessException {
    // 1. Create default preferences for a user that uses centimeter
    Locale.setDefault(Locale.FRANCE);
    UserPreferences preferences = new DefaultUserPreferences();
    ViewFactory viewFactory = new SwingViewFactory();
    // Create a home and add a selected wall to it
    Home home = new Home();
    Wall wall1 = new Wall(0.1f, 0.2f, 100.1f, 100.2f, 7.5f);
    home.addWall(wall1);
    wall1.setLeftSideColor(10);
View Full Code Here

    wall1.setRightSideColor(0xFFFF00);
    home.setSelectedItems(Arrays.asList(new Wall [] {wall1}));
   
    DefaultUserPreferences preferences = new DefaultUserPreferences();
    new WallController(home, preferences,
          new SwingViewFactory(), new FileContentManager(preferences), null).displayView(null);
  }
View Full Code Here

        }
      };
    // Ensure we use default language and centimeter unit
    preferences.setLanguage(language);
    preferences.setUnit(LengthUnit.CENTIMETER);
    ViewFactory viewFactory = new SwingViewFactory();
    // Create a dummy content manager
    final URL testedImageName = BackgroundImageWizardTest.class.getResource("resources/test.png");
    final ContentManager contentManager = new ContentManager() {
      public Content getContent(String contentName) throws RecorderException {
        try {
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.swing.SwingViewFactory

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.