.. | .. |
---|
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 | { |
---|
.. | .. |
---|
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); |
---|
383 | 404 | |
---|
384 | 405 | if (Globals.ADVANCED) |
---|
385 | 406 | { |
---|
386 | 407 | menu.add("-"); |
---|
387 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
388 | 409 | linkerItem.addActionListener(this); |
---|
389 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
390 | | - attributeItem.addActionListener(this); |
---|
391 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
392 | 411 | templateItem.addActionListener(this); |
---|
393 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
416 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
417 | 436 | if (Globals.ADVANCED) |
---|
418 | 437 | { |
---|
419 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
420 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
421 | 440 | } |
---|
422 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
539 | 558 | buildToolsMenu(menu); |
---|
540 | 559 | } |
---|
541 | 560 | |
---|
| 561 | + |
---|
542 | 562 | void SetupUI2(ObjEditor oe) |
---|
543 | 563 | { |
---|
544 | 564 | // June 2019 |
---|
.. | .. |
---|
610 | 630 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
611 | 631 | restoreCameraButton.addActionListener(this); |
---|
612 | 632 | |
---|
| 633 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + saveButton.setToolTipText("New version"); |
---|
| 635 | + saveButton.addActionListener(this); |
---|
| 636 | + |
---|
613 | 637 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
614 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 638 | + undoButton.setToolTipText("Previous version"); |
---|
615 | 639 | undoButton.addActionListener(this); |
---|
616 | 640 | undoButton.setEnabled(false); |
---|
617 | 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 | + |
---|
618 | 655 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
619 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 656 | + redoButton.setToolTipText("Next version"); |
---|
620 | 657 | redoButton.addActionListener(this); |
---|
621 | 658 | redoButton.setEnabled(false); |
---|
622 | 659 | |
---|
623 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | | - saveButton.setToolTipText("Save changes"); |
---|
625 | | - saveButton.addActionListener(this); |
---|
626 | | - |
---|
627 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
628 | 661 | liveCB.setToolTipText("Enable animation"); |
---|
629 | 662 | liveCB.addItemListener(this); |
---|
630 | 663 | |
---|
631 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
632 | 665 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
633 | 666 | oneStepButton.addActionListener(this); |
---|
634 | 667 | |
---|
635 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 668 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
636 | 669 | fastCB.setToolTipText("Fast mode"); |
---|
637 | 670 | fastCB.addItemListener(this); |
---|
638 | 671 | |
---|
.. | .. |
---|
654 | 687 | |
---|
655 | 688 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
656 | 689 | |
---|
657 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
658 | | - twoButton.setToolTipText("Show center view only"); |
---|
659 | | - twoButton.addActionListener(this); |
---|
660 | | - this.fullscreenLayout = twoButton; |
---|
661 | | - |
---|
662 | 690 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
663 | 691 | fourButton.addActionListener(this); |
---|
664 | 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 | + |
---|
665 | 699 | oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
666 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 700 | + sixButton.setToolTipText("Show left and right"); |
---|
667 | 701 | sixButton.addActionListener(this); |
---|
668 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
669 | | - threeButton.setToolTipText("2-column layout right"); |
---|
670 | | - threeButton.addActionListener(this); |
---|
671 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
672 | | - sevenButton.setToolTipText("3-column layout"); |
---|
673 | | - 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); |
---|
674 | 708 | // |
---|
675 | 709 | |
---|
676 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
677 | | - 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"); |
---|
678 | 712 | rootButton.addActionListener(this); |
---|
679 | 713 | |
---|
680 | 714 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
815 | 849 | |
---|
816 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
817 | 851 | oe.treePanel.Return(); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 854 | + sliderPane.preferredHeight = 1; |
---|
818 | 855 | |
---|
819 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
820 | 857 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
837 | 874 | dgr.addDragGestureListener(this); |
---|
838 | 875 | }catch(Exception e) {} |
---|
839 | 876 | */ |
---|
840 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
841 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
842 | 879 | } |
---|
843 | 880 | |
---|
.. | .. |
---|
940 | 977 | toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
941 | 978 | toggleSwitchCB.addItemListener(this); |
---|
942 | 979 | |
---|
943 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
944 | | - autosaveCB.setToolTipText("On structure change"); |
---|
945 | | - autosaveCB.addItemListener(this); |
---|
| 980 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 981 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 982 | + autokeepCB.addItemListener(this); |
---|
946 | 983 | |
---|
947 | 984 | panel.Return(); |
---|
948 | 985 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
971 | 1008 | { |
---|
972 | 1009 | cRadio radioButton = new cRadio(obj.name); |
---|
973 | 1010 | |
---|
974 | | - // Patch to avoid bug with transparency. |
---|
| 1011 | + // June 2019. Patch to avoid bug with transparency. |
---|
975 | 1012 | radioButton.hadMaterial = obj.material != null; |
---|
976 | 1013 | if (!radioButton.hadMaterial) |
---|
977 | 1014 | { |
---|
.. | .. |
---|
979 | 1016 | } |
---|
980 | 1017 | |
---|
981 | 1018 | radioButton.SetObject(obj); |
---|
982 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
983 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
984 | 1021 | radioButton.addActionListener(this); |
---|
985 | 1022 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1019 | 1056 | |
---|
1020 | 1057 | cCheckBox oeilCB; |
---|
1021 | 1058 | cCheckBox shadowCB; |
---|
1022 | | - cCheckBox autosaveCB; |
---|
| 1059 | + cCheckBox autokeepCB; |
---|
1023 | 1060 | cCheckBox lookAtCB; |
---|
1024 | 1061 | |
---|
1025 | 1062 | // static int COLOR = 1; |
---|
.. | .. |
---|
1131 | 1168 | { |
---|
1132 | 1169 | Globals.FREEZEONMOVE ^= true; |
---|
1133 | 1170 | } |
---|
1134 | | - else if(e.getSource() == autosaveCB) |
---|
| 1171 | + else if(e.getSource() == autokeepCB) |
---|
1135 | 1172 | { |
---|
1136 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1173 | + Globals.REPLACEONMAKE ^= true; |
---|
1137 | 1174 | } |
---|
1138 | 1175 | else if(e.getSource() == lookAtCB) |
---|
1139 | 1176 | { |
---|
.. | .. |
---|
1223 | 1260 | // return; |
---|
1224 | 1261 | // } |
---|
1225 | 1262 | |
---|
1226 | | - String string = (String) object; |
---|
| 1263 | + String string = object.toString(); |
---|
1227 | 1264 | |
---|
1228 | 1265 | // File path for Mac and Windows |
---|
1229 | 1266 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1488 | 1525 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1489 | 1526 | reduce34MorphItem.addActionListener(this); |
---|
1490 | 1527 | menu.add("-"); |
---|
| 1528 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1529 | + memoryItem.addActionListener(this); |
---|
1491 | 1530 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1492 | 1531 | computeAOItem.addActionListener(this); |
---|
1493 | 1532 | |
---|
.. | .. |
---|
1496 | 1535 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1497 | 1536 | mirrorItem.addActionListener(this); |
---|
1498 | 1537 | menu.add("-"); |
---|
1499 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1500 | | - memoryItem.addActionListener(this); |
---|
1501 | 1538 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1502 | 1539 | analyzeItem.addActionListener(this); |
---|
1503 | 1540 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1658 | 1695 | listUI.remove(i); |
---|
1659 | 1696 | } |
---|
1660 | 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 |
---|
1661 | 1708 | } |
---|
1662 | 1709 | |
---|
1663 | 1710 | /** |
---|
.. | .. |
---|
2220 | 2267 | } else |
---|
2221 | 2268 | if (source == undoButton) |
---|
2222 | 2269 | { |
---|
2223 | | - if (!Undo()) |
---|
2224 | | - java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2270 | + // Go to previous version |
---|
| 2271 | + //if (!Undo()) |
---|
| 2272 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 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(); |
---|
2225 | 2284 | } else |
---|
2226 | 2285 | if (source == redoButton) |
---|
2227 | 2286 | { |
---|
| 2287 | + // Go to next version |
---|
2228 | 2288 | Redo(); |
---|
2229 | 2289 | } else |
---|
2230 | 2290 | if (source == saveButton) |
---|
2231 | 2291 | { |
---|
| 2292 | + // Save a new version |
---|
2232 | 2293 | if (!Save(true)) |
---|
2233 | 2294 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2234 | 2295 | } else |
---|
.. | .. |
---|
2610 | 2671 | { |
---|
2611 | 2672 | StepAll(); |
---|
2612 | 2673 | } else |
---|
2613 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2614 | 2675 | { |
---|
2615 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2616 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3474 | 3535 | } |
---|
3475 | 3536 | |
---|
3476 | 3537 | copy = group; |
---|
| 3538 | + |
---|
| 3539 | + SetUndoStates(); |
---|
| 3540 | + |
---|
3477 | 3541 | //Globals.theRenderer.object = group; |
---|
3478 | 3542 | if(!useclient) |
---|
3479 | 3543 | { |
---|
.. | .. |
---|
3502 | 3566 | radio.layout.doClick(); |
---|
3503 | 3567 | |
---|
3504 | 3568 | ClearUnpinned(); |
---|
3505 | | - SetPinStates(group.selection.size() > 0); |
---|
3506 | | - if (group.selection.size() == 1) |
---|
| 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) |
---|
3507 | 3573 | EditSelection(false); |
---|
3508 | 3574 | keepparent = group.parent; |
---|
3509 | 3575 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4574 | 4640 | |
---|
4575 | 4641 | void EditSelection(boolean newWindow) |
---|
4576 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4577 | 4649 | // aConstraints.gridy = 0; |
---|
4578 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4579 | 4651 | { |
---|
.. | .. |
---|
4584 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4585 | 4657 | if(elem != group || !newWindow) |
---|
4586 | 4658 | { |
---|
4587 | | - // if (!(elem instanceof Composite)) |
---|
4588 | | - // newWindow = false; |
---|
4589 | | - listUI.add(elem); |
---|
4590 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4591 | | - System.out.println("edit : " + elem); |
---|
4592 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4593 | 4660 | } |
---|
4594 | 4661 | } |
---|
4595 | 4662 | } |
---|
.. | .. |
---|
4733 | 4800 | |
---|
4734 | 4801 | void refreshContents(boolean cp) |
---|
4735 | 4802 | { |
---|
4736 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4737 | 4804 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4738 | 4805 | { |
---|
4739 | 4806 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
4833 | 4900 | |
---|
4834 | 4901 | if (cut) |
---|
4835 | 4902 | { |
---|
4836 | | - if (Globals.SAVEONMAKE) |
---|
4837 | | - Save(); |
---|
| 4903 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4904 | +// Save(); |
---|
4838 | 4905 | //int indices[] = jList.getSelectedIndices(); |
---|
4839 | 4906 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4840 | 4907 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4937 | 5004 | |
---|
4938 | 5005 | void paste(boolean expand) |
---|
4939 | 5006 | { |
---|
| 5007 | + if (Globals.REPLACEONMAKE) |
---|
| 5008 | + Save(); |
---|
| 5009 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5010 | + Globals.REPLACEONMAKE = false; |
---|
4940 | 5011 | // if (GrafreeD.clipboard == null) |
---|
4941 | 5012 | // return; |
---|
4942 | 5013 | boolean first = true; |
---|
.. | .. |
---|
4996 | 5067 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4997 | 5068 | } |
---|
4998 | 5069 | |
---|
| 5070 | + Globals.REPLACEONMAKE = keep; |
---|
4999 | 5071 | ResetModel(); |
---|
5000 | 5072 | refreshContents(); |
---|
5001 | 5073 | } |
---|
.. | .. |
---|
5131 | 5203 | |
---|
5132 | 5204 | void group(Object3D csg, boolean grab) |
---|
5133 | 5205 | { |
---|
| 5206 | + if (Globals.REPLACEONMAKE) |
---|
| 5207 | + Save(); |
---|
| 5208 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5209 | + Globals.REPLACEONMAKE = false; |
---|
5134 | 5210 | if (//false) // why?? |
---|
5135 | 5211 | !group.selection.isEmpty()) |
---|
5136 | 5212 | { |
---|
.. | .. |
---|
5244 | 5320 | //node.add(csg); |
---|
5245 | 5321 | //makeSomething(node); |
---|
5246 | 5322 | makeSomething(csg); |
---|
| 5323 | + Globals.REPLACEONMAKE = keep; |
---|
5247 | 5324 | } |
---|
5248 | 5325 | |
---|
5249 | 5326 | void Ungroup(Object3D g) |
---|
5250 | 5327 | { |
---|
| 5328 | + if (Globals.REPLACEONMAKE) |
---|
| 5329 | + Save(); |
---|
| 5330 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5331 | + Globals.REPLACEONMAKE = false; |
---|
5251 | 5332 | if (g instanceof HiddenObject) |
---|
5252 | 5333 | { |
---|
5253 | 5334 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5264 | 5345 | objEditor.makeSomething(g.get(i), false); |
---|
5265 | 5346 | } |
---|
5266 | 5347 | } |
---|
| 5348 | + Globals.REPLACEONMAKE = keep; |
---|
5267 | 5349 | } |
---|
5268 | 5350 | |
---|
5269 | 5351 | void ungroup() |
---|
.. | .. |
---|
5627 | 5709 | private MenuItem pasteLinkItem; |
---|
5628 | 5710 | private MenuItem pasteCloneItem; |
---|
5629 | 5711 | private MenuItem pasteExpandItem; |
---|
5630 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5631 | 5713 | private MenuItem clearAllItem; |
---|
5632 | 5714 | private MenuItem genUVItem; |
---|
5633 | 5715 | private MenuItem genNormalsMESHItem; |
---|