.. | .. |
---|
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) |
---|
.. | .. |
---|
204 | 221 | //zBufferItem.addActionListener(this); |
---|
205 | 222 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
206 | 223 | //normalLensItem.addActionListener(this); |
---|
207 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
208 | | - revertCameraItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
209 | 226 | |
---|
210 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
211 | | - toggleFullScreenItem.addItemListener(this); |
---|
212 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
213 | | - 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); |
---|
214 | 239 | |
---|
215 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
216 | | - toggleTextureItem.addItemListener(this); |
---|
217 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
218 | | - |
---|
219 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
220 | | - toggleSwitchItem.addItemListener(this); |
---|
221 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | | - |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 241 | toggleHandleItem.addItemListener(this); |
---|
225 | 242 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 243 | |
---|
.. | .. |
---|
275 | 292 | { |
---|
276 | 293 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
277 | 294 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
278 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
279 | 296 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
280 | 297 | oe.cameraMenu.add("-"); |
---|
281 | 298 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
283 | 300 | editLeafItem.addActionListener(this); |
---|
284 | 301 | lookAtItem.addActionListener(this); |
---|
285 | 302 | //lookFromItem.addActinoListener(this); |
---|
286 | | - //switchItem.addActionListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
287 | 304 | } |
---|
288 | 305 | |
---|
289 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
328 | 345 | } |
---|
329 | 346 | |
---|
330 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
331 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
332 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
333 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
334 | 351 | backItem.addActionListener(this); |
---|
335 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
336 | 353 | frontItem.addActionListener(this); |
---|
337 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
338 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
339 | 356 | |
---|
340 | 357 | if (Globals.ADVANCED) |
---|
341 | 358 | { |
---|
.. | .. |
---|
345 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
346 | 363 | ungroupItem.addActionListener(this); |
---|
347 | 364 | |
---|
348 | | - menu.add("-"); |
---|
349 | | - |
---|
350 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
351 | | - randomItem.addActionListener(this); |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
352 | 369 | if (Globals.ADVANCED) |
---|
353 | 370 | { |
---|
354 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
.. | .. |
---|
365 | 382 | frameselectorItem.addActionListener(this); |
---|
366 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
367 | 384 | scriptNodeItem.addActionListener(this); |
---|
368 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
369 | | - cameraItem.addActionListener(this); |
---|
370 | 385 | } |
---|
371 | 386 | |
---|
372 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
373 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
374 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
375 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
376 | 391 | billboardItem.addActionListener(this); |
---|
377 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
382 | 397 | shadowYItem.addActionListener(this); |
---|
383 | 398 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
384 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
385 | 403 | if (Globals.ADVANCED) |
---|
386 | 404 | { |
---|
387 | 405 | menu.add("-"); |
---|
388 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
389 | 407 | linkerItem.addActionListener(this); |
---|
390 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
391 | | - attributeItem.addActionListener(this); |
---|
392 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
393 | 409 | templateItem.addActionListener(this); |
---|
394 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
540 | 556 | buildToolsMenu(menu); |
---|
541 | 557 | } |
---|
542 | 558 | |
---|
| 559 | + |
---|
543 | 560 | void SetupUI2(ObjEditor oe) |
---|
544 | 561 | { |
---|
545 | 562 | // June 2019 |
---|
.. | .. |
---|
582 | 599 | oe.radioPanel.add(dummyButton); |
---|
583 | 600 | oe.buttonGroup.add(dummyButton); |
---|
584 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
585 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
586 | 607 | |
---|
587 | 608 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 609 | //minButton.setToolTipText("Minimize window"); |
---|
589 | 610 | //minButton.addActionListener(this); |
---|
590 | 611 | |
---|
591 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - maxButton.setToolTipText("Maximize window"); |
---|
593 | | - maxButton.addActionListener(this); |
---|
| 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 | + } |
---|
594 | 618 | |
---|
595 | 619 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | 620 | fullButton.setToolTipText("Full-screen window"); |
---|
597 | 621 | fullButton.addActionListener(this); |
---|
598 | 622 | |
---|
599 | | - oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - undoButton.setToolTipText("Undo changes"); |
---|
601 | | - undoButton.addActionListener(this); |
---|
| 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); |
---|
602 | 630 | |
---|
603 | | - oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
604 | | - redoButton.setToolTipText("Redo changes"); |
---|
605 | | - redoButton.addActionListener(this); |
---|
606 | | - |
---|
607 | | - oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | | - saveButton.setToolTipText("Save changes"); |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
609 | 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); |
---|
610 | 639 | |
---|
611 | | - oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 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); |
---|
612 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
613 | 660 | liveCB.addItemListener(this); |
---|
614 | 661 | |
---|
615 | | - oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
616 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
617 | 664 | oneStepButton.addActionListener(this); |
---|
618 | 665 | |
---|
619 | | - oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
620 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
621 | 668 | fastCB.addItemListener(this); |
---|
622 | 669 | |
---|
623 | | - oe.toolboxPanel.Return(); |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
624 | 671 | |
---|
625 | | - oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
626 | | - trackCB.setToolTipText("Enable tracking"); |
---|
627 | | - trackCB.addItemListener(this); |
---|
628 | | - |
---|
629 | | - oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
630 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
631 | | - screenfitButton.addActionListener(this); |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
632 | 675 | |
---|
633 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
634 | 677 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
640 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
641 | 684 | } |
---|
642 | 685 | |
---|
643 | | - oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
644 | | - flashSelectionButton.setToolTipText("Highlight selection"); |
---|
645 | | - flashSelectionButton.addActionListener(this); |
---|
646 | | - |
---|
647 | 686 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
648 | 687 | |
---|
649 | 688 | oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
688 | 727 | sphereButton.setToolTipText("Create sphere"); |
---|
689 | 728 | sphereButton.addActionListener(this); |
---|
690 | 729 | |
---|
691 | | - oe.toolboxPanel.Return(); |
---|
692 | | - |
---|
693 | 730 | oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
694 | 731 | coneButton.setToolTipText("Create cone"); |
---|
695 | 732 | coneButton.addActionListener(this); |
---|
.. | .. |
---|
713 | 750 | particlesButton.setToolTipText("Create particle system"); |
---|
714 | 751 | particlesButton.addActionListener(this); |
---|
715 | 752 | |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + groupButton.setToolTipText("Create group"); |
---|
| 757 | + groupButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + compositeButton.setToolTipText("Create composite"); |
---|
| 761 | + compositeButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 765 | + switchButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + loopButton.setToolTipText("Create loop"); |
---|
| 769 | + loopButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + textureButton.setToolTipText("Create texture"); |
---|
| 773 | + textureButton.addActionListener(this); |
---|
| 774 | + |
---|
716 | 775 | oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
717 | 776 | overlayButton.setToolTipText("Create overlay"); |
---|
718 | 777 | overlayButton.addActionListener(this); |
---|
.. | .. |
---|
721 | 780 | lightButton.setToolTipText("Create light"); |
---|
722 | 781 | lightButton.addActionListener(this); |
---|
723 | 782 | |
---|
| 783 | + for (int i=6; --i>=0;) |
---|
| 784 | + { |
---|
| 785 | + oe.toolboxPanel.Return(); |
---|
| 786 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 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 | + } |
---|
| 794 | + |
---|
724 | 795 | // EDIT panel |
---|
725 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
726 | | - editButton.setToolTipText("Edit selection"); |
---|
| 796 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + editButton.setToolTipText("Pin selection controls"); |
---|
727 | 798 | editButton.addActionListener(this); |
---|
728 | 799 | |
---|
729 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
730 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 800 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
731 | 802 | uneditButton.addActionListener(this); |
---|
732 | 803 | |
---|
733 | 804 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
734 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 805 | + allParamsButton.setToolTipText("Show all controle"); |
---|
735 | 806 | allParamsButton.addActionListener(this); |
---|
736 | 807 | |
---|
737 | 808 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
742 | 813 | unselectButton.setToolTipText("Unselect"); |
---|
743 | 814 | unselectButton.addActionListener(this); |
---|
744 | 815 | |
---|
| 816 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 818 | + flashSelectionButton.addActionListener(this); |
---|
| 819 | + |
---|
745 | 820 | editCommandsPanel.preferredHeight = 1; |
---|
746 | 821 | |
---|
| 822 | + SetPinStates(false); |
---|
747 | 823 | // oe.treePanel.add(commandsPanel); |
---|
748 | 824 | // oe.treePanel.Return(); |
---|
749 | 825 | |
---|
.. | .. |
---|
768 | 844 | oe.treePanel.add(jSPPanel); |
---|
769 | 845 | oe.treePanel.Return(); |
---|
770 | 846 | |
---|
771 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
772 | | - |
---|
773 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
774 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
775 | | - colorCB.addItemListener(this); |
---|
776 | | - |
---|
777 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
778 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
779 | | - materialCB.addItemListener(this); |
---|
780 | | - |
---|
781 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
782 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
783 | | - textureCB.addItemListener(this); |
---|
784 | | - |
---|
785 | | - copyOptionsPanel.preferredHeight = 1; |
---|
786 | 847 | oe.treePanel.add(copyOptionsPanel); |
---|
787 | 848 | oe.treePanel.Return(); |
---|
| 849 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 850 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 851 | + sliderPane.preferredHeight = 1; |
---|
788 | 852 | |
---|
789 | 853 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
790 | 854 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
813 | 877 | |
---|
814 | 878 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
815 | 879 | { |
---|
| 880 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 881 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 882 | + colorCB.addItemListener(this); |
---|
| 883 | + |
---|
| 884 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 885 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 886 | + materialCB.addItemListener(this); |
---|
| 887 | + |
---|
| 888 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 889 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 890 | + textureCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.Return(); |
---|
| 893 | + |
---|
816 | 894 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
817 | 895 | boxCB.setToolTipText("Display bounding boxes"); |
---|
818 | 896 | boxCB.addItemListener(this); |
---|
819 | 897 | |
---|
820 | 898 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
821 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 899 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
822 | 900 | zoomBoxCB.addItemListener(this); |
---|
823 | 901 | |
---|
824 | 902 | if (true) // Globals.ADVANCED) |
---|
825 | 903 | { |
---|
826 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
827 | | - supportCB.setToolTipText("Enable rigging"); |
---|
828 | | - supportCB.addItemListener(this); |
---|
| 904 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 905 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 906 | +// supportCB.addItemListener(this); |
---|
| 907 | + |
---|
| 908 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 909 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 910 | + freezeCB.addItemListener(this); |
---|
829 | 911 | |
---|
830 | 912 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
831 | 913 | // localCB.addItemListener(this); |
---|
832 | 914 | |
---|
| 915 | + panel.Return(); |
---|
| 916 | + |
---|
833 | 917 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
834 | 918 | crowdCB.setToolTipText("Used for crowds"); |
---|
835 | 919 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
846 | 930 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
847 | 931 | // speakerMocapCB.addItemListener(this); |
---|
848 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + |
---|
849 | 935 | if (false) |
---|
850 | 936 | { |
---|
851 | 937 | // handled in scripts |
---|
.. | .. |
---|
860 | 946 | //constraints.gridy += 1; |
---|
861 | 947 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
862 | 948 | smoothfocusCB.addItemListener(this); |
---|
| 949 | + panel.Return(); |
---|
863 | 950 | } |
---|
864 | 951 | |
---|
865 | 952 | //constraints.gridx += 1; |
---|
866 | 953 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
867 | 954 | // debugCB.addItemListener(this); |
---|
868 | 955 | |
---|
| 956 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 957 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 958 | + trackCB.addItemListener(this); |
---|
| 959 | + |
---|
869 | 960 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
870 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 961 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
871 | 962 | oeilCB.addItemListener(this); |
---|
872 | 963 | |
---|
873 | 964 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
874 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 965 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
875 | 966 | shadowCB.addItemListener(this); |
---|
876 | 967 | |
---|
877 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
878 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
879 | | - autosaveCB.addItemListener(this); |
---|
| 968 | + panel.Return(); |
---|
| 969 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 970 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 971 | + toggleTextureCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 974 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 975 | + toggleSwitchCB.addItemListener(this); |
---|
| 976 | + |
---|
| 977 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 978 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 979 | + autokeepCB.addItemListener(this); |
---|
880 | 980 | |
---|
| 981 | + panel.Return(); |
---|
881 | 982 | if (Globals.ADVANCED) |
---|
882 | 983 | { |
---|
883 | 984 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
888 | 989 | } |
---|
889 | 990 | |
---|
890 | 991 | cGridBag fill = new cGridBag(); |
---|
891 | | - |
---|
892 | 992 | fill.preferredHeight = 200; |
---|
| 993 | + cGridBag fill2 = new cGridBag(); |
---|
| 994 | + fill2.preferredHeight = 200; |
---|
| 995 | + cGridBag fill3 = new cGridBag(); |
---|
| 996 | + fill3.preferredHeight = 200; |
---|
893 | 997 | |
---|
894 | 998 | panel.add(fill); |
---|
| 999 | + panel.add(fill2); |
---|
| 1000 | + panel.add(fill3); |
---|
895 | 1001 | |
---|
896 | 1002 | } |
---|
897 | 1003 | |
---|
.. | .. |
---|
899 | 1005 | { |
---|
900 | 1006 | cRadio radioButton = new cRadio(obj.name); |
---|
901 | 1007 | |
---|
902 | | - // Patch to avoid bug with transparency. |
---|
| 1008 | + // June 2019. Patch to avoid bug with transparency. |
---|
903 | 1009 | radioButton.hadMaterial = obj.material != null; |
---|
904 | 1010 | if (!radioButton.hadMaterial) |
---|
905 | 1011 | { |
---|
.. | .. |
---|
936 | 1042 | cCheckBox slowCB; |
---|
937 | 1043 | cCheckBox boxCB; |
---|
938 | 1044 | cCheckBox zoomBoxCB; |
---|
939 | | - cToggleButton trackCB; |
---|
| 1045 | + cCheckBox freezeCB; |
---|
| 1046 | + //cToggleButton trackCB; |
---|
| 1047 | + cCheckBox trackCB; |
---|
940 | 1048 | cCheckBox smoothfocusCB; |
---|
941 | 1049 | // JCheckBox speakerMocapCB; |
---|
942 | 1050 | cCheckBox speakerCameraCB; |
---|
.. | .. |
---|
945 | 1053 | |
---|
946 | 1054 | cCheckBox oeilCB; |
---|
947 | 1055 | cCheckBox shadowCB; |
---|
948 | | - cCheckBox autosaveCB; |
---|
| 1056 | + cCheckBox autokeepCB; |
---|
949 | 1057 | cCheckBox lookAtCB; |
---|
950 | 1058 | |
---|
951 | 1059 | // static int COLOR = 1; |
---|
.. | .. |
---|
1053 | 1161 | { |
---|
1054 | 1162 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1055 | 1163 | } |
---|
1056 | | - else if(e.getSource() == autosaveCB) |
---|
| 1164 | + else if(e.getSource() == freezeCB) |
---|
1057 | 1165 | { |
---|
1058 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1166 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1167 | + } |
---|
| 1168 | + else if(e.getSource() == autokeepCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.REPLACEONMAKE ^= true; |
---|
1059 | 1171 | } |
---|
1060 | 1172 | else if(e.getSource() == lookAtCB) |
---|
1061 | 1173 | { |
---|
.. | .. |
---|
1137 | 1249 | } |
---|
1138 | 1250 | } |
---|
1139 | 1251 | |
---|
1140 | | - String string = (String) object; |
---|
1141 | | - |
---|
1142 | 1252 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1143 | 1253 | // if( object instanceof java.io.File[]) |
---|
1144 | 1254 | // { |
---|
.. | .. |
---|
1146 | 1256 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1147 | 1257 | // return; |
---|
1148 | 1258 | // } |
---|
| 1259 | + |
---|
| 1260 | + String string = object.toString(); |
---|
1149 | 1261 | |
---|
1150 | 1262 | // File path for Mac and Windows |
---|
1151 | 1263 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1191 | 1303 | |
---|
1192 | 1304 | assert target == objEditor.jTree; |
---|
1193 | 1305 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1306 | + Object3D destinationLeaf; |
---|
1194 | 1307 | try { |
---|
1195 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1308 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1196 | 1309 | } catch (Exception e) { |
---|
1197 | 1310 | System.out.println("destinationPath : " + destinationPath); |
---|
1198 | 1311 | return; |
---|
1199 | 1312 | } |
---|
1200 | 1313 | |
---|
| 1314 | + for (int i=group.selection.size(); --i>=0;) |
---|
| 1315 | + { |
---|
| 1316 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1317 | + |
---|
| 1318 | + // Cannot move into itself |
---|
| 1319 | + if (child == destinationLeaf) |
---|
| 1320 | + return; |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
1201 | 1323 | // june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
1202 | 1324 | // { |
---|
1203 | 1325 | loadClipboard(true); |
---|
.. | .. |
---|
1312 | 1434 | { |
---|
1313 | 1435 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1314 | 1436 | //heightFieldItem.addActionListener(this); |
---|
1315 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1316 | | - gridItem.addActionListener(this); |
---|
1317 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1318 | | - rectoidItem.addActionListener(this); |
---|
1319 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1320 | | - ellipsoidItem.addActionListener(this); |
---|
1321 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1322 | | - coneItem.addActionListener(this); |
---|
1323 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1324 | | - torusItem.addActionListener(this); |
---|
1325 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1326 | | - superItem.addActionListener(this); |
---|
| 1437 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1438 | +// gridItem.addActionListener(this); |
---|
| 1439 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1440 | +// rectoidItem.addActionListener(this); |
---|
| 1441 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1442 | +// ellipsoidItem.addActionListener(this); |
---|
| 1443 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1444 | +// coneItem.addActionListener(this); |
---|
| 1445 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1446 | +// torusItem.addActionListener(this); |
---|
| 1447 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1448 | +// superItem.addActionListener(this); |
---|
| 1449 | + |
---|
| 1450 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1451 | + cameraItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + if (!Globals.ADVANCED) |
---|
| 1454 | + { |
---|
1327 | 1455 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1328 | 1456 | kleinItem.addActionListener(this); |
---|
1329 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1330 | | - particleItem.addActionListener(this); |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
| 1459 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1460 | +// particleItem.addActionListener(this); |
---|
1331 | 1461 | if (Globals.ADVANCED) |
---|
1332 | 1462 | { |
---|
1333 | 1463 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1353 | 1483 | } |
---|
1354 | 1484 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1355 | 1485 | bezierItem.addActionListener(this); |
---|
1356 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1357 | | - overlayItem.addActionListener(this); |
---|
1358 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1359 | | - lightItem.addActionListener(this); |
---|
| 1486 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1487 | +// overlayItem.addActionListener(this); |
---|
| 1488 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1489 | +// lightItem.addActionListener(this); |
---|
1360 | 1490 | menu.add("-"); |
---|
1361 | 1491 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1362 | 1492 | //superLoopItem.addActionListener(this); |
---|
1363 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1364 | | - loopItem.addActionListener(this); |
---|
| 1493 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1494 | +// loopItem.addActionListener(this); |
---|
1365 | 1495 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1366 | 1496 | doubleItem.addActionListener(this); |
---|
1367 | 1497 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1377 | 1507 | animationItem.addItemListener(this); |
---|
1378 | 1508 | animationItem.setState(Globals.ANIMATION); |
---|
1379 | 1509 | |
---|
| 1510 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1511 | + archiveItem.addActionListener(this); |
---|
| 1512 | + |
---|
1380 | 1513 | menu.add("-"); |
---|
1381 | 1514 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1382 | 1515 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1389 | 1522 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1390 | 1523 | reduce34MorphItem.addActionListener(this); |
---|
1391 | 1524 | menu.add("-"); |
---|
| 1525 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1526 | + memoryItem.addActionListener(this); |
---|
1392 | 1527 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1393 | 1528 | computeAOItem.addActionListener(this); |
---|
1394 | 1529 | |
---|
.. | .. |
---|
1397 | 1532 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1398 | 1533 | mirrorItem.addActionListener(this); |
---|
1399 | 1534 | menu.add("-"); |
---|
1400 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1401 | | - memoryItem.addActionListener(this); |
---|
1402 | 1535 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1403 | 1536 | analyzeItem.addActionListener(this); |
---|
1404 | 1537 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1546 | 1679 | |
---|
1547 | 1680 | makeSomething(shadow); |
---|
1548 | 1681 | } |
---|
| 1682 | + |
---|
| 1683 | + private void ClearUnpinned() |
---|
| 1684 | + { |
---|
| 1685 | + //for (Object3D obj : listUI) |
---|
| 1686 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1687 | + { |
---|
| 1688 | + Object3D obj = listUI.elementAt(i); |
---|
| 1689 | + if (!obj.pinned) |
---|
| 1690 | + { |
---|
| 1691 | + obj.CloseUI(); |
---|
| 1692 | + listUI.remove(i); |
---|
| 1693 | + } |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
1549 | 1696 | |
---|
1550 | 1697 | /** |
---|
1551 | 1698 | * applyExample |
---|
.. | .. |
---|
1790 | 1937 | { |
---|
1791 | 1938 | ScreenFit(); |
---|
1792 | 1939 | } else |
---|
1793 | | - if (source == switchItem) |
---|
| 1940 | + if (source == switchViewItem) |
---|
1794 | 1941 | { |
---|
1795 | 1942 | cVector v1 = new cVector(); |
---|
1796 | 1943 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
2020 | 2167 | |
---|
2021 | 2168 | group(g); |
---|
2022 | 2169 | } else |
---|
2023 | | - if (source == loopItem) |
---|
| 2170 | + if (source == loopItem || source == loopButton) |
---|
2024 | 2171 | { |
---|
2025 | 2172 | Composite csg = new GroupLeaf(); |
---|
2026 | 2173 | csg.count = 5; |
---|
2027 | 2174 | group(csg); |
---|
2028 | | - Composite child = new cGroup(); |
---|
| 2175 | + Composite child = new cGroup("Branch"); |
---|
2029 | 2176 | csg.addChild(child); |
---|
2030 | 2177 | child.addChild(csg); |
---|
2031 | 2178 | } else |
---|
2032 | 2179 | if (source == doubleItem) |
---|
2033 | 2180 | { |
---|
2034 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Fork"); |
---|
2035 | 2182 | csg.count = 5; |
---|
2036 | 2183 | group(csg); |
---|
2037 | | - Composite child = new cGroup(); |
---|
| 2184 | + Composite child = new cGroup("Branch A"); |
---|
2038 | 2185 | csg.addChild(child); |
---|
2039 | 2186 | child.addChild(csg); |
---|
2040 | | - child = new cGroup(); |
---|
| 2187 | + child = new cGroup("Branch B"); |
---|
2041 | 2188 | csg.addChild(child); |
---|
2042 | 2189 | child.addChild(csg); |
---|
2043 | 2190 | } else |
---|
2044 | 2191 | if (source == tripleItem) |
---|
2045 | 2192 | { |
---|
2046 | | - Composite csg = new GroupLeaf(); |
---|
| 2193 | + Composite csg = new GroupLeaf("Trident"); |
---|
2047 | 2194 | csg.count = 4; |
---|
2048 | 2195 | group(csg); |
---|
2049 | 2196 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2107 | 2254 | } else |
---|
2108 | 2255 | if (source == undoButton) |
---|
2109 | 2256 | { |
---|
| 2257 | + // Go to previous version |
---|
| 2258 | + //if (!Undo()) |
---|
| 2259 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2110 | 2260 | Undo(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == restoreButton) |
---|
| 2263 | + { |
---|
| 2264 | + // Restore current version |
---|
| 2265 | + Restore(); |
---|
| 2266 | + } else |
---|
| 2267 | + if (source == replaceButton) |
---|
| 2268 | + { |
---|
| 2269 | + // Overwrite current version |
---|
| 2270 | + Replace(); |
---|
2111 | 2271 | } else |
---|
2112 | 2272 | if (source == redoButton) |
---|
2113 | 2273 | { |
---|
| 2274 | + // Go to next version |
---|
2114 | 2275 | Redo(); |
---|
2115 | 2276 | } else |
---|
2116 | 2277 | if (source == saveButton) |
---|
2117 | 2278 | { |
---|
2118 | | - Save(); |
---|
| 2279 | + // Save a new version |
---|
| 2280 | + if (!Save(true)) |
---|
| 2281 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2119 | 2282 | } else |
---|
2120 | 2283 | if (source == oneStepButton) |
---|
2121 | 2284 | { |
---|
.. | .. |
---|
2124 | 2287 | } else |
---|
2125 | 2288 | if (source == screenfitButton) |
---|
2126 | 2289 | { |
---|
2127 | | - //Reload(lastConverter, lastFilename, true); |
---|
2128 | 2290 | ScreenFit(); |
---|
2129 | 2291 | } else |
---|
2130 | 2292 | if (source == screenfitpointButton) |
---|
2131 | 2293 | { |
---|
2132 | | - //Reload(lastConverter, lastFilename, true); |
---|
2133 | 2294 | ScreenFitPoint(); |
---|
2134 | 2295 | } else |
---|
2135 | 2296 | if (source == snapobjectButton) |
---|
2136 | 2297 | { |
---|
2137 | | - //Reload(lastConverter, lastFilename, true); |
---|
2138 | 2298 | SnapObject(); |
---|
2139 | 2299 | } else |
---|
2140 | 2300 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2510 | 2670 | { |
---|
2511 | 2671 | ClearSelection(true); |
---|
2512 | 2672 | } else |
---|
2513 | | - if (source == grabItem) |
---|
| 2673 | + if (source == grabItem || source == groupButton) |
---|
2514 | 2674 | { |
---|
2515 | | - group(new cGroup(), true); |
---|
| 2675 | + group(new cGroup(), false); // true); |
---|
2516 | 2676 | } else |
---|
2517 | 2677 | if (source == hideItem) |
---|
2518 | 2678 | { |
---|
.. | .. |
---|
2530 | 2690 | { |
---|
2531 | 2691 | makeSomething(new Camera()); |
---|
2532 | 2692 | } else |
---|
2533 | | - if (source == compositeItem) |
---|
| 2693 | + if (source == compositeItem || source == compositeButton) |
---|
2534 | 2694 | { |
---|
2535 | 2695 | group(new Composite()); |
---|
2536 | 2696 | } else |
---|
2537 | | - if (source == randomItem) |
---|
| 2697 | + if (source == switchItem || source == switchButton) |
---|
2538 | 2698 | { |
---|
2539 | 2699 | RandomNode random = new RandomNode(); |
---|
2540 | 2700 | group(random); |
---|
.. | .. |
---|
2636 | 2796 | { |
---|
2637 | 2797 | group(new cLinker()); |
---|
2638 | 2798 | } else |
---|
2639 | | - if (source == textureItem) |
---|
| 2799 | + if (source == textureItem || source == textureButton) |
---|
2640 | 2800 | { |
---|
2641 | 2801 | group(new TextureNode()); |
---|
2642 | 2802 | } else |
---|
.. | .. |
---|
2658 | 2818 | } else |
---|
2659 | 2819 | if (source == ungroupItem || source == ungroupButton) |
---|
2660 | 2820 | { |
---|
2661 | | - //ungroup(); |
---|
| 2821 | + boolean hasRoot = false; |
---|
| 2822 | + |
---|
2662 | 2823 | for (int i=0; i<group.selection.size(); i++) |
---|
2663 | 2824 | { |
---|
2664 | | - Ungroup(group.selection.get(i)); |
---|
| 2825 | + if (group.selection.get(i) == group) |
---|
| 2826 | + { |
---|
| 2827 | + hasRoot = true; |
---|
| 2828 | + break; |
---|
| 2829 | + } |
---|
2665 | 2830 | } |
---|
2666 | 2831 | |
---|
2667 | | - ClearSelection(false); |
---|
2668 | | - |
---|
2669 | | - refreshContents(); |
---|
| 2832 | + if (!hasRoot) |
---|
| 2833 | + { |
---|
| 2834 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2835 | + { |
---|
| 2836 | + Ungroup(group.selection.get(i)); |
---|
| 2837 | + } |
---|
| 2838 | + |
---|
| 2839 | + ClearSelection(false); |
---|
| 2840 | + |
---|
| 2841 | + refreshContents(); |
---|
| 2842 | + } |
---|
2670 | 2843 | } else |
---|
2671 | 2844 | if (source == genUVItem) |
---|
2672 | 2845 | { |
---|
.. | .. |
---|
3258 | 3431 | } else |
---|
3259 | 3432 | if (source == editItem || source == editButton) |
---|
3260 | 3433 | { |
---|
| 3434 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3435 | + { |
---|
| 3436 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3437 | + child.pinned = true; |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
3261 | 3440 | EditSelection(false); |
---|
3262 | 3441 | } else |
---|
3263 | 3442 | if (source == uneditButton) |
---|
.. | .. |
---|
3267 | 3446 | Object3D child = (Object3D)e.nextElement(); |
---|
3268 | 3447 | if(child.editWindow != null) |
---|
3269 | 3448 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3449 | + child.pinned = false; |
---|
3270 | 3450 | child.CloseUI(); |
---|
3271 | 3451 | listUI.remove(child); |
---|
3272 | 3452 | |
---|
.. | .. |
---|
3283 | 3463 | //copy.ClearUI(); |
---|
3284 | 3464 | for (Object3D obj : listUI) |
---|
3285 | 3465 | { |
---|
| 3466 | + obj.pinned = false; |
---|
3286 | 3467 | obj.CloseUI(); |
---|
3287 | 3468 | } |
---|
3288 | 3469 | listUI.clear(); |
---|
.. | .. |
---|
3292 | 3473 | { |
---|
3293 | 3474 | assert(copy == group); |
---|
3294 | 3475 | |
---|
3295 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3476 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3296 | 3477 | |
---|
3297 | 3478 | for (Object3D obj : listUI) |
---|
3298 | 3479 | { |
---|
.. | .. |
---|
3341 | 3522 | } |
---|
3342 | 3523 | |
---|
3343 | 3524 | copy = group; |
---|
| 3525 | + |
---|
| 3526 | + SetUndoStates(); |
---|
| 3527 | + |
---|
3344 | 3528 | //Globals.theRenderer.object = group; |
---|
3345 | 3529 | if(!useclient) |
---|
3346 | 3530 | { |
---|
.. | .. |
---|
3367 | 3551 | currentLayout = sevenButton; |
---|
3368 | 3552 | */ |
---|
3369 | 3553 | radio.layout.doClick(); |
---|
| 3554 | + |
---|
| 3555 | + ClearUnpinned(); |
---|
| 3556 | + Grafreed.Assert(group != null); |
---|
| 3557 | + Grafreed.Assert(group.selection != null); |
---|
| 3558 | + SetPinStates(group.selection.size() > 0); |
---|
| 3559 | + if (group.selection.size() == 1) |
---|
| 3560 | + EditSelection(false); |
---|
3370 | 3561 | keepparent = group.parent; |
---|
3371 | 3562 | // PARENT = NULL or not??? |
---|
3372 | 3563 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3380 | 3571 | cameraView.ProtectCamera(); |
---|
3381 | 3572 | cameraView.repaint(); |
---|
3382 | 3573 | return; |
---|
3383 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3574 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3384 | 3575 | { |
---|
3385 | 3576 | cameraView.RevertCamera(); |
---|
3386 | 3577 | cameraView.repaint(); |
---|
.. | .. |
---|
4434 | 4625 | // } |
---|
4435 | 4626 | // } |
---|
4436 | 4627 | |
---|
4437 | | - static boolean allparams = true; |
---|
4438 | | - |
---|
4439 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4440 | | - |
---|
4441 | 4628 | void EditSelection(boolean newWindow) |
---|
4442 | 4629 | { |
---|
4443 | 4630 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4530 | 4717 | //new Exception().printStackTrace(); |
---|
4531 | 4718 | |
---|
4532 | 4719 | freezemodel = true; |
---|
4533 | | - |
---|
| 4720 | + ClearUnpinned(); |
---|
| 4721 | + |
---|
4534 | 4722 | /**/ |
---|
4535 | 4723 | //switch (event.id) |
---|
4536 | 4724 | { |
---|
.. | .. |
---|
4563 | 4751 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4564 | 4752 | // a camera |
---|
4565 | 4753 | { |
---|
4566 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4754 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4567 | 4755 | { |
---|
4568 | 4756 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4569 | 4757 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4572 | 4760 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4573 | 4761 | } |
---|
4574 | 4762 | |
---|
| 4763 | + if (tps != null && tps.length == 1) |
---|
| 4764 | + { |
---|
| 4765 | + EditSelection(false); |
---|
| 4766 | + } |
---|
| 4767 | + |
---|
| 4768 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4769 | + |
---|
4575 | 4770 | refreshContents(); |
---|
4576 | 4771 | //return true; |
---|
4577 | 4772 | } |
---|
.. | .. |
---|
4581 | 4776 | freezemodel = false; |
---|
4582 | 4777 | } |
---|
4583 | 4778 | |
---|
| 4779 | + void SetPinStates(boolean enabled) |
---|
| 4780 | + { |
---|
| 4781 | + editButton.setEnabled(enabled); |
---|
| 4782 | + uneditButton.setEnabled(enabled); |
---|
| 4783 | + unselectButton.setEnabled(enabled); |
---|
| 4784 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4785 | + } |
---|
| 4786 | + |
---|
4584 | 4787 | void refreshContents(boolean cp) |
---|
4585 | 4788 | { |
---|
4586 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4789 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4790 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4587 | 4791 | { |
---|
4588 | 4792 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4589 | 4793 | |
---|
.. | .. |
---|
4682 | 4886 | |
---|
4683 | 4887 | if (cut) |
---|
4684 | 4888 | { |
---|
4685 | | - if (Globals.SAVEONMAKE) |
---|
4686 | | - Save(); |
---|
| 4889 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4890 | +// Save(); |
---|
4687 | 4891 | //int indices[] = jList.getSelectedIndices(); |
---|
4688 | 4892 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4689 | 4893 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4786 | 4990 | |
---|
4787 | 4991 | void paste(boolean expand) |
---|
4788 | 4992 | { |
---|
| 4993 | + if (Globals.REPLACEONMAKE) |
---|
| 4994 | + Save(); |
---|
| 4995 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4996 | + Globals.REPLACEONMAKE = false; |
---|
4789 | 4997 | // if (GrafreeD.clipboard == null) |
---|
4790 | 4998 | // return; |
---|
4791 | 4999 | boolean first = true; |
---|
.. | .. |
---|
4845 | 5053 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4846 | 5054 | } |
---|
4847 | 5055 | |
---|
| 5056 | + Globals.REPLACEONMAKE = keep; |
---|
4848 | 5057 | ResetModel(); |
---|
4849 | 5058 | refreshContents(); |
---|
4850 | 5059 | } |
---|
.. | .. |
---|
4980 | 5189 | |
---|
4981 | 5190 | void group(Object3D csg, boolean grab) |
---|
4982 | 5191 | { |
---|
| 5192 | + if (Globals.REPLACEONMAKE) |
---|
| 5193 | + Save(); |
---|
| 5194 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5195 | + Globals.REPLACEONMAKE = false; |
---|
4983 | 5196 | if (//false) // why?? |
---|
4984 | 5197 | !group.selection.isEmpty()) |
---|
4985 | 5198 | { |
---|
.. | .. |
---|
5093 | 5306 | //node.add(csg); |
---|
5094 | 5307 | //makeSomething(node); |
---|
5095 | 5308 | makeSomething(csg); |
---|
| 5309 | + Globals.REPLACEONMAKE = keep; |
---|
5096 | 5310 | } |
---|
5097 | 5311 | |
---|
5098 | 5312 | void Ungroup(Object3D g) |
---|
5099 | 5313 | { |
---|
| 5314 | + if (Globals.REPLACEONMAKE) |
---|
| 5315 | + Save(); |
---|
| 5316 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5317 | + Globals.REPLACEONMAKE = false; |
---|
5100 | 5318 | if (g instanceof HiddenObject) |
---|
5101 | 5319 | { |
---|
5102 | 5320 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5113 | 5331 | objEditor.makeSomething(g.get(i), false); |
---|
5114 | 5332 | } |
---|
5115 | 5333 | } |
---|
| 5334 | + Globals.REPLACEONMAKE = keep; |
---|
5116 | 5335 | } |
---|
5117 | 5336 | |
---|
5118 | 5337 | void ungroup() |
---|
.. | .. |
---|
5401 | 5620 | cButton clearpanelButton; |
---|
5402 | 5621 | cButton unselectButton; |
---|
5403 | 5622 | |
---|
5404 | | - cButton minButton; |
---|
5405 | | - cButton maxButton; |
---|
5406 | | - cButton fullButton; |
---|
5407 | | - cButton undoButton; |
---|
5408 | | - cButton redoButton; |
---|
| 5623 | + cButton restoreCameraButton; |
---|
| 5624 | + |
---|
5409 | 5625 | cButton saveButton; |
---|
5410 | 5626 | cButton oneStepButton; |
---|
5411 | 5627 | |
---|
5412 | 5628 | cButton groupButton; |
---|
5413 | 5629 | cButton ungroupButton; |
---|
5414 | 5630 | cButton compositeButton; |
---|
| 5631 | + cButton switchButton; |
---|
| 5632 | + cButton loopButton; |
---|
| 5633 | + cButton textureButton; |
---|
5415 | 5634 | |
---|
5416 | 5635 | cButton gridButton; |
---|
5417 | 5636 | cButton boxButton; |
---|
.. | .. |
---|
5444 | 5663 | //JTree jTree; |
---|
5445 | 5664 | private MenuItem lookAtItem; |
---|
5446 | 5665 | private MenuItem lookFromItem; |
---|
5447 | | - private MenuItem switchItem; |
---|
| 5666 | + private MenuItem switchViewItem; |
---|
5448 | 5667 | private MenuItem cutItem; |
---|
5449 | 5668 | private MenuItem undoItem; |
---|
5450 | 5669 | private MenuItem redoItem; |
---|
.. | .. |
---|
5536 | 5755 | private MenuItem frontItem; |
---|
5537 | 5756 | private MenuItem cameraItem; |
---|
5538 | 5757 | private MenuItem compositeItem; |
---|
5539 | | - private MenuItem randomItem; |
---|
| 5758 | + private MenuItem switchItem; |
---|
5540 | 5759 | private MenuItem physicsItem; |
---|
5541 | 5760 | private MenuItem frameselectorItem; |
---|
5542 | 5761 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5610 | 5829 | |
---|
5611 | 5830 | Menu cameraMenu; |
---|
5612 | 5831 | MenuItem editCameraItem; |
---|
5613 | | - MenuItem revertCameraItem; |
---|
| 5832 | + MenuItem restoreCameraItem; |
---|
5614 | 5833 | } |
---|