| 249 | |
| 250 | |
| 251 | public void newBoxPair() |
| 252 | { |
| 253 | salt ++; |
| 254 | |
| 255 | Box b1 = new Box(); |
| 256 | Box b2 = new Box(); |
| 257 | |
| 258 | b1.connect(b2); |
| 259 | root.connect(b1); |
| 260 | b1.properties.put(Box.name, "Untitled"); |
| 261 | b2.properties.put(Box.name, ""); |
| 262 | |
| 263 | FieldBoxWindow window = root.find(Boxes.window, root.both()).findFirst().get(); |
| 264 | Window.MouseState mouse = window.getCurrentMouseState(); |
| 265 | |
| 266 | |
| 267 | double cx = mouse.mx; |
| 268 | double cy = mouse.my; |
| 269 | b1.properties.put(Box.frame, new Rect(cx-w/2, cy-h/2, w, h)); |
| 270 | b2.properties.put(Box.frame, new Rect(cx-w/2, cy+gap, w, h/3)); |
| 271 | |
| 272 | b1.properties.put(f, b2); |
| 273 | b2.properties.put(m, b1); |
| 274 | |
| 275 | b1.properties.put(isPaired, true); |
| 276 | b2.properties.put(isPaired, true); |
| 277 | |
| 278 | b2.properties.put(FrameManipulation.lockHeight, true); |
| 279 | } |
| 280 | } |