.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row3) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + skyboxButton.setToolTipText(s); |
---|
| 33 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 34 | + { |
---|
| 35 | + @Override |
---|
| 36 | + public void actionPerformed(ActionEvent e) |
---|
| 37 | + { |
---|
| 38 | + ChangeSkybox(path); |
---|
| 39 | + } |
---|
| 40 | + }); |
---|
| 41 | + } |
---|
| 42 | + |
---|
| 43 | + public void ChangeSkybox(String name) |
---|
| 44 | + { |
---|
| 45 | + cameraView.envyoff = false; |
---|
| 46 | + cameraView.skyboxname = name; |
---|
| 47 | + cameraView.skyboxext = "jpg"; |
---|
| 48 | + cameraView.repaint(); |
---|
| 49 | + } |
---|
| 50 | + |
---|
26 | 51 | //ObjEditor objEditor; |
---|
27 | 52 | public void closeUI2() |
---|
28 | 53 | { |
---|
.. | .. |
---|
60 | 85 | this.copy = this.group = group; |
---|
61 | 86 | //selectees = this.group.selectees; |
---|
62 | 87 | |
---|
| 88 | + if (copy.versions == null) |
---|
| 89 | + { |
---|
| 90 | + copy.versions = new byte[100][]; |
---|
| 91 | + copy.versionindex = -1; |
---|
| 92 | + } |
---|
| 93 | + |
---|
63 | 94 | if(ui) |
---|
64 | 95 | SetupUI(objEditor); |
---|
65 | 96 | } |
---|
.. | .. |
---|
80 | 111 | SetupViews(objEditor); |
---|
81 | 112 | |
---|
82 | 113 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 114 | + |
---|
| 115 | + if (copy.versions == null) |
---|
| 116 | + { |
---|
| 117 | + copy.versions = new byte[100][]; |
---|
| 118 | + copy.versionindex = -1; |
---|
| 119 | + |
---|
| 120 | + Save(true); |
---|
| 121 | + } |
---|
83 | 122 | } |
---|
84 | 123 | |
---|
85 | 124 | void CloneSelection(boolean supports) |
---|
86 | 125 | { |
---|
| 126 | + if (Globals.REPLACEONMAKE) |
---|
| 127 | + Save(); |
---|
| 128 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 129 | + Globals.REPLACEONMAKE = false; |
---|
87 | 130 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 131 | //Object3D obj; |
---|
89 | 132 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 137 | |
---|
95 | 138 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 139 | } |
---|
| 140 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 141 | } |
---|
98 | 142 | |
---|
99 | 143 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
189 | 233 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 234 | // pasteExpandItem.addActionListener(this); |
---|
191 | 235 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 236 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 237 | + deleteItem.addActionListener(this); |
---|
194 | 238 | |
---|
195 | 239 | if (Globals.ADVANCED) |
---|
196 | 240 | { |
---|
.. | .. |
---|
220 | 264 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 265 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 266 | |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 267 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 268 | toggleHandleItem.addItemListener(this); |
---|
225 | 269 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 270 | |
---|
.. | .. |
---|
380 | 424 | shadowYItem.addActionListener(this); |
---|
381 | 425 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 426 | shadowZItem.addActionListener(this); |
---|
| 427 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 428 | + attributeItem.addActionListener(this); |
---|
| 429 | + |
---|
383 | 430 | if (Globals.ADVANCED) |
---|
384 | 431 | { |
---|
385 | 432 | menu.add("-"); |
---|
386 | 433 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 434 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 435 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 436 | templateItem.addActionListener(this); |
---|
392 | 437 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 460 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 461 | if (Globals.ADVANCED) |
---|
417 | 462 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 463 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 464 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 465 | } |
---|
421 | 466 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
508 | 553 | attachBumpItem.addActionListener(this); |
---|
509 | 554 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
510 | 555 | pigmentBumpItem.addActionListener(this); |
---|
| 556 | + //embedTexturesItem |
---|
511 | 557 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
512 | 558 | detachPigmentItem.addActionListener(this); |
---|
513 | 559 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
514 | 560 | detachBumpItem.addActionListener(this); |
---|
| 561 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 562 | + embedTexturesItem.addActionListener(this); |
---|
| 563 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 564 | + deEmbedTexturesItem.addActionListener(this); |
---|
515 | 565 | menu.add("-"); |
---|
516 | 566 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
517 | 567 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
538 | 588 | buildToolsMenu(menu); |
---|
539 | 589 | } |
---|
540 | 590 | |
---|
| 591 | + |
---|
541 | 592 | void SetupUI2(ObjEditor oe) |
---|
542 | 593 | { |
---|
543 | 594 | // June 2019 |
---|
.. | .. |
---|
590 | 641 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 642 | //minButton.addActionListener(this); |
---|
592 | 643 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 644 | + if (Globals.ADVANCED) |
---|
| 645 | + { |
---|
| 646 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + maxButton.setToolTipText("Maximize window"); |
---|
| 648 | + maxButton.addActionListener(this); |
---|
| 649 | + } |
---|
596 | 650 | |
---|
597 | 651 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 652 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 653 | fullButton.addActionListener(this); |
---|
600 | 654 | |
---|
| 655 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 657 | + screenfitButton.addActionListener(this); |
---|
| 658 | + |
---|
601 | 659 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 660 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 661 | restoreCameraButton.addActionListener(this); |
---|
604 | 662 | |
---|
| 663 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + saveButton.setToolTipText("New version"); |
---|
| 665 | + saveButton.addActionListener(this); |
---|
| 666 | + |
---|
605 | 667 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 668 | + undoButton.setToolTipText("Previous version"); |
---|
607 | 669 | undoButton.addActionListener(this); |
---|
608 | 670 | undoButton.setEnabled(false); |
---|
609 | 671 | |
---|
| 672 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 673 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 674 | + restoreButton.setToolTipText("Restore current"); |
---|
| 675 | + restoreButton.addActionListener(this); |
---|
| 676 | + restoreButton.setEnabled(false); |
---|
| 677 | + |
---|
| 678 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + replaceButton.setToolTipText("Replace current"); |
---|
| 680 | + replaceButton.addActionListener(this); |
---|
| 681 | + replaceButton.setEnabled(false); |
---|
| 682 | + |
---|
| 683 | + copyOptionsPanel.add(updown); |
---|
| 684 | + |
---|
610 | 685 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
611 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 686 | + redoButton.setToolTipText("Next version"); |
---|
612 | 687 | redoButton.addActionListener(this); |
---|
613 | 688 | redoButton.setEnabled(false); |
---|
614 | 689 | |
---|
615 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
616 | | - saveButton.setToolTipText("Save changes"); |
---|
617 | | - saveButton.addActionListener(this); |
---|
618 | | - |
---|
619 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
620 | 691 | liveCB.setToolTipText("Enable animation"); |
---|
621 | 692 | liveCB.addItemListener(this); |
---|
622 | 693 | |
---|
623 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 695 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
625 | 696 | oneStepButton.addActionListener(this); |
---|
626 | 697 | |
---|
627 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 698 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
628 | 699 | fastCB.setToolTipText("Fast mode"); |
---|
629 | 700 | fastCB.addItemListener(this); |
---|
630 | 701 | |
---|
631 | 702 | //oe.toolboxPanel.Return(); |
---|
632 | 703 | |
---|
633 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
635 | | - screenfitButton.addActionListener(this); |
---|
636 | | - |
---|
637 | 704 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
638 | 705 | // trackCB.setToolTipText("Enable tracking"); |
---|
639 | 706 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
646 | 713 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
647 | 714 | snapobjectButton.addActionListener(this); |
---|
648 | 715 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 716 | + |
---|
| 717 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 718 | + fourButton.addActionListener(this); |
---|
| 719 | + fourButton.setToolTipText("Show control panel only"); |
---|
649 | 720 | } |
---|
650 | 721 | |
---|
651 | 722 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
652 | 723 | |
---|
653 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 724 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 725 | + twoButton.setToolTipText("Show 3D view only"); |
---|
655 | 726 | twoButton.addActionListener(this); |
---|
656 | 727 | this.fullscreenLayout = twoButton; |
---|
657 | 728 | |
---|
658 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
659 | | - fourButton.addActionListener(this); |
---|
660 | | - fourButton.setToolTipText("Show left panel only"); |
---|
661 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | | - sixButton.setToolTipText("2-column layout left"); |
---|
663 | | - sixButton.addActionListener(this); |
---|
664 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
665 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 729 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
666 | 731 | threeButton.addActionListener(this); |
---|
667 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - sevenButton.setToolTipText("3-column layout"); |
---|
669 | | - sevenButton.addActionListener(this); |
---|
| 732 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 734 | + sixButton.addActionListener(this); |
---|
| 735 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 737 | +// sevenButton.addActionListener(this); |
---|
670 | 738 | // |
---|
671 | 739 | |
---|
672 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
673 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 740 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
674 | 742 | rootButton.addActionListener(this); |
---|
675 | 743 | |
---|
676 | 744 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
679 | 747 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
680 | 748 | //clearButton.addActionListener(this); |
---|
681 | 749 | |
---|
| 750 | + cGridBag row1 = new cGridBag(); |
---|
| 751 | + |
---|
682 | 752 | // INSERT |
---|
683 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
684 | 754 | gridButton.setToolTipText("Create grid"); |
---|
685 | 755 | gridButton.addActionListener(this); |
---|
686 | 756 | |
---|
687 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 757 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
688 | 758 | boxButton.setToolTipText("Create box"); |
---|
689 | 759 | boxButton.addActionListener(this); |
---|
690 | 760 | |
---|
691 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 761 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
692 | 762 | sphereButton.setToolTipText("Create sphere"); |
---|
693 | 763 | sphereButton.addActionListener(this); |
---|
694 | 764 | |
---|
695 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
696 | 766 | coneButton.setToolTipText("Create cone"); |
---|
697 | 767 | coneButton.addActionListener(this); |
---|
698 | 768 | |
---|
699 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
700 | 770 | torusButton.setToolTipText("Create torus"); |
---|
701 | 771 | torusButton.addActionListener(this); |
---|
702 | 772 | |
---|
703 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 773 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
704 | 774 | superButton.setToolTipText("Create superellipsoid"); |
---|
705 | 775 | superButton.addActionListener(this); |
---|
706 | 776 | |
---|
.. | .. |
---|
711 | 781 | kleinButton.addActionListener(this); |
---|
712 | 782 | } |
---|
713 | 783 | |
---|
714 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 784 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
715 | 785 | particlesButton.setToolTipText("Create particle system"); |
---|
716 | 786 | particlesButton.addActionListener(this); |
---|
717 | 787 | |
---|
718 | | - oe.toolboxPanel.Return(); |
---|
| 788 | + oe.toolboxPanel.add(row1); |
---|
719 | 789 | |
---|
720 | | - oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 790 | + cGridBag row2 = new cGridBag(); |
---|
| 791 | + |
---|
| 792 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
721 | 793 | groupButton.setToolTipText("Create group"); |
---|
722 | 794 | groupButton.addActionListener(this); |
---|
723 | 795 | |
---|
724 | | - oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 796 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
725 | 797 | compositeButton.setToolTipText("Create composite"); |
---|
726 | 798 | compositeButton.addActionListener(this); |
---|
727 | 799 | |
---|
728 | | - oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
729 | | - switchButton.setToolTipText("Create switch"); |
---|
| 800 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + switchButton.setToolTipText("Create item switcher"); |
---|
730 | 802 | switchButton.addActionListener(this); |
---|
731 | 803 | |
---|
732 | | - oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 804 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
733 | 805 | loopButton.setToolTipText("Create loop"); |
---|
734 | 806 | loopButton.addActionListener(this); |
---|
735 | 807 | |
---|
736 | | - oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 808 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
737 | 809 | textureButton.setToolTipText("Create texture"); |
---|
738 | 810 | textureButton.addActionListener(this); |
---|
739 | 811 | |
---|
740 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 812 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
741 | 813 | overlayButton.setToolTipText("Create overlay"); |
---|
742 | 814 | overlayButton.addActionListener(this); |
---|
743 | 815 | |
---|
744 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 816 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
745 | 817 | lightButton.setToolTipText("Create light"); |
---|
746 | 818 | lightButton.addActionListener(this); |
---|
747 | 819 | |
---|
748 | | - for (int i=6; --i>=0;) |
---|
| 820 | + oe.toolboxPanel.add(row2); |
---|
| 821 | + |
---|
| 822 | + // ENVYMAPS |
---|
| 823 | + cGridBag row3 = new cGridBag(); |
---|
| 824 | + row3.preferredHeight = 20; |
---|
| 825 | + |
---|
| 826 | + AddSkyboxButton("default", "rgb", row3); |
---|
| 827 | + AddSkyboxButton("default", "cornell", row3); |
---|
| 828 | + AddSkyboxButton("default", "uffizi", row3); |
---|
| 829 | + AddSkyboxButton("default", "CloudyHills", row3); |
---|
| 830 | + AddSkyboxButton("default", "skycube", row3); |
---|
| 831 | + |
---|
| 832 | + oe.toolboxPanel.add(row3); |
---|
| 833 | + |
---|
| 834 | + cGridBag row4 = new cGridBag(); |
---|
| 835 | + row4.preferredHeight = 20; |
---|
| 836 | + |
---|
| 837 | + AddSkyboxButton("bridge", "Bridge2", row4); |
---|
| 838 | + AddSkyboxButton("urban", "GamlaStan2", row4); |
---|
| 839 | + AddSkyboxButton("urban", "Parliament", row4); |
---|
| 840 | + AddSkyboxButton("urban", "Roundabout", row4); |
---|
| 841 | + |
---|
| 842 | + oe.toolboxPanel.add(row4); |
---|
| 843 | + |
---|
| 844 | + cGridBag row5 = new cGridBag(); |
---|
| 845 | + row5.preferredHeight = 20; |
---|
| 846 | + |
---|
| 847 | + AddSkyboxButton("urban", "SaintLazarusChurch", row5); |
---|
| 848 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row5); |
---|
| 849 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row5); |
---|
| 850 | + AddSkyboxButton("urban", "UnionSquare", row5); |
---|
| 851 | + |
---|
| 852 | + oe.toolboxPanel.add(row5); |
---|
| 853 | + |
---|
| 854 | + cGridBag row6 = new cGridBag(); |
---|
| 855 | + row6.preferredHeight = 20; |
---|
| 856 | + |
---|
| 857 | + AddSkyboxButton("park", "BerzeliiPark", row6); |
---|
| 858 | + AddSkyboxButton("park", "Buddha", row6); |
---|
| 859 | + AddSkyboxButton("park", "CNTower2", row6); |
---|
| 860 | + //AddSkyboxButton("park", "Fatbursparken", row6); |
---|
| 861 | + AddSkyboxButton("park", "NiagaraFalls1", row6); |
---|
| 862 | + |
---|
| 863 | + oe.toolboxPanel.add(row6); |
---|
| 864 | + |
---|
| 865 | + cGridBag row7 = new cGridBag(); |
---|
| 866 | + row7.preferredHeight = 20; |
---|
| 867 | + |
---|
| 868 | + AddSkyboxButton("park", "NiagaraFalls3", row7); |
---|
| 869 | + AddSkyboxButton("park", "Park", row7); |
---|
| 870 | + //AddSkyboxButton("park", "Park2", row6); |
---|
| 871 | + //AddSkyboxButton("park", "Path", row6); |
---|
| 872 | + AddSkyboxButton("park", "Pond", row7); |
---|
| 873 | + AddSkyboxButton("park", "Skansen", row7); |
---|
| 874 | + |
---|
| 875 | + oe.toolboxPanel.add(row7); |
---|
| 876 | + |
---|
| 877 | + cGridBag row8 = new cGridBag(); |
---|
| 878 | + row8.preferredHeight = 20; |
---|
| 879 | + |
---|
| 880 | + AddSkyboxButton("park", "Skansen2", row8); |
---|
| 881 | + AddSkyboxButton("park", "Skansen3", row8); |
---|
| 882 | + AddSkyboxButton("park", "Skansen4", row8); |
---|
| 883 | + AddSkyboxButton("park", "Skansen5", row8); |
---|
| 884 | + |
---|
| 885 | + oe.toolboxPanel.add(row8); |
---|
| 886 | + |
---|
| 887 | + cGridBag row9 = new cGridBag(); |
---|
| 888 | + row9.preferredHeight = 20; |
---|
| 889 | + |
---|
| 890 | + AddSkyboxButton("park", "Stairs", row9); |
---|
| 891 | + //AddSkyboxButton("park", "Tantolunden", row6); |
---|
| 892 | + //AddSkyboxButton("park", "Tantolunden3", row6); |
---|
| 893 | + AddSkyboxButton("park", "Tantolunden4", row9); |
---|
| 894 | + |
---|
| 895 | + oe.toolboxPanel.add(row9); |
---|
| 896 | +/* |
---|
| 897 | +BerzeliiPark |
---|
| 898 | +Buddha |
---|
| 899 | +CNTower2 |
---|
| 900 | +Fatbursparken |
---|
| 901 | +NiagaraFalls1 |
---|
| 902 | +NiagaraFalls3 |
---|
| 903 | +Park |
---|
| 904 | +Park2 |
---|
| 905 | +Path |
---|
| 906 | +Pond |
---|
| 907 | +Skansen |
---|
| 908 | +Skansen2 |
---|
| 909 | +Skansen3 |
---|
| 910 | +Skansen4 |
---|
| 911 | +Skansen5 |
---|
| 912 | +Stairs |
---|
| 913 | +Tantolunden |
---|
| 914 | +Tantolunden3 |
---|
| 915 | +Tantolunden4 |
---|
| 916 | + */ |
---|
| 917 | + |
---|
| 918 | + for (int i=1; --i>=0;) |
---|
749 | 919 | { |
---|
750 | | - oe.toolboxPanel.Return(); |
---|
751 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
752 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
753 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
754 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
755 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
756 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
757 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
| 920 | + //oe.toolboxPanel.Return(); |
---|
| 921 | + oe.toolboxPanel.add(new cGridBag()); |
---|
758 | 922 | } |
---|
759 | 923 | |
---|
760 | 924 | // EDIT panel |
---|
.. | .. |
---|
811 | 975 | |
---|
812 | 976 | oe.treePanel.add(copyOptionsPanel); |
---|
813 | 977 | oe.treePanel.Return(); |
---|
| 978 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 979 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 980 | + sliderPane.preferredHeight = 1; |
---|
814 | 981 | |
---|
815 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
816 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 982 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 983 | + mainPanel.setResizeWeight(0.4); |
---|
817 | 984 | |
---|
818 | 985 | //jList.addListSelectionListener(this); |
---|
819 | 986 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
821 | 988 | //jTree.setEditable(true); |
---|
822 | 989 | oe.jTree.setDragEnabled(true); |
---|
823 | 990 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
824 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 991 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
825 | 992 | |
---|
826 | 993 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
827 | 994 | |
---|
.. | .. |
---|
833 | 1000 | dgr.addDragGestureListener(this); |
---|
834 | 1001 | }catch(Exception e) {} |
---|
835 | 1002 | */ |
---|
836 | | - radio.layout = sevenButton; |
---|
| 1003 | + radio.layout = sixButton; // sevenButton; |
---|
837 | 1004 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
838 | 1005 | } |
---|
839 | 1006 | |
---|
.. | .. |
---|
863 | 1030 | |
---|
864 | 1031 | if (true) // Globals.ADVANCED) |
---|
865 | 1032 | { |
---|
866 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
867 | | - supportCB.setToolTipText("Enable rigging"); |
---|
868 | | - supportCB.addItemListener(this); |
---|
| 1033 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1034 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1035 | +// supportCB.addItemListener(this); |
---|
| 1036 | + |
---|
| 1037 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1038 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1039 | + freezeCB.addItemListener(this); |
---|
869 | 1040 | |
---|
870 | 1041 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
871 | 1042 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
929 | 1100 | toggleTextureCB.addItemListener(this); |
---|
930 | 1101 | |
---|
931 | 1102 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
932 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 1103 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
933 | 1104 | toggleSwitchCB.addItemListener(this); |
---|
934 | 1105 | |
---|
935 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
936 | | - autosaveCB.setToolTipText("On structure change"); |
---|
937 | | - autosaveCB.addItemListener(this); |
---|
| 1106 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1107 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1108 | + autokeepCB.addItemListener(this); |
---|
938 | 1109 | |
---|
939 | 1110 | panel.Return(); |
---|
940 | 1111 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
963 | 1134 | { |
---|
964 | 1135 | cRadio radioButton = new cRadio(obj.name); |
---|
965 | 1136 | |
---|
966 | | - // Patch to avoid bug with transparency. |
---|
| 1137 | + // June 2019. Patch to avoid bug with transparency. |
---|
967 | 1138 | radioButton.hadMaterial = obj.material != null; |
---|
968 | 1139 | if (!radioButton.hadMaterial) |
---|
969 | 1140 | { |
---|
.. | .. |
---|
971 | 1142 | } |
---|
972 | 1143 | |
---|
973 | 1144 | radioButton.SetObject(obj); |
---|
974 | | - radioButton.layout = sevenButton; |
---|
| 1145 | + radioButton.layout = sixButton; // sevenButton; |
---|
975 | 1146 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
976 | 1147 | radioButton.addActionListener(this); |
---|
977 | 1148 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1000 | 1171 | cCheckBox slowCB; |
---|
1001 | 1172 | cCheckBox boxCB; |
---|
1002 | 1173 | cCheckBox zoomBoxCB; |
---|
| 1174 | + cCheckBox freezeCB; |
---|
1003 | 1175 | //cToggleButton trackCB; |
---|
1004 | 1176 | cCheckBox trackCB; |
---|
1005 | 1177 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1010 | 1182 | |
---|
1011 | 1183 | cCheckBox oeilCB; |
---|
1012 | 1184 | cCheckBox shadowCB; |
---|
1013 | | - cCheckBox autosaveCB; |
---|
| 1185 | + cCheckBox autokeepCB; |
---|
1014 | 1186 | cCheckBox lookAtCB; |
---|
1015 | 1187 | |
---|
1016 | 1188 | // static int COLOR = 1; |
---|
.. | .. |
---|
1118 | 1290 | { |
---|
1119 | 1291 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1120 | 1292 | } |
---|
1121 | | - else if(e.getSource() == autosaveCB) |
---|
| 1293 | + else if(e.getSource() == freezeCB) |
---|
1122 | 1294 | { |
---|
1123 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1295 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1296 | + } |
---|
| 1297 | + else if(e.getSource() == autokeepCB) |
---|
| 1298 | + { |
---|
| 1299 | + Globals.REPLACEONMAKE ^= true; |
---|
1124 | 1300 | } |
---|
1125 | 1301 | else if(e.getSource() == lookAtCB) |
---|
1126 | 1302 | { |
---|
.. | .. |
---|
1202 | 1378 | } |
---|
1203 | 1379 | } |
---|
1204 | 1380 | |
---|
1205 | | - String string = (String) object; |
---|
1206 | | - |
---|
1207 | 1381 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1208 | 1382 | // if( object instanceof java.io.File[]) |
---|
1209 | 1383 | // { |
---|
.. | .. |
---|
1211 | 1385 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1212 | 1386 | // return; |
---|
1213 | 1387 | // } |
---|
| 1388 | + |
---|
| 1389 | + String string = object.toString(); |
---|
1214 | 1390 | |
---|
1215 | 1391 | // File path for Mac and Windows |
---|
1216 | 1392 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1460 | 1636 | animationItem.addItemListener(this); |
---|
1461 | 1637 | animationItem.setState(Globals.ANIMATION); |
---|
1462 | 1638 | |
---|
| 1639 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1640 | + archiveItem.addActionListener(this); |
---|
| 1641 | + |
---|
1463 | 1642 | menu.add("-"); |
---|
1464 | 1643 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1465 | 1644 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1472 | 1651 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1473 | 1652 | reduce34MorphItem.addActionListener(this); |
---|
1474 | 1653 | menu.add("-"); |
---|
| 1654 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1655 | + memoryItem.addActionListener(this); |
---|
1475 | 1656 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1476 | 1657 | computeAOItem.addActionListener(this); |
---|
1477 | 1658 | |
---|
.. | .. |
---|
1480 | 1661 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1481 | 1662 | mirrorItem.addActionListener(this); |
---|
1482 | 1663 | menu.add("-"); |
---|
1483 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1484 | | - memoryItem.addActionListener(this); |
---|
1485 | 1664 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1486 | 1665 | analyzeItem.addActionListener(this); |
---|
1487 | 1666 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1642 | 1821 | listUI.remove(i); |
---|
1643 | 1822 | } |
---|
1644 | 1823 | } |
---|
| 1824 | + } |
---|
| 1825 | + |
---|
| 1826 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1827 | + { |
---|
| 1828 | + // if (!(elem instanceof Composite)) |
---|
| 1829 | + // newWindow = false; |
---|
| 1830 | + listUI.add(elem); |
---|
| 1831 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1832 | + System.out.println("edit : " + elem); |
---|
| 1833 | + elem.editWindow.refreshContents(true); // ? new |
---|
1645 | 1834 | } |
---|
1646 | 1835 | |
---|
1647 | 1836 | /** |
---|
.. | .. |
---|
2071 | 2260 | { |
---|
2072 | 2261 | makeSomething(new Light()); |
---|
2073 | 2262 | } else |
---|
| 2263 | +// if (source == skybox1Button || |
---|
| 2264 | +// source == skybox2Button || |
---|
| 2265 | +// source == skybox3Button || |
---|
| 2266 | +// source == skybox4Button || |
---|
| 2267 | +// source == skybox5Button || |
---|
| 2268 | +// source == skybox6Button || |
---|
| 2269 | +// source == skybox7Button || |
---|
| 2270 | +// source == skybox11Button || |
---|
| 2271 | +// source == skybox12Button || |
---|
| 2272 | +// source == skybox13Button || |
---|
| 2273 | +// source == skybox14Button || |
---|
| 2274 | +// source == skybox15Button || |
---|
| 2275 | +// source == skybox16Button || |
---|
| 2276 | +// source == skybox17Button) |
---|
| 2277 | +// { |
---|
| 2278 | +// ChangeSkybox(source); |
---|
| 2279 | +// } else |
---|
2074 | 2280 | if (source == csgItem) |
---|
2075 | 2281 | { |
---|
2076 | 2282 | group(new CSG()); |
---|
.. | .. |
---|
2122 | 2328 | Composite csg = new GroupLeaf(); |
---|
2123 | 2329 | csg.count = 5; |
---|
2124 | 2330 | group(csg); |
---|
2125 | | - Composite child = new cGroup(); |
---|
| 2331 | + Composite child = new cGroup("Branch"); |
---|
2126 | 2332 | csg.addChild(child); |
---|
2127 | 2333 | child.addChild(csg); |
---|
2128 | 2334 | } else |
---|
2129 | 2335 | if (source == doubleItem) |
---|
2130 | 2336 | { |
---|
2131 | | - Composite csg = new GroupLeaf(); |
---|
| 2337 | + Composite csg = new GroupLeaf("Fork"); |
---|
2132 | 2338 | csg.count = 5; |
---|
2133 | 2339 | group(csg); |
---|
2134 | | - Composite child = new cGroup(); |
---|
| 2340 | + Composite child = new cGroup("Branch A"); |
---|
2135 | 2341 | csg.addChild(child); |
---|
2136 | 2342 | child.addChild(csg); |
---|
2137 | | - child = new cGroup(); |
---|
| 2343 | + child = new cGroup("Branch B"); |
---|
2138 | 2344 | csg.addChild(child); |
---|
2139 | 2345 | child.addChild(csg); |
---|
2140 | 2346 | } else |
---|
2141 | 2347 | if (source == tripleItem) |
---|
2142 | 2348 | { |
---|
2143 | | - Composite csg = new GroupLeaf(); |
---|
| 2349 | + Composite csg = new GroupLeaf("Trident"); |
---|
2144 | 2350 | csg.count = 4; |
---|
2145 | 2351 | group(csg); |
---|
2146 | 2352 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2156 | 2362 | if (source == computeAOItem) |
---|
2157 | 2363 | { |
---|
2158 | 2364 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2159 | | - Globals.theRenderer.repaint(); |
---|
| 2365 | + cameraView.repaint(); |
---|
2160 | 2366 | } else |
---|
2161 | 2367 | if (source == recompileItem) |
---|
2162 | 2368 | { |
---|
.. | .. |
---|
2204 | 2410 | } else |
---|
2205 | 2411 | if (source == undoButton) |
---|
2206 | 2412 | { |
---|
| 2413 | + // Go to previous version |
---|
| 2414 | + //if (!Undo()) |
---|
| 2415 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2207 | 2416 | Undo(); |
---|
| 2417 | + } else |
---|
| 2418 | + if (source == restoreButton) |
---|
| 2419 | + { |
---|
| 2420 | + // Restore current version |
---|
| 2421 | + Restore(); |
---|
| 2422 | + } else |
---|
| 2423 | + if (source == replaceButton) |
---|
| 2424 | + { |
---|
| 2425 | + // Overwrite current version |
---|
| 2426 | + Replace(); |
---|
2208 | 2427 | } else |
---|
2209 | 2428 | if (source == redoButton) |
---|
2210 | 2429 | { |
---|
| 2430 | + // Go to next version |
---|
2211 | 2431 | Redo(); |
---|
2212 | 2432 | } else |
---|
2213 | 2433 | if (source == saveButton) |
---|
2214 | 2434 | { |
---|
2215 | | - Save(); |
---|
| 2435 | + // Save a new version |
---|
| 2436 | + if (!Save(true)) |
---|
| 2437 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2216 | 2438 | } else |
---|
2217 | 2439 | if (source == oneStepButton) |
---|
2218 | 2440 | { |
---|
.. | .. |
---|
2221 | 2443 | } else |
---|
2222 | 2444 | if (source == screenfitButton) |
---|
2223 | 2445 | { |
---|
2224 | | - //Reload(lastConverter, lastFilename, true); |
---|
2225 | 2446 | ScreenFit(); |
---|
2226 | 2447 | } else |
---|
2227 | 2448 | if (source == screenfitpointButton) |
---|
2228 | 2449 | { |
---|
2229 | | - //Reload(lastConverter, lastFilename, true); |
---|
2230 | 2450 | ScreenFitPoint(); |
---|
2231 | 2451 | } else |
---|
2232 | 2452 | if (source == snapobjectButton) |
---|
2233 | 2453 | { |
---|
2234 | | - //Reload(lastConverter, lastFilename, true); |
---|
2235 | 2454 | SnapObject(); |
---|
2236 | 2455 | } else |
---|
2237 | 2456 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2595 | 2814 | { |
---|
2596 | 2815 | StepAll(); |
---|
2597 | 2816 | } else |
---|
2598 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2817 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2599 | 2818 | { |
---|
2600 | 2819 | //int indices[] = jList.getSelectedIndices(); |
---|
2601 | 2820 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2755 | 2974 | } else |
---|
2756 | 2975 | if (source == ungroupItem || source == ungroupButton) |
---|
2757 | 2976 | { |
---|
2758 | | - //ungroup(); |
---|
| 2977 | + boolean hasRoot = false; |
---|
| 2978 | + |
---|
2759 | 2979 | for (int i=0; i<group.selection.size(); i++) |
---|
2760 | 2980 | { |
---|
2761 | | - Ungroup(group.selection.get(i)); |
---|
| 2981 | + if (group.selection.get(i) == group) |
---|
| 2982 | + { |
---|
| 2983 | + hasRoot = true; |
---|
| 2984 | + break; |
---|
| 2985 | + } |
---|
2762 | 2986 | } |
---|
2763 | 2987 | |
---|
2764 | | - ClearSelection(false); |
---|
2765 | | - |
---|
2766 | | - refreshContents(); |
---|
| 2988 | + if (!hasRoot) |
---|
| 2989 | + { |
---|
| 2990 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2991 | + { |
---|
| 2992 | + Ungroup(group.selection.get(i)); |
---|
| 2993 | + } |
---|
| 2994 | + |
---|
| 2995 | + ClearSelection(false); |
---|
| 2996 | + |
---|
| 2997 | + refreshContents(); |
---|
| 2998 | + } |
---|
2767 | 2999 | } else |
---|
2768 | 3000 | if (source == genUVItem) |
---|
2769 | 3001 | { |
---|
.. | .. |
---|
3064 | 3296 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3065 | 3297 | { |
---|
3066 | 3298 | obj = (Object3D)e.nextElement(); |
---|
3067 | | - obj.SetBumpTexture(null); |
---|
| 3299 | + obj.ResetBumpTexture(); |
---|
3068 | 3300 | } |
---|
3069 | 3301 | |
---|
3070 | 3302 | refreshContents(); |
---|
.. | .. |
---|
3078 | 3310 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3079 | 3311 | } |
---|
3080 | 3312 | |
---|
| 3313 | + refreshContents(); |
---|
| 3314 | + } else |
---|
| 3315 | + if (source == embedTexturesItem) |
---|
| 3316 | + { |
---|
| 3317 | + Object3D obj; |
---|
| 3318 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3319 | + { |
---|
| 3320 | + obj = (Object3D)e.nextElement(); |
---|
| 3321 | + obj.EmbedTextures(true); |
---|
| 3322 | + } |
---|
| 3323 | + |
---|
| 3324 | + refreshContents(); |
---|
| 3325 | + } else |
---|
| 3326 | + if (source == deEmbedTexturesItem) |
---|
| 3327 | + { |
---|
| 3328 | + Object3D obj; |
---|
| 3329 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3330 | + { |
---|
| 3331 | + obj = (Object3D)e.nextElement(); |
---|
| 3332 | + obj.EmbedTextures(false); |
---|
| 3333 | + } |
---|
| 3334 | + |
---|
| 3335 | + CameraPane.texturepigment.clear(); |
---|
| 3336 | + CameraPane.texturebump.clear(); |
---|
| 3337 | + |
---|
3081 | 3338 | refreshContents(); |
---|
3082 | 3339 | } else |
---|
3083 | 3340 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3181 | 3438 | // centralPanel.setVisible(true); |
---|
3182 | 3439 | // XYZPanel.setVisible(true); |
---|
3183 | 3440 | bigThree.ClearUI(); |
---|
| 3441 | + bigThree.add(scenePanel); |
---|
3184 | 3442 | bigThree.add(centralPanel); |
---|
3185 | | - bigThree.add(XYZPanel); |
---|
3186 | 3443 | bigThree.FlushUI(); |
---|
3187 | 3444 | |
---|
3188 | 3445 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3262 | 3519 | // centralPanel.setVisible(true); |
---|
3263 | 3520 | // XYZPanel.setVisible(false); |
---|
3264 | 3521 | bigThree.ClearUI(); |
---|
3265 | | - bigThree.add(scenePanel); |
---|
3266 | 3522 | bigThree.add(centralPanel); |
---|
| 3523 | + bigThree.add(scenePanel); |
---|
3267 | 3524 | bigThree.FlushUI(); |
---|
3268 | 3525 | |
---|
3269 | 3526 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3446 | 3703 | } |
---|
3447 | 3704 | |
---|
3448 | 3705 | copy = group; |
---|
| 3706 | + |
---|
| 3707 | + SetUndoStates(); |
---|
| 3708 | + |
---|
3449 | 3709 | //Globals.theRenderer.object = group; |
---|
3450 | 3710 | if(!useclient) |
---|
3451 | 3711 | { |
---|
.. | .. |
---|
3474 | 3734 | radio.layout.doClick(); |
---|
3475 | 3735 | |
---|
3476 | 3736 | ClearUnpinned(); |
---|
3477 | | - SetPinStates(group.selection.size() > 0); |
---|
3478 | | - if (group.selection.size() == 1) |
---|
| 3737 | + //Grafreed.Assert(group != null); |
---|
| 3738 | + //Grafreed.Assert(group.selection != null); |
---|
| 3739 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3740 | + if (group.selection == null || group.selection.size() == 1) |
---|
3479 | 3741 | EditSelection(false); |
---|
3480 | 3742 | keepparent = group.parent; |
---|
3481 | 3743 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4069 | 4331 | |
---|
4070 | 4332 | try |
---|
4071 | 4333 | { |
---|
4072 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4334 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4073 | 4335 | } |
---|
4074 | 4336 | catch (Exception e) |
---|
4075 | 4337 | { |
---|
.. | .. |
---|
4546 | 4808 | |
---|
4547 | 4809 | void EditSelection(boolean newWindow) |
---|
4548 | 4810 | { |
---|
| 4811 | + if (group.selection == null) |
---|
| 4812 | + { |
---|
| 4813 | + EditElement(group, newWindow); // ? new |
---|
| 4814 | + return; |
---|
| 4815 | + } |
---|
| 4816 | + |
---|
4549 | 4817 | // aConstraints.gridy = 0; |
---|
4550 | 4818 | for (int i=0; i<group.selection.size(); i++) |
---|
4551 | 4819 | { |
---|
.. | .. |
---|
4556 | 4824 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4557 | 4825 | if(elem != group || !newWindow) |
---|
4558 | 4826 | { |
---|
4559 | | - // if (!(elem instanceof Composite)) |
---|
4560 | | - // newWindow = false; |
---|
4561 | | - listUI.add(elem); |
---|
4562 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4563 | | - System.out.println("edit : " + elem); |
---|
4564 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4827 | + EditElement(elem, newWindow); // ? new |
---|
4565 | 4828 | } |
---|
4566 | 4829 | } |
---|
4567 | 4830 | } |
---|
.. | .. |
---|
4705 | 4968 | |
---|
4706 | 4969 | void refreshContents(boolean cp) |
---|
4707 | 4970 | { |
---|
4708 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4709 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4971 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4972 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4710 | 4973 | { |
---|
4711 | 4974 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4712 | 4975 | |
---|
.. | .. |
---|
4805 | 5068 | |
---|
4806 | 5069 | if (cut) |
---|
4807 | 5070 | { |
---|
4808 | | - if (Globals.SAVEONMAKE) |
---|
4809 | | - Save(); |
---|
| 5071 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5072 | +// Save(); |
---|
4810 | 5073 | //int indices[] = jList.getSelectedIndices(); |
---|
4811 | 5074 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4812 | 5075 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4909 | 5172 | |
---|
4910 | 5173 | void paste(boolean expand) |
---|
4911 | 5174 | { |
---|
| 5175 | + if (Globals.REPLACEONMAKE) |
---|
| 5176 | + Save(); |
---|
| 5177 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5178 | + Globals.REPLACEONMAKE = false; |
---|
4912 | 5179 | // if (GrafreeD.clipboard == null) |
---|
4913 | 5180 | // return; |
---|
4914 | 5181 | boolean first = true; |
---|
.. | .. |
---|
4968 | 5235 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4969 | 5236 | } |
---|
4970 | 5237 | |
---|
| 5238 | + Globals.REPLACEONMAKE = keep; |
---|
4971 | 5239 | ResetModel(); |
---|
4972 | 5240 | refreshContents(); |
---|
4973 | 5241 | } |
---|
.. | .. |
---|
5103 | 5371 | |
---|
5104 | 5372 | void group(Object3D csg, boolean grab) |
---|
5105 | 5373 | { |
---|
| 5374 | + if (Globals.REPLACEONMAKE) |
---|
| 5375 | + Save(); |
---|
| 5376 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5377 | + Globals.REPLACEONMAKE = false; |
---|
5106 | 5378 | if (//false) // why?? |
---|
5107 | 5379 | !group.selection.isEmpty()) |
---|
5108 | 5380 | { |
---|
.. | .. |
---|
5216 | 5488 | //node.add(csg); |
---|
5217 | 5489 | //makeSomething(node); |
---|
5218 | 5490 | makeSomething(csg); |
---|
| 5491 | + Globals.REPLACEONMAKE = keep; |
---|
5219 | 5492 | } |
---|
5220 | 5493 | |
---|
5221 | 5494 | void Ungroup(Object3D g) |
---|
5222 | 5495 | { |
---|
| 5496 | + if (Globals.REPLACEONMAKE) |
---|
| 5497 | + Save(); |
---|
| 5498 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5499 | + Globals.REPLACEONMAKE = false; |
---|
5223 | 5500 | if (g instanceof HiddenObject) |
---|
5224 | 5501 | { |
---|
5225 | 5502 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5236 | 5513 | objEditor.makeSomething(g.get(i), false); |
---|
5237 | 5514 | } |
---|
5238 | 5515 | } |
---|
| 5516 | + Globals.REPLACEONMAKE = keep; |
---|
5239 | 5517 | } |
---|
5240 | 5518 | |
---|
5241 | 5519 | void ungroup() |
---|
.. | .. |
---|
5526 | 5804 | |
---|
5527 | 5805 | cButton restoreCameraButton; |
---|
5528 | 5806 | |
---|
5529 | | - cButton minButton; |
---|
5530 | | - cButton maxButton; |
---|
5531 | | - cButton fullButton; |
---|
5532 | 5807 | cButton saveButton; |
---|
5533 | 5808 | cButton oneStepButton; |
---|
5534 | 5809 | |
---|
.. | .. |
---|
5538 | 5813 | cButton switchButton; |
---|
5539 | 5814 | cButton loopButton; |
---|
5540 | 5815 | cButton textureButton; |
---|
| 5816 | + |
---|
| 5817 | + cButton skybox1Button; |
---|
| 5818 | + cButton skybox2Button; |
---|
| 5819 | + cButton skybox3Button; |
---|
| 5820 | + cButton skybox4Button; |
---|
| 5821 | + cButton skybox5Button; |
---|
| 5822 | + cButton skybox6Button; |
---|
| 5823 | + cButton skybox7Button; |
---|
| 5824 | + |
---|
| 5825 | + cButton skybox11Button; |
---|
| 5826 | + cButton skybox12Button; |
---|
| 5827 | + cButton skybox13Button; |
---|
| 5828 | + cButton skybox14Button; |
---|
| 5829 | + cButton skybox15Button; |
---|
| 5830 | + cButton skybox16Button; |
---|
| 5831 | + cButton skybox17Button; |
---|
5541 | 5832 | |
---|
5542 | 5833 | cButton gridButton; |
---|
5543 | 5834 | cButton boxButton; |
---|
.. | .. |
---|
5602 | 5893 | private MenuItem pasteLinkItem; |
---|
5603 | 5894 | private MenuItem pasteCloneItem; |
---|
5604 | 5895 | private MenuItem pasteExpandItem; |
---|
5605 | | - private MenuItem clearItem; |
---|
| 5896 | + private MenuItem deleteItem; |
---|
5606 | 5897 | private MenuItem clearAllItem; |
---|
5607 | 5898 | private MenuItem genUVItem; |
---|
5608 | 5899 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5686 | 5977 | private MenuItem attachBumpItem; |
---|
5687 | 5978 | private MenuItem detachBumpItem; |
---|
5688 | 5979 | private MenuItem pigmentBumpItem; |
---|
| 5980 | + private MenuItem embedTexturesItem; |
---|
| 5981 | + private MenuItem deEmbedTexturesItem; |
---|
5689 | 5982 | |
---|
5690 | 5983 | private MenuItem particleItem; |
---|
5691 | 5984 | private MenuItem ragdollItem; |
---|