Package com.eteks.sweethome3d.swing

Examples of com.eteks.sweethome3d.swing.FileContentManager


  /**
   * Returns a content manager able to handle files.
   */
  protected ContentManager getContentManager() {
    if (this.contentManager == null) {
      this.contentManager = new FileContentManager(getUserPreferences()) {
          private File modelsDirectory;
 
          @Override
          public String showOpenDialog(View parentView,
                                     String dialogTitle,
View Full Code Here


          @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

    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

  /**
   * Returns a content manager able to handle files.
   */
  protected ContentManager getContentManager() {
    if (this.contentManager == null) {
      this.contentManager = new FileContentManager(getUserPreferences());
    }
    return this.contentManager;
  }
View Full Code Here

    Home home = new Home();
    Content imageContent = new URLContent(UserPreferencesPanelTest.class.getResource("resources/test.png"));
    home.setBackgroundImage(new BackgroundImage(imageContent, 1, 0, 1, 0, 1, 0, 0));

    SwingViewFactory viewFactory = new SwingViewFactory();
    FileContentManager contentManager = new FileContentManager(preferences);
    UndoableEditSupport undoableEditSupport = new UndoableEditSupport();
   
    for (String language : preferences.getSupportedLanguages()) {
      preferences.setLanguage(language);
      // Instantiate all views available in Sweet Home 3D
View Full Code Here

  /**
   * Controls the export of home to a SH3D file.
   */
  public void exportToSH3D() {
    final String sh3dName = new FileContentManager(this.application.getUserPreferences()).showSaveDialog(getView(),
        this.application.getUserPreferences().getLocalizedString(HomeAppletController.class, "exportToSH3DDialog.title"),
        ContentManager.ContentType.SWEET_HOME_3D, home.getName());   
    if (sh3dName != null) {
      // Export home in a threaded task
      Callable<Void> exportToObjTask = new Callable<Void>() {
View Full Code Here

  public void testHomePieceOfFurniturePanel() throws ComponentSearchException, NoSuchFieldException, IllegalAccessException {
    // 1. Create default preferences for a user that uses centimeter
    Locale.setDefault(Locale.FRANCE);
    UserPreferences preferences = new DefaultUserPreferences();
    SwingViewFactory viewFactory = new SwingViewFactory();
    ContentManager contentManager = new FileContentManager(preferences);
    // 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);
View Full Code Here

    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 =
        new HomeFurniturePanel(preferences, controller);
    furniturePanel.displayView(null);
  }
View Full Code Here

  public void testPageSetupAndPrintPreview() throws ComponentSearchException, InterruptedException,
      NoSuchFieldException, IllegalAccessException, InvocationTargetException, IOException {
    UserPreferences preferences = new DefaultUserPreferences();
    ViewFactory viewFactory = new SwingViewFactory();
    Home home = new Home();
    ContentManager contentManager = new FileContentManager(preferences) {
        @Override
        public String showSaveDialog(View parentView, String dialogTitle, ContentType contentType, String name) {
          String os = System.getProperty("os.name");
          if (OperatingSystem.isMacOSX()) {
            // Let's pretend the OS isn't Mac OS X to get a JFileChooser instance that works better in test
View Full Code Here

TOP

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

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.