Normand Briere
2019-08-20 537f4ac57ae2b34f0a04fa63874c8ca6534c9a6d
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);
....@@ -928,7 +934,7 @@
928934
929935 JTabbedPane resourcecontainer;
930936 cGridBag currenttab;
931
- boolean added; // patch for jar
937
+ //boolean added; // patch for jar
932938
933939 int tabcount = 0;
934940 int colcount = 0;
....@@ -940,33 +946,34 @@
940946
941947 public void ResourceCallBack(String[] path)
942948 {
943
- for (int i = 0; i < path.length; i++)
944
- System.out.print(path[i] + "/");
945
- System.out.println();
949
+// for (int i = 0; i < path.length; i++)
950
+// System.out.print(path[i] + "/");
951
+// System.out.println();
946952
947953 if (//rowcount == 0 ||
948
- path.length == 1)
954
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
949955 {
950956 currenttab = new cGridBag();
951
- added = false;
952957 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
953958 currenttab.setName(tabname);
959
+ //added = false;
960
+ resourcecontainer.add(currenttab);
961
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
954962 rowcount = 1;
955963 colcount = 0;
956964 texturecount = 0;
957965 }
958966
959
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
967
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
960968 {
961
- if (!added)
969
+ //if (!added)
962970 {
963
- added = true;
964
- resourcecontainer.add(currenttab);
971
+ //added = true;
965972 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
966
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
973
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
967974 }
968975
969
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
976
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
970977
971978 if (++colcount >= columns)
972979 {
....@@ -1031,9 +1038,9 @@
10311038 oe.radioPanel.add(dummyButton);
10321039 oe.buttonGroup.add(dummyButton);
10331040 */
1034
- cGridBag copyOptionsPanel = new cGridBag();
1041
+ cGridBag versionManagerPanel = new cGridBag();
10351042
1036
- copyOptionsPanel.preferredHeight = 2;
1043
+ versionManagerPanel.preferredHeight = 4;
10371044
10381045 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10391046
....@@ -1060,25 +1067,25 @@
10601067 // }
10611068 // });
10621069
1063
- 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);
10641071 collapseButton.setToolTipText("Collapse toolbar");
10651072 collapseButton.addActionListener(this);
10661073
1067
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1074
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10681075 maximize3DButton.setToolTipText("Maximize 3D view");
10691076 maximize3DButton.addActionListener(this);
10701077
1071
- 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);
10721079 twoButton.setToolTipText("Show 3D view only");
10731080 twoButton.addActionListener(this);
10741081 this.fullscreenLayout = twoButton;
10751082
1076
- 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);
10771084 threeButton.setToolTipText("Show controls and 3D view");
10781085 threeButton.addActionListener(this);
10791086 if (Globals.ADVANCED)
10801087 {
1081
- 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);
10821089 sixButton.setToolTipText("Show 3D view and controls");
10831090 sixButton.addActionListener(this);
10841091 }
....@@ -1087,50 +1094,51 @@
10871094 // sevenButton.addActionListener(this);
10881095 //
10891096
1090
- 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);
10911098 fullButton.setToolTipText("Full-screen window");
10921099 fullButton.addActionListener(this);
10931100
1094
- 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);
10951102 screenfitButton.setToolTipText("Screen fit");
10961103 screenfitButton.addActionListener(this);
10971104
1098
- 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);
10991106 restoreCameraButton.setToolTipText("Restore viewpoint");
11001107 restoreCameraButton.addActionListener(this);
11011108
1102
- 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);
11031110 saveVersionButton.setToolTipText("Duplicate current version");
11041111 saveVersionButton.addActionListener(this);
11051112
1106
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11071114 deleteVersionButton.setToolTipText("Delete current version");
11081115 deleteVersionButton.addActionListener(this);
1116
+ deleteVersionButton.setEnabled(false);
11091117
1110
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11111119 previousVersionButton.setToolTipText("Previous version");
11121120 previousVersionButton.addActionListener(this);
11131121 previousVersionButton.setEnabled(false);
11141122
11151123 cGridBag updown = new cGridBag().setVertical(true);
1116
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11171125 restoreButton.setToolTipText("Undo (restore current version)");
11181126 restoreButton.addActionListener(this);
1119
- //restoreButton.setEnabled(false);
1127
+ restoreButton.setEnabled(false);
11201128
1121
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11221130 replaceButton.setToolTipText("Save (replace current version)");
11231131 replaceButton.addActionListener(this);
1124
- //replaceButton.setEnabled(false);
1132
+ replaceButton.setEnabled(false);
11251133
1126
- copyOptionsPanel.add(updown);
1134
+ versionManagerPanel.add(updown);
11271135
1128
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11291137 nextVersionButton.setToolTipText("Next version");
11301138 nextVersionButton.addActionListener(this);
11311139 nextVersionButton.setEnabled(false);
11321140
1133
- 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);
11341142 oneStepButton.setToolTipText("Animate one step forward");
11351143 oneStepButton.addActionListener(this);
11361144
....@@ -1153,11 +1161,11 @@
11531161
11541162 if (Globals.ADVANCED)
11551163 {
1156
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1164
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11571165 snapobjectButton.addActionListener(this);
11581166 snapobjectButton.setToolTipText("Snap Object");
11591167
1160
- 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);
11611169 fourButton.addActionListener(this);
11621170 fourButton.setToolTipText("Show control panel only");
11631171 }
....@@ -1165,11 +1173,11 @@
11651173 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11661174
11671175
1168
- 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);
11691177 rootButton.setToolTipText("Open selection in new tab");
11701178 rootButton.addActionListener(this);
11711179
1172
- 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);
11731181 closeButton.setToolTipText("Close tab");
11741182 closeButton.addActionListener(this);
11751183 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1178,38 +1186,38 @@
11781186 cGridBag row1 = new cGridBag();
11791187
11801188 // INSERT
1181
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1189
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11821190 gridButton.setToolTipText("Create ground");
11831191 gridButton.addActionListener(this);
11841192
1185
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1193
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11861194 boxButton.setToolTipText("Create box");
11871195 boxButton.addActionListener(this);
11881196
1189
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1190
- sphereButton.setToolTipText("Create sphere");
1191
- sphereButton.addActionListener(this);
1192
-
1193
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1194
- coneButton.setToolTipText("Create cone");
1195
- coneButton.addActionListener(this);
1196
-
1197
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
- torusButton.setToolTipText("Create torus");
1199
- torusButton.addActionListener(this);
1200
-
1201
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1197
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12021198 superButton.setToolTipText("Create superellipsoid");
12031199 superButton.addActionListener(this);
12041200
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
+
12051213 if (Globals.ADVANCED)
12061214 {
1207
- 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);
12081216 kleinButton.setToolTipText("Create Klein bottle");
12091217 kleinButton.addActionListener(this);
12101218 }
12111219
1212
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12131221 particlesButton.setToolTipText("Create particle system");
12141222 particlesButton.addActionListener(this);
12151223
....@@ -1217,31 +1225,31 @@
12171225
12181226 cGridBag row2 = new cGridBag();
12191227
1220
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1228
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12211229 groupButton.setToolTipText("Create group");
12221230 groupButton.addActionListener(this);
12231231
1224
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12251233 compositeButton.setToolTipText("Create composite");
12261234 compositeButton.addActionListener(this);
12271235
1228
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1236
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12291237 switchButton.setToolTipText("Create item switcher");
12301238 switchButton.addActionListener(this);
12311239
1232
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1240
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12331241 loopButton.setToolTipText("Create loop");
12341242 loopButton.addActionListener(this);
12351243
1236
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1244
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12371245 textureButton.setToolTipText("Create texture");
12381246 textureButton.addActionListener(this);
12391247
1240
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1248
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12411249 overlayButton.setToolTipText("Create overlay");
12421250 overlayButton.addActionListener(this);
12431251
1244
- 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);
12451253 lightButton.setToolTipText("Create light");
12461254 lightButton.addActionListener(this);
12471255
....@@ -1251,6 +1259,11 @@
12511259
12521260 CreateTexturePanel(textures);
12531261
1262
+ int tabCount = resourcecontainer.getTabCount();
1263
+
1264
+ if (tabCount > 0)
1265
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1266
+
12541267 oe.toolboxPanel.add(textures);
12551268
12561269 textures.preferredHeight = 100;
....@@ -1258,11 +1271,11 @@
12581271 CreateSkyboxPanel(oe.skyboxPanel);
12591272
12601273 // EDIT panel
1261
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1274
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12621275 editButton.setToolTipText("Pin selection controls");
12631276 editButton.addActionListener(this);
12641277
1265
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1278
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12661279 uneditButton.setToolTipText("Unpin and remove selection controls");
12671280 uneditButton.addActionListener(this);
12681281
....@@ -1270,7 +1283,7 @@
12701283 allParamsButton.setToolTipText("Show all controls");
12711284 allParamsButton.addActionListener(this);
12721285
1273
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1286
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12741287 clearPanelButton.setToolTipText("Clear all controls");
12751288 clearPanelButton.addActionListener(this);
12761289
....@@ -1278,7 +1291,7 @@
12781291 //unselectButton.setToolTipText("Unselect");
12791292 //unselectButton.addActionListener(this);
12801293
1281
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1294
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12821295 flashSelectionButton.setToolTipText("Highlight selection");
12831296 flashSelectionButton.addActionListener(this);
12841297
....@@ -1301,6 +1314,8 @@
13011314
13021315 cGridBag jSPPanel = new cGridBag();
13031316
1317
+ jSPPanel.preferredHeight = 20;
1318
+
13041319 JScrollPane jSP;
13051320 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13061321 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1309,11 +1324,11 @@
13091324 oe.treePanel.add(jSPPanel);
13101325 oe.treePanel.Return();
13111326
1312
- oe.treePanel.add(copyOptionsPanel);
1327
+ oe.treePanel.add(versionManagerPanel);
13131328 oe.treePanel.Return();
1314
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1315
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1316
- sliderPane.preferredHeight = 1;
1329
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1330
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1331
+ versionSliderPane.preferredHeight = 3;
13171332
13181333 // mainPanel.setDividerLocation(0.1); //1.0);
13191334 mainPanel.setResizeWeight(0.4);
....@@ -1503,6 +1518,7 @@
15031518
15041519 oe.SetupViews();
15051520
1521
+ if (Globals.DEBUG)
15061522 System.out.println("SetupViews");
15071523 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15081524 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2164,7 +2180,11 @@
21642180 shadow.material = new cMaterial(obj.material);
21652181 shadow.material.diffuse = 0.0001f;
21662182 shadow.material.specular = 0.0001f;
2167
- //shadow.projectedVertices[1].x = 300;
2183
+ shadow.material.opacity = 0.75f;
2184
+
2185
+ AllocProjectedVertices(shadow);
2186
+
2187
+ shadow.projectedVertices[1].x = 300;
21682188
21692189 makeSomething(shadow);
21702190 }
....@@ -3953,6 +3973,8 @@
39533973 if (source == closeButton)
39543974 {
39553975 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3976
+ Replace();
3977
+
39563978 cRadio ab;
39573979 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39583980 {
....@@ -4051,6 +4073,8 @@
40514073 } else
40524074 if(source instanceof cRadio)
40534075 {
4076
+ Replace();
4077
+
40544078 group.parent = keepparent;
40554079 group.attributes = 0;
40564080 //group.editWindow = null;
....@@ -4106,10 +4130,21 @@
41064130
41074131 if (copy.versionlist == null)
41084132 {
4109
- copy.versionlist = new Object3D[100];
41104133 copy.versionindex = -1;
41114134
4112
- Save(true);
4135
+ // Cannot work with loops
4136
+ // To fix this issue, we first mark all nodes above the root,
4137
+ // and check if any of these nodes are reachable below the root.
4138
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4139
+
4140
+ if (!copy.HasTags())
4141
+ {
4142
+ copy.versionlist = new Object3D[100];
4143
+
4144
+ Save(true);
4145
+ }
4146
+
4147
+ Grafreed.grafreed.universe.TagObjects(copy, false);
41134148 }
41144149
41154150 SetVersionStates();
....@@ -4257,7 +4292,7 @@
42574292 TouchTransform(obj);
42584293 continue;
42594294 }
4260
- if ((mask&2) != 0) // Scale
4295
+ if ((mask&2) != 0) // Scale/rotation
42614296 {
42624297 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42634298 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4265,10 +4300,6 @@
42654300 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42664301 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42674302 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4268
- }
4269
- if ((mask&4) != 0) // Rotation
4270
- {
4271
- // ?
42724303 }
42734304 if ((mask&1) != 0) // Translation
42744305 {
....@@ -5354,7 +5385,8 @@
53545385 if (group.selection != null)
53555386 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53565387 {
5357
- if (!(e.nextElement() instanceof Composite))
5388
+ Object next = e.nextElement();
5389
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53585390 {
53595391 allComposites = false;
53605392 break;
....@@ -5366,6 +5398,7 @@
53665398
53675399 void refreshContents(boolean cp)
53685400 {
5401
+ if (Globals.ADVANCED)
53695402 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53705403 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53715404 {
....@@ -6345,7 +6378,7 @@
63456378 private MenuItem transformGeometryItem;
63466379 private MenuItem transformChildrenItem;
63476380 private MenuItem hideItem;
6348
- private MenuItem grabItem;
6381
+ private JMenuItem grabItem;
63496382 private MenuItem backItem;
63506383 private MenuItem frontItem;
63516384 private MenuItem cameraItem;