.. | .. |
---|
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); |
---|
| 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 |
---|
.. | .. |
---|
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); |
---|
.. | .. |
---|
811 | 849 | |
---|
812 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
813 | 851 | oe.treePanel.Return(); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 854 | + sliderPane.preferredHeight = 1; |
---|
814 | 855 | |
---|
815 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
816 | 857 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
833 | 874 | dgr.addDragGestureListener(this); |
---|
834 | 875 | }catch(Exception e) {} |
---|
835 | 876 | */ |
---|
836 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
837 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
838 | 879 | } |
---|
839 | 880 | |
---|
.. | .. |
---|
936 | 977 | toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
937 | 978 | toggleSwitchCB.addItemListener(this); |
---|
938 | 979 | |
---|
939 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
940 | | - autosaveCB.setToolTipText("On structure change"); |
---|
941 | | - autosaveCB.addItemListener(this); |
---|
| 980 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 981 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 982 | + autokeepCB.addItemListener(this); |
---|
942 | 983 | |
---|
943 | 984 | panel.Return(); |
---|
944 | 985 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
967 | 1008 | { |
---|
968 | 1009 | cRadio radioButton = new cRadio(obj.name); |
---|
969 | 1010 | |
---|
970 | | - // Patch to avoid bug with transparency. |
---|
| 1011 | + // June 2019. Patch to avoid bug with transparency. |
---|
971 | 1012 | radioButton.hadMaterial = obj.material != null; |
---|
972 | 1013 | if (!radioButton.hadMaterial) |
---|
973 | 1014 | { |
---|
.. | .. |
---|
975 | 1016 | } |
---|
976 | 1017 | |
---|
977 | 1018 | radioButton.SetObject(obj); |
---|
978 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
979 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
980 | 1021 | radioButton.addActionListener(this); |
---|
981 | 1022 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1015 | 1056 | |
---|
1016 | 1057 | cCheckBox oeilCB; |
---|
1017 | 1058 | cCheckBox shadowCB; |
---|
1018 | | - cCheckBox autosaveCB; |
---|
| 1059 | + cCheckBox autokeepCB; |
---|
1019 | 1060 | cCheckBox lookAtCB; |
---|
1020 | 1061 | |
---|
1021 | 1062 | // static int COLOR = 1; |
---|
.. | .. |
---|
1127 | 1168 | { |
---|
1128 | 1169 | Globals.FREEZEONMOVE ^= true; |
---|
1129 | 1170 | } |
---|
1130 | | - else if(e.getSource() == autosaveCB) |
---|
| 1171 | + else if(e.getSource() == autokeepCB) |
---|
1131 | 1172 | { |
---|
1132 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1173 | + Globals.REPLACEONMAKE ^= true; |
---|
1133 | 1174 | } |
---|
1134 | 1175 | else if(e.getSource() == lookAtCB) |
---|
1135 | 1176 | { |
---|
.. | .. |
---|
1211 | 1252 | } |
---|
1212 | 1253 | } |
---|
1213 | 1254 | |
---|
1214 | | - String string = (String) object; |
---|
1215 | | - |
---|
1216 | 1255 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1217 | 1256 | // if( object instanceof java.io.File[]) |
---|
1218 | 1257 | // { |
---|
.. | .. |
---|
1220 | 1259 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1221 | 1260 | // return; |
---|
1222 | 1261 | // } |
---|
| 1262 | + |
---|
| 1263 | + String string = object.toString(); |
---|
1223 | 1264 | |
---|
1224 | 1265 | // File path for Mac and Windows |
---|
1225 | 1266 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1469 | 1510 | animationItem.addItemListener(this); |
---|
1470 | 1511 | animationItem.setState(Globals.ANIMATION); |
---|
1471 | 1512 | |
---|
| 1513 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1514 | + archiveItem.addActionListener(this); |
---|
| 1515 | + |
---|
1472 | 1516 | menu.add("-"); |
---|
1473 | 1517 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1474 | 1518 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1481 | 1525 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1482 | 1526 | reduce34MorphItem.addActionListener(this); |
---|
1483 | 1527 | menu.add("-"); |
---|
| 1528 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1529 | + memoryItem.addActionListener(this); |
---|
1484 | 1530 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1485 | 1531 | computeAOItem.addActionListener(this); |
---|
1486 | 1532 | |
---|
.. | .. |
---|
1489 | 1535 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1490 | 1536 | mirrorItem.addActionListener(this); |
---|
1491 | 1537 | menu.add("-"); |
---|
1492 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1493 | | - memoryItem.addActionListener(this); |
---|
1494 | 1538 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1495 | 1539 | analyzeItem.addActionListener(this); |
---|
1496 | 1540 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1651 | 1695 | listUI.remove(i); |
---|
1652 | 1696 | } |
---|
1653 | 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 |
---|
1654 | 1708 | } |
---|
1655 | 1709 | |
---|
1656 | 1710 | /** |
---|
.. | .. |
---|
2213 | 2267 | } else |
---|
2214 | 2268 | if (source == undoButton) |
---|
2215 | 2269 | { |
---|
| 2270 | + // Go to previous version |
---|
| 2271 | + //if (!Undo()) |
---|
| 2272 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2216 | 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(); |
---|
2217 | 2284 | } else |
---|
2218 | 2285 | if (source == redoButton) |
---|
2219 | 2286 | { |
---|
| 2287 | + // Go to next version |
---|
2220 | 2288 | Redo(); |
---|
2221 | 2289 | } else |
---|
2222 | 2290 | if (source == saveButton) |
---|
2223 | 2291 | { |
---|
2224 | | - Save(); |
---|
| 2292 | + // Save a new version |
---|
| 2293 | + if (!Save(true)) |
---|
| 2294 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2225 | 2295 | } else |
---|
2226 | 2296 | if (source == oneStepButton) |
---|
2227 | 2297 | { |
---|
.. | .. |
---|
2230 | 2300 | } else |
---|
2231 | 2301 | if (source == screenfitButton) |
---|
2232 | 2302 | { |
---|
2233 | | - //Reload(lastConverter, lastFilename, true); |
---|
2234 | 2303 | ScreenFit(); |
---|
2235 | 2304 | } else |
---|
2236 | 2305 | if (source == screenfitpointButton) |
---|
2237 | 2306 | { |
---|
2238 | | - //Reload(lastConverter, lastFilename, true); |
---|
2239 | 2307 | ScreenFitPoint(); |
---|
2240 | 2308 | } else |
---|
2241 | 2309 | if (source == snapobjectButton) |
---|
2242 | 2310 | { |
---|
2243 | | - //Reload(lastConverter, lastFilename, true); |
---|
2244 | 2311 | SnapObject(); |
---|
2245 | 2312 | } else |
---|
2246 | 2313 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2604 | 2671 | { |
---|
2605 | 2672 | StepAll(); |
---|
2606 | 2673 | } else |
---|
2607 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2608 | 2675 | { |
---|
2609 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2610 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3468 | 3535 | } |
---|
3469 | 3536 | |
---|
3470 | 3537 | copy = group; |
---|
| 3538 | + |
---|
| 3539 | + SetUndoStates(); |
---|
| 3540 | + |
---|
3471 | 3541 | //Globals.theRenderer.object = group; |
---|
3472 | 3542 | if(!useclient) |
---|
3473 | 3543 | { |
---|
.. | .. |
---|
3496 | 3566 | radio.layout.doClick(); |
---|
3497 | 3567 | |
---|
3498 | 3568 | ClearUnpinned(); |
---|
3499 | | - SetPinStates(group.selection.size() > 0); |
---|
3500 | | - 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) |
---|
3501 | 3573 | EditSelection(false); |
---|
3502 | 3574 | keepparent = group.parent; |
---|
3503 | 3575 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4568 | 4640 | |
---|
4569 | 4641 | void EditSelection(boolean newWindow) |
---|
4570 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4571 | 4649 | // aConstraints.gridy = 0; |
---|
4572 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4573 | 4651 | { |
---|
.. | .. |
---|
4578 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4579 | 4657 | if(elem != group || !newWindow) |
---|
4580 | 4658 | { |
---|
4581 | | - // if (!(elem instanceof Composite)) |
---|
4582 | | - // newWindow = false; |
---|
4583 | | - listUI.add(elem); |
---|
4584 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4585 | | - System.out.println("edit : " + elem); |
---|
4586 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4587 | 4660 | } |
---|
4588 | 4661 | } |
---|
4589 | 4662 | } |
---|
.. | .. |
---|
4727 | 4800 | |
---|
4728 | 4801 | void refreshContents(boolean cp) |
---|
4729 | 4802 | { |
---|
4730 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4731 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4804 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4732 | 4805 | { |
---|
4733 | 4806 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4734 | 4807 | |
---|
.. | .. |
---|
4827 | 4900 | |
---|
4828 | 4901 | if (cut) |
---|
4829 | 4902 | { |
---|
4830 | | - if (Globals.SAVEONMAKE) |
---|
4831 | | - Save(); |
---|
| 4903 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4904 | +// Save(); |
---|
4832 | 4905 | //int indices[] = jList.getSelectedIndices(); |
---|
4833 | 4906 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4834 | 4907 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4931 | 5004 | |
---|
4932 | 5005 | void paste(boolean expand) |
---|
4933 | 5006 | { |
---|
| 5007 | + if (Globals.REPLACEONMAKE) |
---|
| 5008 | + Save(); |
---|
| 5009 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5010 | + Globals.REPLACEONMAKE = false; |
---|
4934 | 5011 | // if (GrafreeD.clipboard == null) |
---|
4935 | 5012 | // return; |
---|
4936 | 5013 | boolean first = true; |
---|
.. | .. |
---|
4990 | 5067 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4991 | 5068 | } |
---|
4992 | 5069 | |
---|
| 5070 | + Globals.REPLACEONMAKE = keep; |
---|
4993 | 5071 | ResetModel(); |
---|
4994 | 5072 | refreshContents(); |
---|
4995 | 5073 | } |
---|
.. | .. |
---|
5125 | 5203 | |
---|
5126 | 5204 | void group(Object3D csg, boolean grab) |
---|
5127 | 5205 | { |
---|
| 5206 | + if (Globals.REPLACEONMAKE) |
---|
| 5207 | + Save(); |
---|
| 5208 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5209 | + Globals.REPLACEONMAKE = false; |
---|
5128 | 5210 | if (//false) // why?? |
---|
5129 | 5211 | !group.selection.isEmpty()) |
---|
5130 | 5212 | { |
---|
.. | .. |
---|
5238 | 5320 | //node.add(csg); |
---|
5239 | 5321 | //makeSomething(node); |
---|
5240 | 5322 | makeSomething(csg); |
---|
| 5323 | + Globals.REPLACEONMAKE = keep; |
---|
5241 | 5324 | } |
---|
5242 | 5325 | |
---|
5243 | 5326 | void Ungroup(Object3D g) |
---|
5244 | 5327 | { |
---|
| 5328 | + if (Globals.REPLACEONMAKE) |
---|
| 5329 | + Save(); |
---|
| 5330 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5331 | + Globals.REPLACEONMAKE = false; |
---|
5245 | 5332 | if (g instanceof HiddenObject) |
---|
5246 | 5333 | { |
---|
5247 | 5334 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5258 | 5345 | objEditor.makeSomething(g.get(i), false); |
---|
5259 | 5346 | } |
---|
5260 | 5347 | } |
---|
| 5348 | + Globals.REPLACEONMAKE = keep; |
---|
5261 | 5349 | } |
---|
5262 | 5350 | |
---|
5263 | 5351 | void ungroup() |
---|
.. | .. |
---|
5621 | 5709 | private MenuItem pasteLinkItem; |
---|
5622 | 5710 | private MenuItem pasteCloneItem; |
---|
5623 | 5711 | private MenuItem pasteExpandItem; |
---|
5624 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5625 | 5713 | private MenuItem clearAllItem; |
---|
5626 | 5714 | private MenuItem genUVItem; |
---|
5627 | 5715 | private MenuItem genNormalsMESHItem; |
---|