.. | .. |
---|
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) |
---|
.. | .. |
---|
189 | 206 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 207 | // pasteExpandItem.addActionListener(this); |
---|
191 | 208 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 209 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 210 | + deleteItem.addActionListener(this); |
---|
194 | 211 | |
---|
195 | 212 | if (Globals.ADVANCED) |
---|
196 | 213 | { |
---|
.. | .. |
---|
220 | 237 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 238 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 239 | |
---|
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 | |
---|
.. | .. |
---|
380 | 397 | shadowYItem.addActionListener(this); |
---|
381 | 398 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
383 | 403 | if (Globals.ADVANCED) |
---|
384 | 404 | { |
---|
385 | 405 | menu.add("-"); |
---|
386 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 407 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 409 | templateItem.addActionListener(this); |
---|
392 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 433 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 434 | if (Globals.ADVANCED) |
---|
417 | 435 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 436 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 437 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 438 | } |
---|
421 | 439 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
538 | 556 | buildToolsMenu(menu); |
---|
539 | 557 | } |
---|
540 | 558 | |
---|
| 559 | + |
---|
541 | 560 | void SetupUI2(ObjEditor oe) |
---|
542 | 561 | { |
---|
543 | 562 | // June 2019 |
---|
.. | .. |
---|
582 | 601 | */ |
---|
583 | 602 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 603 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
586 | 605 | |
---|
587 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 607 | |
---|
.. | .. |
---|
590 | 609 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 610 | //minButton.addActionListener(this); |
---|
592 | 611 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - 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 | + } |
---|
596 | 618 | |
---|
597 | 619 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 620 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 621 | fullButton.addActionListener(this); |
---|
600 | 622 | |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
601 | 627 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 628 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 629 | restoreCameraButton.addActionListener(this); |
---|
604 | 630 | |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
| 633 | + saveButton.addActionListener(this); |
---|
| 634 | + |
---|
605 | 635 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
607 | 637 | undoButton.addActionListener(this); |
---|
608 | 638 | undoButton.setEnabled(false); |
---|
609 | 639 | |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
610 | 653 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
611 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
612 | 655 | redoButton.addActionListener(this); |
---|
613 | 656 | redoButton.setEnabled(false); |
---|
614 | 657 | |
---|
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); |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
620 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
621 | 660 | liveCB.addItemListener(this); |
---|
622 | 661 | |
---|
623 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
625 | 664 | oneStepButton.addActionListener(this); |
---|
626 | 665 | |
---|
627 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
628 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
629 | 668 | fastCB.addItemListener(this); |
---|
630 | 669 | |
---|
631 | 670 | //oe.toolboxPanel.Return(); |
---|
632 | 671 | |
---|
633 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
635 | | - screenfitButton.addActionListener(this); |
---|
636 | | - |
---|
637 | 672 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
638 | 673 | // trackCB.setToolTipText("Enable tracking"); |
---|
639 | 674 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
650 | 685 | |
---|
651 | 686 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
652 | 687 | |
---|
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 | 688 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
659 | 689 | fourButton.addActionListener(this); |
---|
660 | 690 | fourButton.setToolTipText("Show left panel only"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + twoButton.setToolTipText("Show right view only"); |
---|
| 694 | + twoButton.addActionListener(this); |
---|
| 695 | + this.fullscreenLayout = twoButton; |
---|
| 696 | + |
---|
661 | 697 | oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 698 | + sixButton.setToolTipText("Show left and right"); |
---|
663 | 699 | 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); |
---|
| 700 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 701 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 702 | +// threeButton.addActionListener(this); |
---|
| 703 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 704 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 705 | +// sevenButton.addActionListener(this); |
---|
670 | 706 | // |
---|
671 | 707 | |
---|
672 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
673 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 708 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 709 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
674 | 710 | rootButton.addActionListener(this); |
---|
675 | 711 | |
---|
676 | 712 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
726 | 762 | compositeButton.addActionListener(this); |
---|
727 | 763 | |
---|
728 | 764 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
729 | | - switchButton.setToolTipText("Create switch"); |
---|
| 765 | + switchButton.setToolTipText("Create item switcher"); |
---|
730 | 766 | switchButton.addActionListener(this); |
---|
731 | 767 | |
---|
732 | 768 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
811 | 847 | |
---|
812 | 848 | oe.treePanel.add(copyOptionsPanel); |
---|
813 | 849 | oe.treePanel.Return(); |
---|
| 850 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 851 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 852 | + sliderPane.preferredHeight = 1; |
---|
814 | 853 | |
---|
815 | 854 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
816 | 855 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
833 | 872 | dgr.addDragGestureListener(this); |
---|
834 | 873 | }catch(Exception e) {} |
---|
835 | 874 | */ |
---|
836 | | - radio.layout = sevenButton; |
---|
| 875 | + radio.layout = sixButton; // sevenButton; |
---|
837 | 876 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
838 | 877 | } |
---|
839 | 878 | |
---|
.. | .. |
---|
863 | 902 | |
---|
864 | 903 | if (true) // Globals.ADVANCED) |
---|
865 | 904 | { |
---|
866 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
867 | | - supportCB.setToolTipText("Enable rigging"); |
---|
868 | | - supportCB.addItemListener(this); |
---|
| 905 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 906 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 907 | +// supportCB.addItemListener(this); |
---|
| 908 | + |
---|
| 909 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 910 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 911 | + freezeCB.addItemListener(this); |
---|
869 | 912 | |
---|
870 | 913 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
871 | 914 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
929 | 972 | toggleTextureCB.addItemListener(this); |
---|
930 | 973 | |
---|
931 | 974 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
932 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 975 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
933 | 976 | toggleSwitchCB.addItemListener(this); |
---|
934 | 977 | |
---|
935 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
936 | | - autosaveCB.setToolTipText("On structure change"); |
---|
937 | | - autosaveCB.addItemListener(this); |
---|
| 978 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 979 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 980 | + autokeepCB.addItemListener(this); |
---|
938 | 981 | |
---|
939 | 982 | panel.Return(); |
---|
940 | 983 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
963 | 1006 | { |
---|
964 | 1007 | cRadio radioButton = new cRadio(obj.name); |
---|
965 | 1008 | |
---|
966 | | - // Patch to avoid bug with transparency. |
---|
| 1009 | + // June 2019. Patch to avoid bug with transparency. |
---|
967 | 1010 | radioButton.hadMaterial = obj.material != null; |
---|
968 | 1011 | if (!radioButton.hadMaterial) |
---|
969 | 1012 | { |
---|
.. | .. |
---|
971 | 1014 | } |
---|
972 | 1015 | |
---|
973 | 1016 | radioButton.SetObject(obj); |
---|
974 | | - radioButton.layout = sevenButton; |
---|
| 1017 | + radioButton.layout = sixButton; // sevenButton; |
---|
975 | 1018 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
976 | 1019 | radioButton.addActionListener(this); |
---|
977 | 1020 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1000 | 1043 | cCheckBox slowCB; |
---|
1001 | 1044 | cCheckBox boxCB; |
---|
1002 | 1045 | cCheckBox zoomBoxCB; |
---|
| 1046 | + cCheckBox freezeCB; |
---|
1003 | 1047 | //cToggleButton trackCB; |
---|
1004 | 1048 | cCheckBox trackCB; |
---|
1005 | 1049 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1010 | 1054 | |
---|
1011 | 1055 | cCheckBox oeilCB; |
---|
1012 | 1056 | cCheckBox shadowCB; |
---|
1013 | | - cCheckBox autosaveCB; |
---|
| 1057 | + cCheckBox autokeepCB; |
---|
1014 | 1058 | cCheckBox lookAtCB; |
---|
1015 | 1059 | |
---|
1016 | 1060 | // static int COLOR = 1; |
---|
.. | .. |
---|
1118 | 1162 | { |
---|
1119 | 1163 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1120 | 1164 | } |
---|
1121 | | - else if(e.getSource() == autosaveCB) |
---|
| 1165 | + else if(e.getSource() == freezeCB) |
---|
1122 | 1166 | { |
---|
1123 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1167 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1168 | + } |
---|
| 1169 | + else if(e.getSource() == autokeepCB) |
---|
| 1170 | + { |
---|
| 1171 | + Globals.REPLACEONMAKE ^= true; |
---|
1124 | 1172 | } |
---|
1125 | 1173 | else if(e.getSource() == lookAtCB) |
---|
1126 | 1174 | { |
---|
.. | .. |
---|
1202 | 1250 | } |
---|
1203 | 1251 | } |
---|
1204 | 1252 | |
---|
1205 | | - String string = (String) object; |
---|
1206 | | - |
---|
1207 | 1253 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1208 | 1254 | // if( object instanceof java.io.File[]) |
---|
1209 | 1255 | // { |
---|
.. | .. |
---|
1211 | 1257 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1212 | 1258 | // return; |
---|
1213 | 1259 | // } |
---|
| 1260 | + |
---|
| 1261 | + String string = object.toString(); |
---|
1214 | 1262 | |
---|
1215 | 1263 | // File path for Mac and Windows |
---|
1216 | 1264 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1460 | 1508 | animationItem.addItemListener(this); |
---|
1461 | 1509 | animationItem.setState(Globals.ANIMATION); |
---|
1462 | 1510 | |
---|
| 1511 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1512 | + archiveItem.addActionListener(this); |
---|
| 1513 | + |
---|
1463 | 1514 | menu.add("-"); |
---|
1464 | 1515 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1465 | 1516 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1472 | 1523 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1473 | 1524 | reduce34MorphItem.addActionListener(this); |
---|
1474 | 1525 | menu.add("-"); |
---|
| 1526 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1527 | + memoryItem.addActionListener(this); |
---|
1475 | 1528 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1476 | 1529 | computeAOItem.addActionListener(this); |
---|
1477 | 1530 | |
---|
.. | .. |
---|
1480 | 1533 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1481 | 1534 | mirrorItem.addActionListener(this); |
---|
1482 | 1535 | menu.add("-"); |
---|
1483 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1484 | | - memoryItem.addActionListener(this); |
---|
1485 | 1536 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1486 | 1537 | analyzeItem.addActionListener(this); |
---|
1487 | 1538 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1642 | 1693 | listUI.remove(i); |
---|
1643 | 1694 | } |
---|
1644 | 1695 | } |
---|
| 1696 | + } |
---|
| 1697 | + |
---|
| 1698 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1699 | + { |
---|
| 1700 | + // if (!(elem instanceof Composite)) |
---|
| 1701 | + // newWindow = false; |
---|
| 1702 | + listUI.add(elem); |
---|
| 1703 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1704 | + System.out.println("edit : " + elem); |
---|
| 1705 | + elem.editWindow.refreshContents(true); // ? new |
---|
1645 | 1706 | } |
---|
1646 | 1707 | |
---|
1647 | 1708 | /** |
---|
.. | .. |
---|
2122 | 2183 | Composite csg = new GroupLeaf(); |
---|
2123 | 2184 | csg.count = 5; |
---|
2124 | 2185 | group(csg); |
---|
2125 | | - Composite child = new cGroup(); |
---|
| 2186 | + Composite child = new cGroup("Branch"); |
---|
2126 | 2187 | csg.addChild(child); |
---|
2127 | 2188 | child.addChild(csg); |
---|
2128 | 2189 | } else |
---|
2129 | 2190 | if (source == doubleItem) |
---|
2130 | 2191 | { |
---|
2131 | | - Composite csg = new GroupLeaf(); |
---|
| 2192 | + Composite csg = new GroupLeaf("Fork"); |
---|
2132 | 2193 | csg.count = 5; |
---|
2133 | 2194 | group(csg); |
---|
2134 | | - Composite child = new cGroup(); |
---|
| 2195 | + Composite child = new cGroup("Branch A"); |
---|
2135 | 2196 | csg.addChild(child); |
---|
2136 | 2197 | child.addChild(csg); |
---|
2137 | | - child = new cGroup(); |
---|
| 2198 | + child = new cGroup("Branch B"); |
---|
2138 | 2199 | csg.addChild(child); |
---|
2139 | 2200 | child.addChild(csg); |
---|
2140 | 2201 | } else |
---|
2141 | 2202 | if (source == tripleItem) |
---|
2142 | 2203 | { |
---|
2143 | | - Composite csg = new GroupLeaf(); |
---|
| 2204 | + Composite csg = new GroupLeaf("Trident"); |
---|
2144 | 2205 | csg.count = 4; |
---|
2145 | 2206 | group(csg); |
---|
2146 | 2207 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2204 | 2265 | } else |
---|
2205 | 2266 | if (source == undoButton) |
---|
2206 | 2267 | { |
---|
| 2268 | + // Go to previous version |
---|
| 2269 | + //if (!Undo()) |
---|
| 2270 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2207 | 2271 | Undo(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == restoreButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Restore current version |
---|
| 2276 | + Restore(); |
---|
| 2277 | + } else |
---|
| 2278 | + if (source == replaceButton) |
---|
| 2279 | + { |
---|
| 2280 | + // Overwrite current version |
---|
| 2281 | + Replace(); |
---|
2208 | 2282 | } else |
---|
2209 | 2283 | if (source == redoButton) |
---|
2210 | 2284 | { |
---|
| 2285 | + // Go to next version |
---|
2211 | 2286 | Redo(); |
---|
2212 | 2287 | } else |
---|
2213 | 2288 | if (source == saveButton) |
---|
2214 | 2289 | { |
---|
2215 | | - Save(); |
---|
| 2290 | + // Save a new version |
---|
| 2291 | + if (!Save(true)) |
---|
| 2292 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2216 | 2293 | } else |
---|
2217 | 2294 | if (source == oneStepButton) |
---|
2218 | 2295 | { |
---|
.. | .. |
---|
2221 | 2298 | } else |
---|
2222 | 2299 | if (source == screenfitButton) |
---|
2223 | 2300 | { |
---|
2224 | | - //Reload(lastConverter, lastFilename, true); |
---|
2225 | 2301 | ScreenFit(); |
---|
2226 | 2302 | } else |
---|
2227 | 2303 | if (source == screenfitpointButton) |
---|
2228 | 2304 | { |
---|
2229 | | - //Reload(lastConverter, lastFilename, true); |
---|
2230 | 2305 | ScreenFitPoint(); |
---|
2231 | 2306 | } else |
---|
2232 | 2307 | if (source == snapobjectButton) |
---|
2233 | 2308 | { |
---|
2234 | | - //Reload(lastConverter, lastFilename, true); |
---|
2235 | 2309 | SnapObject(); |
---|
2236 | 2310 | } else |
---|
2237 | 2311 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2595 | 2669 | { |
---|
2596 | 2670 | StepAll(); |
---|
2597 | 2671 | } else |
---|
2598 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2672 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2599 | 2673 | { |
---|
2600 | 2674 | //int indices[] = jList.getSelectedIndices(); |
---|
2601 | 2675 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2755 | 2829 | } else |
---|
2756 | 2830 | if (source == ungroupItem || source == ungroupButton) |
---|
2757 | 2831 | { |
---|
2758 | | - //ungroup(); |
---|
| 2832 | + boolean hasRoot = false; |
---|
| 2833 | + |
---|
2759 | 2834 | for (int i=0; i<group.selection.size(); i++) |
---|
2760 | 2835 | { |
---|
2761 | | - Ungroup(group.selection.get(i)); |
---|
| 2836 | + if (group.selection.get(i) == group) |
---|
| 2837 | + { |
---|
| 2838 | + hasRoot = true; |
---|
| 2839 | + break; |
---|
| 2840 | + } |
---|
2762 | 2841 | } |
---|
2763 | 2842 | |
---|
2764 | | - ClearSelection(false); |
---|
2765 | | - |
---|
2766 | | - refreshContents(); |
---|
| 2843 | + if (!hasRoot) |
---|
| 2844 | + { |
---|
| 2845 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2846 | + { |
---|
| 2847 | + Ungroup(group.selection.get(i)); |
---|
| 2848 | + } |
---|
| 2849 | + |
---|
| 2850 | + ClearSelection(false); |
---|
| 2851 | + |
---|
| 2852 | + refreshContents(); |
---|
| 2853 | + } |
---|
2767 | 2854 | } else |
---|
2768 | 2855 | if (source == genUVItem) |
---|
2769 | 2856 | { |
---|
.. | .. |
---|
3446 | 3533 | } |
---|
3447 | 3534 | |
---|
3448 | 3535 | copy = group; |
---|
| 3536 | + |
---|
| 3537 | + SetUndoStates(); |
---|
| 3538 | + |
---|
3449 | 3539 | //Globals.theRenderer.object = group; |
---|
3450 | 3540 | if(!useclient) |
---|
3451 | 3541 | { |
---|
.. | .. |
---|
3474 | 3564 | radio.layout.doClick(); |
---|
3475 | 3565 | |
---|
3476 | 3566 | ClearUnpinned(); |
---|
3477 | | - SetPinStates(group.selection.size() > 0); |
---|
3478 | | - if (group.selection.size() == 1) |
---|
| 3567 | + //Grafreed.Assert(group != null); |
---|
| 3568 | + //Grafreed.Assert(group.selection != null); |
---|
| 3569 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3570 | + if (group.selection == null || group.selection.size() == 1) |
---|
3479 | 3571 | EditSelection(false); |
---|
3480 | 3572 | keepparent = group.parent; |
---|
3481 | 3573 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4546 | 4638 | |
---|
4547 | 4639 | void EditSelection(boolean newWindow) |
---|
4548 | 4640 | { |
---|
| 4641 | + if (group.selection == null) |
---|
| 4642 | + { |
---|
| 4643 | + EditElement(group, newWindow); // ? new |
---|
| 4644 | + return; |
---|
| 4645 | + } |
---|
| 4646 | + |
---|
4549 | 4647 | // aConstraints.gridy = 0; |
---|
4550 | 4648 | for (int i=0; i<group.selection.size(); i++) |
---|
4551 | 4649 | { |
---|
.. | .. |
---|
4556 | 4654 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4557 | 4655 | if(elem != group || !newWindow) |
---|
4558 | 4656 | { |
---|
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 |
---|
| 4657 | + EditElement(elem, newWindow); // ? new |
---|
4565 | 4658 | } |
---|
4566 | 4659 | } |
---|
4567 | 4660 | } |
---|
.. | .. |
---|
4706 | 4799 | void refreshContents(boolean cp) |
---|
4707 | 4800 | { |
---|
4708 | 4801 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4709 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4802 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4710 | 4803 | { |
---|
4711 | 4804 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4712 | 4805 | |
---|
.. | .. |
---|
4805 | 4898 | |
---|
4806 | 4899 | if (cut) |
---|
4807 | 4900 | { |
---|
4808 | | - if (Globals.SAVEONMAKE) |
---|
4809 | | - Save(); |
---|
| 4901 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4902 | +// Save(); |
---|
4810 | 4903 | //int indices[] = jList.getSelectedIndices(); |
---|
4811 | 4904 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4812 | 4905 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4909 | 5002 | |
---|
4910 | 5003 | void paste(boolean expand) |
---|
4911 | 5004 | { |
---|
| 5005 | + if (Globals.REPLACEONMAKE) |
---|
| 5006 | + Save(); |
---|
| 5007 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5008 | + Globals.REPLACEONMAKE = false; |
---|
4912 | 5009 | // if (GrafreeD.clipboard == null) |
---|
4913 | 5010 | // return; |
---|
4914 | 5011 | boolean first = true; |
---|
.. | .. |
---|
4968 | 5065 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4969 | 5066 | } |
---|
4970 | 5067 | |
---|
| 5068 | + Globals.REPLACEONMAKE = keep; |
---|
4971 | 5069 | ResetModel(); |
---|
4972 | 5070 | refreshContents(); |
---|
4973 | 5071 | } |
---|
.. | .. |
---|
5103 | 5201 | |
---|
5104 | 5202 | void group(Object3D csg, boolean grab) |
---|
5105 | 5203 | { |
---|
| 5204 | + if (Globals.REPLACEONMAKE) |
---|
| 5205 | + Save(); |
---|
| 5206 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5207 | + Globals.REPLACEONMAKE = false; |
---|
5106 | 5208 | if (//false) // why?? |
---|
5107 | 5209 | !group.selection.isEmpty()) |
---|
5108 | 5210 | { |
---|
.. | .. |
---|
5216 | 5318 | //node.add(csg); |
---|
5217 | 5319 | //makeSomething(node); |
---|
5218 | 5320 | makeSomething(csg); |
---|
| 5321 | + Globals.REPLACEONMAKE = keep; |
---|
5219 | 5322 | } |
---|
5220 | 5323 | |
---|
5221 | 5324 | void Ungroup(Object3D g) |
---|
5222 | 5325 | { |
---|
| 5326 | + if (Globals.REPLACEONMAKE) |
---|
| 5327 | + Save(); |
---|
| 5328 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5329 | + Globals.REPLACEONMAKE = false; |
---|
5223 | 5330 | if (g instanceof HiddenObject) |
---|
5224 | 5331 | { |
---|
5225 | 5332 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5236 | 5343 | objEditor.makeSomething(g.get(i), false); |
---|
5237 | 5344 | } |
---|
5238 | 5345 | } |
---|
| 5346 | + Globals.REPLACEONMAKE = keep; |
---|
5239 | 5347 | } |
---|
5240 | 5348 | |
---|
5241 | 5349 | void ungroup() |
---|
.. | .. |
---|
5526 | 5634 | |
---|
5527 | 5635 | cButton restoreCameraButton; |
---|
5528 | 5636 | |
---|
5529 | | - cButton minButton; |
---|
5530 | | - cButton maxButton; |
---|
5531 | | - cButton fullButton; |
---|
5532 | 5637 | cButton saveButton; |
---|
5533 | 5638 | cButton oneStepButton; |
---|
5534 | 5639 | |
---|
.. | .. |
---|
5602 | 5707 | private MenuItem pasteLinkItem; |
---|
5603 | 5708 | private MenuItem pasteCloneItem; |
---|
5604 | 5709 | private MenuItem pasteExpandItem; |
---|
5605 | | - private MenuItem clearItem; |
---|
| 5710 | + private MenuItem deleteItem; |
---|
5606 | 5711 | private MenuItem clearAllItem; |
---|
5607 | 5712 | private MenuItem genUVItem; |
---|
5608 | 5713 | private MenuItem genNormalsMESHItem; |
---|