Normand Briere
2019-08-22 6a145f6c81dfcbe0653eda27d042efb48daa7512
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,8 +934,10 @@
928934
929935 JTabbedPane resourcecontainer;
930936 cGridBag currenttab;
931
- boolean added; // patch for jar
937
+ //boolean added; // patch for jar
932938
939
+ int totalcount = 0;
940
+
933941 int tabcount = 0;
934942 int colcount = 0;
935943 int rowcount = 0;
....@@ -940,33 +948,35 @@
940948
941949 public void ResourceCallBack(String[] path)
942950 {
943
- for (int i = 0; i < path.length; i++)
944
- System.out.print(path[i] + "/");
945
- System.out.println();
951
+// for (int i = 0; i < path.length; i++)
952
+// System.out.print(path[i] + "/");
953
+// System.out.println();
946954
947955 if (//rowcount == 0 ||
948
- path.length == 1)
956
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
949957 {
950958 currenttab = new cGridBag();
951
- added = false;
952959 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
953960 currenttab.setName(tabname);
961
+ //added = false;
962
+ resourcecontainer.add(currenttab);
963
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
954964 rowcount = 1;
955965 colcount = 0;
956966 texturecount = 0;
957967 }
958968
959
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
969
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
960970 {
961
- if (!added)
971
+ //if (!added)
962972 {
963
- added = true;
964
- resourcecontainer.add(currenttab);
973
+ //added = true;
965974 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
966
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
975
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
967976 }
968977
969
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
978
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
979
+ totalcount++;
970980
971981 if (++colcount >= columns)
972982 {
....@@ -992,6 +1002,8 @@
9921002 container.add(resourcecontainer);
9931003
9941004 Grafreed.ParseResources("textures", this);
1005
+
1006
+ // 935. System.out.println("Total = " + totalcount);
9951007 }
9961008
9971009 void SetupUI2(ObjEditor oe)
....@@ -1031,9 +1043,9 @@
10311043 oe.radioPanel.add(dummyButton);
10321044 oe.buttonGroup.add(dummyButton);
10331045 */
1034
- cGridBag copyOptionsPanel = new cGridBag();
1046
+ cGridBag versionManagerPanel = new cGridBag();
10351047
1036
- copyOptionsPanel.preferredHeight = 2;
1048
+ versionManagerPanel.preferredHeight = 4;
10371049
10381050 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10391051
....@@ -1060,25 +1072,25 @@
10601072 // }
10611073 // });
10621074
1063
- oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10641076 collapseButton.setToolTipText("Collapse toolbar");
10651077 collapseButton.addActionListener(this);
10661078
1067
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10681080 maximize3DButton.setToolTipText("Maximize 3D view");
10691081 maximize3DButton.addActionListener(this);
10701082
1071
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10721084 twoButton.setToolTipText("Show 3D view only");
10731085 twoButton.addActionListener(this);
10741086 this.fullscreenLayout = twoButton;
10751087
1076
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10771089 threeButton.setToolTipText("Show controls and 3D view");
10781090 threeButton.addActionListener(this);
10791091 if (Globals.ADVANCED)
10801092 {
1081
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1093
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10821094 sixButton.setToolTipText("Show 3D view and controls");
10831095 sixButton.addActionListener(this);
10841096 }
....@@ -1087,50 +1099,51 @@
10871099 // sevenButton.addActionListener(this);
10881100 //
10891101
1090
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1102
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10911103 fullButton.setToolTipText("Full-screen window");
10921104 fullButton.addActionListener(this);
10931105
1094
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10951107 screenfitButton.setToolTipText("Screen fit");
10961108 screenfitButton.addActionListener(this);
10971109
1098
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1110
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10991111 restoreCameraButton.setToolTipText("Restore viewpoint");
11001112 restoreCameraButton.addActionListener(this);
11011113
1102
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1114
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11031115 saveVersionButton.setToolTipText("Duplicate current version");
11041116 saveVersionButton.addActionListener(this);
11051117
1106
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11071119 deleteVersionButton.setToolTipText("Delete current version");
11081120 deleteVersionButton.addActionListener(this);
1121
+ deleteVersionButton.setEnabled(false);
11091122
1110
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1123
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11111124 previousVersionButton.setToolTipText("Previous version");
11121125 previousVersionButton.addActionListener(this);
11131126 previousVersionButton.setEnabled(false);
11141127
11151128 cGridBag updown = new cGridBag().setVertical(true);
1116
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11171130 restoreButton.setToolTipText("Undo (restore current version)");
11181131 restoreButton.addActionListener(this);
1119
- //restoreButton.setEnabled(false);
1132
+ restoreButton.setEnabled(false);
11201133
1121
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1134
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11221135 replaceButton.setToolTipText("Save (replace current version)");
11231136 replaceButton.addActionListener(this);
1124
- //replaceButton.setEnabled(false);
1137
+ replaceButton.setEnabled(false);
11251138
1126
- copyOptionsPanel.add(updown);
1139
+ versionManagerPanel.add(updown);
11271140
1128
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1141
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11291142 nextVersionButton.setToolTipText("Next version");
11301143 nextVersionButton.addActionListener(this);
11311144 nextVersionButton.setEnabled(false);
11321145
1133
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1146
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11341147 oneStepButton.setToolTipText("Animate one step forward");
11351148 oneStepButton.addActionListener(this);
11361149
....@@ -1153,11 +1166,11 @@
11531166
11541167 if (Globals.ADVANCED)
11551168 {
1156
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1169
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11571170 snapobjectButton.addActionListener(this);
11581171 snapobjectButton.setToolTipText("Snap Object");
11591172
1160
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1173
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11611174 fourButton.addActionListener(this);
11621175 fourButton.setToolTipText("Show control panel only");
11631176 }
....@@ -1165,11 +1178,11 @@
11651178 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11661179
11671180
1168
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1181
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11691182 rootButton.setToolTipText("Open selection in new tab");
11701183 rootButton.addActionListener(this);
11711184
1172
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1185
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11731186 closeButton.setToolTipText("Close tab");
11741187 closeButton.addActionListener(this);
11751188 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1178,38 +1191,38 @@
11781191 cGridBag row1 = new cGridBag();
11791192
11801193 // INSERT
1181
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1194
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11821195 gridButton.setToolTipText("Create ground");
11831196 gridButton.addActionListener(this);
11841197
1185
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11861199 boxButton.setToolTipText("Create box");
11871200 boxButton.addActionListener(this);
11881201
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);
1202
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12021203 superButton.setToolTipText("Create superellipsoid");
12031204 superButton.addActionListener(this);
12041205
1206
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1207
+ sphereButton.setToolTipText("Create sphere");
1208
+ sphereButton.addActionListener(this);
1209
+
1210
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1211
+ coneButton.setToolTipText("Create cone");
1212
+ coneButton.addActionListener(this);
1213
+
1214
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1215
+ torusButton.setToolTipText("Create torus");
1216
+ torusButton.addActionListener(this);
1217
+
12051218 if (Globals.ADVANCED)
12061219 {
1207
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12081221 kleinButton.setToolTipText("Create Klein bottle");
12091222 kleinButton.addActionListener(this);
12101223 }
12111224
1212
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1225
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12131226 particlesButton.setToolTipText("Create particle system");
12141227 particlesButton.addActionListener(this);
12151228
....@@ -1217,31 +1230,31 @@
12171230
12181231 cGridBag row2 = new cGridBag();
12191232
1220
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1233
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12211234 groupButton.setToolTipText("Create group");
12221235 groupButton.addActionListener(this);
12231236
1224
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1237
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12251238 compositeButton.setToolTipText("Create composite");
12261239 compositeButton.addActionListener(this);
12271240
1228
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1241
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12291242 switchButton.setToolTipText("Create item switcher");
12301243 switchButton.addActionListener(this);
12311244
1232
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1245
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12331246 loopButton.setToolTipText("Create loop");
12341247 loopButton.addActionListener(this);
12351248
1236
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1249
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12371250 textureButton.setToolTipText("Create texture");
12381251 textureButton.addActionListener(this);
12391252
1240
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1253
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12411254 overlayButton.setToolTipText("Create overlay");
12421255 overlayButton.addActionListener(this);
12431256
1244
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1257
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12451258 lightButton.setToolTipText("Create light");
12461259 lightButton.addActionListener(this);
12471260
....@@ -1251,6 +1264,11 @@
12511264
12521265 CreateTexturePanel(textures);
12531266
1267
+ int tabCount = resourcecontainer.getTabCount();
1268
+
1269
+ if (tabCount > 0)
1270
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1271
+
12541272 oe.toolboxPanel.add(textures);
12551273
12561274 textures.preferredHeight = 100;
....@@ -1258,11 +1276,11 @@
12581276 CreateSkyboxPanel(oe.skyboxPanel);
12591277
12601278 // EDIT panel
1261
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1279
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12621280 editButton.setToolTipText("Pin selection controls");
12631281 editButton.addActionListener(this);
12641282
1265
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1283
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12661284 uneditButton.setToolTipText("Unpin and remove selection controls");
12671285 uneditButton.addActionListener(this);
12681286
....@@ -1270,7 +1288,7 @@
12701288 allParamsButton.setToolTipText("Show all controls");
12711289 allParamsButton.addActionListener(this);
12721290
1273
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1291
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12741292 clearPanelButton.setToolTipText("Clear all controls");
12751293 clearPanelButton.addActionListener(this);
12761294
....@@ -1278,7 +1296,7 @@
12781296 //unselectButton.setToolTipText("Unselect");
12791297 //unselectButton.addActionListener(this);
12801298
1281
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1299
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12821300 flashSelectionButton.setToolTipText("Highlight selection");
12831301 flashSelectionButton.addActionListener(this);
12841302
....@@ -1301,6 +1319,8 @@
13011319
13021320 cGridBag jSPPanel = new cGridBag();
13031321
1322
+ jSPPanel.preferredHeight = 20;
1323
+
13041324 JScrollPane jSP;
13051325 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13061326 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1309,11 +1329,11 @@
13091329 oe.treePanel.add(jSPPanel);
13101330 oe.treePanel.Return();
13111331
1312
- oe.treePanel.add(copyOptionsPanel);
1332
+ oe.treePanel.add(versionManagerPanel);
13131333 oe.treePanel.Return();
1314
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1315
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1316
- sliderPane.preferredHeight = 1;
1334
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1335
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1336
+ versionSliderPane.preferredHeight = 3;
13171337
13181338 // mainPanel.setDividerLocation(0.1); //1.0);
13191339 mainPanel.setResizeWeight(0.4);
....@@ -1503,6 +1523,7 @@
15031523
15041524 oe.SetupViews();
15051525
1526
+ if (Globals.DEBUG)
15061527 System.out.println("SetupViews");
15071528 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15081529 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2164,7 +2185,11 @@
21642185 shadow.material = new cMaterial(obj.material);
21652186 shadow.material.diffuse = 0.0001f;
21662187 shadow.material.specular = 0.0001f;
2167
- //shadow.projectedVertices[1].x = 300;
2188
+ shadow.material.opacity = 0.75f;
2189
+
2190
+ AllocProjectedVertices(shadow);
2191
+
2192
+ shadow.projectedVertices[1].x = 300;
21682193
21692194 makeSomething(shadow);
21702195 }
....@@ -3953,6 +3978,8 @@
39533978 if (source == closeButton)
39543979 {
39553980 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3981
+ Replace();
3982
+
39563983 cRadio ab;
39573984 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39583985 {
....@@ -4051,6 +4078,8 @@
40514078 } else
40524079 if(source instanceof cRadio)
40534080 {
4081
+ Replace();
4082
+
40544083 group.parent = keepparent;
40554084 group.attributes = 0;
40564085 //group.editWindow = null;
....@@ -4106,10 +4135,21 @@
41064135
41074136 if (copy.versionlist == null)
41084137 {
4109
- copy.versionlist = new Object3D[100];
41104138 copy.versionindex = -1;
41114139
4112
- Save(true);
4140
+ // Cannot work with loops
4141
+ // To fix this issue, we first mark all nodes above the root,
4142
+ // and check if any of these nodes are reachable below the root.
4143
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4144
+
4145
+ if (!copy.HasTags())
4146
+ {
4147
+ copy.versionlist = new Object3D[100];
4148
+
4149
+ Save(true);
4150
+ }
4151
+
4152
+ Grafreed.grafreed.universe.TagObjects(copy, false);
41134153 }
41144154
41154155 SetVersionStates();
....@@ -4257,7 +4297,7 @@
42574297 TouchTransform(obj);
42584298 continue;
42594299 }
4260
- if ((mask&2) != 0) // Scale
4300
+ if ((mask&2) != 0) // Scale/rotation
42614301 {
42624302 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42634303 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4265,10 +4305,6 @@
42654305 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42664306 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42674307 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4268
- }
4269
- if ((mask&4) != 0) // Rotation
4270
- {
4271
- // ?
42724308 }
42734309 if ((mask&1) != 0) // Translation
42744310 {
....@@ -5354,7 +5390,8 @@
53545390 if (group.selection != null)
53555391 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53565392 {
5357
- if (!(e.nextElement() instanceof Composite))
5393
+ Object next = e.nextElement();
5394
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53585395 {
53595396 allComposites = false;
53605397 break;
....@@ -5366,6 +5403,7 @@
53665403
53675404 void refreshContents(boolean cp)
53685405 {
5406
+ if (Globals.ADVANCED)
53695407 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53705408 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53715409 {
....@@ -6345,7 +6383,7 @@
63456383 private MenuItem transformGeometryItem;
63466384 private MenuItem transformChildrenItem;
63476385 private MenuItem hideItem;
6348
- private MenuItem grabItem;
6386
+ private JMenuItem grabItem;
63496387 private MenuItem backItem;
63506388 private MenuItem frontItem;
63516389 private MenuItem cameraItem;