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

Method newBox

src/main/java/fieldbox/DefaultMenus.java:225–239  ·  view source on GitHub ↗
(Vec2 at, Box... parents)

Source from the content-addressed store, hash-verified

223 private Box newBox(Vec2 at, Box... parents) {
224
225 Box b1 = new Box();
226 for (Box p : parents)
227 p.connect(b1);
228 float w = 50;
229 b1.properties.put(frame, new Rect(at.x - w, at.y - w, w * 2, w * 2));
230 b1.properties.put(Box.name, "Untitled");
231 b1.properties.put(wasNew, true);
232 Drawing.dirty(b1);
233 return b1;
234 }
235
236 static public Box newBoxOfClass(Class cz, Vec2 at, Box... parents) {
237 Box b1 = null;
238 try {
239 b1 = (Box) cz.getConstructor()
240 .newInstance();
241 } catch (NoSuchMethodException e) {
242 try {

Callers 1

DefaultMenusMethod · 0.95

Calls 7

dirtyMethod · 0.95
moveToCurrentPageMethod · 0.80
upwardsMethod · 0.80
getMethod · 0.65
connectMethod · 0.45
putMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected