Normand Briere
2019-08-22 0c7b833be7d86598a6813cd1c6db0ca9e1b17966
GroupEditor.java
....@@ -29,7 +29,7 @@
2929 {
3030 cButton skyboxButton;
3131 final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF));
3333 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
3434 skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3535 skyboxButton.addActionListener(new ActionListener()
....@@ -46,7 +46,7 @@
4646 {
4747 cButton textureButton;
4848 final String path = "textures/" + f + "/" + c + "/"; // + t;
49
- row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF));
5050 textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
....@@ -347,7 +347,7 @@
347347
348348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
349349 {
350
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351351
352352 AddSkyboxTab0(skyboxpane);
353353 AddSkyboxTab1(skyboxpane);
....@@ -417,13 +417,13 @@
417417
418418 assert(false);
419419
420
- if (copy.versionlist == null)
421
- {
422
- copy.versionlist = new Object3D[100];
423
- copy.versionindex = -1;
424
-
425
- //Save(true);
426
- }
420
+// if (copy.versionlist == null)
421
+// {
422
+// copy.versionlist = new Object3D[100];
423
+// copy.versionindex = -1;
424
+//
425
+// //Save(true);
426
+// }
427427
428428 if(ui)
429429 SetupUI(objEditor);
....@@ -446,13 +446,13 @@
446446
447447 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
448448
449
- if (copy.versionlist == null)
450
- {
451
- copy.versionlist = new Object3D[100];
452
- copy.versionindex = -1;
453
-
454
- //Save(true);
455
- }
449
+// if (copy.versionlist == null)
450
+// {
451
+// copy.versionlist = new Object3D[100];
452
+// copy.versionindex = -1;
453
+//
454
+// //Save(true);
455
+// }
456456 }
457457
458458 void CloneSelection(boolean supports)
....@@ -835,6 +835,8 @@
835835 }
836836
837837 oe.menuBar.add(menu = new Menu("Attributes"));
838
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
839
+ clearVersionsItem.addActionListener(this);
838840 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
839841 clearMaterialsItem.addActionListener(this);
840842 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -857,9 +859,9 @@
857859 hideleavesItem.addActionListener(this);
858860 showleavesItem = menu.add(new MenuItem("Show Leaves"));
859861 showleavesItem.addActionListener(this);
860
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
862
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
861863 markleavesItem.addActionListener(this);
862
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
864
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
863865 unmarkleavesItem.addActionListener(this);
864866 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
865867 rewindleavesItem.addActionListener(this);
....@@ -936,6 +938,8 @@
936938 cGridBag currenttab;
937939 //boolean added; // patch for jar
938940
941
+ int totalcount = 0;
942
+
939943 int tabcount = 0;
940944 int colcount = 0;
941945 int rowcount = 0;
....@@ -964,7 +968,7 @@
964968 texturecount = 0;
965969 }
966970
967
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
971
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
968972 {
969973 //if (!added)
970974 {
....@@ -973,7 +977,8 @@
973977 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
974978 }
975979
976
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
980
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
981
+ totalcount++;
977982
978983 if (++colcount >= columns)
979984 {
....@@ -999,6 +1004,8 @@
9991004 container.add(resourcecontainer);
10001005
10011006 Grafreed.ParseResources("textures", this);
1007
+
1008
+ // 935. System.out.println("Total = " + totalcount);
10021009 }
10031010
10041011 void SetupUI2(ObjEditor oe)
....@@ -1038,9 +1045,9 @@
10381045 oe.radioPanel.add(dummyButton);
10391046 oe.buttonGroup.add(dummyButton);
10401047 */
1041
- cGridBag copyOptionsPanel = new cGridBag();
1048
+ cGridBag versionManagerPanel = new cGridBag();
10421049
1043
- copyOptionsPanel.preferredHeight = 3;
1050
+ versionManagerPanel.preferredHeight = 4;
10441051
10451052 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10461053
....@@ -1067,25 +1074,25 @@
10671074 // }
10681075 // });
10691076
1070
- oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10711078 collapseButton.setToolTipText("Collapse toolbar");
10721079 collapseButton.addActionListener(this);
10731080
1074
- oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1081
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10751082 maximize3DButton.setToolTipText("Maximize 3D view");
10761083 maximize3DButton.addActionListener(this);
10771084
1078
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1085
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10791086 twoButton.setToolTipText("Show 3D view only");
10801087 twoButton.addActionListener(this);
10811088 this.fullscreenLayout = twoButton;
10821089
1083
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1090
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10841091 threeButton.setToolTipText("Show controls and 3D view");
10851092 threeButton.addActionListener(this);
10861093 if (Globals.ADVANCED)
10871094 {
1088
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1095
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10891096 sixButton.setToolTipText("Show 3D view and controls");
10901097 sixButton.addActionListener(this);
10911098 }
....@@ -1094,51 +1101,51 @@
10941101 // sevenButton.addActionListener(this);
10951102 //
10961103
1097
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1104
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10981105 fullButton.setToolTipText("Full-screen window");
10991106 fullButton.addActionListener(this);
11001107
1101
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1108
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11021109 screenfitButton.setToolTipText("Screen fit");
11031110 screenfitButton.addActionListener(this);
11041111
1105
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11061113 restoreCameraButton.setToolTipText("Restore viewpoint");
11071114 restoreCameraButton.addActionListener(this);
11081115
1109
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1116
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11101117 saveVersionButton.setToolTipText("Duplicate current version");
11111118 saveVersionButton.addActionListener(this);
11121119
1113
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11141121 deleteVersionButton.setToolTipText("Delete current version");
11151122 deleteVersionButton.addActionListener(this);
11161123 deleteVersionButton.setEnabled(false);
11171124
1118
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11191126 previousVersionButton.setToolTipText("Previous version");
11201127 previousVersionButton.addActionListener(this);
11211128 previousVersionButton.setEnabled(false);
11221129
11231130 cGridBag updown = new cGridBag().setVertical(true);
1124
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1131
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11251132 restoreButton.setToolTipText("Undo (restore current version)");
11261133 restoreButton.addActionListener(this);
11271134 restoreButton.setEnabled(false);
11281135
1129
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11301137 replaceButton.setToolTipText("Save (replace current version)");
11311138 replaceButton.addActionListener(this);
11321139 replaceButton.setEnabled(false);
11331140
1134
- copyOptionsPanel.add(updown);
1141
+ versionManagerPanel.add(updown);
11351142
1136
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1143
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11371144 nextVersionButton.setToolTipText("Next version");
11381145 nextVersionButton.addActionListener(this);
11391146 nextVersionButton.setEnabled(false);
11401147
1141
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1148
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11421149 oneStepButton.setToolTipText("Animate one step forward");
11431150 oneStepButton.addActionListener(this);
11441151
....@@ -1161,11 +1168,11 @@
11611168
11621169 if (Globals.ADVANCED)
11631170 {
1164
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1171
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11651172 snapobjectButton.addActionListener(this);
11661173 snapobjectButton.setToolTipText("Snap Object");
11671174
1168
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11691176 fourButton.addActionListener(this);
11701177 fourButton.setToolTipText("Show control panel only");
11711178 }
....@@ -1173,11 +1180,11 @@
11731180 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11741181
11751182
1176
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11771184 rootButton.setToolTipText("Open selection in new tab");
11781185 rootButton.addActionListener(this);
11791186
1180
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11811188 closeButton.setToolTipText("Close tab");
11821189 closeButton.addActionListener(this);
11831190 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1186,38 +1193,38 @@
11861193 cGridBag row1 = new cGridBag();
11871194
11881195 // INSERT
1189
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1196
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11901197 gridButton.setToolTipText("Create ground");
11911198 gridButton.addActionListener(this);
11921199
1193
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1200
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11941201 boxButton.setToolTipText("Create box");
11951202 boxButton.addActionListener(this);
11961203
1197
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1204
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11981205 superButton.setToolTipText("Create superellipsoid");
11991206 superButton.addActionListener(this);
12001207
1201
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1208
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12021209 sphereButton.setToolTipText("Create sphere");
12031210 sphereButton.addActionListener(this);
12041211
1205
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1212
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12061213 coneButton.setToolTipText("Create cone");
12071214 coneButton.addActionListener(this);
12081215
1209
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12101217 torusButton.setToolTipText("Create torus");
12111218 torusButton.addActionListener(this);
12121219
12131220 if (Globals.ADVANCED)
12141221 {
1215
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1222
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12161223 kleinButton.setToolTipText("Create Klein bottle");
12171224 kleinButton.addActionListener(this);
12181225 }
12191226
1220
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1227
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12211228 particlesButton.setToolTipText("Create particle system");
12221229 particlesButton.addActionListener(this);
12231230
....@@ -1225,31 +1232,31 @@
12251232
12261233 cGridBag row2 = new cGridBag();
12271234
1228
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1235
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12291236 groupButton.setToolTipText("Create group");
12301237 groupButton.addActionListener(this);
12311238
1232
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1239
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12331240 compositeButton.setToolTipText("Create composite");
12341241 compositeButton.addActionListener(this);
12351242
1236
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1243
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12371244 switchButton.setToolTipText("Create item switcher");
12381245 switchButton.addActionListener(this);
12391246
1240
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1247
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12411248 loopButton.setToolTipText("Create loop");
12421249 loopButton.addActionListener(this);
12431250
1244
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1251
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12451252 textureButton.setToolTipText("Create texture");
12461253 textureButton.addActionListener(this);
12471254
1248
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1255
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12491256 overlayButton.setToolTipText("Create overlay");
12501257 overlayButton.addActionListener(this);
12511258
1252
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1259
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12531260 lightButton.setToolTipText("Create light");
12541261 lightButton.addActionListener(this);
12551262
....@@ -1259,7 +1266,10 @@
12591266
12601267 CreateTexturePanel(textures);
12611268
1262
- resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1269
+ int tabCount = resourcecontainer.getTabCount();
1270
+
1271
+ if (tabCount > 0)
1272
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
12631273
12641274 oe.toolboxPanel.add(textures);
12651275
....@@ -1268,11 +1278,11 @@
12681278 CreateSkyboxPanel(oe.skyboxPanel);
12691279
12701280 // EDIT panel
1271
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1281
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12721282 editButton.setToolTipText("Pin selection controls");
12731283 editButton.addActionListener(this);
12741284
1275
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1285
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12761286 uneditButton.setToolTipText("Unpin and remove selection controls");
12771287 uneditButton.addActionListener(this);
12781288
....@@ -1280,7 +1290,7 @@
12801290 allParamsButton.setToolTipText("Show all controls");
12811291 allParamsButton.addActionListener(this);
12821292
1283
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1293
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12841294 clearPanelButton.setToolTipText("Clear all controls");
12851295 clearPanelButton.addActionListener(this);
12861296
....@@ -1288,7 +1298,7 @@
12881298 //unselectButton.setToolTipText("Unselect");
12891299 //unselectButton.addActionListener(this);
12901300
1291
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1301
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12921302 flashSelectionButton.setToolTipText("Highlight selection");
12931303 flashSelectionButton.addActionListener(this);
12941304
....@@ -1311,6 +1321,8 @@
13111321
13121322 cGridBag jSPPanel = new cGridBag();
13131323
1324
+ jSPPanel.preferredHeight = 20;
1325
+
13141326 JScrollPane jSP;
13151327 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13161328 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1319,11 +1331,11 @@
13191331 oe.treePanel.add(jSPPanel);
13201332 oe.treePanel.Return();
13211333
1322
- oe.treePanel.add(copyOptionsPanel);
1334
+ oe.treePanel.add(versionManagerPanel);
13231335 oe.treePanel.Return();
1324
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1325
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1326
- sliderPane.preferredHeight = 2;
1336
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1337
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1338
+ versionSliderPane.preferredHeight = 3;
13271339
13281340 // mainPanel.setDividerLocation(0.1); //1.0);
13291341 mainPanel.setResizeWeight(0.4);
....@@ -3456,6 +3468,10 @@
34563468 {
34573469 ClearMaterials();
34583470 } else
3471
+ if (source == clearVersionsItem)
3472
+ {
3473
+ ClearVersions();
3474
+ } else
34593475 if (source == liveleavesItem)
34603476 {
34613477 LiveLeaves(true);
....@@ -3968,6 +3984,8 @@
39683984 if (source == closeButton)
39693985 {
39703986 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3987
+ Replace();
3988
+
39713989 cRadio ab;
39723990 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39733991 {
....@@ -4066,6 +4084,8 @@
40664084 } else
40674085 if(source instanceof cRadio)
40684086 {
4087
+ Replace();
4088
+
40694089 group.parent = keepparent;
40704090 group.attributes = 0;
40714091 //group.editWindow = null;
....@@ -4121,13 +4141,23 @@
41214141
41224142 if (copy.versionlist == null)
41234143 {
4124
- copy.versionlist = new Object3D[100];
41254144 copy.versionindex = -1;
41264145
41274146 // Cannot work with loops
4128
- // To fix this issue, first mark all nodes above the root,
4147
+ // To fix this issue, we first mark all nodes above the root,
41294148 // and check if any of these nodes are reachable below the root.
4130
- //Save(true);
4149
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4150
+
4151
+ if (copy.versionlist == null && !copy.HasTags())
4152
+ {
4153
+ copy.versionlist = new Object3D[100];
4154
+
4155
+ //Save(true);
4156
+ }
4157
+ else
4158
+ copy.versionindex = -2;
4159
+
4160
+ Grafreed.grafreed.universe.TagObjects(copy, false);
41314161 }
41324162
41334163 SetVersionStates();
....@@ -4275,7 +4305,7 @@
42754305 TouchTransform(obj);
42764306 continue;
42774307 }
4278
- if ((mask&2) != 0) // Scale
4308
+ if ((mask&2) != 0) // Scale/rotation
42794309 {
42804310 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42814311 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4283,10 +4313,6 @@
42834313 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42844314 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42854315 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4286
- }
4287
- if ((mask&4) != 0) // Rotation
4288
- {
4289
- // ?
42904316 }
42914317 if ((mask&1) != 0) // Translation
42924318 {
....@@ -5095,6 +5121,12 @@
50955121 refreshContents();
50965122 }
50975123
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
5127
+ refreshContents();
5128
+ }
5129
+
50985130 void FlipV(boolean flip)
50995131 {
51005132 group.selection.FlipV(flip);
....@@ -5385,6 +5417,7 @@
53855417
53865418 void refreshContents(boolean cp)
53875419 {
5420
+ if (Globals.ADVANCED)
53885421 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53895422 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53905423 {
....@@ -6335,6 +6368,7 @@
63356368 private MenuItem clipMeshItem;
63366369 private MenuItem smoothMeshItem;
63376370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
63386372
63396373 private MenuItem liveleavesItem;
63406374 private MenuItem unliveleavesItem;