.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
| 83 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
77 | 89 | SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 167 | |
---|
151 | 168 | void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
153 | 172 | Menu menu; |
---|
154 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 175 | //editItem.addActionListener(this); |
---|
157 | | - undoItem = menu.add(new MenuItem("Undo")); |
---|
158 | | - undoItem.addActionListener(this); |
---|
159 | | - redoItem = menu.add(new MenuItem("Redo")); |
---|
160 | | - redoItem.addActionListener(this); |
---|
161 | | - menu.add("-"); |
---|
162 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 176 | + |
---|
| 177 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 178 | +// undoItem.addActionListener(this); |
---|
| 179 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 180 | +// redoItem.addActionListener(this); |
---|
| 181 | +// menu.add("-"); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
163 | 183 | duplicateItem.addActionListener(this); |
---|
164 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
165 | 185 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
175 | 195 | copyItem.addActionListener(this); |
---|
176 | 196 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
177 | 197 | pasteItem.addActionListener(this); |
---|
178 | | - menu.add("-"); |
---|
179 | 198 | |
---|
180 | 199 | menu.add("-"); |
---|
181 | 200 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
187 | 206 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
188 | 207 | // pasteExpandItem.addActionListener(this); |
---|
189 | 208 | menu.add("-"); |
---|
190 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
191 | | - clearItem.addActionListener(this); |
---|
| 209 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 210 | + deleteItem.addActionListener(this); |
---|
192 | 211 | |
---|
193 | 212 | if (Globals.ADVANCED) |
---|
194 | 213 | { |
---|
.. | .. |
---|
202 | 221 | //zBufferItem.addActionListener(this); |
---|
203 | 222 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 223 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
207 | 226 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 239 | |
---|
213 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
214 | | - toggleTextureItem.addItemListener(this); |
---|
215 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
216 | | - |
---|
217 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
218 | | - toggleSwitchItem.addItemListener(this); |
---|
219 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
220 | | - |
---|
221 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 241 | toggleHandleItem.addItemListener(this); |
---|
223 | 242 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 243 | |
---|
.. | .. |
---|
245 | 264 | |
---|
246 | 265 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
247 | 266 | toggleDebugItem.addItemListener(this); |
---|
248 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 267 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
249 | 268 | |
---|
250 | 269 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
251 | 270 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
266 | 285 | // animationItem.addItemListener(this); |
---|
267 | 286 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 287 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 288 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 289 | editCameraItem.addActionListener(this); |
---|
271 | 290 | |
---|
272 | 291 | if (Globals.ADVANCED) |
---|
273 | 292 | { |
---|
274 | 293 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 294 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 296 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 297 | oe.cameraMenu.add("-"); |
---|
279 | 298 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 300 | editLeafItem.addActionListener(this); |
---|
282 | 301 | lookAtItem.addActionListener(this); |
---|
283 | 302 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
285 | 304 | } |
---|
286 | 305 | |
---|
287 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 345 | } |
---|
327 | 346 | |
---|
328 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
331 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 351 | backItem.addActionListener(this); |
---|
333 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 353 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
337 | 359 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
339 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 363 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
344 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 372 | switchGeoItem.addActionListener(this); |
---|
346 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 375 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 376 | morphItem.addActionListener(this); |
---|
350 | 377 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 378 | menu.add("-"); |
---|
354 | 379 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 380 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 382 | frameselectorItem.addActionListener(this); |
---|
358 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 384 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 385 | } |
---|
363 | 386 | |
---|
364 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
367 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 391 | billboardItem.addActionListener(this); |
---|
369 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
370 | 393 | csgItem.addActionListener(this); |
---|
371 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 394 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
372 | 395 | shadowXItem.addActionListener(this); |
---|
373 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 396 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
374 | 397 | shadowYItem.addActionListener(this); |
---|
375 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 398 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
377 | 403 | if (Globals.ADVANCED) |
---|
378 | 404 | { |
---|
379 | 405 | menu.add("-"); |
---|
380 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 407 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 409 | templateItem.addActionListener(this); |
---|
386 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
409 | 433 | genNormalsMESHItem.addActionListener(this); |
---|
410 | 434 | if (Globals.ADVANCED) |
---|
411 | 435 | { |
---|
412 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 436 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
413 | 437 | genNormalsMINEItem.addActionListener(this); |
---|
414 | 438 | } |
---|
415 | 439 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
469 | 493 | markleavesItem.addActionListener(this); |
---|
470 | 494 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
471 | 495 | unmarkleavesItem.addActionListener(this); |
---|
| 496 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 497 | + rewindleavesItem.addActionListener(this); |
---|
| 498 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 499 | + unrewindleavesItem.addActionListener(this); |
---|
| 500 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 501 | + randomleavesItem.addActionListener(this); |
---|
| 502 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 503 | + unrandomleavesItem.addActionListener(this); |
---|
472 | 504 | menu.add("-"); |
---|
473 | 505 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
474 | 506 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
524 | 556 | buildToolsMenu(menu); |
---|
525 | 557 | } |
---|
526 | 558 | |
---|
| 559 | + |
---|
527 | 560 | void SetupUI2(ObjEditor oe) |
---|
528 | 561 | { |
---|
| 562 | + // June 2019 |
---|
| 563 | + if (oe == null) |
---|
| 564 | + { |
---|
| 565 | + //super.SetupUI2(this); |
---|
| 566 | + //return; |
---|
| 567 | + } |
---|
| 568 | + |
---|
| 569 | + if (copy != group) |
---|
| 570 | + { |
---|
| 571 | + //super.SetupUI2(this); |
---|
| 572 | + } |
---|
| 573 | + |
---|
529 | 574 | //new Exception().printStackTrace(); |
---|
530 | 575 | |
---|
531 | 576 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
554 | 599 | oe.radioPanel.add(dummyButton); |
---|
555 | 600 | oe.buttonGroup.add(dummyButton); |
---|
556 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
557 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
558 | 607 | |
---|
559 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 608 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + //minButton.setToolTipText("Minimize window"); |
---|
| 610 | + //minButton.addActionListener(this); |
---|
| 611 | + |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
| 618 | + |
---|
| 619 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 621 | + fullButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
| 630 | + |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
| 633 | + saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
| 639 | + |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
561 | 660 | liveCB.addItemListener(this); |
---|
562 | 661 | |
---|
563 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | 664 | oneStepButton.addActionListener(this); |
---|
566 | 665 | |
---|
567 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
568 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 668 | fastCB.addItemListener(this); |
---|
570 | 669 | |
---|
571 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
572 | | - trackCB.setToolTipText("Enable tracking"); |
---|
573 | | - trackCB.addItemListener(this); |
---|
574 | | - |
---|
575 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
576 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
577 | | - screenfitButton.addActionListener(this); |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
578 | 675 | |
---|
579 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
580 | 677 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
586 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
587 | 684 | } |
---|
588 | 685 | |
---|
589 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
590 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
591 | | - flashSelectionButton.addActionListener(this); |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
592 | 687 | |
---|
593 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
594 | | - |
---|
595 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - twoButton.setToolTipText("Show center view only"); |
---|
597 | | - twoButton.addActionListener(this); |
---|
598 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
599 | 689 | fourButton.addActionListener(this); |
---|
600 | 690 | fourButton.setToolTipText("Show left panel only"); |
---|
601 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + twoButton.setToolTipText("Show right view only"); |
---|
| 694 | + twoButton.addActionListener(this); |
---|
| 695 | + this.fullscreenLayout = twoButton; |
---|
| 696 | + |
---|
| 697 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + sixButton.setToolTipText("Show left and right"); |
---|
603 | 699 | sixButton.addActionListener(this); |
---|
604 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | | - threeButton.setToolTipText("2-column layout right"); |
---|
606 | | - threeButton.addActionListener(this); |
---|
607 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | | - sevenButton.setToolTipText("3-column layout"); |
---|
609 | | - sevenButton.addActionListener(this); |
---|
| 700 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 701 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 702 | +// threeButton.addActionListener(this); |
---|
| 703 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 704 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 705 | +// sevenButton.addActionListener(this); |
---|
610 | 706 | // |
---|
611 | 707 | |
---|
612 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
613 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 708 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 709 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
614 | 710 | rootButton.addActionListener(this); |
---|
615 | 711 | |
---|
616 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 712 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
617 | 713 | closeButton.setToolTipText("Close tab"); |
---|
618 | 714 | closeButton.addActionListener(this); |
---|
619 | 715 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
620 | 716 | //clearButton.addActionListener(this); |
---|
621 | | - |
---|
622 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 717 | + |
---|
| 718 | + // INSERT |
---|
| 719 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 720 | + gridButton.setToolTipText("Create grid"); |
---|
| 721 | + gridButton.addActionListener(this); |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + boxButton.setToolTipText("Create box"); |
---|
| 725 | + boxButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 728 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 729 | + sphereButton.addActionListener(this); |
---|
| 730 | + |
---|
| 731 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 732 | + coneButton.setToolTipText("Create cone"); |
---|
| 733 | + coneButton.addActionListener(this); |
---|
| 734 | + |
---|
| 735 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | + torusButton.setToolTipText("Create torus"); |
---|
| 737 | + torusButton.addActionListener(this); |
---|
| 738 | + |
---|
| 739 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 740 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 741 | + superButton.addActionListener(this); |
---|
| 742 | + |
---|
| 743 | + if (Globals.ADVANCED) |
---|
| 744 | + { |
---|
| 745 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 746 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 747 | + kleinButton.addActionListener(this); |
---|
| 748 | + } |
---|
623 | 749 | |
---|
624 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
625 | | - editButton.setToolTipText("Edit selection"); |
---|
| 750 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 751 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 752 | + particlesButton.addActionListener(this); |
---|
| 753 | + |
---|
| 754 | + oe.toolboxPanel.Return(); |
---|
| 755 | + |
---|
| 756 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 757 | + groupButton.setToolTipText("Create group"); |
---|
| 758 | + groupButton.addActionListener(this); |
---|
| 759 | + |
---|
| 760 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 761 | + compositeButton.setToolTipText("Create composite"); |
---|
| 762 | + compositeButton.addActionListener(this); |
---|
| 763 | + |
---|
| 764 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 766 | + switchButton.addActionListener(this); |
---|
| 767 | + |
---|
| 768 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + loopButton.setToolTipText("Create loop"); |
---|
| 770 | + loopButton.addActionListener(this); |
---|
| 771 | + |
---|
| 772 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 773 | + textureButton.setToolTipText("Create texture"); |
---|
| 774 | + textureButton.addActionListener(this); |
---|
| 775 | + |
---|
| 776 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 777 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 778 | + overlayButton.addActionListener(this); |
---|
| 779 | + |
---|
| 780 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 781 | + lightButton.setToolTipText("Create light"); |
---|
| 782 | + lightButton.addActionListener(this); |
---|
| 783 | + |
---|
| 784 | + for (int i=6; --i>=0;) |
---|
| 785 | + { |
---|
| 786 | + oe.toolboxPanel.Return(); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 794 | + } |
---|
| 795 | + |
---|
| 796 | + // EDIT panel |
---|
| 797 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 798 | + editButton.setToolTipText("Pin selection controls"); |
---|
626 | 799 | editButton.addActionListener(this); |
---|
627 | 800 | |
---|
628 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 801 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 802 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
630 | 803 | uneditButton.addActionListener(this); |
---|
631 | 804 | |
---|
632 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
633 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 805 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 806 | + allParamsButton.setToolTipText("Show all controle"); |
---|
634 | 807 | allParamsButton.addActionListener(this); |
---|
635 | 808 | |
---|
636 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 810 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
638 | 811 | clearPanelButton.addActionListener(this); |
---|
639 | 812 | |
---|
640 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 813 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 814 | unselectButton.setToolTipText("Unselect"); |
---|
642 | 815 | unselectButton.addActionListener(this); |
---|
643 | 816 | |
---|
644 | | - commandsPanel.preferredHeight = 1; |
---|
| 817 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 818 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 819 | + flashSelectionButton.addActionListener(this); |
---|
645 | 820 | |
---|
646 | | - oe.treePanel.add(commandsPanel); |
---|
647 | | - oe.treePanel.Return(); |
---|
| 821 | + editCommandsPanel.preferredHeight = 1; |
---|
| 822 | + |
---|
| 823 | + SetPinStates(false); |
---|
| 824 | +// oe.treePanel.add(commandsPanel); |
---|
| 825 | +// oe.treePanel.Return(); |
---|
648 | 826 | |
---|
649 | 827 | // oe.aConstraints.gridx += 1; |
---|
650 | 828 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
661 | 839 | |
---|
662 | 840 | JScrollPane jSP; |
---|
663 | 841 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
664 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 842 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
665 | 843 | ResetModel(); |
---|
666 | 844 | |
---|
667 | 845 | oe.treePanel.add(jSPPanel); |
---|
668 | 846 | oe.treePanel.Return(); |
---|
669 | 847 | |
---|
670 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
671 | | - |
---|
672 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
673 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
674 | | - colorCB.addItemListener(this); |
---|
675 | | - |
---|
676 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
677 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
678 | | - materialCB.addItemListener(this); |
---|
679 | | - |
---|
680 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
681 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
682 | | - textureCB.addItemListener(this); |
---|
683 | | - |
---|
684 | | - copyOptionsPanel.preferredHeight = 1; |
---|
685 | 848 | oe.treePanel.add(copyOptionsPanel); |
---|
686 | 849 | oe.treePanel.Return(); |
---|
| 850 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 851 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 852 | + sliderPane.preferredHeight = 1; |
---|
687 | 853 | |
---|
688 | 854 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
689 | 855 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
706 | 872 | dgr.addDragGestureListener(this); |
---|
707 | 873 | }catch(Exception e) {} |
---|
708 | 874 | */ |
---|
709 | | - radio.layout = sevenButton; |
---|
| 875 | + radio.layout = sixButton; // sevenButton; |
---|
710 | 876 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
711 | 877 | } |
---|
712 | 878 | |
---|
713 | 879 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
714 | 880 | { |
---|
| 881 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 882 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 883 | + colorCB.addItemListener(this); |
---|
| 884 | + |
---|
| 885 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 886 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 887 | + materialCB.addItemListener(this); |
---|
| 888 | + |
---|
| 889 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 890 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 891 | + textureCB.addItemListener(this); |
---|
| 892 | + |
---|
| 893 | + panel.Return(); |
---|
| 894 | + |
---|
715 | 895 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
716 | 896 | boxCB.setToolTipText("Display bounding boxes"); |
---|
717 | 897 | boxCB.addItemListener(this); |
---|
718 | 898 | |
---|
719 | 899 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
720 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 900 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
721 | 901 | zoomBoxCB.addItemListener(this); |
---|
722 | 902 | |
---|
723 | 903 | if (true) // Globals.ADVANCED) |
---|
724 | 904 | { |
---|
725 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
726 | | - supportCB.setToolTipText("Enable rigging"); |
---|
727 | | - supportCB.addItemListener(this); |
---|
| 905 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 906 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 907 | +// supportCB.addItemListener(this); |
---|
| 908 | + |
---|
| 909 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 910 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 911 | + freezeCB.addItemListener(this); |
---|
728 | 912 | |
---|
729 | 913 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
730 | 914 | // localCB.addItemListener(this); |
---|
731 | 915 | |
---|
| 916 | + panel.Return(); |
---|
| 917 | + |
---|
732 | 918 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
733 | 919 | crowdCB.setToolTipText("Used for crowds"); |
---|
734 | 920 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
745 | 931 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
746 | 932 | // speakerMocapCB.addItemListener(this); |
---|
747 | 933 | |
---|
| 934 | + panel.Return(); |
---|
| 935 | + |
---|
748 | 936 | if (false) |
---|
749 | 937 | { |
---|
750 | 938 | // handled in scripts |
---|
.. | .. |
---|
759 | 947 | //constraints.gridy += 1; |
---|
760 | 948 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
761 | 949 | smoothfocusCB.addItemListener(this); |
---|
| 950 | + panel.Return(); |
---|
762 | 951 | } |
---|
763 | 952 | |
---|
764 | 953 | //constraints.gridx += 1; |
---|
765 | 954 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
766 | 955 | // debugCB.addItemListener(this); |
---|
767 | 956 | |
---|
| 957 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 958 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 959 | + trackCB.addItemListener(this); |
---|
| 960 | + |
---|
768 | 961 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 962 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
769 | 963 | oeilCB.addItemListener(this); |
---|
770 | 964 | |
---|
| 965 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 966 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 967 | + shadowCB.addItemListener(this); |
---|
| 968 | + |
---|
| 969 | + panel.Return(); |
---|
| 970 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 971 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 972 | + toggleTextureCB.addItemListener(this); |
---|
| 973 | + |
---|
| 974 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 975 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 976 | + toggleSwitchCB.addItemListener(this); |
---|
| 977 | + |
---|
| 978 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 979 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 980 | + autokeepCB.addItemListener(this); |
---|
| 981 | + |
---|
| 982 | + panel.Return(); |
---|
| 983 | + if (Globals.ADVANCED) |
---|
| 984 | + { |
---|
771 | 985 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 986 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 987 | lookAtCB.addItemListener(this); |
---|
| 988 | + } |
---|
774 | 989 | |
---|
775 | 990 | } |
---|
776 | 991 | |
---|
777 | 992 | cGridBag fill = new cGridBag(); |
---|
778 | | - |
---|
779 | 993 | fill.preferredHeight = 200; |
---|
| 994 | + cGridBag fill2 = new cGridBag(); |
---|
| 995 | + fill2.preferredHeight = 200; |
---|
| 996 | + cGridBag fill3 = new cGridBag(); |
---|
| 997 | + fill3.preferredHeight = 200; |
---|
780 | 998 | |
---|
781 | 999 | panel.add(fill); |
---|
| 1000 | + panel.add(fill2); |
---|
| 1001 | + panel.add(fill3); |
---|
782 | 1002 | |
---|
783 | 1003 | } |
---|
784 | 1004 | |
---|
785 | 1005 | void EditObject(Object3D obj) |
---|
786 | 1006 | { |
---|
787 | 1007 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1008 | + |
---|
| 1009 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1010 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1011 | + if (!radioButton.hadMaterial) |
---|
| 1012 | + { |
---|
| 1013 | + obj.material = new cMaterial(); |
---|
| 1014 | + } |
---|
| 1015 | + |
---|
788 | 1016 | radioButton.SetObject(obj); |
---|
789 | | - radioButton.layout = sevenButton; |
---|
| 1017 | + radioButton.layout = sixButton; // sevenButton; |
---|
790 | 1018 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
791 | 1019 | radioButton.addActionListener(this); |
---|
792 | 1020 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
796 | 1024 | |
---|
797 | 1025 | void SetupViews(ObjEditor oe) |
---|
798 | 1026 | { |
---|
| 1027 | + theFrame = this; |
---|
| 1028 | + |
---|
799 | 1029 | oe.SetupViews(); |
---|
800 | 1030 | |
---|
801 | 1031 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
804 | 1034 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
805 | 1035 | } |
---|
806 | 1036 | |
---|
807 | | - JCheckBox liveCB; |
---|
808 | | - JCheckBox supportCB; |
---|
809 | | - JCheckBox localCB; |
---|
810 | | - JCheckBox crowdCB; |
---|
811 | | - JCheckBox smoothCB; |
---|
812 | | - JCheckBox fastCB; |
---|
813 | | - JCheckBox slowCB; |
---|
814 | | - JCheckBox boxCB; |
---|
815 | | - JCheckBox zoomBoxCB; |
---|
816 | | - JCheckBox trackCB; |
---|
817 | | - JCheckBox smoothfocusCB; |
---|
| 1037 | + cToggleButton liveCB; |
---|
| 1038 | + cCheckBox supportCB; |
---|
| 1039 | + cCheckBox localCB; |
---|
| 1040 | + cCheckBox crowdCB; |
---|
| 1041 | + cCheckBox smoothCB; |
---|
| 1042 | + cToggleButton fastCB; |
---|
| 1043 | + cCheckBox slowCB; |
---|
| 1044 | + cCheckBox boxCB; |
---|
| 1045 | + cCheckBox zoomBoxCB; |
---|
| 1046 | + cCheckBox freezeCB; |
---|
| 1047 | + //cToggleButton trackCB; |
---|
| 1048 | + cCheckBox trackCB; |
---|
| 1049 | + cCheckBox smoothfocusCB; |
---|
818 | 1050 | // JCheckBox speakerMocapCB; |
---|
819 | | - JCheckBox speakerCameraCB; |
---|
820 | | - JCheckBox speakerFocusCB; |
---|
821 | | - JCheckBox debugCB; |
---|
822 | | - JCheckBox oeilCB; |
---|
823 | | - JCheckBox lookAtCB; |
---|
| 1051 | + cCheckBox speakerCameraCB; |
---|
| 1052 | + cCheckBox speakerFocusCB; |
---|
| 1053 | + cCheckBox debugCB; |
---|
| 1054 | + |
---|
| 1055 | + cCheckBox oeilCB; |
---|
| 1056 | + cCheckBox shadowCB; |
---|
| 1057 | + cCheckBox autokeepCB; |
---|
| 1058 | + cCheckBox lookAtCB; |
---|
824 | 1059 | |
---|
825 | 1060 | // static int COLOR = 1; |
---|
826 | 1061 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
828 | 1063 | |
---|
829 | 1064 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
830 | 1065 | |
---|
831 | | - JCheckBox colorCB; |
---|
832 | | - JCheckBox materialCB; |
---|
833 | | - JCheckBox textureCB; |
---|
| 1066 | + cCheckBox colorCB; |
---|
| 1067 | + cCheckBox materialCB; |
---|
| 1068 | + cCheckBox textureCB; |
---|
834 | 1069 | |
---|
835 | 1070 | public void itemStateChanged(ItemEvent e) |
---|
836 | 1071 | { |
---|
.. | .. |
---|
858 | 1093 | } else if(e.getSource() == liveCB) |
---|
859 | 1094 | { |
---|
860 | 1095 | cameraView.ToggleLive(); |
---|
| 1096 | + refreshContents(false); |
---|
861 | 1097 | } |
---|
862 | 1098 | else if(e.getSource() == supportCB) |
---|
863 | 1099 | { |
---|
.. | .. |
---|
922 | 1158 | { |
---|
923 | 1159 | cameraView.ToggleOeil(); |
---|
924 | 1160 | } |
---|
| 1161 | + else if(e.getSource() == shadowCB) |
---|
| 1162 | + { |
---|
| 1163 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1164 | + } |
---|
| 1165 | + else if(e.getSource() == freezeCB) |
---|
| 1166 | + { |
---|
| 1167 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1168 | + } |
---|
| 1169 | + else if(e.getSource() == autokeepCB) |
---|
| 1170 | + { |
---|
| 1171 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1172 | + } |
---|
925 | 1173 | else if(e.getSource() == lookAtCB) |
---|
926 | 1174 | { |
---|
927 | 1175 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
938 | 1186 | |
---|
939 | 1187 | /**/ |
---|
940 | 1188 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
941 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1190 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
942 | 1191 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
943 | 1192 | // We can't move the root node or an empty selection |
---|
944 | 1193 | return; |
---|
.. | .. |
---|
1001 | 1250 | } |
---|
1002 | 1251 | } |
---|
1003 | 1252 | |
---|
1004 | | - String string = (String) object; |
---|
1005 | | - |
---|
1006 | 1253 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1007 | 1254 | // if( object instanceof java.io.File[]) |
---|
1008 | 1255 | // { |
---|
.. | .. |
---|
1010 | 1257 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1011 | 1258 | // return; |
---|
1012 | 1259 | // } |
---|
| 1260 | + |
---|
| 1261 | + String string = object.toString(); |
---|
1013 | 1262 | |
---|
1014 | 1263 | // File path for Mac and Windows |
---|
1015 | 1264 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1055 | 1304 | |
---|
1056 | 1305 | assert target == objEditor.jTree; |
---|
1057 | 1306 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1307 | + Object3D destinationLeaf; |
---|
1058 | 1308 | try { |
---|
1059 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1309 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1060 | 1310 | } catch (Exception e) { |
---|
1061 | 1311 | System.out.println("destinationPath : " + destinationPath); |
---|
1062 | 1312 | return; |
---|
1063 | 1313 | } |
---|
1064 | 1314 | |
---|
1065 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1315 | + for (int i=group.selection.size(); --i>=0;) |
---|
1066 | 1316 | { |
---|
| 1317 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1318 | + |
---|
| 1319 | + // Cannot move into itself |
---|
| 1320 | + if (child == destinationLeaf) |
---|
| 1321 | + return; |
---|
| 1322 | + } |
---|
| 1323 | + |
---|
| 1324 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1325 | +// { |
---|
1067 | 1326 | loadClipboard(true); |
---|
1068 | 1327 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1069 | 1328 | pasteInto(false, false); |
---|
1070 | | - } else { |
---|
1071 | | - loadClipboard(false); |
---|
1072 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1073 | | - pasteInto(false, false); // true); // ??? |
---|
1074 | | - } |
---|
| 1329 | +// } else { |
---|
| 1330 | +// loadClipboard(false); |
---|
| 1331 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1332 | +// pasteInto(false, false); // true); // ??? |
---|
| 1333 | +// } |
---|
1075 | 1334 | } |
---|
1076 | 1335 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1077 | 1336 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1176 | 1435 | { |
---|
1177 | 1436 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1178 | 1437 | //heightFieldItem.addActionListener(this); |
---|
1179 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1180 | | - gridItem.addActionListener(this); |
---|
1181 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1182 | | - rectoidItem.addActionListener(this); |
---|
1183 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1184 | | - ellipsoidItem.addActionListener(this); |
---|
1185 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1186 | | - coneItem.addActionListener(this); |
---|
1187 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1188 | | - torusItem.addActionListener(this); |
---|
1189 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1190 | | - superItem.addActionListener(this); |
---|
| 1438 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1439 | +// gridItem.addActionListener(this); |
---|
| 1440 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1441 | +// rectoidItem.addActionListener(this); |
---|
| 1442 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1443 | +// ellipsoidItem.addActionListener(this); |
---|
| 1444 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1445 | +// coneItem.addActionListener(this); |
---|
| 1446 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1447 | +// torusItem.addActionListener(this); |
---|
| 1448 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1449 | +// superItem.addActionListener(this); |
---|
| 1450 | + |
---|
| 1451 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1452 | + cameraItem.addActionListener(this); |
---|
| 1453 | + |
---|
| 1454 | + if (!Globals.ADVANCED) |
---|
| 1455 | + { |
---|
1191 | 1456 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1192 | 1457 | kleinItem.addActionListener(this); |
---|
1193 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1194 | | - particleItem.addActionListener(this); |
---|
| 1458 | + } |
---|
| 1459 | + |
---|
| 1460 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1461 | +// particleItem.addActionListener(this); |
---|
1195 | 1462 | if (Globals.ADVANCED) |
---|
1196 | 1463 | { |
---|
1197 | 1464 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1217 | 1484 | } |
---|
1218 | 1485 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1219 | 1486 | bezierItem.addActionListener(this); |
---|
1220 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1221 | | - overlayItem.addActionListener(this); |
---|
1222 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1223 | | - lightItem.addActionListener(this); |
---|
| 1487 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1488 | +// overlayItem.addActionListener(this); |
---|
| 1489 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1490 | +// lightItem.addActionListener(this); |
---|
1224 | 1491 | menu.add("-"); |
---|
1225 | 1492 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1226 | 1493 | //superLoopItem.addActionListener(this); |
---|
1227 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1228 | | - loopItem.addActionListener(this); |
---|
| 1494 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1495 | +// loopItem.addActionListener(this); |
---|
1229 | 1496 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1230 | 1497 | doubleItem.addActionListener(this); |
---|
1231 | 1498 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1241 | 1508 | animationItem.addItemListener(this); |
---|
1242 | 1509 | animationItem.setState(Globals.ANIMATION); |
---|
1243 | 1510 | |
---|
| 1511 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1512 | + archiveItem.addActionListener(this); |
---|
| 1513 | + |
---|
1244 | 1514 | menu.add("-"); |
---|
1245 | 1515 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1246 | 1516 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1253 | 1523 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1254 | 1524 | reduce34MorphItem.addActionListener(this); |
---|
1255 | 1525 | menu.add("-"); |
---|
| 1526 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1527 | + memoryItem.addActionListener(this); |
---|
1256 | 1528 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1257 | 1529 | computeAOItem.addActionListener(this); |
---|
1258 | 1530 | |
---|
.. | .. |
---|
1261 | 1533 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1262 | 1534 | mirrorItem.addActionListener(this); |
---|
1263 | 1535 | menu.add("-"); |
---|
1264 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1265 | | - memoryItem.addActionListener(this); |
---|
1266 | 1536 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1537 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1538 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1539 | dumpItem.addActionListener(this); |
---|
1270 | 1540 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1541 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1676 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1677 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1678 | shadow.material.specular = 0.0001f; |
---|
| 1679 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1680 | |
---|
1410 | 1681 | makeSomething(shadow); |
---|
1411 | 1682 | } |
---|
| 1683 | + |
---|
| 1684 | + private void ClearUnpinned() |
---|
| 1685 | + { |
---|
| 1686 | + //for (Object3D obj : listUI) |
---|
| 1687 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1688 | + { |
---|
| 1689 | + Object3D obj = listUI.elementAt(i); |
---|
| 1690 | + if (!obj.pinned) |
---|
| 1691 | + { |
---|
| 1692 | + obj.CloseUI(); |
---|
| 1693 | + listUI.remove(i); |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
| 1696 | + } |
---|
| 1697 | + |
---|
| 1698 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1699 | + { |
---|
| 1700 | + // if (!(elem instanceof Composite)) |
---|
| 1701 | + // newWindow = false; |
---|
| 1702 | + listUI.add(elem); |
---|
| 1703 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1704 | + System.out.println("edit : " + elem); |
---|
| 1705 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1706 | + } |
---|
1412 | 1707 | |
---|
1413 | 1708 | /** |
---|
1414 | 1709 | * applyExample |
---|
.. | .. |
---|
1653 | 1948 | { |
---|
1654 | 1949 | ScreenFit(); |
---|
1655 | 1950 | } else |
---|
1656 | | - if (source == switchItem) |
---|
| 1951 | + if (source == switchViewItem) |
---|
1657 | 1952 | { |
---|
1658 | 1953 | cVector v1 = new cVector(); |
---|
1659 | 1954 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1662 | 1957 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1663 | 1958 | objEditor.cameraView.repaint(); |
---|
1664 | 1959 | } else |
---|
1665 | | - if (source == rectoidItem) |
---|
| 1960 | + if (source == rectoidItem || source == boxButton) |
---|
1666 | 1961 | { |
---|
1667 | 1962 | makeSomething(new Box()); |
---|
1668 | 1963 | } else |
---|
1669 | | - if (source == particleItem) |
---|
| 1964 | + if (source == particleItem || source == particlesButton) |
---|
1670 | 1965 | { |
---|
1671 | 1966 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1672 | 1967 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1745 | 2040 | |
---|
1746 | 2041 | makeSomething(obj); |
---|
1747 | 2042 | } else |
---|
1748 | | - if (source == gridItem) |
---|
| 2043 | + if (source == gridItem || source == gridButton) |
---|
1749 | 2044 | { |
---|
1750 | 2045 | makeSomething(new Grid()); |
---|
1751 | 2046 | } else |
---|
1752 | | - if (source == ellipsoidItem) |
---|
| 2047 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1753 | 2048 | { |
---|
1754 | 2049 | makeSomething(new Sphere()); |
---|
1755 | 2050 | } else |
---|
1756 | | - if (source == coneItem) |
---|
| 2051 | + if (source == coneItem || source == coneButton) |
---|
1757 | 2052 | { |
---|
1758 | 2053 | makeSomething(new Cone()); |
---|
1759 | 2054 | } else |
---|
1760 | | - if (source == torusItem) |
---|
| 2055 | + if (source == torusItem || source == torusButton) |
---|
1761 | 2056 | { |
---|
1762 | 2057 | makeSomething(new Torus()); |
---|
1763 | 2058 | } else |
---|
1764 | | - if (source == superItem) |
---|
| 2059 | + if (source == superItem || source == superButton) |
---|
1765 | 2060 | { |
---|
1766 | 2061 | makeSomething(new Superellipsoid()); |
---|
1767 | 2062 | } else |
---|
1768 | | - if (source == kleinItem) |
---|
| 2063 | + if (source == kleinItem || source == kleinButton) |
---|
1769 | 2064 | { |
---|
1770 | 2065 | makeSomething(new Klein()); |
---|
1771 | 2066 | } else |
---|
.. | .. |
---|
1785 | 2080 | { |
---|
1786 | 2081 | makeSomething(new BezierSurface()); |
---|
1787 | 2082 | } else |
---|
1788 | | - if (source == overlayItem) |
---|
| 2083 | + if (source == overlayItem || source == overlayButton) |
---|
1789 | 2084 | { |
---|
1790 | 2085 | /* |
---|
1791 | 2086 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1833 | 2128 | s.setup(); |
---|
1834 | 2129 | makeSomething(s); |
---|
1835 | 2130 | } else |
---|
1836 | | - if (source == lightItem) |
---|
| 2131 | + if (source == lightItem || source == lightButton) |
---|
1837 | 2132 | { |
---|
1838 | 2133 | makeSomething(new Light()); |
---|
1839 | 2134 | } else |
---|
.. | .. |
---|
1883 | 2178 | |
---|
1884 | 2179 | group(g); |
---|
1885 | 2180 | } else |
---|
1886 | | - if (source == loopItem) |
---|
| 2181 | + if (source == loopItem || source == loopButton) |
---|
1887 | 2182 | { |
---|
1888 | 2183 | Composite csg = new GroupLeaf(); |
---|
1889 | 2184 | csg.count = 5; |
---|
1890 | 2185 | group(csg); |
---|
1891 | | - Composite child = new cGroup(); |
---|
| 2186 | + Composite child = new cGroup("Branch"); |
---|
1892 | 2187 | csg.addChild(child); |
---|
1893 | 2188 | child.addChild(csg); |
---|
1894 | 2189 | } else |
---|
1895 | 2190 | if (source == doubleItem) |
---|
1896 | 2191 | { |
---|
1897 | | - Composite csg = new GroupLeaf(); |
---|
| 2192 | + Composite csg = new GroupLeaf("Fork"); |
---|
1898 | 2193 | csg.count = 5; |
---|
1899 | 2194 | group(csg); |
---|
1900 | | - Composite child = new cGroup(); |
---|
| 2195 | + Composite child = new cGroup("Branch A"); |
---|
1901 | 2196 | csg.addChild(child); |
---|
1902 | 2197 | child.addChild(csg); |
---|
1903 | | - child = new cGroup(); |
---|
| 2198 | + child = new cGroup("Branch B"); |
---|
1904 | 2199 | csg.addChild(child); |
---|
1905 | 2200 | child.addChild(csg); |
---|
1906 | 2201 | } else |
---|
1907 | 2202 | if (source == tripleItem) |
---|
1908 | 2203 | { |
---|
1909 | | - Composite csg = new GroupLeaf(); |
---|
| 2204 | + Composite csg = new GroupLeaf("Trident"); |
---|
1910 | 2205 | csg.count = 4; |
---|
1911 | 2206 | group(csg); |
---|
1912 | 2207 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1956 | 2251 | { |
---|
1957 | 2252 | DumpObject(); |
---|
1958 | 2253 | } else |
---|
| 2254 | + if (source == minButton) |
---|
| 2255 | + { |
---|
| 2256 | + Minimize(); |
---|
| 2257 | + } else |
---|
| 2258 | + if (source == maxButton) |
---|
| 2259 | + { |
---|
| 2260 | + Maximize(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == fullButton) |
---|
| 2263 | + { |
---|
| 2264 | + ToggleFullScreen(); |
---|
| 2265 | + } else |
---|
| 2266 | + if (source == undoButton) |
---|
| 2267 | + { |
---|
| 2268 | + // Go to previous version |
---|
| 2269 | + //if (!Undo()) |
---|
| 2270 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2271 | + Undo(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == restoreButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Restore current version |
---|
| 2276 | + Restore(); |
---|
| 2277 | + } else |
---|
| 2278 | + if (source == replaceButton) |
---|
| 2279 | + { |
---|
| 2280 | + // Overwrite current version |
---|
| 2281 | + Replace(); |
---|
| 2282 | + } else |
---|
| 2283 | + if (source == redoButton) |
---|
| 2284 | + { |
---|
| 2285 | + // Go to next version |
---|
| 2286 | + Redo(); |
---|
| 2287 | + } else |
---|
| 2288 | + if (source == saveButton) |
---|
| 2289 | + { |
---|
| 2290 | + // Save a new version |
---|
| 2291 | + if (!Save(true)) |
---|
| 2292 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2293 | + } else |
---|
1959 | 2294 | if (source == oneStepButton) |
---|
1960 | 2295 | { |
---|
1961 | 2296 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1963 | 2298 | } else |
---|
1964 | 2299 | if (source == screenfitButton) |
---|
1965 | 2300 | { |
---|
1966 | | - //Reload(lastConverter, lastFilename, true); |
---|
1967 | 2301 | ScreenFit(); |
---|
1968 | 2302 | } else |
---|
1969 | 2303 | if (source == screenfitpointButton) |
---|
1970 | 2304 | { |
---|
1971 | | - //Reload(lastConverter, lastFilename, true); |
---|
1972 | 2305 | ScreenFitPoint(); |
---|
1973 | 2306 | } else |
---|
1974 | 2307 | if (source == snapobjectButton) |
---|
1975 | 2308 | { |
---|
1976 | | - //Reload(lastConverter, lastFilename, true); |
---|
1977 | 2309 | SnapObject(); |
---|
1978 | 2310 | } else |
---|
1979 | 2311 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2337 | 2669 | { |
---|
2338 | 2670 | StepAll(); |
---|
2339 | 2671 | } else |
---|
2340 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2672 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2341 | 2673 | { |
---|
2342 | 2674 | //int indices[] = jList.getSelectedIndices(); |
---|
2343 | 2675 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2349 | 2681 | { |
---|
2350 | 2682 | ClearSelection(true); |
---|
2351 | 2683 | } else |
---|
2352 | | - if (source == grabItem) |
---|
| 2684 | + if (source == grabItem || source == groupButton) |
---|
2353 | 2685 | { |
---|
2354 | | - group(new cGroup(), true); |
---|
| 2686 | + group(new cGroup(), false); // true); |
---|
2355 | 2687 | } else |
---|
2356 | 2688 | if (source == hideItem) |
---|
2357 | 2689 | { |
---|
.. | .. |
---|
2369 | 2701 | { |
---|
2370 | 2702 | makeSomething(new Camera()); |
---|
2371 | 2703 | } else |
---|
2372 | | - if (source == compositeItem) |
---|
| 2704 | + if (source == compositeItem || source == compositeButton) |
---|
2373 | 2705 | { |
---|
2374 | 2706 | group(new Composite()); |
---|
2375 | 2707 | } else |
---|
2376 | | - if (source == randomItem) |
---|
| 2708 | + if (source == switchItem || source == switchButton) |
---|
2377 | 2709 | { |
---|
2378 | 2710 | RandomNode random = new RandomNode(); |
---|
2379 | 2711 | group(random); |
---|
.. | .. |
---|
2475 | 2807 | { |
---|
2476 | 2808 | group(new cLinker()); |
---|
2477 | 2809 | } else |
---|
2478 | | - if (source == textureItem) |
---|
| 2810 | + if (source == textureItem || source == textureButton) |
---|
2479 | 2811 | { |
---|
2480 | 2812 | group(new TextureNode()); |
---|
2481 | 2813 | } else |
---|
.. | .. |
---|
2495 | 2827 | { |
---|
2496 | 2828 | CastShadow(2); |
---|
2497 | 2829 | } else |
---|
2498 | | - if (source == ungroupItem) |
---|
| 2830 | + if (source == ungroupItem || source == ungroupButton) |
---|
2499 | 2831 | { |
---|
2500 | | - //ungroup(); |
---|
| 2832 | + boolean hasRoot = false; |
---|
| 2833 | + |
---|
2501 | 2834 | for (int i=0; i<group.selection.size(); i++) |
---|
2502 | 2835 | { |
---|
2503 | | - Ungroup(group.selection.get(i)); |
---|
| 2836 | + if (group.selection.get(i) == group) |
---|
| 2837 | + { |
---|
| 2838 | + hasRoot = true; |
---|
| 2839 | + break; |
---|
| 2840 | + } |
---|
2504 | 2841 | } |
---|
2505 | 2842 | |
---|
2506 | | - ClearSelection(false); |
---|
2507 | | - |
---|
2508 | | - refreshContents(); |
---|
| 2843 | + if (!hasRoot) |
---|
| 2844 | + { |
---|
| 2845 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2846 | + { |
---|
| 2847 | + Ungroup(group.selection.get(i)); |
---|
| 2848 | + } |
---|
| 2849 | + |
---|
| 2850 | + ClearSelection(false); |
---|
| 2851 | + |
---|
| 2852 | + refreshContents(); |
---|
| 2853 | + } |
---|
2509 | 2854 | } else |
---|
2510 | 2855 | if (source == genUVItem) |
---|
2511 | 2856 | { |
---|
.. | .. |
---|
2517 | 2862 | } else |
---|
2518 | 2863 | if (source == genNormalsMESHItem) |
---|
2519 | 2864 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2865 | + GenNormalsMESH(); |
---|
2521 | 2866 | } else |
---|
2522 | 2867 | if (source == genNormalsORGANItem) |
---|
2523 | 2868 | { |
---|
.. | .. |
---|
2582 | 2927 | if (source == unmarkleavesItem) |
---|
2583 | 2928 | { |
---|
2584 | 2929 | MarkLeaves(false); |
---|
| 2930 | + } else |
---|
| 2931 | + if (source == rewindleavesItem) |
---|
| 2932 | + { |
---|
| 2933 | + RewindLeaves(true); |
---|
| 2934 | + } else |
---|
| 2935 | + if (source == unrewindleavesItem) |
---|
| 2936 | + { |
---|
| 2937 | + RewindLeaves(false); |
---|
| 2938 | + } else |
---|
| 2939 | + if (source == randomleavesItem) |
---|
| 2940 | + { |
---|
| 2941 | + RandomLeaves(true); |
---|
| 2942 | + } else |
---|
| 2943 | + if (source == unrandomleavesItem) |
---|
| 2944 | + { |
---|
| 2945 | + RandomLeaves(false); |
---|
2585 | 2946 | } else |
---|
2586 | 2947 | if (source == flipVItem) |
---|
2587 | 2948 | { |
---|
.. | .. |
---|
2817 | 3178 | if (source == twoButton) |
---|
2818 | 3179 | { |
---|
2819 | 3180 | radio.layout = twoButton; |
---|
| 3181 | + |
---|
| 3182 | + if (CameraPane.FULLSCREEN) |
---|
| 3183 | + fullscreenLayout = radio.layout; |
---|
| 3184 | + |
---|
2820 | 3185 | // bug |
---|
2821 | 3186 | //gridPanel.setDividerLocation(1.0); |
---|
2822 | 3187 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2849 | 3214 | bigThree.ClearUI(); |
---|
2850 | 3215 | bigThree.add(centralPanel); |
---|
2851 | 3216 | bigThree.FlushUI(); |
---|
| 3217 | + |
---|
| 3218 | + cameraView.requestFocusInWindow(); |
---|
| 3219 | + |
---|
| 3220 | +// refreshContents(true); |
---|
| 3221 | +// |
---|
| 3222 | +// try |
---|
| 3223 | +// { |
---|
| 3224 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3225 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3226 | +// bot.mouseMove(100, 100); |
---|
| 3227 | +// bot.mousePress(mask); |
---|
| 3228 | +// bot.mouseRelease(mask); |
---|
| 3229 | +// } |
---|
| 3230 | +// catch (Exception e) |
---|
| 3231 | +// { |
---|
| 3232 | +// |
---|
| 3233 | +// } |
---|
| 3234 | + |
---|
2852 | 3235 | } else |
---|
2853 | 3236 | if (source == threeButton) |
---|
2854 | 3237 | { |
---|
2855 | 3238 | radio.layout = threeButton; |
---|
| 3239 | + |
---|
| 3240 | + if (CameraPane.FULLSCREEN) |
---|
| 3241 | + fullscreenLayout = radio.layout; |
---|
2856 | 3242 | |
---|
2857 | 3243 | // bigThree.remove(scenePanel); |
---|
2858 | 3244 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2885 | 3271 | bigThree.add(centralPanel); |
---|
2886 | 3272 | bigThree.add(XYZPanel); |
---|
2887 | 3273 | bigThree.FlushUI(); |
---|
| 3274 | + |
---|
| 3275 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3276 | } else |
---|
2889 | 3277 | if (source == fourButton) |
---|
2890 | 3278 | { |
---|
2891 | 3279 | radio.layout = fourButton; |
---|
| 3280 | + |
---|
| 3281 | + if (CameraPane.FULLSCREEN) |
---|
| 3282 | + fullscreenLayout = radio.layout; |
---|
2892 | 3283 | |
---|
2893 | 3284 | // bigThree.remove(scenePanel); |
---|
2894 | 3285 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2920 | 3311 | bigThree.ClearUI(); |
---|
2921 | 3312 | bigThree.add(scenePanel); |
---|
2922 | 3313 | bigThree.FlushUI(); |
---|
| 3314 | + |
---|
| 3315 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3316 | } else |
---|
2924 | 3317 | if (source == sixButton) |
---|
2925 | 3318 | { |
---|
2926 | 3319 | radio.layout = sixButton; |
---|
| 3320 | + |
---|
| 3321 | + if (CameraPane.FULLSCREEN) |
---|
| 3322 | + fullscreenLayout = radio.layout; |
---|
2927 | 3323 | |
---|
2928 | 3324 | // bigThree.remove(scenePanel); |
---|
2929 | 3325 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2956 | 3352 | bigThree.add(scenePanel); |
---|
2957 | 3353 | bigThree.add(centralPanel); |
---|
2958 | 3354 | bigThree.FlushUI(); |
---|
| 3355 | + |
---|
| 3356 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3357 | } else |
---|
2960 | 3358 | if (source == sevenButton) |
---|
2961 | 3359 | { |
---|
2962 | 3360 | radio.layout = sevenButton; |
---|
| 3361 | + |
---|
| 3362 | + if (CameraPane.FULLSCREEN) |
---|
| 3363 | + fullscreenLayout = radio.layout; |
---|
2963 | 3364 | |
---|
2964 | 3365 | // bigThree.remove(scenePanel); |
---|
2965 | 3366 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2993 | 3394 | bigThree.add(centralPanel); |
---|
2994 | 3395 | bigThree.add(XYZPanel); |
---|
2995 | 3396 | bigThree.FlushUI(); |
---|
| 3397 | + |
---|
| 3398 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3399 | } else |
---|
2997 | 3400 | if (source == rootButton) |
---|
2998 | 3401 | { |
---|
.. | .. |
---|
3004 | 3407 | EditObject(obj); |
---|
3005 | 3408 | } |
---|
3006 | 3409 | |
---|
| 3410 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3411 | refreshContents(true); |
---|
3008 | 3412 | } else |
---|
3009 | 3413 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3417 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3418 | { |
---|
3015 | 3419 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3420 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3421 | { |
---|
| 3422 | + // Patch to avoid bug with transparency. |
---|
| 3423 | + if (!ab.hadMaterial) |
---|
| 3424 | + { |
---|
| 3425 | + ab.object.material = null; |
---|
| 3426 | + } |
---|
| 3427 | + |
---|
3018 | 3428 | buttonGroup.remove(ab); |
---|
3019 | 3429 | radioPanel.remove(ab); |
---|
3020 | 3430 | |
---|
3021 | | - ab.GetObject().editWindow = null; |
---|
| 3431 | + //ab.GetObject().editWindow = null; |
---|
| 3432 | + ab.GetObject().manipWindow = null; |
---|
3022 | 3433 | // ab.GetObject().objectUI = null; // ????????? |
---|
3023 | 3434 | |
---|
3024 | 3435 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3025 | 3436 | break; |
---|
3026 | 3437 | } |
---|
3027 | 3438 | } |
---|
| 3439 | + |
---|
| 3440 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3441 | refreshContents(true); |
---|
3029 | 3442 | } else |
---|
3030 | 3443 | if (source == editItem || source == editButton) |
---|
3031 | 3444 | { |
---|
| 3445 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3446 | + { |
---|
| 3447 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3448 | + child.pinned = true; |
---|
| 3449 | + } |
---|
| 3450 | + |
---|
3032 | 3451 | EditSelection(false); |
---|
3033 | 3452 | } else |
---|
3034 | 3453 | if (source == uneditButton) |
---|
.. | .. |
---|
3038 | 3457 | Object3D child = (Object3D)e.nextElement(); |
---|
3039 | 3458 | if(child.editWindow != null) |
---|
3040 | 3459 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3460 | + child.pinned = false; |
---|
3041 | 3461 | child.CloseUI(); |
---|
3042 | 3462 | listUI.remove(child); |
---|
3043 | 3463 | |
---|
3044 | | - child.editWindow = null; // ??????????? |
---|
| 3464 | + //child.editWindow = null; // ??????????? |
---|
3045 | 3465 | } |
---|
3046 | 3466 | objEditor.ctrlPanel.FlushUI(); |
---|
3047 | 3467 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3054 | 3474 | //copy.ClearUI(); |
---|
3055 | 3475 | for (Object3D obj : listUI) |
---|
3056 | 3476 | { |
---|
| 3477 | + obj.pinned = false; |
---|
3057 | 3478 | obj.CloseUI(); |
---|
3058 | 3479 | } |
---|
3059 | 3480 | listUI.clear(); |
---|
.. | .. |
---|
3063 | 3484 | { |
---|
3064 | 3485 | assert(copy == group); |
---|
3065 | 3486 | |
---|
3066 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3487 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3067 | 3488 | |
---|
3068 | 3489 | for (Object3D obj : listUI) |
---|
3069 | 3490 | { |
---|
.. | .. |
---|
3112 | 3533 | } |
---|
3113 | 3534 | |
---|
3114 | 3535 | copy = group; |
---|
| 3536 | + |
---|
| 3537 | + SetUndoStates(); |
---|
| 3538 | + |
---|
3115 | 3539 | //Globals.theRenderer.object = group; |
---|
3116 | 3540 | if(!useclient) |
---|
3117 | 3541 | { |
---|
.. | .. |
---|
3128 | 3552 | sideView.object = group; |
---|
3129 | 3553 | } |
---|
3130 | 3554 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3555 | +// fix "+" issue |
---|
| 3556 | + //group.editWindow = this; |
---|
| 3557 | + group.manipWindow = this; |
---|
3132 | 3558 | |
---|
3133 | 3559 | /* |
---|
3134 | 3560 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3136 | 3562 | currentLayout = sevenButton; |
---|
3137 | 3563 | */ |
---|
3138 | 3564 | radio.layout.doClick(); |
---|
| 3565 | + |
---|
| 3566 | + ClearUnpinned(); |
---|
| 3567 | + //Grafreed.Assert(group != null); |
---|
| 3568 | + //Grafreed.Assert(group.selection != null); |
---|
| 3569 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3570 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3571 | + EditSelection(false); |
---|
3139 | 3572 | keepparent = group.parent; |
---|
3140 | 3573 | // PARENT = NULL or not??? |
---|
3141 | 3574 | //group.parent = null; // ROOT |
---|
3142 | 3575 | //group.attributes = -1; |
---|
3143 | 3576 | ResetModel(); |
---|
| 3577 | + |
---|
| 3578 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3579 | refreshContents(true); |
---|
3145 | 3580 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3581 | { |
---|
3147 | 3582 | cameraView.ProtectCamera(); |
---|
3148 | 3583 | cameraView.repaint(); |
---|
3149 | 3584 | return; |
---|
3150 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3585 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3151 | 3586 | { |
---|
3152 | 3587 | cameraView.RevertCamera(); |
---|
3153 | 3588 | cameraView.repaint(); |
---|
.. | .. |
---|
3164 | 3599 | } |
---|
3165 | 3600 | |
---|
3166 | 3601 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3602 | |
---|
3169 | 3603 | void ToggleRoot() |
---|
3170 | 3604 | { |
---|
.. | .. |
---|
3403 | 3837 | |
---|
3404 | 3838 | int size = obj.MemorySize(); |
---|
3405 | 3839 | |
---|
3406 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3840 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3841 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3407 | 3842 | } |
---|
3408 | 3843 | } |
---|
3409 | 3844 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3919 | void GenNormals(boolean crease) |
---|
3485 | 3920 | { |
---|
3486 | 3921 | group.GenNormalsS(crease); |
---|
| 3922 | + |
---|
| 3923 | + refreshContents(); |
---|
| 3924 | + } |
---|
| 3925 | + |
---|
| 3926 | + void GenNormalsMESH() |
---|
| 3927 | + { |
---|
| 3928 | + group.GenNormalsMeshS(); |
---|
3487 | 3929 | |
---|
3488 | 3930 | refreshContents(); |
---|
3489 | 3931 | } |
---|
.. | .. |
---|
4111 | 4553 | refreshContents(); |
---|
4112 | 4554 | } |
---|
4113 | 4555 | |
---|
| 4556 | + void RewindLeaves(boolean hide) |
---|
| 4557 | + { |
---|
| 4558 | + group.selection.RewindLeaves(hide); |
---|
| 4559 | + refreshContents(); |
---|
| 4560 | + } |
---|
| 4561 | + |
---|
| 4562 | + void RandomLeaves(boolean hide) |
---|
| 4563 | + { |
---|
| 4564 | + group.selection.RandomLeaves(hide); |
---|
| 4565 | + refreshContents(); |
---|
| 4566 | + } |
---|
| 4567 | + |
---|
4114 | 4568 | void SetTexRes(int tr) |
---|
4115 | 4569 | { |
---|
4116 | 4570 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4182 | 4636 | // } |
---|
4183 | 4637 | // } |
---|
4184 | 4638 | |
---|
4185 | | - static boolean allparams = true; |
---|
4186 | | - |
---|
4187 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4188 | | - |
---|
4189 | 4639 | void EditSelection(boolean newWindow) |
---|
4190 | 4640 | { |
---|
| 4641 | + if (group.selection == null) |
---|
| 4642 | + { |
---|
| 4643 | + EditElement(group, newWindow); // ? new |
---|
| 4644 | + return; |
---|
| 4645 | + } |
---|
| 4646 | + |
---|
4191 | 4647 | // aConstraints.gridy = 0; |
---|
4192 | 4648 | for (int i=0; i<group.selection.size(); i++) |
---|
4193 | 4649 | { |
---|
4194 | 4650 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4195 | 4651 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4196 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4652 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4197 | 4653 | |
---|
4198 | 4654 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4199 | 4655 | if(elem != group || !newWindow) |
---|
4200 | 4656 | { |
---|
4201 | | - // if (!(elem instanceof Composite)) |
---|
4202 | | - // newWindow = false; |
---|
4203 | | - listUI.add(elem); |
---|
4204 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4205 | | - System.out.println("edit : " + elem); |
---|
4206 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4657 | + EditElement(elem, newWindow); // ? new |
---|
4207 | 4658 | } |
---|
4208 | 4659 | } |
---|
4209 | 4660 | } |
---|
.. | .. |
---|
4278 | 4729 | //new Exception().printStackTrace(); |
---|
4279 | 4730 | |
---|
4280 | 4731 | freezemodel = true; |
---|
4281 | | - |
---|
| 4732 | + ClearUnpinned(); |
---|
| 4733 | + |
---|
4282 | 4734 | /**/ |
---|
4283 | 4735 | //switch (event.id) |
---|
4284 | 4736 | { |
---|
.. | .. |
---|
4286 | 4738 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4739 | group.deselectAll(); |
---|
4288 | 4740 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4741 | if (tps != null) |
---|
4291 | 4742 | { |
---|
4292 | 4743 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 4746 | |
---|
4296 | 4747 | //if (child.parent != null) |
---|
4297 | 4748 | //child.parent.addSelectee(child); |
---|
| 4749 | + objEditor.SetMaterial(child); |
---|
4298 | 4750 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4751 | } |
---|
4303 | 4752 | } |
---|
4304 | 4753 | // else |
---|
.. | .. |
---|
4308 | 4757 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4758 | // } |
---|
4310 | 4759 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | | - Object3D object = (Object3D) tps[0].getLastPathComponent(); |
---|
4314 | | - |
---|
4315 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera)) |
---|
| 4760 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4316 | 4761 | CameraPane.flash = true; |
---|
4317 | 4762 | |
---|
4318 | | - if (tps != null && tps.length > 0 && object instanceof Camera) |
---|
| 4763 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4319 | 4764 | // a camera |
---|
4320 | 4765 | { |
---|
4321 | | - if (object != Globals.theRenderer.LightCamera()) |
---|
| 4766 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4322 | 4767 | { |
---|
4323 | 4768 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4324 | 4769 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4327 | 4772 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4328 | 4773 | } |
---|
4329 | 4774 | |
---|
| 4775 | + if (tps != null && tps.length == 1) |
---|
| 4776 | + { |
---|
| 4777 | + EditSelection(false); |
---|
| 4778 | + } |
---|
| 4779 | + |
---|
| 4780 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4781 | + |
---|
4330 | 4782 | refreshContents(); |
---|
4331 | 4783 | //return true; |
---|
4332 | 4784 | } |
---|
.. | .. |
---|
4335 | 4787 | |
---|
4336 | 4788 | freezemodel = false; |
---|
4337 | 4789 | } |
---|
| 4790 | + |
---|
| 4791 | + void SetPinStates(boolean enabled) |
---|
| 4792 | + { |
---|
| 4793 | + editButton.setEnabled(enabled); |
---|
| 4794 | + uneditButton.setEnabled(enabled); |
---|
| 4795 | + unselectButton.setEnabled(enabled); |
---|
| 4796 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4797 | + } |
---|
| 4798 | + |
---|
| 4799 | + void refreshContents(boolean cp) |
---|
| 4800 | + { |
---|
| 4801 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4802 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4803 | + { |
---|
| 4804 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4805 | + |
---|
| 4806 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4807 | + { |
---|
| 4808 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4809 | + |
---|
| 4810 | + objEditor.AddInfo(child, this, true); |
---|
| 4811 | + System.err.println("info : " + child.GetPath()); |
---|
| 4812 | + } |
---|
| 4813 | + |
---|
| 4814 | + objEditor.SetText(); // jan 2014 |
---|
| 4815 | + } |
---|
| 4816 | + |
---|
| 4817 | + super.refreshContents(cp); |
---|
| 4818 | + } |
---|
4338 | 4819 | |
---|
4339 | 4820 | void linkSomething(Object3D thing) |
---|
4340 | 4821 | { |
---|
.. | .. |
---|
4406 | 4887 | { |
---|
4407 | 4888 | if (group.selection.isEmpty()) |
---|
4408 | 4889 | return; |
---|
| 4890 | + |
---|
4409 | 4891 | Grafreed.clipboardIsTempGroup = false; |
---|
4410 | 4892 | Composite tGroup = null; |
---|
4411 | 4893 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4416 | 4898 | |
---|
4417 | 4899 | if (cut) |
---|
4418 | 4900 | { |
---|
| 4901 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4902 | +// Save(); |
---|
4419 | 4903 | //int indices[] = jList.getSelectedIndices(); |
---|
4420 | 4904 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4421 | 4905 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4505 | 4989 | } |
---|
4506 | 4990 | |
---|
4507 | 4991 | } |
---|
| 4992 | + |
---|
4508 | 4993 | if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4994 | Grafreed.clipboard = tGroup; |
---|
| 4995 | + |
---|
4510 | 4996 | if (cut) |
---|
4511 | 4997 | { |
---|
4512 | 4998 | ResetModel(); |
---|
.. | .. |
---|
4516 | 5002 | |
---|
4517 | 5003 | void paste(boolean expand) |
---|
4518 | 5004 | { |
---|
| 5005 | + if (Globals.REPLACEONMAKE) |
---|
| 5006 | + Save(); |
---|
| 5007 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5008 | + Globals.REPLACEONMAKE = false; |
---|
4519 | 5009 | // if (GrafreeD.clipboard == null) |
---|
4520 | 5010 | // return; |
---|
4521 | 5011 | boolean first = true; |
---|
.. | .. |
---|
4575 | 5065 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4576 | 5066 | } |
---|
4577 | 5067 | |
---|
| 5068 | + Globals.REPLACEONMAKE = keep; |
---|
4578 | 5069 | ResetModel(); |
---|
4579 | 5070 | refreshContents(); |
---|
4580 | 5071 | } |
---|
.. | .. |
---|
4710 | 5201 | |
---|
4711 | 5202 | void group(Object3D csg, boolean grab) |
---|
4712 | 5203 | { |
---|
| 5204 | + if (Globals.REPLACEONMAKE) |
---|
| 5205 | + Save(); |
---|
| 5206 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5207 | + Globals.REPLACEONMAKE = false; |
---|
4713 | 5208 | if (//false) // why?? |
---|
4714 | 5209 | !group.selection.isEmpty()) |
---|
4715 | 5210 | { |
---|
.. | .. |
---|
4823 | 5318 | //node.add(csg); |
---|
4824 | 5319 | //makeSomething(node); |
---|
4825 | 5320 | makeSomething(csg); |
---|
| 5321 | + Globals.REPLACEONMAKE = keep; |
---|
4826 | 5322 | } |
---|
4827 | 5323 | |
---|
4828 | 5324 | void Ungroup(Object3D g) |
---|
4829 | 5325 | { |
---|
| 5326 | + if (Globals.REPLACEONMAKE) |
---|
| 5327 | + Save(); |
---|
| 5328 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5329 | + Globals.REPLACEONMAKE = false; |
---|
4830 | 5330 | if (g instanceof HiddenObject) |
---|
4831 | 5331 | { |
---|
4832 | 5332 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4843 | 5343 | objEditor.makeSomething(g.get(i), false); |
---|
4844 | 5344 | } |
---|
4845 | 5345 | } |
---|
| 5346 | + Globals.REPLACEONMAKE = keep; |
---|
4846 | 5347 | } |
---|
4847 | 5348 | |
---|
4848 | 5349 | void ungroup() |
---|
.. | .. |
---|
5131 | 5632 | cButton clearpanelButton; |
---|
5132 | 5633 | cButton unselectButton; |
---|
5133 | 5634 | |
---|
| 5635 | + cButton restoreCameraButton; |
---|
| 5636 | + |
---|
| 5637 | + cButton saveButton; |
---|
5134 | 5638 | cButton oneStepButton; |
---|
| 5639 | + |
---|
| 5640 | + cButton groupButton; |
---|
| 5641 | + cButton ungroupButton; |
---|
| 5642 | + cButton compositeButton; |
---|
| 5643 | + cButton switchButton; |
---|
| 5644 | + cButton loopButton; |
---|
| 5645 | + cButton textureButton; |
---|
| 5646 | + |
---|
| 5647 | + cButton gridButton; |
---|
| 5648 | + cButton boxButton; |
---|
| 5649 | + cButton sphereButton; |
---|
| 5650 | + cButton coneButton; |
---|
| 5651 | + cButton torusButton; |
---|
| 5652 | + cButton superButton; |
---|
| 5653 | + cButton kleinButton; |
---|
| 5654 | + cButton particlesButton; |
---|
| 5655 | + cButton overlayButton; |
---|
| 5656 | + cButton lightButton; |
---|
5135 | 5657 | |
---|
5136 | 5658 | cButton screenfitButton; |
---|
5137 | 5659 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5144 | 5666 | |
---|
5145 | 5667 | cButton setsupportButton; |
---|
5146 | 5668 | |
---|
5147 | | - cButton twoButton; |
---|
5148 | | - cButton sixButton; |
---|
5149 | | - cButton threeButton; |
---|
5150 | | - cButton sevenButton; |
---|
5151 | | - cButton fourButton; // full panel |
---|
5152 | | - cButton oneButton; // full XYZ |
---|
5153 | | - //cButton currentLayout; |
---|
5154 | | - |
---|
5155 | 5669 | // |
---|
5156 | 5670 | //Composite |
---|
5157 | 5671 | Object3D // to do !! |
---|
.. | .. |
---|
5161 | 5675 | //JTree jTree; |
---|
5162 | 5676 | private MenuItem lookAtItem; |
---|
5163 | 5677 | private MenuItem lookFromItem; |
---|
5164 | | - private MenuItem switchItem; |
---|
| 5678 | + private MenuItem switchViewItem; |
---|
5165 | 5679 | private MenuItem cutItem; |
---|
5166 | 5680 | private MenuItem undoItem; |
---|
5167 | 5681 | private MenuItem redoItem; |
---|
5168 | | - private MenuItem duplicateItem; |
---|
| 5682 | + private JMenuItem duplicateItem; |
---|
5169 | 5683 | private MenuItem cloneItem; |
---|
5170 | 5684 | private MenuItem cloneSupportItem; |
---|
5171 | 5685 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5193 | 5707 | private MenuItem pasteLinkItem; |
---|
5194 | 5708 | private MenuItem pasteCloneItem; |
---|
5195 | 5709 | private MenuItem pasteExpandItem; |
---|
5196 | | - private MenuItem clearItem; |
---|
| 5710 | + private MenuItem deleteItem; |
---|
5197 | 5711 | private MenuItem clearAllItem; |
---|
5198 | 5712 | private MenuItem genUVItem; |
---|
5199 | 5713 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5228 | 5742 | private MenuItem showleavesItem; |
---|
5229 | 5743 | private MenuItem markleavesItem; |
---|
5230 | 5744 | private MenuItem unmarkleavesItem; |
---|
| 5745 | + private MenuItem rewindleavesItem; |
---|
| 5746 | + private MenuItem unrewindleavesItem; |
---|
| 5747 | + private MenuItem randomleavesItem; |
---|
| 5748 | + private MenuItem unrandomleavesItem; |
---|
5231 | 5749 | |
---|
5232 | 5750 | private MenuItem flipVItem; |
---|
5233 | 5751 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5249 | 5767 | private MenuItem frontItem; |
---|
5250 | 5768 | private MenuItem cameraItem; |
---|
5251 | 5769 | private MenuItem compositeItem; |
---|
5252 | | - private MenuItem randomItem; |
---|
| 5770 | + private MenuItem switchItem; |
---|
5253 | 5771 | private MenuItem physicsItem; |
---|
5254 | 5772 | private MenuItem frameselectorItem; |
---|
5255 | 5773 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5323 | 5841 | |
---|
5324 | 5842 | Menu cameraMenu; |
---|
5325 | 5843 | MenuItem editCameraItem; |
---|
5326 | | - MenuItem revertCameraItem; |
---|
| 5844 | + MenuItem restoreCameraItem; |
---|
5327 | 5845 | } |
---|