(Vec2 at, Box... parents)
| 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 { |
no test coverage detected