Normand Briere
2019-08-23 60cec91731a350fe67e9b5ffe7a00d70e9026314
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 = 2;
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,6 +1266,11 @@
12591266
12601267 CreateTexturePanel(textures);
12611268
1269
+ int tabCount = resourcecontainer.getTabCount();
1270
+
1271
+ if (tabCount > 0)
1272
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1273
+
12621274 oe.toolboxPanel.add(textures);
12631275
12641276 textures.preferredHeight = 100;
....@@ -1266,11 +1278,11 @@
12661278 CreateSkyboxPanel(oe.skyboxPanel);
12671279
12681280 // EDIT panel
1269
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1281
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12701282 editButton.setToolTipText("Pin selection controls");
12711283 editButton.addActionListener(this);
12721284
1273
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1285
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12741286 uneditButton.setToolTipText("Unpin and remove selection controls");
12751287 uneditButton.addActionListener(this);
12761288
....@@ -1278,7 +1290,7 @@
12781290 allParamsButton.setToolTipText("Show all controls");
12791291 allParamsButton.addActionListener(this);
12801292
1281
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1293
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12821294 clearPanelButton.setToolTipText("Clear all controls");
12831295 clearPanelButton.addActionListener(this);
12841296
....@@ -1286,7 +1298,7 @@
12861298 //unselectButton.setToolTipText("Unselect");
12871299 //unselectButton.addActionListener(this);
12881300
1289
- 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);
12901302 flashSelectionButton.setToolTipText("Highlight selection");
12911303 flashSelectionButton.addActionListener(this);
12921304
....@@ -1309,6 +1321,8 @@
13091321
13101322 cGridBag jSPPanel = new cGridBag();
13111323
1324
+ jSPPanel.preferredHeight = 20;
1325
+
13121326 JScrollPane jSP;
13131327 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13141328 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1317,11 +1331,11 @@
13171331 oe.treePanel.add(jSPPanel);
13181332 oe.treePanel.Return();
13191333
1320
- oe.treePanel.add(copyOptionsPanel);
1334
+ oe.treePanel.add(versionManagerPanel);
13211335 oe.treePanel.Return();
1322
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1323
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1324
- sliderPane.preferredHeight = 1;
1336
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1337
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1338
+ versionSliderPane.preferredHeight = 3;
13251339
13261340 // mainPanel.setDividerLocation(0.1); //1.0);
13271341 mainPanel.setResizeWeight(0.4);
....@@ -2115,24 +2129,24 @@
21152129 switch(axis)
21162130 {
21172131 case 0 :
2118
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2119
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2120
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2121
- vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z;
2132
+ vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z;
2133
+ vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z;
2134
+ vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z;
2135
+ vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z;
21222136 norm = cVector.X;
21232137 break;
21242138 case 1 :
2125
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2126
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2127
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2128
- vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z;
2139
+ vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z;
2140
+ vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z;
2141
+ vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z;
2142
+ vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z;
21292143 norm = cVector.Y;
21302144 break;
21312145 case 2 :
2132
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2133
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2134
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2135
- vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z;
2146
+ vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f;
2147
+ vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f;
2148
+ vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f;
2149
+ vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f;
21362150 norm = cVector.Z;
21372151 break;
21382152 }
....@@ -3454,6 +3468,10 @@
34543468 {
34553469 ClearMaterials();
34563470 } else
3471
+ if (source == clearVersionsItem)
3472
+ {
3473
+ ClearVersions();
3474
+ } else
34573475 if (source == liveleavesItem)
34583476 {
34593477 LiveLeaves(true);
....@@ -3966,6 +3984,8 @@
39663984 if (source == closeButton)
39673985 {
39683986 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3987
+ Replace();
3988
+
39693989 cRadio ab;
39703990 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39713991 {
....@@ -4064,6 +4084,8 @@
40644084 } else
40654085 if(source instanceof cRadio)
40664086 {
4087
+ Replace();
4088
+
40674089 group.parent = keepparent;
40684090 group.attributes = 0;
40694091 //group.editWindow = null;
....@@ -4119,13 +4141,23 @@
41194141
41204142 if (copy.versionlist == null)
41214143 {
4122
- copy.versionlist = new Object3D[100];
41234144 copy.versionindex = -1;
41244145
41254146 // Cannot work with loops
4126
- // To fix this issue, first mark all nodes above the root,
4147
+ // To fix this issue, we first mark all nodes above the root,
41274148 // and check if any of these nodes are reachable below the root.
4128
- //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);
41294161 }
41304162
41314163 SetVersionStates();
....@@ -4273,7 +4305,7 @@
42734305 TouchTransform(obj);
42744306 continue;
42754307 }
4276
- if ((mask&2) != 0) // Scale
4308
+ if ((mask&2) != 0) // Scale/rotation
42774309 {
42784310 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42794311 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4281,10 +4313,6 @@
42814313 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42824314 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42834315 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4284
- }
4285
- if ((mask&4) != 0) // Rotation
4286
- {
4287
- // ?
42884316 }
42894317 if ((mask&1) != 0) // Translation
42904318 {
....@@ -5093,6 +5121,12 @@
50935121 refreshContents();
50945122 }
50955123
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
5127
+ refreshContents();
5128
+ }
5129
+
50965130 void FlipV(boolean flip)
50975131 {
50985132 group.selection.FlipV(flip);
....@@ -5383,6 +5417,7 @@
53835417
53845418 void refreshContents(boolean cp)
53855419 {
5420
+ if (Globals.ADVANCED)
53865421 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53875422 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53885423 {
....@@ -6333,6 +6368,7 @@
63336368 private MenuItem clipMeshItem;
63346369 private MenuItem smoothMeshItem;
63356370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
63366372
63376373 private MenuItem liveleavesItem;
63386374 private MenuItem unliveleavesItem;