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

Method padFactory

src/main/java/fieldcef/plugins/Pads.java:74–89  ·  view source on GitHub ↗
(Box parent, String kind, String name)

Source from the content-addressed store, hash-verified

72 public static Box padFactory(Box parent, String kind, String name) {
73
74 Box c = parent.first(DefaultMenus.ensureChildOfClass)
75 .get()
76 .apply(parent, name, SimpleCanvas.class);
77
78 if (c.properties.isTrue(DefaultMenus.wasNew, false)) {
79 c.properties.put(Execution.code, code_padFactory);
80
81 parent.find(Boxes.root, parent.upwards()).findFirst().map( r -> r.disconnect(c));
82 }
83
84 c.properties.put(DragToCopy._ownedByParent, true);
85
86 return c;
87 }
88
89 @Override
90 public Mouse.Dragger onMouseDown(Window.Event<Window.MouseState> e, int button) {
91 if (button == 0) return button0(e);
92 return null;

Callers 1

loadedMethod · 0.95

Calls 9

firstMethod · 0.80
isTrueMethod · 0.80
upwardsMethod · 0.80
applyMethod · 0.65
getMethod · 0.65
putMethod · 0.45
mapMethod · 0.45
findMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected