diff options
author | JJ | 2022-12-28 06:26:54 +0000 |
---|---|---|
committer | JJ | 2022-12-28 23:31:27 +0000 |
commit | 4d55ecb842fab83e25adfd2cac76bc6b1ba8d0da (patch) | |
tree | f42dc8d25856b1ea0a7decc95c9734842976b235 /src/main/model/layout/BlockLayout.java | |
parent | a1b9e8c5259472ab13b2fd4161d3df8825f52b86 (diff) |
encapsulation is evil
Diffstat (limited to 'src/main/model/layout/BlockLayout.java')
-rw-r--r-- | src/main/model/layout/BlockLayout.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/model/layout/BlockLayout.java b/src/main/model/layout/BlockLayout.java index 9204b61..9264035 100644 --- a/src/main/model/layout/BlockLayout.java +++ b/src/main/model/layout/BlockLayout.java @@ -12,20 +12,20 @@ public class BlockLayout extends Layout { // recursively construct the layout tree public void layout() { - this.setLocation(this.getParent().getLocation()); - this.getPreviousSibling().ifPresent( - sibling -> this.setY(sibling.getY() + sibling.getHeight())); - this.getPreviousSibling().ifPresent( - sibling -> System.out.println("bluh" + sibling.getAssociatedNode().getData())); + this.location = (Point) this.parent.location.clone(); + this.previousSibling.ifPresent( + sibling -> this.location.y = sibling.location.y + sibling.dimension.height); +// this.previousSibling.ifPresent( +// sibling -> System.out.println("bluh" + sibling.associatedNode.data())); -// this.setDimension(this.getParent().getDimension()); +// this.dimension = (Dimension) this.parent.dimension.clone(); - for (Layout child : this.getChildren()) { + for (Layout child : this.children) { child.layout(); - this.setHeight(this.getHeight() + child.getHeight()); + this.dimension.height += child.dimension.height; } -// System.out.println(this.getAssociatedNode().getData() + this.getLocation()); -// System.out.println(System.identityHashCode(this.getLocation())); -// System.out.println(this.getAssociatedNode().getData() + this.getDimension()); +// System.out.println(this.associatedNode.data() + this.location); +// System.out.println(System.identityHashCode(this.location)); +// System.out.println(this.associatedNode.data() + this.dimension); } } |