Package com.eteks.sweethome3d.viewcontroller

Examples of com.eteks.sweethome3d.viewcontroller.ViewFactory


            ex.printStackTrace();
          }
        }
      };
  
    ViewFactory threadedTaskViewFactory = new ViewFactory() {
        public ThreadedTaskView createThreadedTaskView(String taskMessage, UserPreferences preferences,
                                                       ThreadedTaskController controller) {
          return editorViewFactory.createImportFurnitureView(taskMessage, (FurnitureLibraryUserPreferences)preferences, controller);
        }
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

        }
      };
    // 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

      // Create model objects
      this.home = new Home();
      this.home.getCompass().setVisible(false);
      Locale.setDefault(Locale.FRANCE);
      this.preferences = new DefaultUserPreferences();
      ViewFactory viewFactory = new SwingViewFactory();
      UndoableEditSupport undoSupport = new UndoableEditSupport();
      final UndoManager undoManager = new UndoManager();
      undoSupport.addUndoableEditListener(undoManager);
      this.planController = new PlanController(this.home, this.preferences, viewFactory, null, undoSupport);
      // Add plan component to frame at its preferred size
View Full Code Here

* @author Emmanuel Puybaret
*/
public class ThreadedTaskControllerTest extends TestCase {
  public void testThreadedTaskController() throws TimeoutException, InterruptedException {
    DefaultUserPreferences preferences = new DefaultUserPreferences();
    ViewFactory viewFactory = new SwingViewFactory();
    // 1. Create a very simple short task that simply counts down latch
    final CountDownLatch shortTaskLatch = new CountDownLatch(1);
    Callable<Void> shortTask = new Callable<Void>() {
        public Void call() throws Exception {
          shortTaskLatch.countDown();
View Full Code Here

          return "true".equalsIgnoreCase(applet.getParameter(NAVIGATION_PANEL));
        }
      };
   
    // Create a view factory able to instantiate only a 3D view and a threaded task view
    final ViewFactory viewFactory = new ViewFactory() {
        public View createBackgroundImageWizardStepsView(BackgroundImage backgroundImage, UserPreferences preferences,
                                                         BackgroundImageWizardController backgroundImageWizardController) {
          throw new UnsupportedOperationException();
        }
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.viewcontroller.ViewFactory

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.