Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
GroupEditor.java
....@@ -84,6 +84,10 @@
8484
8585 void CloneSelection(boolean supports)
8686 {
87
+ if (Globals.REPLACEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.REPLACEONMAKE;
90
+ Globals.REPLACEONMAKE = false;
8791 // Object3D keep = GrafreeD.clipboard;
8892 //Object3D obj;
8993 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +98,7 @@
9498
9599 makeSomething(clone, i==group.selection.size()-1);
96100 }
101
+ Globals.REPLACEONMAKE = keep;
97102 }
98103
99104 void CloneClipboard(boolean supports)
....@@ -220,7 +225,7 @@
220225 // toggleSwitchItem.addItemListener(this);
221226 // toggleSwitchItem.setState(CameraPane.SWITCH);
222227
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224229 toggleHandleItem.addItemListener(this);
225230 toggleHandleItem.setState(CameraPane.HANDLES);
226231
....@@ -380,13 +385,14 @@
380385 shadowYItem.addActionListener(this);
381386 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
383391 if (Globals.ADVANCED)
384392 {
385393 menu.add("-");
386394 linkerItem = menu.add(new MenuItem("Linker"));
387395 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390396 templateItem = menu.add(new MenuItem("Template"));
391397 templateItem.addActionListener(this);
392398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -538,6 +544,7 @@
538544 buildToolsMenu(menu);
539545 }
540546
547
+
541548 void SetupUI2(ObjEditor oe)
542549 {
543550 // June 2019
....@@ -582,7 +589,7 @@
582589 */
583590 cGridBag copyOptionsPanel = new cGridBag();
584591
585
- copyOptionsPanel.preferredHeight = 2;
592
+ copyOptionsPanel.preferredHeight = 1;
586593
587594 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588595
....@@ -590,48 +597,66 @@
590597 //minButton.setToolTipText("Minimize window");
591598 //minButton.addActionListener(this);
592599
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
+ }
596606
597607 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598608 fullButton.setToolTipText("Full-screen window");
599609 fullButton.addActionListener(this);
600610
611
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ screenfitButton.setToolTipText("Screen fit");
613
+ screenfitButton.addActionListener(this);
614
+
601615 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602616 restoreCameraButton.setToolTipText("Restore viewpoint");
603617 restoreCameraButton.addActionListener(this);
604618
619
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ saveButton.setToolTipText("New version");
621
+ saveButton.addActionListener(this);
622
+
605623 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
624
+ undoButton.setToolTipText("Previous version");
607625 undoButton.addActionListener(this);
626
+ undoButton.setEnabled(false);
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);
608640
609641 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
- redoButton.setToolTipText("Redo changes");
642
+ redoButton.setToolTipText("Next version");
611643 redoButton.addActionListener(this);
644
+ redoButton.setEnabled(false);
612645
613
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
- saveButton.setToolTipText("Save changes");
615
- saveButton.addActionListener(this);
616
-
617
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
646
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618647 liveCB.setToolTipText("Enable animation");
619648 liveCB.addItemListener(this);
620649
621
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622651 oneStepButton.setToolTipText("Animate one step forward");
623652 oneStepButton.addActionListener(this);
624653
625
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
654
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626655 fastCB.setToolTipText("Fast mode");
627656 fastCB.addItemListener(this);
628657
629658 //oe.toolboxPanel.Return();
630659
631
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
- screenfitButton.setToolTipText("Screen fit");
633
- screenfitButton.addActionListener(this);
634
-
635660 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636661 // trackCB.setToolTipText("Enable tracking");
637662 // trackCB.addItemListener(this);
....@@ -724,7 +749,7 @@
724749 compositeButton.addActionListener(this);
725750
726751 oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
- switchButton.setToolTipText("Create switch");
752
+ switchButton.setToolTipText("Create item switcher");
728753 switchButton.addActionListener(this);
729754
730755 oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -743,17 +768,29 @@
743768 lightButton.setToolTipText("Create light");
744769 lightButton.addActionListener(this);
745770
771
+ for (int i=6; --i>=0;)
772
+ {
773
+ oe.toolboxPanel.Return();
774
+ oe.toolboxPanel.add(new cGridBag());
775
+ oe.toolboxPanel.add(new cGridBag());
776
+ oe.toolboxPanel.add(new cGridBag());
777
+ oe.toolboxPanel.add(new cGridBag());
778
+ oe.toolboxPanel.add(new cGridBag());
779
+ oe.toolboxPanel.add(new cGridBag());
780
+ oe.toolboxPanel.add(new cGridBag());
781
+ }
782
+
746783 // EDIT panel
747
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
- editButton.setToolTipText("Edit selection");
784
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ editButton.setToolTipText("Pin selection controls");
749786 editButton.addActionListener(this);
750787
751
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
- uneditButton.setToolTipText("Unedit selection");
788
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
789
+ uneditButton.setToolTipText("Remove selection controls");
753790 uneditButton.addActionListener(this);
754791
755792 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
- allParamsButton.setToolTipText("Edit all params");
793
+ allParamsButton.setToolTipText("Show all controle");
757794 allParamsButton.addActionListener(this);
758795
759796 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -770,6 +807,7 @@
770807
771808 editCommandsPanel.preferredHeight = 1;
772809
810
+ SetPinStates(false);
773811 // oe.treePanel.add(commandsPanel);
774812 // oe.treePanel.Return();
775813
....@@ -796,6 +834,9 @@
796834
797835 oe.treePanel.add(copyOptionsPanel);
798836 oe.treePanel.Return();
837
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0);
838
+ versionField = (cNumberSlider)sliderPane.getComponent(1);
839
+ sliderPane.preferredHeight = 1;
799840
800841 // mainPanel.setDividerLocation(0.5); //1.0);
801842 // mainPanel.setResizeWeight(0.5);
....@@ -843,14 +884,18 @@
843884 boxCB.addItemListener(this);
844885
845886 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
887
+ zoomBoxCB.setToolTipText("Display only for wheel");
847888 zoomBoxCB.addItemListener(this);
848889
849890 if (true) // Globals.ADVANCED)
850891 {
851
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
- supportCB.setToolTipText("Enable rigging");
853
- 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);
854899
855900 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
856901 // localCB.addItemListener(this);
....@@ -905,7 +950,7 @@
905950 oeilCB.addItemListener(this);
906951
907952 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
- shadowCB.setToolTipText("Compute shadows when live");
953
+ shadowCB.setToolTipText("When live compute shadows");
909954 shadowCB.addItemListener(this);
910955
911956 panel.Return();
....@@ -914,12 +959,12 @@
914959 toggleTextureCB.addItemListener(this);
915960
916961 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
- toggleSwitchCB.setToolTipText("Use switch");
962
+ toggleSwitchCB.setToolTipText("Choose a single item");
918963 toggleSwitchCB.addItemListener(this);
919964
920
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
- autosaveCB.setToolTipText("Auto-save on structure change");
922
- autosaveCB.addItemListener(this);
965
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
966
+ autokeepCB.setToolTipText("On structure change");
967
+ autokeepCB.addItemListener(this);
923968
924969 panel.Return();
925970 if (Globals.ADVANCED)
....@@ -948,7 +993,7 @@
948993 {
949994 cRadio radioButton = new cRadio(obj.name);
950995
951
- // Patch to avoid bug with transparency.
996
+ // June 2019. Patch to avoid bug with transparency.
952997 radioButton.hadMaterial = obj.material != null;
953998 if (!radioButton.hadMaterial)
954999 {
....@@ -985,6 +1030,7 @@
9851030 cCheckBox slowCB;
9861031 cCheckBox boxCB;
9871032 cCheckBox zoomBoxCB;
1033
+ cCheckBox freezeCB;
9881034 //cToggleButton trackCB;
9891035 cCheckBox trackCB;
9901036 cCheckBox smoothfocusCB;
....@@ -995,7 +1041,7 @@
9951041
9961042 cCheckBox oeilCB;
9971043 cCheckBox shadowCB;
998
- cCheckBox autosaveCB;
1044
+ cCheckBox autokeepCB;
9991045 cCheckBox lookAtCB;
10001046
10011047 // static int COLOR = 1;
....@@ -1103,9 +1149,13 @@
11031149 {
11041150 Globals.COMPUTESHADOWWHENLIVE ^= true;
11051151 }
1106
- else if(e.getSource() == autosaveCB)
1152
+ else if(e.getSource() == freezeCB)
11071153 {
1108
- Globals.SAVEONMAKE ^= true;
1154
+ Globals.FREEZEONMOVE ^= true;
1155
+ }
1156
+ else if(e.getSource() == autokeepCB)
1157
+ {
1158
+ Globals.REPLACEONMAKE ^= true;
11091159 }
11101160 else if(e.getSource() == lookAtCB)
11111161 {
....@@ -1187,8 +1237,6 @@
11871237 }
11881238 }
11891239
1190
- String string = (String) object;
1191
-
11921240 System.out.println("Transfer = " + object + "; drop : " + target);
11931241 // if( object instanceof java.io.File[])
11941242 // {
....@@ -1196,6 +1244,8 @@
11961244 // objEditor.DropFile((java.io.File[]) object, true);
11971245 // return;
11981246 // }
1247
+
1248
+ String string = object.toString();
11991249
12001250 // File path for Mac and Windows
12011251 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1445,6 +1495,9 @@
14451495 animationItem.addItemListener(this);
14461496 animationItem.setState(Globals.ANIMATION);
14471497
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
1500
+
14481501 menu.add("-");
14491502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14501503 parseverticesItem.addActionListener(this);
....@@ -1457,6 +1510,8 @@
14571510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14581511 reduce34MorphItem.addActionListener(this);
14591512 menu.add("-");
1513
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1514
+ memoryItem.addActionListener(this);
14601515 menu.add(computeAOItem = new MenuItem("Compute AO"));
14611516 computeAOItem.addActionListener(this);
14621517
....@@ -1465,8 +1520,6 @@
14651520 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14661521 mirrorItem.addActionListener(this);
14671522 menu.add("-");
1468
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1469
- memoryItem.addActionListener(this);
14701523 menu.add(analyzeItem = new MenuItem("Analyze"));
14711524 analyzeItem.addActionListener(this);
14721525 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1614,6 +1667,20 @@
16141667
16151668 makeSomething(shadow);
16161669 }
1670
+
1671
+ private void ClearUnpinned()
1672
+ {
1673
+ //for (Object3D obj : listUI)
1674
+ for (int i=listUI.size(); --i>=0;)
1675
+ {
1676
+ Object3D obj = listUI.elementAt(i);
1677
+ if (!obj.pinned)
1678
+ {
1679
+ obj.CloseUI();
1680
+ listUI.remove(i);
1681
+ }
1682
+ }
1683
+ }
16171684
16181685 /**
16191686 * applyExample
....@@ -2093,25 +2160,25 @@
20932160 Composite csg = new GroupLeaf();
20942161 csg.count = 5;
20952162 group(csg);
2096
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
20972164 csg.addChild(child);
20982165 child.addChild(csg);
20992166 } else
21002167 if (source == doubleItem)
21012168 {
2102
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
21032170 csg.count = 5;
21042171 group(csg);
2105
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
21062173 csg.addChild(child);
21072174 child.addChild(csg);
2108
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
21092176 csg.addChild(child);
21102177 child.addChild(csg);
21112178 } else
21122179 if (source == tripleItem)
21132180 {
2114
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
21152182 csg.count = 4;
21162183 group(csg);
21172184 Composite child = new cGroup();
....@@ -2175,15 +2242,31 @@
21752242 } else
21762243 if (source == undoButton)
21772244 {
2245
+ // Go to previous version
2246
+ //if (!Undo())
2247
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21782248 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();
21792259 } else
21802260 if (source == redoButton)
21812261 {
2262
+ // Go to next version
21822263 Redo();
21832264 } else
21842265 if (source == saveButton)
21852266 {
2186
- Save();
2267
+ // Save a new version
2268
+ if (!Save(true))
2269
+ java.awt.Toolkit.getDefaultToolkit().beep();
21872270 } else
21882271 if (source == oneStepButton)
21892272 {
....@@ -2192,17 +2275,14 @@
21922275 } else
21932276 if (source == screenfitButton)
21942277 {
2195
- //Reload(lastConverter, lastFilename, true);
21962278 ScreenFit();
21972279 } else
21982280 if (source == screenfitpointButton)
21992281 {
2200
- //Reload(lastConverter, lastFilename, true);
22012282 ScreenFitPoint();
22022283 } else
22032284 if (source == snapobjectButton)
22042285 {
2205
- //Reload(lastConverter, lastFilename, true);
22062286 SnapObject();
22072287 } else
22082288 // if (event.getSource() == recompileButton)
....@@ -2726,15 +2806,28 @@
27262806 } else
27272807 if (source == ungroupItem || source == ungroupButton)
27282808 {
2729
- //ungroup();
2809
+ boolean hasRoot = false;
2810
+
27302811 for (int i=0; i<group.selection.size(); i++)
27312812 {
2732
- Ungroup(group.selection.get(i));
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
27332818 }
27342819
2735
- ClearSelection(false);
2736
-
2737
- 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
+ }
27382831 } else
27392832 if (source == genUVItem)
27402833 {
....@@ -3326,6 +3419,12 @@
33263419 } else
33273420 if (source == editItem || source == editButton)
33283421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
33293428 EditSelection(false);
33303429 } else
33313430 if (source == uneditButton)
....@@ -3335,6 +3434,7 @@
33353434 Object3D child = (Object3D)e.nextElement();
33363435 if(child.editWindow != null)
33373436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
33383438 child.CloseUI();
33393439 listUI.remove(child);
33403440
....@@ -3351,6 +3451,7 @@
33513451 //copy.ClearUI();
33523452 for (Object3D obj : listUI)
33533453 {
3454
+ obj.pinned = false;
33543455 obj.CloseUI();
33553456 }
33563457 listUI.clear();
....@@ -3360,7 +3461,7 @@
33603461 {
33613462 assert(copy == group);
33623463
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643465
33653466 for (Object3D obj : listUI)
33663467 {
....@@ -3409,6 +3510,9 @@
34093510 }
34103511
34113512 copy = group;
3513
+
3514
+ SetUndoStates();
3515
+
34123516 //Globals.theRenderer.object = group;
34133517 if(!useclient)
34143518 {
....@@ -3435,6 +3539,11 @@
34353539 currentLayout = sevenButton;
34363540 */
34373541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
34383547 keepparent = group.parent;
34393548 // PARENT = NULL or not???
34403549 //group.parent = null; // ROOT
....@@ -4502,10 +4611,6 @@
45024611 // }
45034612 // }
45044613
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45094614 void EditSelection(boolean newWindow)
45104615 {
45114616 // aConstraints.gridy = 0;
....@@ -4598,7 +4703,8 @@
45984703 //new Exception().printStackTrace();
45994704
46004705 freezemodel = true;
4601
-
4706
+ ClearUnpinned();
4707
+
46024708 /**/
46034709 //switch (event.id)
46044710 {
....@@ -4631,7 +4737,7 @@
46314737 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46324738 // a camera
46334739 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4740
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46354741 {
46364742 CameraPane.camerachangeframe = 0; // don't refuse it
46374743 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +4746,13 @@
46404746 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46414747 }
46424748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
46434756 refreshContents();
46444757 //return true;
46454758 }
....@@ -4649,10 +4762,18 @@
46494762 freezemodel = false;
46504763 }
46514764
4765
+ void SetPinStates(boolean enabled)
4766
+ {
4767
+ editButton.setEnabled(enabled);
4768
+ uneditButton.setEnabled(enabled);
4769
+ unselectButton.setEnabled(enabled);
4770
+ flashSelectionButton.setEnabled(enabled);
4771
+ }
4772
+
46524773 void refreshContents(boolean cp)
46534774 {
46544775 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4776
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46564777 {
46574778 objEditor.ClearInfo(); // .GetMaterial());
46584779
....@@ -4751,8 +4872,8 @@
47514872
47524873 if (cut)
47534874 {
4754
- if (Globals.SAVEONMAKE)
4755
- Save();
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
47564877 //int indices[] = jList.getSelectedIndices();
47574878 //for (int i = indices.length - 1; i >= 0; i--)
47584879 //jList.remove(indices[i]);
....@@ -4855,6 +4976,10 @@
48554976
48564977 void paste(boolean expand)
48574978 {
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
48584983 // if (GrafreeD.clipboard == null)
48594984 // return;
48604985 boolean first = true;
....@@ -4914,6 +5039,7 @@
49145039 Grafreed.clipboard.get(0).parent = keepparent;
49155040 }
49165041
5042
+ Globals.REPLACEONMAKE = keep;
49175043 ResetModel();
49185044 refreshContents();
49195045 }
....@@ -5049,6 +5175,10 @@
50495175
50505176 void group(Object3D csg, boolean grab)
50515177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
50525182 if (//false) // why??
50535183 !group.selection.isEmpty())
50545184 {
....@@ -5162,10 +5292,15 @@
51625292 //node.add(csg);
51635293 //makeSomething(node);
51645294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
51655296 }
51665297
51675298 void Ungroup(Object3D g)
51685299 {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
51695304 if (g instanceof HiddenObject)
51705305 {
51715306 HiddenObject h = (HiddenObject) g;
....@@ -5182,6 +5317,7 @@
51825317 objEditor.makeSomething(g.get(i), false);
51835318 }
51845319 }
5320
+ Globals.REPLACEONMAKE = keep;
51855321 }
51865322
51875323 void ungroup()
....@@ -5472,11 +5608,6 @@
54725608
54735609 cButton restoreCameraButton;
54745610
5475
- cButton minButton;
5476
- cButton maxButton;
5477
- cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54805611 cButton saveButton;
54815612 cButton oneStepButton;
54825613