.. | .. |
---|
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 | } |
---|
.. | .. |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
189 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 209 | // pasteExpandItem.addActionListener(this); |
---|
191 | 210 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
194 | 213 | |
---|
195 | 214 | if (Globals.ADVANCED) |
---|
196 | 215 | { |
---|
.. | .. |
---|
220 | 239 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 240 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 241 | |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 243 | toggleHandleItem.addItemListener(this); |
---|
225 | 244 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 245 | |
---|
.. | .. |
---|
380 | 399 | shadowYItem.addActionListener(this); |
---|
381 | 400 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 401 | shadowZItem.addActionListener(this); |
---|
| 402 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 403 | + attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
383 | 405 | if (Globals.ADVANCED) |
---|
384 | 406 | { |
---|
385 | 407 | menu.add("-"); |
---|
386 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 409 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 411 | templateItem.addActionListener(this); |
---|
392 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 436 | if (Globals.ADVANCED) |
---|
417 | 437 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 440 | } |
---|
421 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
538 | 558 | buildToolsMenu(menu); |
---|
539 | 559 | } |
---|
540 | 560 | |
---|
| 561 | + |
---|
541 | 562 | void SetupUI2(ObjEditor oe) |
---|
542 | 563 | { |
---|
543 | 564 | // June 2019 |
---|
.. | .. |
---|
582 | 603 | */ |
---|
583 | 604 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 605 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 606 | + copyOptionsPanel.preferredHeight = 1; |
---|
586 | 607 | |
---|
587 | 608 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 609 | |
---|
.. | .. |
---|
590 | 611 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 612 | //minButton.addActionListener(this); |
---|
592 | 613 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 614 | + if (Globals.ADVANCED) |
---|
| 615 | + { |
---|
| 616 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + maxButton.setToolTipText("Maximize window"); |
---|
| 618 | + maxButton.addActionListener(this); |
---|
| 619 | + } |
---|
596 | 620 | |
---|
597 | 621 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 622 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 623 | fullButton.addActionListener(this); |
---|
600 | 624 | |
---|
| 625 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 627 | + screenfitButton.addActionListener(this); |
---|
| 628 | + |
---|
601 | 629 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 630 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 631 | restoreCameraButton.addActionListener(this); |
---|
604 | 632 | |
---|
| 633 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + saveButton.setToolTipText("New version"); |
---|
| 635 | + saveButton.addActionListener(this); |
---|
| 636 | + |
---|
605 | 637 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 638 | + undoButton.setToolTipText("Previous version"); |
---|
607 | 639 | undoButton.addActionListener(this); |
---|
608 | 640 | undoButton.setEnabled(false); |
---|
609 | 641 | |
---|
| 642 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 643 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + restoreButton.setToolTipText("Restore current"); |
---|
| 645 | + restoreButton.addActionListener(this); |
---|
| 646 | + restoreButton.setEnabled(false); |
---|
| 647 | + |
---|
| 648 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + replaceButton.setToolTipText("Replace current"); |
---|
| 650 | + replaceButton.addActionListener(this); |
---|
| 651 | + replaceButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(updown); |
---|
| 654 | + |
---|
610 | 655 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
611 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 656 | + redoButton.setToolTipText("Next version"); |
---|
612 | 657 | redoButton.addActionListener(this); |
---|
613 | 658 | redoButton.setEnabled(false); |
---|
614 | 659 | |
---|
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); |
---|
| 660 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
620 | 661 | liveCB.setToolTipText("Enable animation"); |
---|
621 | 662 | liveCB.addItemListener(this); |
---|
622 | 663 | |
---|
623 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 665 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
625 | 666 | oneStepButton.addActionListener(this); |
---|
626 | 667 | |
---|
627 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 668 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
628 | 669 | fastCB.setToolTipText("Fast mode"); |
---|
629 | 670 | fastCB.addItemListener(this); |
---|
630 | 671 | |
---|
631 | 672 | //oe.toolboxPanel.Return(); |
---|
632 | 673 | |
---|
633 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
635 | | - screenfitButton.addActionListener(this); |
---|
636 | | - |
---|
637 | 674 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
638 | 675 | // trackCB.setToolTipText("Enable tracking"); |
---|
639 | 676 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
650 | 687 | |
---|
651 | 688 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
652 | 689 | |
---|
653 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | | - twoButton.setToolTipText("Show center view only"); |
---|
655 | | - twoButton.addActionListener(this); |
---|
656 | | - this.fullscreenLayout = twoButton; |
---|
657 | | - |
---|
658 | 690 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
659 | 691 | fourButton.addActionListener(this); |
---|
660 | 692 | fourButton.setToolTipText("Show left panel only"); |
---|
| 693 | + |
---|
| 694 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + twoButton.setToolTipText("Show right view only"); |
---|
| 696 | + twoButton.addActionListener(this); |
---|
| 697 | + this.fullscreenLayout = twoButton; |
---|
| 698 | + |
---|
661 | 699 | oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 700 | + sixButton.setToolTipText("Show left and right"); |
---|
663 | 701 | sixButton.addActionListener(this); |
---|
664 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
665 | | - threeButton.setToolTipText("2-column layout right"); |
---|
666 | | - threeButton.addActionListener(this); |
---|
667 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - sevenButton.setToolTipText("3-column layout"); |
---|
669 | | - sevenButton.addActionListener(this); |
---|
| 702 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 704 | +// threeButton.addActionListener(this); |
---|
| 705 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 706 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 707 | +// sevenButton.addActionListener(this); |
---|
670 | 708 | // |
---|
671 | 709 | |
---|
672 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
673 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 710 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
674 | 712 | rootButton.addActionListener(this); |
---|
675 | 713 | |
---|
676 | 714 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
726 | 764 | compositeButton.addActionListener(this); |
---|
727 | 765 | |
---|
728 | 766 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
729 | | - switchButton.setToolTipText("Create switch"); |
---|
| 767 | + switchButton.setToolTipText("Create item switcher"); |
---|
730 | 768 | switchButton.addActionListener(this); |
---|
731 | 769 | |
---|
732 | 770 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
758 | 796 | } |
---|
759 | 797 | |
---|
760 | 798 | // EDIT panel |
---|
761 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
762 | | - editButton.setToolTipText("Edit selection"); |
---|
| 799 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editButton.setToolTipText("Pin selection controls"); |
---|
763 | 801 | editButton.addActionListener(this); |
---|
764 | 802 | |
---|
765 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
766 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 803 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 804 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
767 | 805 | uneditButton.addActionListener(this); |
---|
768 | 806 | |
---|
769 | 807 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
770 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 808 | + allParamsButton.setToolTipText("Show all controle"); |
---|
771 | 809 | allParamsButton.addActionListener(this); |
---|
772 | 810 | |
---|
773 | 811 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
784 | 822 | |
---|
785 | 823 | editCommandsPanel.preferredHeight = 1; |
---|
786 | 824 | |
---|
| 825 | + SetPinStates(false); |
---|
787 | 826 | // oe.treePanel.add(commandsPanel); |
---|
788 | 827 | // oe.treePanel.Return(); |
---|
789 | 828 | |
---|
.. | .. |
---|
810 | 849 | |
---|
811 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
812 | 851 | oe.treePanel.Return(); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 854 | + sliderPane.preferredHeight = 1; |
---|
813 | 855 | |
---|
814 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
815 | 857 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
832 | 874 | dgr.addDragGestureListener(this); |
---|
833 | 875 | }catch(Exception e) {} |
---|
834 | 876 | */ |
---|
835 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
836 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
837 | 879 | } |
---|
838 | 880 | |
---|
.. | .. |
---|
857 | 899 | boxCB.addItemListener(this); |
---|
858 | 900 | |
---|
859 | 901 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
860 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 902 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
861 | 903 | zoomBoxCB.addItemListener(this); |
---|
862 | 904 | |
---|
863 | 905 | if (true) // Globals.ADVANCED) |
---|
864 | 906 | { |
---|
865 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
866 | | - supportCB.setToolTipText("Enable rigging"); |
---|
867 | | - supportCB.addItemListener(this); |
---|
| 907 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 908 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 909 | +// supportCB.addItemListener(this); |
---|
| 910 | + |
---|
| 911 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 912 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 913 | + freezeCB.addItemListener(this); |
---|
868 | 914 | |
---|
869 | 915 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
870 | 916 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
919 | 965 | oeilCB.addItemListener(this); |
---|
920 | 966 | |
---|
921 | 967 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
922 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 968 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
923 | 969 | shadowCB.addItemListener(this); |
---|
924 | 970 | |
---|
925 | 971 | panel.Return(); |
---|
.. | .. |
---|
928 | 974 | toggleTextureCB.addItemListener(this); |
---|
929 | 975 | |
---|
930 | 976 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
931 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 977 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
932 | 978 | toggleSwitchCB.addItemListener(this); |
---|
933 | 979 | |
---|
934 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
935 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
936 | | - autosaveCB.addItemListener(this); |
---|
| 980 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 981 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 982 | + autokeepCB.addItemListener(this); |
---|
937 | 983 | |
---|
938 | 984 | panel.Return(); |
---|
939 | 985 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
962 | 1008 | { |
---|
963 | 1009 | cRadio radioButton = new cRadio(obj.name); |
---|
964 | 1010 | |
---|
965 | | - // Patch to avoid bug with transparency. |
---|
| 1011 | + // June 2019. Patch to avoid bug with transparency. |
---|
966 | 1012 | radioButton.hadMaterial = obj.material != null; |
---|
967 | 1013 | if (!radioButton.hadMaterial) |
---|
968 | 1014 | { |
---|
.. | .. |
---|
970 | 1016 | } |
---|
971 | 1017 | |
---|
972 | 1018 | radioButton.SetObject(obj); |
---|
973 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
974 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
975 | 1021 | radioButton.addActionListener(this); |
---|
976 | 1022 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
999 | 1045 | cCheckBox slowCB; |
---|
1000 | 1046 | cCheckBox boxCB; |
---|
1001 | 1047 | cCheckBox zoomBoxCB; |
---|
| 1048 | + cCheckBox freezeCB; |
---|
1002 | 1049 | //cToggleButton trackCB; |
---|
1003 | 1050 | cCheckBox trackCB; |
---|
1004 | 1051 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1009 | 1056 | |
---|
1010 | 1057 | cCheckBox oeilCB; |
---|
1011 | 1058 | cCheckBox shadowCB; |
---|
1012 | | - cCheckBox autosaveCB; |
---|
| 1059 | + cCheckBox autokeepCB; |
---|
1013 | 1060 | cCheckBox lookAtCB; |
---|
1014 | 1061 | |
---|
1015 | 1062 | // static int COLOR = 1; |
---|
.. | .. |
---|
1117 | 1164 | { |
---|
1118 | 1165 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1119 | 1166 | } |
---|
1120 | | - else if(e.getSource() == autosaveCB) |
---|
| 1167 | + else if(e.getSource() == freezeCB) |
---|
1121 | 1168 | { |
---|
1122 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1169 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1170 | + } |
---|
| 1171 | + else if(e.getSource() == autokeepCB) |
---|
| 1172 | + { |
---|
| 1173 | + Globals.REPLACEONMAKE ^= true; |
---|
1123 | 1174 | } |
---|
1124 | 1175 | else if(e.getSource() == lookAtCB) |
---|
1125 | 1176 | { |
---|
.. | .. |
---|
1201 | 1252 | } |
---|
1202 | 1253 | } |
---|
1203 | 1254 | |
---|
1204 | | - String string = (String) object; |
---|
1205 | | - |
---|
1206 | 1255 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1207 | 1256 | // if( object instanceof java.io.File[]) |
---|
1208 | 1257 | // { |
---|
.. | .. |
---|
1210 | 1259 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1211 | 1260 | // return; |
---|
1212 | 1261 | // } |
---|
| 1262 | + |
---|
| 1263 | + String string = object.toString(); |
---|
1213 | 1264 | |
---|
1214 | 1265 | // File path for Mac and Windows |
---|
1215 | 1266 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1459 | 1510 | animationItem.addItemListener(this); |
---|
1460 | 1511 | animationItem.setState(Globals.ANIMATION); |
---|
1461 | 1512 | |
---|
| 1513 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1514 | + archiveItem.addActionListener(this); |
---|
| 1515 | + |
---|
1462 | 1516 | menu.add("-"); |
---|
1463 | 1517 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1464 | 1518 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1471 | 1525 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1472 | 1526 | reduce34MorphItem.addActionListener(this); |
---|
1473 | 1527 | menu.add("-"); |
---|
| 1528 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1529 | + memoryItem.addActionListener(this); |
---|
1474 | 1530 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1475 | 1531 | computeAOItem.addActionListener(this); |
---|
1476 | 1532 | |
---|
.. | .. |
---|
1479 | 1535 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1480 | 1536 | mirrorItem.addActionListener(this); |
---|
1481 | 1537 | menu.add("-"); |
---|
1482 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1483 | | - memoryItem.addActionListener(this); |
---|
1484 | 1538 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1485 | 1539 | analyzeItem.addActionListener(this); |
---|
1486 | 1540 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1628 | 1682 | |
---|
1629 | 1683 | makeSomething(shadow); |
---|
1630 | 1684 | } |
---|
| 1685 | + |
---|
| 1686 | + private void ClearUnpinned() |
---|
| 1687 | + { |
---|
| 1688 | + //for (Object3D obj : listUI) |
---|
| 1689 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1690 | + { |
---|
| 1691 | + Object3D obj = listUI.elementAt(i); |
---|
| 1692 | + if (!obj.pinned) |
---|
| 1693 | + { |
---|
| 1694 | + obj.CloseUI(); |
---|
| 1695 | + listUI.remove(i); |
---|
| 1696 | + } |
---|
| 1697 | + } |
---|
| 1698 | + } |
---|
| 1699 | + |
---|
| 1700 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1701 | + { |
---|
| 1702 | + // if (!(elem instanceof Composite)) |
---|
| 1703 | + // newWindow = false; |
---|
| 1704 | + listUI.add(elem); |
---|
| 1705 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1706 | + System.out.println("edit : " + elem); |
---|
| 1707 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1708 | + } |
---|
1631 | 1709 | |
---|
1632 | 1710 | /** |
---|
1633 | 1711 | * applyExample |
---|
.. | .. |
---|
2107 | 2185 | Composite csg = new GroupLeaf(); |
---|
2108 | 2186 | csg.count = 5; |
---|
2109 | 2187 | group(csg); |
---|
2110 | | - Composite child = new cGroup(); |
---|
| 2188 | + Composite child = new cGroup("Branch"); |
---|
2111 | 2189 | csg.addChild(child); |
---|
2112 | 2190 | child.addChild(csg); |
---|
2113 | 2191 | } else |
---|
2114 | 2192 | if (source == doubleItem) |
---|
2115 | 2193 | { |
---|
2116 | | - Composite csg = new GroupLeaf(); |
---|
| 2194 | + Composite csg = new GroupLeaf("Fork"); |
---|
2117 | 2195 | csg.count = 5; |
---|
2118 | 2196 | group(csg); |
---|
2119 | | - Composite child = new cGroup(); |
---|
| 2197 | + Composite child = new cGroup("Branch A"); |
---|
2120 | 2198 | csg.addChild(child); |
---|
2121 | 2199 | child.addChild(csg); |
---|
2122 | | - child = new cGroup(); |
---|
| 2200 | + child = new cGroup("Branch B"); |
---|
2123 | 2201 | csg.addChild(child); |
---|
2124 | 2202 | child.addChild(csg); |
---|
2125 | 2203 | } else |
---|
2126 | 2204 | if (source == tripleItem) |
---|
2127 | 2205 | { |
---|
2128 | | - Composite csg = new GroupLeaf(); |
---|
| 2206 | + Composite csg = new GroupLeaf("Trident"); |
---|
2129 | 2207 | csg.count = 4; |
---|
2130 | 2208 | group(csg); |
---|
2131 | 2209 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2189 | 2267 | } else |
---|
2190 | 2268 | if (source == undoButton) |
---|
2191 | 2269 | { |
---|
| 2270 | + // Go to previous version |
---|
| 2271 | + //if (!Undo()) |
---|
| 2272 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2192 | 2273 | Undo(); |
---|
| 2274 | + } else |
---|
| 2275 | + if (source == restoreButton) |
---|
| 2276 | + { |
---|
| 2277 | + // Restore current version |
---|
| 2278 | + Restore(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == replaceButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Overwrite current version |
---|
| 2283 | + Replace(); |
---|
2193 | 2284 | } else |
---|
2194 | 2285 | if (source == redoButton) |
---|
2195 | 2286 | { |
---|
| 2287 | + // Go to next version |
---|
2196 | 2288 | Redo(); |
---|
2197 | 2289 | } else |
---|
2198 | 2290 | if (source == saveButton) |
---|
2199 | 2291 | { |
---|
2200 | | - Save(); |
---|
| 2292 | + // Save a new version |
---|
| 2293 | + if (!Save(true)) |
---|
| 2294 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2201 | 2295 | } else |
---|
2202 | 2296 | if (source == oneStepButton) |
---|
2203 | 2297 | { |
---|
.. | .. |
---|
2206 | 2300 | } else |
---|
2207 | 2301 | if (source == screenfitButton) |
---|
2208 | 2302 | { |
---|
2209 | | - //Reload(lastConverter, lastFilename, true); |
---|
2210 | 2303 | ScreenFit(); |
---|
2211 | 2304 | } else |
---|
2212 | 2305 | if (source == screenfitpointButton) |
---|
2213 | 2306 | { |
---|
2214 | | - //Reload(lastConverter, lastFilename, true); |
---|
2215 | 2307 | ScreenFitPoint(); |
---|
2216 | 2308 | } else |
---|
2217 | 2309 | if (source == snapobjectButton) |
---|
2218 | 2310 | { |
---|
2219 | | - //Reload(lastConverter, lastFilename, true); |
---|
2220 | 2311 | SnapObject(); |
---|
2221 | 2312 | } else |
---|
2222 | 2313 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2580 | 2671 | { |
---|
2581 | 2672 | StepAll(); |
---|
2582 | 2673 | } else |
---|
2583 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2584 | 2675 | { |
---|
2585 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2586 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2740 | 2831 | } else |
---|
2741 | 2832 | if (source == ungroupItem || source == ungroupButton) |
---|
2742 | 2833 | { |
---|
2743 | | - //ungroup(); |
---|
| 2834 | + boolean hasRoot = false; |
---|
| 2835 | + |
---|
2744 | 2836 | for (int i=0; i<group.selection.size(); i++) |
---|
2745 | 2837 | { |
---|
2746 | | - Ungroup(group.selection.get(i)); |
---|
| 2838 | + if (group.selection.get(i) == group) |
---|
| 2839 | + { |
---|
| 2840 | + hasRoot = true; |
---|
| 2841 | + break; |
---|
| 2842 | + } |
---|
2747 | 2843 | } |
---|
2748 | 2844 | |
---|
2749 | | - ClearSelection(false); |
---|
2750 | | - |
---|
2751 | | - refreshContents(); |
---|
| 2845 | + if (!hasRoot) |
---|
| 2846 | + { |
---|
| 2847 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2848 | + { |
---|
| 2849 | + Ungroup(group.selection.get(i)); |
---|
| 2850 | + } |
---|
| 2851 | + |
---|
| 2852 | + ClearSelection(false); |
---|
| 2853 | + |
---|
| 2854 | + refreshContents(); |
---|
| 2855 | + } |
---|
2752 | 2856 | } else |
---|
2753 | 2857 | if (source == genUVItem) |
---|
2754 | 2858 | { |
---|
.. | .. |
---|
3372 | 3476 | //copy.ClearUI(); |
---|
3373 | 3477 | for (Object3D obj : listUI) |
---|
3374 | 3478 | { |
---|
3375 | | - obj.pinned = true; |
---|
| 3479 | + obj.pinned = false; |
---|
3376 | 3480 | obj.CloseUI(); |
---|
3377 | 3481 | } |
---|
3378 | 3482 | listUI.clear(); |
---|
.. | .. |
---|
3431 | 3535 | } |
---|
3432 | 3536 | |
---|
3433 | 3537 | copy = group; |
---|
| 3538 | + |
---|
| 3539 | + SetUndoStates(); |
---|
| 3540 | + |
---|
3434 | 3541 | //Globals.theRenderer.object = group; |
---|
3435 | 3542 | if(!useclient) |
---|
3436 | 3543 | { |
---|
.. | .. |
---|
3457 | 3564 | currentLayout = sevenButton; |
---|
3458 | 3565 | */ |
---|
3459 | 3566 | radio.layout.doClick(); |
---|
| 3567 | + |
---|
| 3568 | + ClearUnpinned(); |
---|
| 3569 | + //Grafreed.Assert(group != null); |
---|
| 3570 | + //Grafreed.Assert(group.selection != null); |
---|
| 3571 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3572 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3573 | + EditSelection(false); |
---|
3460 | 3574 | keepparent = group.parent; |
---|
3461 | 3575 | // PARENT = NULL or not??? |
---|
3462 | 3576 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
4049 | 4163 | |
---|
4050 | 4164 | try |
---|
4051 | 4165 | { |
---|
4052 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4166 | + texturedata = Globals.theRenderer.GetTextureData(tex.pigmenttexture, pigment, false, node.texres); |
---|
4053 | 4167 | } |
---|
4054 | 4168 | catch (Exception e) |
---|
4055 | 4169 | { |
---|
.. | .. |
---|
4526 | 4640 | |
---|
4527 | 4641 | void EditSelection(boolean newWindow) |
---|
4528 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4529 | 4649 | // aConstraints.gridy = 0; |
---|
4530 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4531 | 4651 | { |
---|
.. | .. |
---|
4536 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4537 | 4657 | if(elem != group || !newWindow) |
---|
4538 | 4658 | { |
---|
4539 | | - // if (!(elem instanceof Composite)) |
---|
4540 | | - // newWindow = false; |
---|
4541 | | - listUI.add(elem); |
---|
4542 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4543 | | - System.out.println("edit : " + elem); |
---|
4544 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4545 | 4660 | } |
---|
4546 | 4661 | } |
---|
4547 | 4662 | } |
---|
.. | .. |
---|
4616 | 4731 | //new Exception().printStackTrace(); |
---|
4617 | 4732 | |
---|
4618 | 4733 | freezemodel = true; |
---|
4619 | | - |
---|
4620 | | - //for (Object3D obj : listUI) |
---|
4621 | | - for (int i=listUI.size(); --i>=0;) |
---|
4622 | | - { |
---|
4623 | | - Object3D obj = listUI.elementAt(i); |
---|
4624 | | - if (!obj.pinned) |
---|
4625 | | - { |
---|
4626 | | - obj.CloseUI(); |
---|
4627 | | - listUI.remove(i); |
---|
4628 | | - } |
---|
4629 | | - } |
---|
| 4734 | + ClearUnpinned(); |
---|
4630 | 4735 | |
---|
4631 | 4736 | /**/ |
---|
4632 | 4737 | //switch (event.id) |
---|
.. | .. |
---|
4689 | 4794 | { |
---|
4690 | 4795 | editButton.setEnabled(enabled); |
---|
4691 | 4796 | uneditButton.setEnabled(enabled); |
---|
| 4797 | + unselectButton.setEnabled(enabled); |
---|
| 4798 | + flashSelectionButton.setEnabled(enabled); |
---|
4692 | 4799 | } |
---|
4693 | 4800 | |
---|
4694 | 4801 | void refreshContents(boolean cp) |
---|
4695 | 4802 | { |
---|
4696 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4697 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4804 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4698 | 4805 | { |
---|
4699 | 4806 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4700 | 4807 | |
---|
.. | .. |
---|
4793 | 4900 | |
---|
4794 | 4901 | if (cut) |
---|
4795 | 4902 | { |
---|
4796 | | - if (Globals.SAVEONMAKE) |
---|
4797 | | - Save(); |
---|
| 4903 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4904 | +// Save(); |
---|
4798 | 4905 | //int indices[] = jList.getSelectedIndices(); |
---|
4799 | 4906 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4800 | 4907 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4897 | 5004 | |
---|
4898 | 5005 | void paste(boolean expand) |
---|
4899 | 5006 | { |
---|
| 5007 | + if (Globals.REPLACEONMAKE) |
---|
| 5008 | + Save(); |
---|
| 5009 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5010 | + Globals.REPLACEONMAKE = false; |
---|
4900 | 5011 | // if (GrafreeD.clipboard == null) |
---|
4901 | 5012 | // return; |
---|
4902 | 5013 | boolean first = true; |
---|
.. | .. |
---|
4956 | 5067 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4957 | 5068 | } |
---|
4958 | 5069 | |
---|
| 5070 | + Globals.REPLACEONMAKE = keep; |
---|
4959 | 5071 | ResetModel(); |
---|
4960 | 5072 | refreshContents(); |
---|
4961 | 5073 | } |
---|
.. | .. |
---|
5091 | 5203 | |
---|
5092 | 5204 | void group(Object3D csg, boolean grab) |
---|
5093 | 5205 | { |
---|
| 5206 | + if (Globals.REPLACEONMAKE) |
---|
| 5207 | + Save(); |
---|
| 5208 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5209 | + Globals.REPLACEONMAKE = false; |
---|
5094 | 5210 | if (//false) // why?? |
---|
5095 | 5211 | !group.selection.isEmpty()) |
---|
5096 | 5212 | { |
---|
.. | .. |
---|
5204 | 5320 | //node.add(csg); |
---|
5205 | 5321 | //makeSomething(node); |
---|
5206 | 5322 | makeSomething(csg); |
---|
| 5323 | + Globals.REPLACEONMAKE = keep; |
---|
5207 | 5324 | } |
---|
5208 | 5325 | |
---|
5209 | 5326 | void Ungroup(Object3D g) |
---|
5210 | 5327 | { |
---|
| 5328 | + if (Globals.REPLACEONMAKE) |
---|
| 5329 | + Save(); |
---|
| 5330 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5331 | + Globals.REPLACEONMAKE = false; |
---|
5211 | 5332 | if (g instanceof HiddenObject) |
---|
5212 | 5333 | { |
---|
5213 | 5334 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5224 | 5345 | objEditor.makeSomething(g.get(i), false); |
---|
5225 | 5346 | } |
---|
5226 | 5347 | } |
---|
| 5348 | + Globals.REPLACEONMAKE = keep; |
---|
5227 | 5349 | } |
---|
5228 | 5350 | |
---|
5229 | 5351 | void ungroup() |
---|
.. | .. |
---|
5514 | 5636 | |
---|
5515 | 5637 | cButton restoreCameraButton; |
---|
5516 | 5638 | |
---|
5517 | | - cButton minButton; |
---|
5518 | | - cButton maxButton; |
---|
5519 | | - cButton fullButton; |
---|
5520 | 5639 | cButton saveButton; |
---|
5521 | 5640 | cButton oneStepButton; |
---|
5522 | 5641 | |
---|
.. | .. |
---|
5590 | 5709 | private MenuItem pasteLinkItem; |
---|
5591 | 5710 | private MenuItem pasteCloneItem; |
---|
5592 | 5711 | private MenuItem pasteExpandItem; |
---|
5593 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5594 | 5713 | private MenuItem clearAllItem; |
---|
5595 | 5714 | private MenuItem genUVItem; |
---|
5596 | 5715 | private MenuItem genNormalsMESHItem; |
---|