Normand Briere
2019-08-12 8f1afe25ea8fc8801aab66331c32a50859a758c2
GroupEditor.java
....@@ -410,6 +410,8 @@
410410 {
411411 copy.versionlist = new Object3D[100];
412412 copy.versionindex = -1;
413
+
414
+ Save(true);
413415 }
414416
415417 if(ui)
....@@ -641,11 +643,9 @@
641643 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
642644 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
643645 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
644
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
645646 oe.cameraMenu.add("-");
646647 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
647648 openWindowItem.addActionListener(this);
648
- editLeafItem.addActionListener(this);
649649 lookAtItem.addActionListener(this);
650650 //lookFromItem.addActinoListener(this);
651651 //switchViewItem.addActionListener(this);
....@@ -893,6 +893,9 @@
893893 shareGeometriesItem.addActionListener(this);
894894 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
895895 mergeGeometriesItem.addActionListener(this);
896
+ menu.add("-");
897
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
898
+ editLeafItem.addActionListener(this);
896899 if (Globals.ADVANCED)
897900 {
898901 // Pretty much the same as duplicate and clone.
....@@ -1026,22 +1029,22 @@
10261029
10271030 if (Globals.ADVANCED)
10281031 {
1029
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1030
- maxButton.setToolTipText("Maximize window");
1031
- maxButton.addActionListener(this);
1032
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+// maxButton.setToolTipText("Maximize window");
1034
+// maxButton.addActionListener(this);
10321035 }
10331036
1034
- cButton gcButton;
1035
-
1036
- oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
- gcButton.setToolTipText("Garbage collect");
1038
- gcButton.addActionListener(new ActionListener()
1039
- {
1040
- public void actionPerformed(ActionEvent e)
1041
- {
1042
- System.gc();
1043
- }
1044
- });
1037
+// cButton gcButton;
1038
+//
1039
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+// gcButton.setToolTipText("Garbage collect");
1041
+// gcButton.addActionListener(new ActionListener()
1042
+// {
1043
+// public void actionPerformed(ActionEvent e)
1044
+// {
1045
+// System.gc();
1046
+// }
1047
+// });
10451048
10461049 oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10471050 collapseButton.setToolTipText("Collapse toolbar");
....@@ -1162,7 +1165,7 @@
11621165
11631166 // INSERT
11641167 row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1165
- gridButton.setToolTipText("Create grid");
1168
+ gridButton.setToolTipText("Create ground");
11661169 gridButton.addActionListener(this);
11671170
11681171 row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1454,6 +1457,14 @@
14541457
14551458 void EditObject(Object3D obj)
14561459 {
1460
+ assert(obj instanceof Composite);
1461
+
1462
+ if (obj.versionlist == null)
1463
+ {
1464
+ obj.versionlist = new Object3D[100];
1465
+ obj.versionindex = -1;
1466
+ }
1467
+
14571468 cRadio radioButton = new cRadio(obj.name);
14581469
14591470 // June 2019. Patch to avoid bug with transparency.
....@@ -3892,6 +3903,7 @@
38923903 } else
38933904 if (source == rootButton)
38943905 {
3906
+ Replace();
38953907 Object3D obj;
38963908 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
38973909 {
....@@ -4028,8 +4040,6 @@
40284040
40294041 copy = group;
40304042
4031
- SetUndoStates();
4032
-
40334043 //Globals.theRenderer.object = group;
40344044 if(!useclient)
40354045 {
....@@ -4057,6 +4067,8 @@
40574067 */
40584068 radio.layout.doClick();
40594069
4070
+ SetUndoStates();
4071
+
40604072 ClearUnpinned();
40614073
40624074 //Grafreed.Assert(group != null);
....@@ -5291,6 +5303,19 @@
52915303 flashSelectionButton.setEnabled(enabled);
52925304
52935305 clearPanelButton.setEnabled(!listUI.isEmpty());
5306
+
5307
+ boolean allComposites = true;
5308
+
5309
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5310
+ {
5311
+ if (!(e.nextElement() instanceof Composite))
5312
+ {
5313
+ allComposites = false;
5314
+ break;
5315
+ }
5316
+ }
5317
+
5318
+ rootButton.setEnabled(allComposites);
52945319 }
52955320
52965321 void refreshContents(boolean cp)