Normand Briere
2019-08-18 66aca73cce89e4b4d7521862760edf4b0888bc38
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 {
....@@ -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,17 +946,19 @@
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;
....@@ -958,12 +966,11 @@
958966
959967 if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
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
969976 AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
....@@ -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,8 @@
12511259
12521260 CreateTexturePanel(textures);
12531261
1262
+ resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1263
+
12541264 oe.toolboxPanel.add(textures);
12551265
12561266 textures.preferredHeight = 100;
....@@ -1258,11 +1268,11 @@
12581268 CreateSkyboxPanel(oe.skyboxPanel);
12591269
12601270 // EDIT panel
1261
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1271
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12621272 editButton.setToolTipText("Pin selection controls");
12631273 editButton.addActionListener(this);
12641274
1265
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1275
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12661276 uneditButton.setToolTipText("Unpin and remove selection controls");
12671277 uneditButton.addActionListener(this);
12681278
....@@ -1270,7 +1280,7 @@
12701280 allParamsButton.setToolTipText("Show all controls");
12711281 allParamsButton.addActionListener(this);
12721282
1273
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1283
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12741284 clearPanelButton.setToolTipText("Clear all controls");
12751285 clearPanelButton.addActionListener(this);
12761286
....@@ -1278,7 +1288,7 @@
12781288 //unselectButton.setToolTipText("Unselect");
12791289 //unselectButton.addActionListener(this);
12801290
1281
- 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);
12821292 flashSelectionButton.setToolTipText("Highlight selection");
12831293 flashSelectionButton.addActionListener(this);
12841294
....@@ -1301,6 +1311,8 @@
13011311
13021312 cGridBag jSPPanel = new cGridBag();
13031313
1314
+ jSPPanel.preferredHeight = 20;
1315
+
13041316 JScrollPane jSP;
13051317 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13061318 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1309,11 +1321,11 @@
13091321 oe.treePanel.add(jSPPanel);
13101322 oe.treePanel.Return();
13111323
1312
- oe.treePanel.add(copyOptionsPanel);
1324
+ oe.treePanel.add(versionManagerPanel);
13131325 oe.treePanel.Return();
1314
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1315
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1316
- sliderPane.preferredHeight = 1;
1326
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1327
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1328
+ versionSliderPane.preferredHeight = 3;
13171329
13181330 // mainPanel.setDividerLocation(0.1); //1.0);
13191331 mainPanel.setResizeWeight(0.4);
....@@ -1503,6 +1515,7 @@
15031515
15041516 oe.SetupViews();
15051517
1518
+ if (Globals.DEBUG)
15061519 System.out.println("SetupViews");
15071520 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15081521 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2164,7 +2177,11 @@
21642177 shadow.material = new cMaterial(obj.material);
21652178 shadow.material.diffuse = 0.0001f;
21662179 shadow.material.specular = 0.0001f;
2167
- //shadow.projectedVertices[1].x = 300;
2180
+ shadow.material.opacity = 0.75f;
2181
+
2182
+ AllocProjectedVertices(shadow);
2183
+
2184
+ shadow.projectedVertices[1].x = 300;
21682185
21692186 makeSomething(shadow);
21702187 }
....@@ -3953,6 +3970,8 @@
39533970 if (source == closeButton)
39543971 {
39553972 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3973
+ Replace();
3974
+
39563975 cRadio ab;
39573976 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39583977 {
....@@ -4051,6 +4070,8 @@
40514070 } else
40524071 if(source instanceof cRadio)
40534072 {
4073
+ Replace();
4074
+
40544075 group.parent = keepparent;
40554076 group.attributes = 0;
40564077 //group.editWindow = null;
....@@ -4106,10 +4127,21 @@
41064127
41074128 if (copy.versionlist == null)
41084129 {
4109
- copy.versionlist = new Object3D[100];
41104130 copy.versionindex = -1;
41114131
4112
- 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);
41134145 }
41144146
41154147 SetVersionStates();
....@@ -4257,7 +4289,7 @@
42574289 TouchTransform(obj);
42584290 continue;
42594291 }
4260
- if ((mask&2) != 0) // Scale
4292
+ if ((mask&2) != 0) // Scale/rotation
42614293 {
42624294 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42634295 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4265,10 +4297,6 @@
42654297 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42664298 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42674299 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4268
- }
4269
- if ((mask&4) != 0) // Rotation
4270
- {
4271
- // ?
42724300 }
42734301 if ((mask&1) != 0) // Translation
42744302 {
....@@ -5354,7 +5382,8 @@
53545382 if (group.selection != null)
53555383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53565384 {
5357
- if (!(e.nextElement() instanceof Composite))
5385
+ Object next = e.nextElement();
5386
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53585387 {
53595388 allComposites = false;
53605389 break;
....@@ -5366,6 +5395,7 @@
53665395
53675396 void refreshContents(boolean cp)
53685397 {
5398
+ if (Globals.ADVANCED)
53695399 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53705400 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53715401 {
....@@ -6345,7 +6375,7 @@
63456375 private MenuItem transformGeometryItem;
63466376 private MenuItem transformChildrenItem;
63476377 private MenuItem hideItem;
6348
- private MenuItem grabItem;
6378
+ private JMenuItem grabItem;
63496379 private MenuItem backItem;
63506380 private MenuItem frontItem;
63516381 private MenuItem cameraItem;