Normand Briere
2019-08-17 d5d6485126da83b06645e90e3e4ce66659a56009
GroupEditor.java
....@@ -1038,9 +1038,9 @@
10381038 oe.radioPanel.add(dummyButton);
10391039 oe.buttonGroup.add(dummyButton);
10401040 */
1041
- cGridBag copyOptionsPanel = new cGridBag();
1041
+ cGridBag versionManagerPanel = new cGridBag();
10421042
1043
- copyOptionsPanel.preferredHeight = 2;
1043
+ versionManagerPanel.preferredHeight = 4;
10441044
10451045 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10461046
....@@ -1071,7 +1071,7 @@
10711071 collapseButton.setToolTipText("Collapse toolbar");
10721072 collapseButton.addActionListener(this);
10731073
1074
- oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1074
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10751075 maximize3DButton.setToolTipText("Maximize 3D view");
10761076 maximize3DButton.addActionListener(this);
10771077
....@@ -1106,16 +1106,16 @@
11061106 restoreCameraButton.setToolTipText("Restore viewpoint");
11071107 restoreCameraButton.addActionListener(this);
11081108
1109
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11101110 saveVersionButton.setToolTipText("Duplicate current version");
11111111 saveVersionButton.addActionListener(this);
11121112
1113
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11141114 deleteVersionButton.setToolTipText("Delete current version");
11151115 deleteVersionButton.addActionListener(this);
11161116 deleteVersionButton.setEnabled(false);
11171117
1118
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11191119 previousVersionButton.setToolTipText("Previous version");
11201120 previousVersionButton.addActionListener(this);
11211121 previousVersionButton.setEnabled(false);
....@@ -1131,9 +1131,9 @@
11311131 replaceButton.addActionListener(this);
11321132 replaceButton.setEnabled(false);
11331133
1134
- copyOptionsPanel.add(updown);
1134
+ versionManagerPanel.add(updown);
11351135
1136
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11371137 nextVersionButton.setToolTipText("Next version");
11381138 nextVersionButton.addActionListener(this);
11391139 nextVersionButton.setEnabled(false);
....@@ -1259,6 +1259,8 @@
12591259
12601260 CreateTexturePanel(textures);
12611261
1262
+ resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1263
+
12621264 oe.toolboxPanel.add(textures);
12631265
12641266 textures.preferredHeight = 100;
....@@ -1309,6 +1311,8 @@
13091311
13101312 cGridBag jSPPanel = new cGridBag();
13111313
1314
+ jSPPanel.preferredHeight = 20;
1315
+
13121316 JScrollPane jSP;
13131317 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13141318 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1317,11 +1321,11 @@
13171321 oe.treePanel.add(jSPPanel);
13181322 oe.treePanel.Return();
13191323
1320
- oe.treePanel.add(copyOptionsPanel);
1324
+ oe.treePanel.add(versionManagerPanel);
13211325 oe.treePanel.Return();
1322
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1323
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1324
- sliderPane.preferredHeight = 1;
1326
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1327
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1328
+ versionSliderPane.preferredHeight = 3;
13251329
13261330 // mainPanel.setDividerLocation(0.1); //1.0);
13271331 mainPanel.setResizeWeight(0.4);
....@@ -3966,6 +3970,8 @@
39663970 if (source == closeButton)
39673971 {
39683972 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3973
+ Replace();
3974
+
39693975 cRadio ab;
39703976 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39713977 {
....@@ -4064,6 +4070,8 @@
40644070 } else
40654071 if(source instanceof cRadio)
40664072 {
4073
+ Replace();
4074
+
40674075 group.parent = keepparent;
40684076 group.attributes = 0;
40694077 //group.editWindow = null;
....@@ -4119,13 +4127,21 @@
41194127
41204128 if (copy.versionlist == null)
41214129 {
4122
- copy.versionlist = new Object3D[100];
41234130 copy.versionindex = -1;
41244131
41254132 // Cannot work with loops
4126
- // To fix this issue, first mark all nodes above the root,
4133
+ // To fix this issue, we first mark all nodes above the root,
41274134 // and check if any of these nodes are reachable below the root.
4128
- //Save(true);
4135
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4136
+
4137
+ if (!copy.HasTags())
4138
+ {
4139
+ copy.versionlist = new Object3D[100];
4140
+
4141
+ Save(true);
4142
+ }
4143
+
4144
+ Grafreed.grafreed.universe.TagObjects(copy, false);
41294145 }
41304146
41314147 SetVersionStates();
....@@ -4273,7 +4289,7 @@
42734289 TouchTransform(obj);
42744290 continue;
42754291 }
4276
- if ((mask&2) != 0) // Scale
4292
+ if ((mask&2) != 0) // Scale/rotation
42774293 {
42784294 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42794295 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4281,10 +4297,6 @@
42814297 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42824298 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42834299 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4284
- }
4285
- if ((mask&4) != 0) // Rotation
4286
- {
4287
- // ?
42884300 }
42894301 if ((mask&1) != 0) // Translation
42904302 {
....@@ -5383,6 +5395,7 @@
53835395
53845396 void refreshContents(boolean cp)
53855397 {
5398
+ if (false)
53865399 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53875400 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53885401 {