~ubuntu-branches/ubuntu/utopic/sweethome3d/utopic

« back to all changes in this revision

Viewing changes to src/com/eteks/sweethome3d/model/HomeDoorOrWindow.java

  • Committer: Package Import Robot
  • Author(s): Gabriele Giacone
  • Date: 2013-11-05 13:02:16 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20131105130216-0e7dgqqvdq4pwm96
Tags: 4.2+dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
package com.eteks.sweethome3d.model;
21
21
 
 
22
import java.io.IOException;
 
23
import java.io.ObjectInputStream;
 
24
 
22
25
/**
23
26
 * A door or a window in {@linkplain Home home}.
24
27
 * @author Emmanuel Puybaret
30
33
  private final float   wallThickness;
31
34
  private final float   wallDistance;
32
35
  private final Sash [] sashes;
 
36
  private String  cutOutShape;
33
37
  private boolean boundToWall;
34
38
 
 
39
 
35
40
  /**
36
41
   * Creates a home door or window from an existing one.
37
42
   * @param doorOrWindow the door or window from which data are copied
41
46
    this.wallThickness = doorOrWindow.getWallThickness();
42
47
    this.wallDistance = doorOrWindow.getWallDistance();
43
48
    this.sashes = doorOrWindow.getSashes();
 
49
    this.cutOutShape = doorOrWindow.getCutOutShape();
44
50
  }
45
51
 
46
52
  /**
 
53
   * Initializes new fields to their default values 
 
54
   * and reads object from <code>in</code> stream with default reading method.
 
55
   */
 
56
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
 
57
    this.cutOutShape = "M0,0 v1 h1 v-1 z";
 
58
    in.defaultReadObject();
 
59
  }
 
60
  
 
61
  /**
47
62
   * Returns the default thickness of the wall in which this door or window should be placed.
48
63
   * @return a value in percentage of the depth of the door or the window.
49
64
   */
72
87
  }
73
88
 
74
89
  /**
 
90
   * Returns the shape used to cut out walls that intersect this new door or window.
 
91
   * @since 4.2
 
92
   */
 
93
  public String getCutOutShape() {
 
94
    return this.cutOutShape;
 
95
  }
 
96
 
 
97
  /**
75
98
   * Returns <code>true</code> if the location and the size of this door or window 
76
99
   * were bound to a wall, last time they were updated. 
77
100
   */