MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / BoxGroup

Method BoxGroup

src/main/java/fieldbox/boxes/plugins/BoxGroup.java:30–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 }
29
30 public BoxGroup() {
31
32 this.properties.put(Planes.plane, "__always__");
33
34 this.properties.putToMap(Mouse.onDoubleClick, "doubleClickMe", (e) -> {
35 if (properties.get(Box.frame).intersects(new Vec2(e.after.mx, e.after.my)))
36 properties.put(_collapsed, !properties.isTrue(_collapsed, false));
37 });
38 this.properties.putToMap(Boxes.insideRunLoop, "main.__checkforcollapsed__", () -> {
39 if (this.properties.isTrue(_collapsed, false) != isCollapsed()) {
40 if (this.properties.isTrue(_collapsed, false)) collapse();
41 else expand();
42 }
43 return true;
44 });
45
46 addCachedLine("__outline__", this::drawFrame);
47 addCachedLine("__outline2__", this::drawName);
48 addCachedLine("__outline2b__", this::drawNameBottom);
49 addCachedLine("__outline3a__", this::drawFrameTop);
50
51
52 this.properties.putToMap(Commands.command, "Isolate contents of group", (k) -> {
53 isolateContents();
54 return null;
55 });
56 this.properties.putToMap(Commands.commandDoc, "Isolate contents of group",
57 "Make sure that the contents of this group are not connected to the root of the box graph directly. This will then allow you to collapse and expand this this group. All connections from the contents of the group will go through this group box. ");
58
59 this.properties.putToMap(Commands.commandGuard, "Isolate contents of group", (k) -> !isContentsIsolated());
60
61 this.properties.putToMap(Commands.command, "Collapse group", (k) -> {
62 collapse();
63 return null;
64 });
65
66
67 this.properties.putToMap(Commands.command, "Integrate contents of group", (k) -> {
68 integrateContents();
69 return null;
70 });
71 this.properties.putToMap(Commands.commandDoc, "Integrate contents of group",
72 "Make sure that the contents of this group are also directly connected to the root of the box graph. This means, if you delete the group, the boxes remain connected. ");
73
74 this.properties.putToMap(Commands.commandGuard, "Integrate contents of group", (k) -> isContentsIsolated());
75
76 this.properties.putToMap(Commands.command, "Collapse group", (k) -> {
77 collapse();
78 return null;
79 });
80
81 this.properties.putToMap(Commands.commandDoc, "Collapse group", "Hides the contents of this group");
82
83 this.properties.putToMap(Commands.commandGuard, "Collapse group", (k) -> isContentsIsolated() && !isCollapsed());
84
85 this.properties.putToMap(Commands.command, "Expand group", (k) -> {
86 expand();
87 return null;

Callers

nothing calls this directly

Calls 13

isCollapsedMethod · 0.95
collapseMethod · 0.95
expandMethod · 0.95
addCachedLineMethod · 0.95
isolateContentsMethod · 0.95
isContentsIsolatedMethod · 0.95
integrateContentsMethod · 0.95
changeChildrenMethod · 0.95
putToMapMethod · 0.80
isTrueMethod · 0.80
getMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected