Normand Briere
2019-08-20 7dc9a8879ed29a7693d617afcb48014504ddc4a9
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);
....@@ -415,12 +415,14 @@
415415 this.copy = this.group = group;
416416 //selectees = this.group.selectees;
417417
418
+ assert(false);
419
+
418420 if (copy.versionlist == null)
419421 {
420422 copy.versionlist = new Object3D[100];
421423 copy.versionindex = -1;
422424
423
- Save(true);
425
+ //Save(true);
424426 }
425427
426428 if(ui)
....@@ -449,7 +451,7 @@
449451 copy.versionlist = new Object3D[100];
450452 copy.versionindex = -1;
451453
452
- Save(true);
454
+ //Save(true);
453455 }
454456 }
455457
....@@ -569,9 +571,6 @@
569571 // pasteExpandItem.addActionListener(this);
570572 //menu.add("-");
571573 oe.jTree.popup.addSeparator();
572
-
573
- deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
574
- deleteItem.addActionListener(this);
575574
576575 if (Globals.ADVANCED)
577576 {
....@@ -706,15 +705,17 @@
706705 setMasterItem.addActionListener(this);
707706 }
708707
709
- oe.menuBar.add(menu = new Menu("Group"));
710
-// grabItem = menu.add(new MenuItem("Grab"));
711
-// grabItem.addActionListener(this);
708
+ oe.menuBar.add(menu = new Menu("Order"));
709
+
712710 backItem = menu.add(new MenuItem("Back"));
713711 backItem.addActionListener(this);
714712 frontItem = menu.add(new MenuItem("Front"));
715713 frontItem.addActionListener(this);
716714 // compositeItem = menu.add(new MenuItem("Composite"));
717715 // compositeItem.addActionListener(this);
716
+
717
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
718
+ grabItem.addActionListener(this);
718719
719720 if (Globals.ADVANCED)
720721 {
....@@ -723,6 +724,11 @@
723724 }
724725 ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
725726 ungroupItem.addActionListener(this);
727
+
728
+ oe.jTree.popup.addSeparator();
729
+
730
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
731
+ deleteItem.addActionListener(this);
726732
727733 // menu.add("-");
728734 //
....@@ -851,9 +857,9 @@
851857 hideleavesItem.addActionListener(this);
852858 showleavesItem = menu.add(new MenuItem("Show Leaves"));
853859 showleavesItem.addActionListener(this);
854
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
860
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
855861 markleavesItem.addActionListener(this);
856
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
862
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
857863 unmarkleavesItem.addActionListener(this);
858864 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
859865 rewindleavesItem.addActionListener(this);
....@@ -958,7 +964,7 @@
958964 texturecount = 0;
959965 }
960966
961
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
967
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
962968 {
963969 //if (!added)
964970 {
....@@ -967,7 +973,7 @@
967973 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
968974 }
969975
970
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
976
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
971977
972978 if (++colcount >= columns)
973979 {
....@@ -1032,9 +1038,9 @@
10321038 oe.radioPanel.add(dummyButton);
10331039 oe.buttonGroup.add(dummyButton);
10341040 */
1035
- cGridBag copyOptionsPanel = new cGridBag();
1041
+ cGridBag versionManagerPanel = new cGridBag();
10361042
1037
- copyOptionsPanel.preferredHeight = 2;
1043
+ versionManagerPanel.preferredHeight = 4;
10381044
10391045 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10401046
....@@ -1061,25 +1067,25 @@
10611067 // }
10621068 // });
10631069
1064
- oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1070
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10651071 collapseButton.setToolTipText("Collapse toolbar");
10661072 collapseButton.addActionListener(this);
10671073
1068
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1074
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10691075 maximize3DButton.setToolTipText("Maximize 3D view");
10701076 maximize3DButton.addActionListener(this);
10711077
1072
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1078
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10731079 twoButton.setToolTipText("Show 3D view only");
10741080 twoButton.addActionListener(this);
10751081 this.fullscreenLayout = twoButton;
10761082
1077
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10781084 threeButton.setToolTipText("Show controls and 3D view");
10791085 threeButton.addActionListener(this);
10801086 if (Globals.ADVANCED)
10811087 {
1082
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10831089 sixButton.setToolTipText("Show 3D view and controls");
10841090 sixButton.addActionListener(this);
10851091 }
....@@ -1088,50 +1094,51 @@
10881094 // sevenButton.addActionListener(this);
10891095 //
10901096
1091
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1097
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10921098 fullButton.setToolTipText("Full-screen window");
10931099 fullButton.addActionListener(this);
10941100
1095
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1101
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10961102 screenfitButton.setToolTipText("Screen fit");
10971103 screenfitButton.addActionListener(this);
10981104
1099
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1105
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11001106 restoreCameraButton.setToolTipText("Restore viewpoint");
11011107 restoreCameraButton.addActionListener(this);
11021108
1103
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11041110 saveVersionButton.setToolTipText("Duplicate current version");
11051111 saveVersionButton.addActionListener(this);
11061112
1107
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11081114 deleteVersionButton.setToolTipText("Delete current version");
11091115 deleteVersionButton.addActionListener(this);
1116
+ deleteVersionButton.setEnabled(false);
11101117
1111
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11121119 previousVersionButton.setToolTipText("Previous version");
11131120 previousVersionButton.addActionListener(this);
11141121 previousVersionButton.setEnabled(false);
11151122
11161123 cGridBag updown = new cGridBag().setVertical(true);
1117
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11181125 restoreButton.setToolTipText("Undo (restore current version)");
11191126 restoreButton.addActionListener(this);
1120
- //restoreButton.setEnabled(false);
1127
+ restoreButton.setEnabled(false);
11211128
1122
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11231130 replaceButton.setToolTipText("Save (replace current version)");
11241131 replaceButton.addActionListener(this);
1125
- //replaceButton.setEnabled(false);
1132
+ replaceButton.setEnabled(false);
11261133
1127
- copyOptionsPanel.add(updown);
1134
+ versionManagerPanel.add(updown);
11281135
1129
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11301137 nextVersionButton.setToolTipText("Next version");
11311138 nextVersionButton.addActionListener(this);
11321139 nextVersionButton.setEnabled(false);
11331140
1134
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1141
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11351142 oneStepButton.setToolTipText("Animate one step forward");
11361143 oneStepButton.addActionListener(this);
11371144
....@@ -1154,11 +1161,11 @@
11541161
11551162 if (Globals.ADVANCED)
11561163 {
1157
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1164
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11581165 snapobjectButton.addActionListener(this);
11591166 snapobjectButton.setToolTipText("Snap Object");
11601167
1161
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1168
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11621169 fourButton.addActionListener(this);
11631170 fourButton.setToolTipText("Show control panel only");
11641171 }
....@@ -1166,11 +1173,11 @@
11661173 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11671174
11681175
1169
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1176
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11701177 rootButton.setToolTipText("Open selection in new tab");
11711178 rootButton.addActionListener(this);
11721179
1173
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1180
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11741181 closeButton.setToolTipText("Close tab");
11751182 closeButton.addActionListener(this);
11761183 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1179,38 +1186,38 @@
11791186 cGridBag row1 = new cGridBag();
11801187
11811188 // INSERT
1182
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1189
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11831190 gridButton.setToolTipText("Create ground");
11841191 gridButton.addActionListener(this);
11851192
1186
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1193
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11871194 boxButton.setToolTipText("Create box");
11881195 boxButton.addActionListener(this);
11891196
1190
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1191
- sphereButton.setToolTipText("Create sphere");
1192
- sphereButton.addActionListener(this);
1193
-
1194
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1195
- coneButton.setToolTipText("Create cone");
1196
- coneButton.addActionListener(this);
1197
-
1198
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1199
- torusButton.setToolTipText("Create torus");
1200
- torusButton.addActionListener(this);
1201
-
1202
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1197
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12031198 superButton.setToolTipText("Create superellipsoid");
12041199 superButton.addActionListener(this);
12051200
1201
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1202
+ sphereButton.setToolTipText("Create sphere");
1203
+ sphereButton.addActionListener(this);
1204
+
1205
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1206
+ coneButton.setToolTipText("Create cone");
1207
+ coneButton.addActionListener(this);
1208
+
1209
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1210
+ torusButton.setToolTipText("Create torus");
1211
+ torusButton.addActionListener(this);
1212
+
12061213 if (Globals.ADVANCED)
12071214 {
1208
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1215
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12091216 kleinButton.setToolTipText("Create Klein bottle");
12101217 kleinButton.addActionListener(this);
12111218 }
12121219
1213
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12141221 particlesButton.setToolTipText("Create particle system");
12151222 particlesButton.addActionListener(this);
12161223
....@@ -1218,31 +1225,31 @@
12181225
12191226 cGridBag row2 = new cGridBag();
12201227
1221
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1228
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12221229 groupButton.setToolTipText("Create group");
12231230 groupButton.addActionListener(this);
12241231
1225
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12261233 compositeButton.setToolTipText("Create composite");
12271234 compositeButton.addActionListener(this);
12281235
1229
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1236
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12301237 switchButton.setToolTipText("Create item switcher");
12311238 switchButton.addActionListener(this);
12321239
1233
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1240
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12341241 loopButton.setToolTipText("Create loop");
12351242 loopButton.addActionListener(this);
12361243
1237
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1244
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12381245 textureButton.setToolTipText("Create texture");
12391246 textureButton.addActionListener(this);
12401247
1241
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1248
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12421249 overlayButton.setToolTipText("Create overlay");
12431250 overlayButton.addActionListener(this);
12441251
1245
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1252
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12461253 lightButton.setToolTipText("Create light");
12471254 lightButton.addActionListener(this);
12481255
....@@ -1252,6 +1259,8 @@
12521259
12531260 CreateTexturePanel(textures);
12541261
1262
+ resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1263
+
12551264 oe.toolboxPanel.add(textures);
12561265
12571266 textures.preferredHeight = 100;
....@@ -1259,11 +1268,11 @@
12591268 CreateSkyboxPanel(oe.skyboxPanel);
12601269
12611270 // EDIT panel
1262
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1271
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12631272 editButton.setToolTipText("Pin selection controls");
12641273 editButton.addActionListener(this);
12651274
1266
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1275
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12671276 uneditButton.setToolTipText("Unpin and remove selection controls");
12681277 uneditButton.addActionListener(this);
12691278
....@@ -1271,7 +1280,7 @@
12711280 allParamsButton.setToolTipText("Show all controls");
12721281 allParamsButton.addActionListener(this);
12731282
1274
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1283
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12751284 clearPanelButton.setToolTipText("Clear all controls");
12761285 clearPanelButton.addActionListener(this);
12771286
....@@ -1279,7 +1288,7 @@
12791288 //unselectButton.setToolTipText("Unselect");
12801289 //unselectButton.addActionListener(this);
12811290
1282
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1291
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12831292 flashSelectionButton.setToolTipText("Highlight selection");
12841293 flashSelectionButton.addActionListener(this);
12851294
....@@ -1302,6 +1311,8 @@
13021311
13031312 cGridBag jSPPanel = new cGridBag();
13041313
1314
+ jSPPanel.preferredHeight = 20;
1315
+
13051316 JScrollPane jSP;
13061317 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13071318 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1310,11 +1321,11 @@
13101321 oe.treePanel.add(jSPPanel);
13111322 oe.treePanel.Return();
13121323
1313
- oe.treePanel.add(copyOptionsPanel);
1324
+ oe.treePanel.add(versionManagerPanel);
13141325 oe.treePanel.Return();
1315
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1316
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1317
- sliderPane.preferredHeight = 1;
1326
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1327
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1328
+ versionSliderPane.preferredHeight = 3;
13181329
13191330 // mainPanel.setDividerLocation(0.1); //1.0);
13201331 mainPanel.setResizeWeight(0.4);
....@@ -1504,6 +1515,7 @@
15041515
15051516 oe.SetupViews();
15061517
1518
+ if (Globals.DEBUG)
15071519 System.out.println("SetupViews");
15081520 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15091521 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2165,7 +2177,11 @@
21652177 shadow.material = new cMaterial(obj.material);
21662178 shadow.material.diffuse = 0.0001f;
21672179 shadow.material.specular = 0.0001f;
2168
- //shadow.projectedVertices[1].x = 300;
2180
+ shadow.material.opacity = 0.75f;
2181
+
2182
+ AllocProjectedVertices(shadow);
2183
+
2184
+ shadow.projectedVertices[1].x = 300;
21692185
21702186 makeSomething(shadow);
21712187 }
....@@ -3954,6 +3970,8 @@
39543970 if (source == closeButton)
39553971 {
39563972 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3973
+ Replace();
3974
+
39573975 cRadio ab;
39583976 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39593977 {
....@@ -4052,6 +4070,8 @@
40524070 } else
40534071 if(source instanceof cRadio)
40544072 {
4073
+ Replace();
4074
+
40554075 group.parent = keepparent;
40564076 group.attributes = 0;
40574077 //group.editWindow = null;
....@@ -4107,10 +4127,21 @@
41074127
41084128 if (copy.versionlist == null)
41094129 {
4110
- copy.versionlist = new Object3D[100];
41114130 copy.versionindex = -1;
41124131
4113
- Save(true);
4132
+ // Cannot work with loops
4133
+ // To fix this issue, we first mark all nodes above the root,
4134
+ // and check if any of these nodes are reachable below the root.
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);
41144145 }
41154146
41164147 SetVersionStates();
....@@ -4258,7 +4289,7 @@
42584289 TouchTransform(obj);
42594290 continue;
42604291 }
4261
- if ((mask&2) != 0) // Scale
4292
+ if ((mask&2) != 0) // Scale/rotation
42624293 {
42634294 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42644295 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4266,10 +4297,6 @@
42664297 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42674298 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42684299 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4269
- }
4270
- if ((mask&4) != 0) // Rotation
4271
- {
4272
- // ?
42734300 }
42744301 if ((mask&1) != 0) // Translation
42754302 {
....@@ -5355,7 +5382,8 @@
53555382 if (group.selection != null)
53565383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53575384 {
5358
- if (!(e.nextElement() instanceof Composite))
5385
+ Object next = e.nextElement();
5386
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53595387 {
53605388 allComposites = false;
53615389 break;
....@@ -5367,6 +5395,7 @@
53675395
53685396 void refreshContents(boolean cp)
53695397 {
5398
+ if (Globals.ADVANCED)
53705399 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53715400 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53725401 {
....@@ -6346,7 +6375,7 @@
63466375 private MenuItem transformGeometryItem;
63476376 private MenuItem transformChildrenItem;
63486377 private MenuItem hideItem;
6349
- private MenuItem grabItem;
6378
+ private JMenuItem grabItem;
63506379 private MenuItem backItem;
63516380 private MenuItem frontItem;
63526381 private MenuItem cameraItem;