Package com.eteks.sweethome3d.model

Examples of com.eteks.sweethome3d.model.HomeLight


   */
  private HomeLight getModifiedLightPowerAt(float x, float y) {
    List<Selectable> selectedItems = this.home.getSelectedItems();
    if (selectedItems.size() == 1
        && selectedItems.get(0) instanceof HomeLight) {
      HomeLight light = (HomeLight)selectedItems.get(0);
      float scaleInverse = 1 / getScale();
      float margin = PIXEL_MARGIN * scaleInverse;
      if (light.isBottomLeftPointAt(x, y, margin)
          // Keep a free zone around piece center
          && Math.abs(x - light.getX()) > scaleInverse
          && Math.abs(y - light.getY()) > scaleInverse) {
        return light;
      }
    }
    return null;
  }
View Full Code Here


      for (CatalogPieceOfFurniture piece : selectedFurniture) {
        HomePieceOfFurniture homePiece;
        if (piece instanceof CatalogDoorOrWindow) {
          homePiece = new HomeDoorOrWindow((DoorOrWindow)piece);
        } else if (piece instanceof CatalogLight) {
          homePiece = new HomeLight((Light)piece);
        } else {
          homePiece = new HomePieceOfFurniture(piece);
        }
        // If magnetism is enabled, adjust piece size and elevation
        if (this.preferences.isMagnetismEnabled()) {
View Full Code Here

        new ArrayList<HomePieceOfFurniture>(selectedCatalogFurniture.size());
    for (CatalogPieceOfFurniture piece : selectedCatalogFurniture) {
      if (piece instanceof CatalogDoorOrWindow) {
        transferedFurniture.add(new HomeDoorOrWindow((DoorOrWindow)piece));
      } else if (piece instanceof CatalogLight) {
        transferedFurniture.add(new HomeLight((Light)piece));
      } else {
        transferedFurniture.add(new HomePieceOfFurniture(piece));
      }
    }
    return new HomeTransferableList(transferedFurniture);
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.model.HomeLight

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.