Package com.eteks.sweethome3d.viewcontroller

Examples of com.eteks.sweethome3d.viewcontroller.UserPreferencesController


        defaultPreferences.getNewWallThickness());
    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");
    JRadioButton meterRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "meterRadioButton");
    JRadioButton millimeterRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "millimeterRadioButton");
    JCheckBox    magnetismCheckBox =
        (JCheckBox)TestUtilities.getField(panel, "magnetismCheckBox");
    JCheckBox    rulersCheckBox =
        (JCheckBox)TestUtilities.getField(panel, "rulersCheckBox");
    JCheckBox    gridCheckBox =
        (JCheckBox)TestUtilities.getField(panel, "gridCheckBox");
    JRadioButton catalogIconRadioButton =
      (JRadioButton)TestUtilities.getField(panel, "catalogIconRadioButton");
    JRadioButton topViewRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "topViewRadioButton");
    JRadioButton monochromeRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "monochromeRadioButton");
    JRadioButton floorColorOrTextureRadioButton =
        (JRadioButton)TestUtilities.getField(panel, "floorColorOrTextureRadioButton");
    JSpinner newWallThicknessSpinner =
        (JSpinner)TestUtilities.getField(panel, "newWallThicknessSpinner");
    JSpinner newHomeWallHeightSpinner =
        (JSpinner)TestUtilities.getField(panel, "newWallHeightSpinner");
    // Check panel components value
    assertTrue("Centimeter radio button isn't selected", centimeterRadioButton.isSelected());
    assertFalse("Inch radio button is selected",  inchRadioButton.isSelected());
    assertFalse("Meter radio button is selected", meterRadioButton.isSelected());
    assertFalse("Millimeter radio button is selected", millimeterRadioButton.isSelected());
    assertTrue("Magnestism isn't selected", magnetismCheckBox.isSelected());
    assertTrue("Rulers isn't selected", rulersCheckBox.isSelected());
    assertTrue("Grid isn't selected", gridCheckBox.isSelected());
    assertTrue("Catalog icon radio button isn't selected", catalogIconRadioButton.isSelected());
    assertFalse("Top view button is selected",  topViewRadioButton.isSelected());
    assertTrue("Monochrome radio button isn't selected", monochromeRadioButton.isSelected());
    assertFalse("Floor color radio button is selected",  floorColorOrTextureRadioButton.isSelected());
    assertEquals("Wrong default thickness",
        newWallThicknessSpinner.getValue(), defaultPreferences.getNewWallThickness());
    assertEquals("Wrong default wall height",
        newHomeWallHeightSpinner.getValue(), defaultPreferences.getNewWallHeight());
   
    // 3. Change panel values
    inchRadioButton.setSelected(true);
    magnetismCheckBox.setSelected(false);
    rulersCheckBox.setSelected(false);
    gridCheckBox.setSelected(false);
    topViewRadioButton.setSelected(true);
    floorColorOrTextureRadioButton.setSelected(true);
    newWallThicknessSpinner.setValue(1);
    newHomeWallHeightSpinner.setValue(100);
   
    // 4. Retrieve panel values into preferences
    controller.modifyUserPreferences();
    // Check preferences value
    assertPreferencesEqual(LengthUnit.INCH, false, false, false,
        true, true,
        LengthUnit.inchToCentimeter(1),
        LengthUnit.inchToCentimeter(100),
View Full Code Here


      new PlanController(home, preferences, viewFactory, contentManager, undoableEditSupport).getView();
      new HomeController3D(home, preferences, viewFactory, contentManager, undoableEditSupport).getView();
     
      new PageSetupController(home, preferences, viewFactory, undoableEditSupport).getView();
      new PrintPreviewController(home, preferences, homeController, viewFactory).getView();
      new UserPreferencesController(preferences, viewFactory, contentManager).getView();
      new HomeFurnitureController(home, preferences, viewFactory, contentManager, undoableEditSupport).getView();
      new WallController(home, preferences, viewFactory, contentManager, undoableEditSupport).getView();
      new RoomController(home, preferences, viewFactory, contentManager, undoableEditSupport).getView();
      new LabelController(home, preferences, viewFactory, undoableEditSupport).getView();
      new CompassController(home, preferences, viewFactory, undoableEditSupport).getView();
View Full Code Here

    }
  }
 
  @Override
  public void editPreferences() {
    new UserPreferencesController(this.application.getUserPreferences(),
        this.viewFactory, this.contentManager) {
      public boolean isPropertyEditable(UserPreferencesController.Property property) {
        // No auto recovery with applet
        return property != UserPreferencesController.Property.AUTO_SAVE_DELAY_FOR_RECOVERY
            && property != UserPreferencesController.Property.AUTO_SAVE_FOR_RECOVERY_ENABLED;
View Full Code Here

TOP

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

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.