.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.SAVEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 90 | + Globals.SAVEONMAKE = 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.SAVEONMAKE = 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")); |
---|
.. | .. |
---|
582 | 588 | */ |
---|
583 | 589 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 590 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 591 | + copyOptionsPanel.preferredHeight = 1; |
---|
586 | 592 | |
---|
587 | 593 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 594 | |
---|
.. | .. |
---|
590 | 596 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 597 | //minButton.addActionListener(this); |
---|
592 | 598 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 599 | + if (Globals.ADVANCED) |
---|
| 600 | + { |
---|
| 601 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + maxButton.setToolTipText("Maximize window"); |
---|
| 603 | + maxButton.addActionListener(this); |
---|
| 604 | + } |
---|
596 | 605 | |
---|
597 | 606 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 607 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 608 | fullButton.addActionListener(this); |
---|
600 | 609 | |
---|
| 610 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 612 | + screenfitButton.addActionListener(this); |
---|
| 613 | + |
---|
601 | 614 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 615 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 616 | restoreCameraButton.addActionListener(this); |
---|
.. | .. |
---|
605 | 618 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | 619 | undoButton.setToolTipText("Undo changes"); |
---|
607 | 620 | undoButton.addActionListener(this); |
---|
| 621 | + undoButton.setEnabled(false); |
---|
608 | 622 | |
---|
609 | 623 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
610 | 624 | redoButton.setToolTipText("Redo changes"); |
---|
611 | 625 | redoButton.addActionListener(this); |
---|
| 626 | + redoButton.setEnabled(false); |
---|
612 | 627 | |
---|
613 | 628 | copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
614 | 629 | saveButton.setToolTipText("Save changes"); |
---|
.. | .. |
---|
628 | 643 | |
---|
629 | 644 | //oe.toolboxPanel.Return(); |
---|
630 | 645 | |
---|
631 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
632 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
633 | | - screenfitButton.addActionListener(this); |
---|
634 | | - |
---|
635 | 646 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
636 | 647 | // trackCB.setToolTipText("Enable tracking"); |
---|
637 | 648 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
724 | 735 | compositeButton.addActionListener(this); |
---|
725 | 736 | |
---|
726 | 737 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
727 | | - switchButton.setToolTipText("Create switch"); |
---|
| 738 | + switchButton.setToolTipText("Create item switcher"); |
---|
728 | 739 | switchButton.addActionListener(this); |
---|
729 | 740 | |
---|
730 | 741 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
743 | 754 | lightButton.setToolTipText("Create light"); |
---|
744 | 755 | lightButton.addActionListener(this); |
---|
745 | 756 | |
---|
| 757 | + for (int i=6; --i>=0;) |
---|
| 758 | + { |
---|
| 759 | + oe.toolboxPanel.Return(); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 762 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 763 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 764 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 765 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 766 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 767 | + } |
---|
| 768 | + |
---|
746 | 769 | // EDIT panel |
---|
747 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
748 | | - editButton.setToolTipText("Edit selection"); |
---|
| 770 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 771 | + editButton.setToolTipText("Pin selection controls"); |
---|
749 | 772 | editButton.addActionListener(this); |
---|
750 | 773 | |
---|
751 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
752 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 774 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 775 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
753 | 776 | uneditButton.addActionListener(this); |
---|
754 | 777 | |
---|
755 | 778 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
756 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 779 | + allParamsButton.setToolTipText("Show all controle"); |
---|
757 | 780 | allParamsButton.addActionListener(this); |
---|
758 | 781 | |
---|
759 | 782 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
770 | 793 | |
---|
771 | 794 | editCommandsPanel.preferredHeight = 1; |
---|
772 | 795 | |
---|
| 796 | + SetPinStates(false); |
---|
773 | 797 | // oe.treePanel.add(commandsPanel); |
---|
774 | 798 | // oe.treePanel.Return(); |
---|
775 | 799 | |
---|
.. | .. |
---|
843 | 867 | boxCB.addItemListener(this); |
---|
844 | 868 | |
---|
845 | 869 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
846 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 870 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
847 | 871 | zoomBoxCB.addItemListener(this); |
---|
848 | 872 | |
---|
849 | 873 | if (true) // Globals.ADVANCED) |
---|
850 | 874 | { |
---|
851 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
852 | | - supportCB.setToolTipText("Enable rigging"); |
---|
853 | | - supportCB.addItemListener(this); |
---|
| 875 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 876 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 877 | +// supportCB.addItemListener(this); |
---|
| 878 | + |
---|
| 879 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 880 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 881 | + freezeCB.addItemListener(this); |
---|
854 | 882 | |
---|
855 | 883 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
856 | 884 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
905 | 933 | oeilCB.addItemListener(this); |
---|
906 | 934 | |
---|
907 | 935 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
908 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 936 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
909 | 937 | shadowCB.addItemListener(this); |
---|
910 | 938 | |
---|
911 | 939 | panel.Return(); |
---|
.. | .. |
---|
914 | 942 | toggleTextureCB.addItemListener(this); |
---|
915 | 943 | |
---|
916 | 944 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
917 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 945 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
918 | 946 | toggleSwitchCB.addItemListener(this); |
---|
919 | 947 | |
---|
920 | 948 | panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
921 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 949 | + autosaveCB.setToolTipText("On structure change"); |
---|
922 | 950 | autosaveCB.addItemListener(this); |
---|
923 | 951 | |
---|
924 | 952 | panel.Return(); |
---|
.. | .. |
---|
948 | 976 | { |
---|
949 | 977 | cRadio radioButton = new cRadio(obj.name); |
---|
950 | 978 | |
---|
951 | | - // Patch to avoid bug with transparency. |
---|
| 979 | + // June 2019. Patch to avoid bug with transparency. |
---|
952 | 980 | radioButton.hadMaterial = obj.material != null; |
---|
953 | 981 | if (!radioButton.hadMaterial) |
---|
954 | 982 | { |
---|
.. | .. |
---|
985 | 1013 | cCheckBox slowCB; |
---|
986 | 1014 | cCheckBox boxCB; |
---|
987 | 1015 | cCheckBox zoomBoxCB; |
---|
| 1016 | + cCheckBox freezeCB; |
---|
988 | 1017 | //cToggleButton trackCB; |
---|
989 | 1018 | cCheckBox trackCB; |
---|
990 | 1019 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1103 | 1132 | { |
---|
1104 | 1133 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1105 | 1134 | } |
---|
| 1135 | + else if(e.getSource() == freezeCB) |
---|
| 1136 | + { |
---|
| 1137 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1138 | + } |
---|
1106 | 1139 | else if(e.getSource() == autosaveCB) |
---|
1107 | 1140 | { |
---|
1108 | 1141 | Globals.SAVEONMAKE ^= true; |
---|
.. | .. |
---|
1187 | 1220 | } |
---|
1188 | 1221 | } |
---|
1189 | 1222 | |
---|
1190 | | - String string = (String) object; |
---|
1191 | | - |
---|
1192 | 1223 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1193 | 1224 | // if( object instanceof java.io.File[]) |
---|
1194 | 1225 | // { |
---|
.. | .. |
---|
1196 | 1227 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1197 | 1228 | // return; |
---|
1198 | 1229 | // } |
---|
| 1230 | + |
---|
| 1231 | + String string = object.toString(); |
---|
1199 | 1232 | |
---|
1200 | 1233 | // File path for Mac and Windows |
---|
1201 | 1234 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1445 | 1478 | animationItem.addItemListener(this); |
---|
1446 | 1479 | animationItem.setState(Globals.ANIMATION); |
---|
1447 | 1480 | |
---|
| 1481 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1482 | + archiveItem.addActionListener(this); |
---|
| 1483 | + |
---|
1448 | 1484 | menu.add("-"); |
---|
1449 | 1485 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1450 | 1486 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1457 | 1493 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1458 | 1494 | reduce34MorphItem.addActionListener(this); |
---|
1459 | 1495 | menu.add("-"); |
---|
| 1496 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1497 | + memoryItem.addActionListener(this); |
---|
1460 | 1498 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1461 | 1499 | computeAOItem.addActionListener(this); |
---|
1462 | 1500 | |
---|
.. | .. |
---|
1465 | 1503 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1466 | 1504 | mirrorItem.addActionListener(this); |
---|
1467 | 1505 | menu.add("-"); |
---|
1468 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1469 | | - memoryItem.addActionListener(this); |
---|
1470 | 1506 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1471 | 1507 | analyzeItem.addActionListener(this); |
---|
1472 | 1508 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1614 | 1650 | |
---|
1615 | 1651 | makeSomething(shadow); |
---|
1616 | 1652 | } |
---|
| 1653 | + |
---|
| 1654 | + private void ClearUnpinned() |
---|
| 1655 | + { |
---|
| 1656 | + //for (Object3D obj : listUI) |
---|
| 1657 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1658 | + { |
---|
| 1659 | + Object3D obj = listUI.elementAt(i); |
---|
| 1660 | + if (!obj.pinned) |
---|
| 1661 | + { |
---|
| 1662 | + obj.CloseUI(); |
---|
| 1663 | + listUI.remove(i); |
---|
| 1664 | + } |
---|
| 1665 | + } |
---|
| 1666 | + } |
---|
1617 | 1667 | |
---|
1618 | 1668 | /** |
---|
1619 | 1669 | * applyExample |
---|
.. | .. |
---|
2093 | 2143 | Composite csg = new GroupLeaf(); |
---|
2094 | 2144 | csg.count = 5; |
---|
2095 | 2145 | group(csg); |
---|
2096 | | - Composite child = new cGroup(); |
---|
| 2146 | + Composite child = new cGroup("Branch"); |
---|
2097 | 2147 | csg.addChild(child); |
---|
2098 | 2148 | child.addChild(csg); |
---|
2099 | 2149 | } else |
---|
2100 | 2150 | if (source == doubleItem) |
---|
2101 | 2151 | { |
---|
2102 | | - Composite csg = new GroupLeaf(); |
---|
| 2152 | + Composite csg = new GroupLeaf("Fork"); |
---|
2103 | 2153 | csg.count = 5; |
---|
2104 | 2154 | group(csg); |
---|
2105 | | - Composite child = new cGroup(); |
---|
| 2155 | + Composite child = new cGroup("Branch A"); |
---|
2106 | 2156 | csg.addChild(child); |
---|
2107 | 2157 | child.addChild(csg); |
---|
2108 | | - child = new cGroup(); |
---|
| 2158 | + child = new cGroup("Branch B"); |
---|
2109 | 2159 | csg.addChild(child); |
---|
2110 | 2160 | child.addChild(csg); |
---|
2111 | 2161 | } else |
---|
2112 | 2162 | if (source == tripleItem) |
---|
2113 | 2163 | { |
---|
2114 | | - Composite csg = new GroupLeaf(); |
---|
| 2164 | + Composite csg = new GroupLeaf("Trident"); |
---|
2115 | 2165 | csg.count = 4; |
---|
2116 | 2166 | group(csg); |
---|
2117 | 2167 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2175 | 2225 | } else |
---|
2176 | 2226 | if (source == undoButton) |
---|
2177 | 2227 | { |
---|
2178 | | - Undo(); |
---|
| 2228 | + if (!Undo()) |
---|
| 2229 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2179 | 2230 | } else |
---|
2180 | 2231 | if (source == redoButton) |
---|
2181 | 2232 | { |
---|
.. | .. |
---|
2183 | 2234 | } else |
---|
2184 | 2235 | if (source == saveButton) |
---|
2185 | 2236 | { |
---|
2186 | | - Save(); |
---|
| 2237 | + if (!Save(true)) |
---|
| 2238 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2187 | 2239 | } else |
---|
2188 | 2240 | if (source == oneStepButton) |
---|
2189 | 2241 | { |
---|
.. | .. |
---|
2192 | 2244 | } else |
---|
2193 | 2245 | if (source == screenfitButton) |
---|
2194 | 2246 | { |
---|
2195 | | - //Reload(lastConverter, lastFilename, true); |
---|
2196 | 2247 | ScreenFit(); |
---|
2197 | 2248 | } else |
---|
2198 | 2249 | if (source == screenfitpointButton) |
---|
2199 | 2250 | { |
---|
2200 | | - //Reload(lastConverter, lastFilename, true); |
---|
2201 | 2251 | ScreenFitPoint(); |
---|
2202 | 2252 | } else |
---|
2203 | 2253 | if (source == snapobjectButton) |
---|
2204 | 2254 | { |
---|
2205 | | - //Reload(lastConverter, lastFilename, true); |
---|
2206 | 2255 | SnapObject(); |
---|
2207 | 2256 | } else |
---|
2208 | 2257 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2726 | 2775 | } else |
---|
2727 | 2776 | if (source == ungroupItem || source == ungroupButton) |
---|
2728 | 2777 | { |
---|
2729 | | - //ungroup(); |
---|
| 2778 | + boolean hasRoot = false; |
---|
| 2779 | + |
---|
2730 | 2780 | for (int i=0; i<group.selection.size(); i++) |
---|
2731 | 2781 | { |
---|
2732 | | - Ungroup(group.selection.get(i)); |
---|
| 2782 | + if (group.selection.get(i) == group) |
---|
| 2783 | + { |
---|
| 2784 | + hasRoot = true; |
---|
| 2785 | + break; |
---|
| 2786 | + } |
---|
2733 | 2787 | } |
---|
2734 | 2788 | |
---|
2735 | | - ClearSelection(false); |
---|
2736 | | - |
---|
2737 | | - refreshContents(); |
---|
| 2789 | + if (!hasRoot) |
---|
| 2790 | + { |
---|
| 2791 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2792 | + { |
---|
| 2793 | + Ungroup(group.selection.get(i)); |
---|
| 2794 | + } |
---|
| 2795 | + |
---|
| 2796 | + ClearSelection(false); |
---|
| 2797 | + |
---|
| 2798 | + refreshContents(); |
---|
| 2799 | + } |
---|
2738 | 2800 | } else |
---|
2739 | 2801 | if (source == genUVItem) |
---|
2740 | 2802 | { |
---|
.. | .. |
---|
3326 | 3388 | } else |
---|
3327 | 3389 | if (source == editItem || source == editButton) |
---|
3328 | 3390 | { |
---|
| 3391 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3392 | + { |
---|
| 3393 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3394 | + child.pinned = true; |
---|
| 3395 | + } |
---|
| 3396 | + |
---|
3329 | 3397 | EditSelection(false); |
---|
3330 | 3398 | } else |
---|
3331 | 3399 | if (source == uneditButton) |
---|
.. | .. |
---|
3335 | 3403 | Object3D child = (Object3D)e.nextElement(); |
---|
3336 | 3404 | if(child.editWindow != null) |
---|
3337 | 3405 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3406 | + child.pinned = false; |
---|
3338 | 3407 | child.CloseUI(); |
---|
3339 | 3408 | listUI.remove(child); |
---|
3340 | 3409 | |
---|
.. | .. |
---|
3351 | 3420 | //copy.ClearUI(); |
---|
3352 | 3421 | for (Object3D obj : listUI) |
---|
3353 | 3422 | { |
---|
| 3423 | + obj.pinned = false; |
---|
3354 | 3424 | obj.CloseUI(); |
---|
3355 | 3425 | } |
---|
3356 | 3426 | listUI.clear(); |
---|
.. | .. |
---|
3360 | 3430 | { |
---|
3361 | 3431 | assert(copy == group); |
---|
3362 | 3432 | |
---|
3363 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3433 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3364 | 3434 | |
---|
3365 | 3435 | for (Object3D obj : listUI) |
---|
3366 | 3436 | { |
---|
.. | .. |
---|
3435 | 3505 | currentLayout = sevenButton; |
---|
3436 | 3506 | */ |
---|
3437 | 3507 | radio.layout.doClick(); |
---|
| 3508 | + |
---|
| 3509 | + ClearUnpinned(); |
---|
| 3510 | + SetPinStates(group.selection.size() > 0); |
---|
| 3511 | + if (group.selection.size() == 1) |
---|
| 3512 | + EditSelection(false); |
---|
3438 | 3513 | keepparent = group.parent; |
---|
3439 | 3514 | // PARENT = NULL or not??? |
---|
3440 | 3515 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
4502 | 4577 | // } |
---|
4503 | 4578 | // } |
---|
4504 | 4579 | |
---|
4505 | | - static boolean allparams = true; |
---|
4506 | | - |
---|
4507 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4508 | | - |
---|
4509 | 4580 | void EditSelection(boolean newWindow) |
---|
4510 | 4581 | { |
---|
4511 | 4582 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4598 | 4669 | //new Exception().printStackTrace(); |
---|
4599 | 4670 | |
---|
4600 | 4671 | freezemodel = true; |
---|
4601 | | - |
---|
| 4672 | + ClearUnpinned(); |
---|
| 4673 | + |
---|
4602 | 4674 | /**/ |
---|
4603 | 4675 | //switch (event.id) |
---|
4604 | 4676 | { |
---|
.. | .. |
---|
4631 | 4703 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4632 | 4704 | // a camera |
---|
4633 | 4705 | { |
---|
4634 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4706 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4635 | 4707 | { |
---|
4636 | 4708 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4637 | 4709 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4640 | 4712 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4641 | 4713 | } |
---|
4642 | 4714 | |
---|
| 4715 | + if (tps != null && tps.length == 1) |
---|
| 4716 | + { |
---|
| 4717 | + EditSelection(false); |
---|
| 4718 | + } |
---|
| 4719 | + |
---|
| 4720 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4721 | + |
---|
4643 | 4722 | refreshContents(); |
---|
4644 | 4723 | //return true; |
---|
4645 | 4724 | } |
---|
.. | .. |
---|
4649 | 4728 | freezemodel = false; |
---|
4650 | 4729 | } |
---|
4651 | 4730 | |
---|
| 4731 | + void SetPinStates(boolean enabled) |
---|
| 4732 | + { |
---|
| 4733 | + editButton.setEnabled(enabled); |
---|
| 4734 | + uneditButton.setEnabled(enabled); |
---|
| 4735 | + unselectButton.setEnabled(enabled); |
---|
| 4736 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4737 | + } |
---|
| 4738 | + |
---|
4652 | 4739 | void refreshContents(boolean cp) |
---|
4653 | 4740 | { |
---|
4654 | 4741 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4655 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4742 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4656 | 4743 | { |
---|
4657 | 4744 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4658 | 4745 | |
---|
.. | .. |
---|
4751 | 4838 | |
---|
4752 | 4839 | if (cut) |
---|
4753 | 4840 | { |
---|
4754 | | - if (Globals.SAVEONMAKE) |
---|
4755 | | - Save(); |
---|
| 4841 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4842 | +// Save(); |
---|
4756 | 4843 | //int indices[] = jList.getSelectedIndices(); |
---|
4757 | 4844 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4758 | 4845 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4855 | 4942 | |
---|
4856 | 4943 | void paste(boolean expand) |
---|
4857 | 4944 | { |
---|
| 4945 | + if (Globals.SAVEONMAKE) |
---|
| 4946 | + Save(); |
---|
| 4947 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 4948 | + Globals.SAVEONMAKE = false; |
---|
4858 | 4949 | // if (GrafreeD.clipboard == null) |
---|
4859 | 4950 | // return; |
---|
4860 | 4951 | boolean first = true; |
---|
.. | .. |
---|
4914 | 5005 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4915 | 5006 | } |
---|
4916 | 5007 | |
---|
| 5008 | + Globals.SAVEONMAKE = keep; |
---|
4917 | 5009 | ResetModel(); |
---|
4918 | 5010 | refreshContents(); |
---|
4919 | 5011 | } |
---|
.. | .. |
---|
5049 | 5141 | |
---|
5050 | 5142 | void group(Object3D csg, boolean grab) |
---|
5051 | 5143 | { |
---|
| 5144 | + if (Globals.SAVEONMAKE) |
---|
| 5145 | + Save(); |
---|
| 5146 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5147 | + Globals.SAVEONMAKE = false; |
---|
5052 | 5148 | if (//false) // why?? |
---|
5053 | 5149 | !group.selection.isEmpty()) |
---|
5054 | 5150 | { |
---|
.. | .. |
---|
5162 | 5258 | //node.add(csg); |
---|
5163 | 5259 | //makeSomething(node); |
---|
5164 | 5260 | makeSomething(csg); |
---|
| 5261 | + Globals.SAVEONMAKE = keep; |
---|
5165 | 5262 | } |
---|
5166 | 5263 | |
---|
5167 | 5264 | void Ungroup(Object3D g) |
---|
5168 | 5265 | { |
---|
| 5266 | + if (Globals.SAVEONMAKE) |
---|
| 5267 | + Save(); |
---|
| 5268 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5269 | + Globals.SAVEONMAKE = false; |
---|
5169 | 5270 | if (g instanceof HiddenObject) |
---|
5170 | 5271 | { |
---|
5171 | 5272 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5182 | 5283 | objEditor.makeSomething(g.get(i), false); |
---|
5183 | 5284 | } |
---|
5184 | 5285 | } |
---|
| 5286 | + Globals.SAVEONMAKE = keep; |
---|
5185 | 5287 | } |
---|
5186 | 5288 | |
---|
5187 | 5289 | void ungroup() |
---|
.. | .. |
---|
5472 | 5574 | |
---|
5473 | 5575 | cButton restoreCameraButton; |
---|
5474 | 5576 | |
---|
5475 | | - cButton minButton; |
---|
5476 | | - cButton maxButton; |
---|
5477 | | - cButton fullButton; |
---|
5478 | | - cButton undoButton; |
---|
5479 | | - cButton redoButton; |
---|
5480 | 5577 | cButton saveButton; |
---|
5481 | 5578 | cButton oneStepButton; |
---|
5482 | 5579 | |
---|