Examples of SwingViewFactory


Examples of com.eteks.sweethome3d.swing.SwingViewFactory

public class WizardControllerTest extends TestCase {
  public void testWizardController()
      throws NoSuchFieldException, IllegalAccessException, ComponentSearchException {
    // 1. Create a wizard controller test waiting for finish call
    final boolean [] finished = {false};
    WizardController controller = new ControllerTest(new DefaultUserPreferences(), new SwingViewFactory()) {
      @Override
      public void finish() {
        finished [0] = true;
      }
    };
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

    assertTrue("Finish wasn't called", finished [0]);
  }
 
  public static void main(String [] args) {
    // Display the wizard controlled by ControllerTest
    new ControllerTest(new DefaultUserPreferences(), new SwingViewFactory()).displayView(null);
  }
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

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

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

* @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

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

    Locale.setDefault(Locale.FRANCE);
    UserPreferences preferences = new DefaultUserPreferences();
    Home home = new Home();
    home.getCompass().setVisible(false);
    final HomeController controller =
        new HomeController(home, preferences, new SwingViewFactory());
    JComponent homeView = (JComponent)controller.getView();
    PlanComponent planComponent = (PlanComponent)TestUtilities.findComponent(
        homeView, PlanComponent.class);
    HomeComponent3D component3D = (HomeComponent3D)TestUtilities.findComponent(
        homeView, HomeComponent3D.class);
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

  /**
   * Returns a Swing view factory.
   */
  protected ViewFactory getViewFactory() {
    if (this.viewFactory == null) {
      this.viewFactory = new SwingViewFactory();
    }
    return this.viewFactory;
  }
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

    preferences.setNewWallHeight(
        defaultPreferences.getNewWallHeight());
   
    // 2. Create a user preferences panel
    UserPreferencesController controller =
        new UserPreferencesController(preferences, new SwingViewFactory(), null);
    UserPreferencesPanel panel = (UserPreferencesPanel)controller.getView();
    JRadioButton centimeterRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "centimeterRadioButton");
    JRadioButton inchRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "inchRadioButton");
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

    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);
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

  /**
   * Returns a Swing view factory.
   */
  protected ViewFactory getViewFactory() {
    if (this.viewFactory == null) {
     this.viewFactory = new SwingViewFactory();
    }
    return this.viewFactory;
  }
View Full Code Here

Examples of com.eteks.sweethome3d.swing.SwingViewFactory

    public TestFrame() {
      super("Home Plan Component Test");
      this.home = new Home();
      this.home.getCompass().setVisible(false);
      UserPreferences preferences = new DefaultUserPreferences();     
      ViewFactory viewFactory = new SwingViewFactory();
      this.homeController = new HomeController(home, preferences, viewFactory);
      JComponent homeView = (JComponent)this.homeController.getView();
      ActionMap actions = homeView.getActionMap();
      // Create buttons from HomePane actions map
      this.selectButton = new JToggleButton(actions.get(HomePane.ActionType.SELECT));
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.