.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.REPLACEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 90 | + Globals.REPLACEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
220 | 225 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 226 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 227 | |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 229 | toggleHandleItem.addItemListener(this); |
---|
225 | 230 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 231 | |
---|
.. | .. |
---|
380 | 385 | shadowYItem.addActionListener(this); |
---|
381 | 386 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
383 | 391 | if (Globals.ADVANCED) |
---|
384 | 392 | { |
---|
385 | 393 | menu.add("-"); |
---|
386 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 395 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 397 | templateItem.addActionListener(this); |
---|
392 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
538 | 544 | buildToolsMenu(menu); |
---|
539 | 545 | } |
---|
540 | 546 | |
---|
| 547 | + |
---|
541 | 548 | void SetupUI2(ObjEditor oe) |
---|
542 | 549 | { |
---|
543 | 550 | // June 2019 |
---|
.. | .. |
---|
582 | 589 | */ |
---|
583 | 590 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 591 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 592 | + copyOptionsPanel.preferredHeight = 1; |
---|
586 | 593 | |
---|
587 | 594 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 595 | |
---|
.. | .. |
---|
590 | 597 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 598 | //minButton.addActionListener(this); |
---|
592 | 599 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 600 | + if (Globals.ADVANCED) |
---|
| 601 | + { |
---|
| 602 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + maxButton.setToolTipText("Maximize window"); |
---|
| 604 | + maxButton.addActionListener(this); |
---|
| 605 | + } |
---|
596 | 606 | |
---|
597 | 607 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 608 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 609 | fullButton.addActionListener(this); |
---|
600 | 610 | |
---|
| 611 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 613 | + screenfitButton.addActionListener(this); |
---|
| 614 | + |
---|
601 | 615 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 616 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 617 | restoreCameraButton.addActionListener(this); |
---|
604 | 618 | |
---|
| 619 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + saveButton.setToolTipText("New version"); |
---|
| 621 | + saveButton.addActionListener(this); |
---|
| 622 | + |
---|
605 | 623 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 624 | + undoButton.setToolTipText("Previous version"); |
---|
607 | 625 | undoButton.addActionListener(this); |
---|
608 | 626 | undoButton.setEnabled(false); |
---|
609 | 627 | |
---|
| 628 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 629 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreButton.setToolTipText("Restore current"); |
---|
| 631 | + restoreButton.addActionListener(this); |
---|
| 632 | + restoreButton.setEnabled(false); |
---|
| 633 | + |
---|
| 634 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + replaceButton.setToolTipText("Replace current"); |
---|
| 636 | + replaceButton.addActionListener(this); |
---|
| 637 | + replaceButton.setEnabled(false); |
---|
| 638 | + |
---|
| 639 | + copyOptionsPanel.add(updown); |
---|
| 640 | + |
---|
610 | 641 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
611 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 642 | + redoButton.setToolTipText("Next version"); |
---|
612 | 643 | redoButton.addActionListener(this); |
---|
613 | 644 | redoButton.setEnabled(false); |
---|
614 | 645 | |
---|
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); |
---|
| 646 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
620 | 647 | liveCB.setToolTipText("Enable animation"); |
---|
621 | 648 | liveCB.addItemListener(this); |
---|
622 | 649 | |
---|
623 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 651 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
625 | 652 | oneStepButton.addActionListener(this); |
---|
626 | 653 | |
---|
627 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 654 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
628 | 655 | fastCB.setToolTipText("Fast mode"); |
---|
629 | 656 | fastCB.addItemListener(this); |
---|
630 | 657 | |
---|
631 | 658 | //oe.toolboxPanel.Return(); |
---|
632 | 659 | |
---|
633 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
635 | | - screenfitButton.addActionListener(this); |
---|
636 | | - |
---|
637 | 660 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
638 | 661 | // trackCB.setToolTipText("Enable tracking"); |
---|
639 | 662 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
726 | 749 | compositeButton.addActionListener(this); |
---|
727 | 750 | |
---|
728 | 751 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
729 | | - switchButton.setToolTipText("Create switch"); |
---|
| 752 | + switchButton.setToolTipText("Create item switcher"); |
---|
730 | 753 | switchButton.addActionListener(this); |
---|
731 | 754 | |
---|
732 | 755 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
811 | 834 | |
---|
812 | 835 | oe.treePanel.add(copyOptionsPanel); |
---|
813 | 836 | oe.treePanel.Return(); |
---|
| 837 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0); |
---|
| 838 | + versionField = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 839 | + sliderPane.preferredHeight = 1; |
---|
814 | 840 | |
---|
815 | 841 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
816 | 842 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
863 | 889 | |
---|
864 | 890 | if (true) // Globals.ADVANCED) |
---|
865 | 891 | { |
---|
866 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
867 | | - supportCB.setToolTipText("Enable rigging"); |
---|
868 | | - supportCB.addItemListener(this); |
---|
| 892 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 893 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 894 | +// supportCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 897 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 898 | + freezeCB.addItemListener(this); |
---|
869 | 899 | |
---|
870 | 900 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
871 | 901 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
929 | 959 | toggleTextureCB.addItemListener(this); |
---|
930 | 960 | |
---|
931 | 961 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
932 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 962 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
933 | 963 | toggleSwitchCB.addItemListener(this); |
---|
934 | 964 | |
---|
935 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
936 | | - autosaveCB.setToolTipText("On structure change"); |
---|
937 | | - autosaveCB.addItemListener(this); |
---|
| 965 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 966 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 967 | + autokeepCB.addItemListener(this); |
---|
938 | 968 | |
---|
939 | 969 | panel.Return(); |
---|
940 | 970 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
963 | 993 | { |
---|
964 | 994 | cRadio radioButton = new cRadio(obj.name); |
---|
965 | 995 | |
---|
966 | | - // Patch to avoid bug with transparency. |
---|
| 996 | + // June 2019. Patch to avoid bug with transparency. |
---|
967 | 997 | radioButton.hadMaterial = obj.material != null; |
---|
968 | 998 | if (!radioButton.hadMaterial) |
---|
969 | 999 | { |
---|
.. | .. |
---|
1000 | 1030 | cCheckBox slowCB; |
---|
1001 | 1031 | cCheckBox boxCB; |
---|
1002 | 1032 | cCheckBox zoomBoxCB; |
---|
| 1033 | + cCheckBox freezeCB; |
---|
1003 | 1034 | //cToggleButton trackCB; |
---|
1004 | 1035 | cCheckBox trackCB; |
---|
1005 | 1036 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1010 | 1041 | |
---|
1011 | 1042 | cCheckBox oeilCB; |
---|
1012 | 1043 | cCheckBox shadowCB; |
---|
1013 | | - cCheckBox autosaveCB; |
---|
| 1044 | + cCheckBox autokeepCB; |
---|
1014 | 1045 | cCheckBox lookAtCB; |
---|
1015 | 1046 | |
---|
1016 | 1047 | // static int COLOR = 1; |
---|
.. | .. |
---|
1118 | 1149 | { |
---|
1119 | 1150 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1120 | 1151 | } |
---|
1121 | | - else if(e.getSource() == autosaveCB) |
---|
| 1152 | + else if(e.getSource() == freezeCB) |
---|
1122 | 1153 | { |
---|
1123 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1154 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1155 | + } |
---|
| 1156 | + else if(e.getSource() == autokeepCB) |
---|
| 1157 | + { |
---|
| 1158 | + Globals.REPLACEONMAKE ^= true; |
---|
1124 | 1159 | } |
---|
1125 | 1160 | else if(e.getSource() == lookAtCB) |
---|
1126 | 1161 | { |
---|
.. | .. |
---|
1202 | 1237 | } |
---|
1203 | 1238 | } |
---|
1204 | 1239 | |
---|
1205 | | - String string = (String) object; |
---|
1206 | | - |
---|
1207 | 1240 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1208 | 1241 | // if( object instanceof java.io.File[]) |
---|
1209 | 1242 | // { |
---|
.. | .. |
---|
1211 | 1244 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1212 | 1245 | // return; |
---|
1213 | 1246 | // } |
---|
| 1247 | + |
---|
| 1248 | + String string = object.toString(); |
---|
1214 | 1249 | |
---|
1215 | 1250 | // File path for Mac and Windows |
---|
1216 | 1251 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1460 | 1495 | animationItem.addItemListener(this); |
---|
1461 | 1496 | animationItem.setState(Globals.ANIMATION); |
---|
1462 | 1497 | |
---|
| 1498 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1499 | + archiveItem.addActionListener(this); |
---|
| 1500 | + |
---|
1463 | 1501 | menu.add("-"); |
---|
1464 | 1502 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1465 | 1503 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1472 | 1510 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1473 | 1511 | reduce34MorphItem.addActionListener(this); |
---|
1474 | 1512 | menu.add("-"); |
---|
| 1513 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1514 | + memoryItem.addActionListener(this); |
---|
1475 | 1515 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1476 | 1516 | computeAOItem.addActionListener(this); |
---|
1477 | 1517 | |
---|
.. | .. |
---|
1480 | 1520 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1481 | 1521 | mirrorItem.addActionListener(this); |
---|
1482 | 1522 | menu.add("-"); |
---|
1483 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1484 | | - memoryItem.addActionListener(this); |
---|
1485 | 1523 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1486 | 1524 | analyzeItem.addActionListener(this); |
---|
1487 | 1525 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
2122 | 2160 | Composite csg = new GroupLeaf(); |
---|
2123 | 2161 | csg.count = 5; |
---|
2124 | 2162 | group(csg); |
---|
2125 | | - Composite child = new cGroup(); |
---|
| 2163 | + Composite child = new cGroup("Branch"); |
---|
2126 | 2164 | csg.addChild(child); |
---|
2127 | 2165 | child.addChild(csg); |
---|
2128 | 2166 | } else |
---|
2129 | 2167 | if (source == doubleItem) |
---|
2130 | 2168 | { |
---|
2131 | | - Composite csg = new GroupLeaf(); |
---|
| 2169 | + Composite csg = new GroupLeaf("Fork"); |
---|
2132 | 2170 | csg.count = 5; |
---|
2133 | 2171 | group(csg); |
---|
2134 | | - Composite child = new cGroup(); |
---|
| 2172 | + Composite child = new cGroup("Branch A"); |
---|
2135 | 2173 | csg.addChild(child); |
---|
2136 | 2174 | child.addChild(csg); |
---|
2137 | | - child = new cGroup(); |
---|
| 2175 | + child = new cGroup("Branch B"); |
---|
2138 | 2176 | csg.addChild(child); |
---|
2139 | 2177 | child.addChild(csg); |
---|
2140 | 2178 | } else |
---|
2141 | 2179 | if (source == tripleItem) |
---|
2142 | 2180 | { |
---|
2143 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Trident"); |
---|
2144 | 2182 | csg.count = 4; |
---|
2145 | 2183 | group(csg); |
---|
2146 | 2184 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2204 | 2242 | } else |
---|
2205 | 2243 | if (source == undoButton) |
---|
2206 | 2244 | { |
---|
| 2245 | + // Go to previous version |
---|
| 2246 | + //if (!Undo()) |
---|
| 2247 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2207 | 2248 | Undo(); |
---|
| 2249 | + } else |
---|
| 2250 | + if (source == restoreButton) |
---|
| 2251 | + { |
---|
| 2252 | + // Restore current version |
---|
| 2253 | + Restore(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == replaceButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Overwrite current version |
---|
| 2258 | + Replace(); |
---|
2208 | 2259 | } else |
---|
2209 | 2260 | if (source == redoButton) |
---|
2210 | 2261 | { |
---|
| 2262 | + // Go to next version |
---|
2211 | 2263 | Redo(); |
---|
2212 | 2264 | } else |
---|
2213 | 2265 | if (source == saveButton) |
---|
2214 | 2266 | { |
---|
2215 | | - Save(); |
---|
| 2267 | + // Save a new version |
---|
| 2268 | + if (!Save(true)) |
---|
| 2269 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2216 | 2270 | } else |
---|
2217 | 2271 | if (source == oneStepButton) |
---|
2218 | 2272 | { |
---|
.. | .. |
---|
2221 | 2275 | } else |
---|
2222 | 2276 | if (source == screenfitButton) |
---|
2223 | 2277 | { |
---|
2224 | | - //Reload(lastConverter, lastFilename, true); |
---|
2225 | 2278 | ScreenFit(); |
---|
2226 | 2279 | } else |
---|
2227 | 2280 | if (source == screenfitpointButton) |
---|
2228 | 2281 | { |
---|
2229 | | - //Reload(lastConverter, lastFilename, true); |
---|
2230 | 2282 | ScreenFitPoint(); |
---|
2231 | 2283 | } else |
---|
2232 | 2284 | if (source == snapobjectButton) |
---|
2233 | 2285 | { |
---|
2234 | | - //Reload(lastConverter, lastFilename, true); |
---|
2235 | 2286 | SnapObject(); |
---|
2236 | 2287 | } else |
---|
2237 | 2288 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2755 | 2806 | } else |
---|
2756 | 2807 | if (source == ungroupItem || source == ungroupButton) |
---|
2757 | 2808 | { |
---|
2758 | | - //ungroup(); |
---|
| 2809 | + boolean hasRoot = false; |
---|
| 2810 | + |
---|
2759 | 2811 | for (int i=0; i<group.selection.size(); i++) |
---|
2760 | 2812 | { |
---|
2761 | | - Ungroup(group.selection.get(i)); |
---|
| 2813 | + if (group.selection.get(i) == group) |
---|
| 2814 | + { |
---|
| 2815 | + hasRoot = true; |
---|
| 2816 | + break; |
---|
| 2817 | + } |
---|
2762 | 2818 | } |
---|
2763 | 2819 | |
---|
2764 | | - ClearSelection(false); |
---|
2765 | | - |
---|
2766 | | - refreshContents(); |
---|
| 2820 | + if (!hasRoot) |
---|
| 2821 | + { |
---|
| 2822 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2823 | + { |
---|
| 2824 | + Ungroup(group.selection.get(i)); |
---|
| 2825 | + } |
---|
| 2826 | + |
---|
| 2827 | + ClearSelection(false); |
---|
| 2828 | + |
---|
| 2829 | + refreshContents(); |
---|
| 2830 | + } |
---|
2767 | 2831 | } else |
---|
2768 | 2832 | if (source == genUVItem) |
---|
2769 | 2833 | { |
---|
.. | .. |
---|
3446 | 3510 | } |
---|
3447 | 3511 | |
---|
3448 | 3512 | copy = group; |
---|
| 3513 | + |
---|
| 3514 | + SetUndoStates(); |
---|
| 3515 | + |
---|
3449 | 3516 | //Globals.theRenderer.object = group; |
---|
3450 | 3517 | if(!useclient) |
---|
3451 | 3518 | { |
---|
.. | .. |
---|
4706 | 4773 | void refreshContents(boolean cp) |
---|
4707 | 4774 | { |
---|
4708 | 4775 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4709 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4776 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4710 | 4777 | { |
---|
4711 | 4778 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4712 | 4779 | |
---|
.. | .. |
---|
4805 | 4872 | |
---|
4806 | 4873 | if (cut) |
---|
4807 | 4874 | { |
---|
4808 | | - if (Globals.SAVEONMAKE) |
---|
4809 | | - Save(); |
---|
| 4875 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4876 | +// Save(); |
---|
4810 | 4877 | //int indices[] = jList.getSelectedIndices(); |
---|
4811 | 4878 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4812 | 4879 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4909 | 4976 | |
---|
4910 | 4977 | void paste(boolean expand) |
---|
4911 | 4978 | { |
---|
| 4979 | + if (Globals.REPLACEONMAKE) |
---|
| 4980 | + Save(); |
---|
| 4981 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4982 | + Globals.REPLACEONMAKE = false; |
---|
4912 | 4983 | // if (GrafreeD.clipboard == null) |
---|
4913 | 4984 | // return; |
---|
4914 | 4985 | boolean first = true; |
---|
.. | .. |
---|
4968 | 5039 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4969 | 5040 | } |
---|
4970 | 5041 | |
---|
| 5042 | + Globals.REPLACEONMAKE = keep; |
---|
4971 | 5043 | ResetModel(); |
---|
4972 | 5044 | refreshContents(); |
---|
4973 | 5045 | } |
---|
.. | .. |
---|
5103 | 5175 | |
---|
5104 | 5176 | void group(Object3D csg, boolean grab) |
---|
5105 | 5177 | { |
---|
| 5178 | + if (Globals.REPLACEONMAKE) |
---|
| 5179 | + Save(); |
---|
| 5180 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5181 | + Globals.REPLACEONMAKE = false; |
---|
5106 | 5182 | if (//false) // why?? |
---|
5107 | 5183 | !group.selection.isEmpty()) |
---|
5108 | 5184 | { |
---|
.. | .. |
---|
5216 | 5292 | //node.add(csg); |
---|
5217 | 5293 | //makeSomething(node); |
---|
5218 | 5294 | makeSomething(csg); |
---|
| 5295 | + Globals.REPLACEONMAKE = keep; |
---|
5219 | 5296 | } |
---|
5220 | 5297 | |
---|
5221 | 5298 | void Ungroup(Object3D g) |
---|
5222 | 5299 | { |
---|
| 5300 | + if (Globals.REPLACEONMAKE) |
---|
| 5301 | + Save(); |
---|
| 5302 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5303 | + Globals.REPLACEONMAKE = false; |
---|
5223 | 5304 | if (g instanceof HiddenObject) |
---|
5224 | 5305 | { |
---|
5225 | 5306 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5236 | 5317 | objEditor.makeSomething(g.get(i), false); |
---|
5237 | 5318 | } |
---|
5238 | 5319 | } |
---|
| 5320 | + Globals.REPLACEONMAKE = keep; |
---|
5239 | 5321 | } |
---|
5240 | 5322 | |
---|
5241 | 5323 | void ungroup() |
---|
.. | .. |
---|
5526 | 5608 | |
---|
5527 | 5609 | cButton restoreCameraButton; |
---|
5528 | 5610 | |
---|
5529 | | - cButton minButton; |
---|
5530 | | - cButton maxButton; |
---|
5531 | | - cButton fullButton; |
---|
5532 | 5611 | cButton saveButton; |
---|
5533 | 5612 | cButton oneStepButton; |
---|
5534 | 5613 | |
---|