45
45
THICKNESS, HEIGHT, HEIGHT_AT_END,
46
46
LEFT_SIDE_COLOR, LEFT_SIDE_TEXTURE, LEFT_SIDE_SHININESS,
47
47
RIGHT_SIDE_COLOR, RIGHT_SIDE_TEXTURE, RIGHT_SIDE_SHININESS,
48
PATTERN, TOP_COLOR, LEVEL}
50
50
private static final long serialVersionUID = 1L;
80
81
* @deprecated specify a height with the {@linkplain #Wall(float, float, float, float, float, float) other constructor}.
82
83
public Wall(float xStart, float yStart, float xEnd, float yEnd, float thickness) {
84
this(xStart, yStart, xEnd, yEnd, thickness, 0);
88
* Creates a wall from (<code>xStart</code>,<code>yStart</code>)
89
* to (<code>xEnd</code>, <code>yEnd</code>),
90
* with given thickness and height. Pattern, left and right colors are <code>null</code>.
92
public Wall(float xStart, float yStart, float xEnd, float yEnd, float thickness, float height) {
93
this(xStart, yStart, xEnd, yEnd, thickness, height, null);
97
* Creates a wall from (<code>xStart</code>,<code>yStart</code>)
98
* to (<code>xEnd</code>, <code>yEnd</code>),
99
* with given thickness, height and pattern.
100
* Colors are <code>null</code>.
103
public Wall(float xStart, float yStart, float xEnd, float yEnd, float thickness, float height, TextureImage pattern) {
83
104
this.xStart = xStart;
84
105
this.yStart = yStart;
87
108
this.thickness = thickness;
91
* Creates a wall from (<code>xStart</code>,<code>yStart</code>)
92
* to (<code>xEnd</code>, <code>yEnd</code>),
93
* with given thickness and height. Left and right colors are <code>null</code>.
95
public Wall(float xStart, float yStart, float xEnd, float yEnd, float thickness, float height) {
96
this(xStart, yStart, xEnd, yEnd, thickness);
97
109
this.height = height;
110
this.pattern = pattern;
435
450
public void setHeightAtEnd(Float heightAtEnd) {
436
451
if (heightAtEnd != this.heightAtEnd
437
|| (heightAtEnd != null && !heightAtEnd.equals(this.heightAtEnd))) {
452
&& (heightAtEnd == null || !heightAtEnd.equals(this.heightAtEnd))) {
438
453
Float oldHeightAtEnd = this.heightAtEnd;
439
454
this.heightAtEnd = heightAtEnd;
440
455
this.propertyChangeSupport.firePropertyChange(Property.HEIGHT_AT_END.name(),
467
482
public void setLeftSideColor(Integer leftSideColor) {
468
483
if (leftSideColor != this.leftSideColor
469
|| (leftSideColor != null && !leftSideColor.equals(this.leftSideColor))) {
484
&& (leftSideColor == null || !leftSideColor.equals(this.leftSideColor))) {
470
485
Integer oldLeftSideColor = this.leftSideColor;
471
486
this.leftSideColor = leftSideColor;
472
487
this.propertyChangeSupport.firePropertyChange(Property.LEFT_SIDE_COLOR.name(),
489
504
public void setRightSideColor(Integer rightSideColor) {
490
505
if (rightSideColor != this.rightSideColor
491
|| (rightSideColor != null && !rightSideColor.equals(this.rightSideColor))) {
506
&& (rightSideColor == null || !rightSideColor.equals(this.rightSideColor))) {
492
507
Integer oldLeftSideColor = this.rightSideColor;
493
508
this.rightSideColor = rightSideColor;
494
509
this.propertyChangeSupport.firePropertyChange(Property.RIGHT_SIDE_COLOR.name(),
511
526
public void setLeftSideTexture(HomeTexture leftSideTexture) {
512
527
if (leftSideTexture != this.leftSideTexture
513
|| (leftSideTexture != null && !leftSideTexture.equals(this.leftSideTexture))) {
528
&& (leftSideTexture == null || !leftSideTexture.equals(this.leftSideTexture))) {
514
529
HomeTexture oldLeftSideTexture = this.leftSideTexture;
515
530
this.leftSideTexture = leftSideTexture;
516
531
this.propertyChangeSupport.firePropertyChange(Property.LEFT_SIDE_TEXTURE.name(),
532
547
public void setRightSideTexture(HomeTexture rightSideTexture) {
533
548
if (rightSideTexture != this.rightSideTexture
534
|| (rightSideTexture != null && !rightSideTexture.equals(this.rightSideTexture))) {
549
&& (rightSideTexture == null || !rightSideTexture.equals(this.rightSideTexture))) {
535
550
HomeTexture oldLeftSideTexture = this.rightSideTexture;
536
551
this.rightSideTexture = rightSideTexture;
537
552
this.propertyChangeSupport.firePropertyChange(Property.RIGHT_SIDE_TEXTURE.name(),
624
* Returns the color of the top of this wall in the 3D view.
627
public Integer getTopColor() {
628
return this.topColor;
632
* Sets the color of the top of this wall in the 3D view, and notifies
633
* listeners of this change.
636
public void setTopColor(Integer topColor) {
637
if (this.topColor != topColor
638
&& (topColor == null || !topColor.equals(this.topColor))) {
639
Integer oldTopColor = this.topColor;
640
this.topColor = topColor;
641
this.propertyChangeSupport.firePropertyChange(Property.TOP_COLOR.name(),
642
oldTopColor, topColor);
609
647
* Returns the level which this wall belongs to.
904
942
boolean sameSignum = Math.signum(alpha1) == Math.signum(alpha2);
905
if ((sameSignum && (Math.abs(alpha1) > Math.abs(alpha2) ? alpha1 / alpha2 : alpha2 / alpha1) > 1.0001)
943
if ((sameSignum && (Math.abs(alpha1) > Math.abs(alpha2) ? alpha1 / alpha2 : alpha2 / alpha1) > 1.004)
906
944
|| (!sameSignum && Math.abs(alpha1 - alpha2) > 1E-5)) {
907
945
float beta1 = point2 [1] - alpha1 * point2 [0];
908
946
float beta2 = point4 [1] - alpha2 * point4 [0];