Normand Briere
2019-08-22 6a823ffbfcda4c843f46e02e83c869d5bc323e25
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);
....@@ -930,6 +936,8 @@
930936 cGridBag currenttab;
931937 //boolean added; // patch for jar
932938
939
+ int totalcount = 0;
940
+
933941 int tabcount = 0;
934942 int colcount = 0;
935943 int rowcount = 0;
....@@ -958,7 +966,7 @@
958966 texturecount = 0;
959967 }
960968
961
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
969
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
962970 {
963971 //if (!added)
964972 {
....@@ -967,7 +975,8 @@
967975 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
968976 }
969977
970
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
978
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
979
+ totalcount++;
971980
972981 if (++colcount >= columns)
973982 {
....@@ -993,6 +1002,8 @@
9931002 container.add(resourcecontainer);
9941003
9951004 Grafreed.ParseResources("textures", this);
1005
+
1006
+ // 935. System.out.println("Total = " + totalcount);
9961007 }
9971008
9981009 void SetupUI2(ObjEditor oe)
....@@ -1032,9 +1043,9 @@
10321043 oe.radioPanel.add(dummyButton);
10331044 oe.buttonGroup.add(dummyButton);
10341045 */
1035
- cGridBag copyOptionsPanel = new cGridBag();
1046
+ cGridBag versionManagerPanel = new cGridBag();
10361047
1037
- copyOptionsPanel.preferredHeight = 2;
1048
+ versionManagerPanel.preferredHeight = 4;
10381049
10391050 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10401051
....@@ -1061,25 +1072,25 @@
10611072 // }
10621073 // });
10631074
1064
- 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);
10651076 collapseButton.setToolTipText("Collapse toolbar");
10661077 collapseButton.addActionListener(this);
10671078
1068
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10691080 maximize3DButton.setToolTipText("Maximize 3D view");
10701081 maximize3DButton.addActionListener(this);
10711082
1072
- 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);
10731084 twoButton.setToolTipText("Show 3D view only");
10741085 twoButton.addActionListener(this);
10751086 this.fullscreenLayout = twoButton;
10761087
1077
- 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);
10781089 threeButton.setToolTipText("Show controls and 3D view");
10791090 threeButton.addActionListener(this);
10801091 if (Globals.ADVANCED)
10811092 {
1082
- 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);
10831094 sixButton.setToolTipText("Show 3D view and controls");
10841095 sixButton.addActionListener(this);
10851096 }
....@@ -1088,50 +1099,51 @@
10881099 // sevenButton.addActionListener(this);
10891100 //
10901101
1091
- 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);
10921103 fullButton.setToolTipText("Full-screen window");
10931104 fullButton.addActionListener(this);
10941105
1095
- 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);
10961107 screenfitButton.setToolTipText("Screen fit");
10971108 screenfitButton.addActionListener(this);
10981109
1099
- 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);
11001111 restoreCameraButton.setToolTipText("Restore viewpoint");
11011112 restoreCameraButton.addActionListener(this);
11021113
1103
- 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);
11041115 saveVersionButton.setToolTipText("Duplicate current version");
11051116 saveVersionButton.addActionListener(this);
11061117
1107
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11081119 deleteVersionButton.setToolTipText("Delete current version");
11091120 deleteVersionButton.addActionListener(this);
1121
+ deleteVersionButton.setEnabled(false);
11101122
1111
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1123
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11121124 previousVersionButton.setToolTipText("Previous version");
11131125 previousVersionButton.addActionListener(this);
11141126 previousVersionButton.setEnabled(false);
11151127
11161128 cGridBag updown = new cGridBag().setVertical(true);
1117
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11181130 restoreButton.setToolTipText("Undo (restore current version)");
11191131 restoreButton.addActionListener(this);
1120
- //restoreButton.setEnabled(false);
1132
+ restoreButton.setEnabled(false);
11211133
1122
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1134
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11231135 replaceButton.setToolTipText("Save (replace current version)");
11241136 replaceButton.addActionListener(this);
1125
- //replaceButton.setEnabled(false);
1137
+ replaceButton.setEnabled(false);
11261138
1127
- copyOptionsPanel.add(updown);
1139
+ versionManagerPanel.add(updown);
11281140
1129
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1141
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11301142 nextVersionButton.setToolTipText("Next version");
11311143 nextVersionButton.addActionListener(this);
11321144 nextVersionButton.setEnabled(false);
11331145
1134
- 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);
11351147 oneStepButton.setToolTipText("Animate one step forward");
11361148 oneStepButton.addActionListener(this);
11371149
....@@ -1154,11 +1166,11 @@
11541166
11551167 if (Globals.ADVANCED)
11561168 {
1157
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1169
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11581170 snapobjectButton.addActionListener(this);
11591171 snapobjectButton.setToolTipText("Snap Object");
11601172
1161
- 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);
11621174 fourButton.addActionListener(this);
11631175 fourButton.setToolTipText("Show control panel only");
11641176 }
....@@ -1166,11 +1178,11 @@
11661178 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11671179
11681180
1169
- 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);
11701182 rootButton.setToolTipText("Open selection in new tab");
11711183 rootButton.addActionListener(this);
11721184
1173
- 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);
11741186 closeButton.setToolTipText("Close tab");
11751187 closeButton.addActionListener(this);
11761188 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1179,38 +1191,38 @@
11791191 cGridBag row1 = new cGridBag();
11801192
11811193 // INSERT
1182
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1194
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11831195 gridButton.setToolTipText("Create ground");
11841196 gridButton.addActionListener(this);
11851197
1186
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11871199 boxButton.setToolTipText("Create box");
11881200 boxButton.addActionListener(this);
11891201
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);
1202
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12031203 superButton.setToolTipText("Create superellipsoid");
12041204 superButton.addActionListener(this);
12051205
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
+
12061218 if (Globals.ADVANCED)
12071219 {
1208
- 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);
12091221 kleinButton.setToolTipText("Create Klein bottle");
12101222 kleinButton.addActionListener(this);
12111223 }
12121224
1213
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1225
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12141226 particlesButton.setToolTipText("Create particle system");
12151227 particlesButton.addActionListener(this);
12161228
....@@ -1218,31 +1230,31 @@
12181230
12191231 cGridBag row2 = new cGridBag();
12201232
1221
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1233
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12221234 groupButton.setToolTipText("Create group");
12231235 groupButton.addActionListener(this);
12241236
1225
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1237
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12261238 compositeButton.setToolTipText("Create composite");
12271239 compositeButton.addActionListener(this);
12281240
1229
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1241
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12301242 switchButton.setToolTipText("Create item switcher");
12311243 switchButton.addActionListener(this);
12321244
1233
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1245
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12341246 loopButton.setToolTipText("Create loop");
12351247 loopButton.addActionListener(this);
12361248
1237
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1249
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12381250 textureButton.setToolTipText("Create texture");
12391251 textureButton.addActionListener(this);
12401252
1241
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1253
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12421254 overlayButton.setToolTipText("Create overlay");
12431255 overlayButton.addActionListener(this);
12441256
1245
- 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);
12461258 lightButton.setToolTipText("Create light");
12471259 lightButton.addActionListener(this);
12481260
....@@ -1252,6 +1264,11 @@
12521264
12531265 CreateTexturePanel(textures);
12541266
1267
+ int tabCount = resourcecontainer.getTabCount();
1268
+
1269
+ if (tabCount > 0)
1270
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1271
+
12551272 oe.toolboxPanel.add(textures);
12561273
12571274 textures.preferredHeight = 100;
....@@ -1259,11 +1276,11 @@
12591276 CreateSkyboxPanel(oe.skyboxPanel);
12601277
12611278 // EDIT panel
1262
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1279
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12631280 editButton.setToolTipText("Pin selection controls");
12641281 editButton.addActionListener(this);
12651282
1266
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1283
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12671284 uneditButton.setToolTipText("Unpin and remove selection controls");
12681285 uneditButton.addActionListener(this);
12691286
....@@ -1271,7 +1288,7 @@
12711288 allParamsButton.setToolTipText("Show all controls");
12721289 allParamsButton.addActionListener(this);
12731290
1274
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1291
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12751292 clearPanelButton.setToolTipText("Clear all controls");
12761293 clearPanelButton.addActionListener(this);
12771294
....@@ -1279,7 +1296,7 @@
12791296 //unselectButton.setToolTipText("Unselect");
12801297 //unselectButton.addActionListener(this);
12811298
1282
- 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);
12831300 flashSelectionButton.setToolTipText("Highlight selection");
12841301 flashSelectionButton.addActionListener(this);
12851302
....@@ -1302,6 +1319,8 @@
13021319
13031320 cGridBag jSPPanel = new cGridBag();
13041321
1322
+ jSPPanel.preferredHeight = 20;
1323
+
13051324 JScrollPane jSP;
13061325 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13071326 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1310,11 +1329,11 @@
13101329 oe.treePanel.add(jSPPanel);
13111330 oe.treePanel.Return();
13121331
1313
- oe.treePanel.add(copyOptionsPanel);
1332
+ oe.treePanel.add(versionManagerPanel);
13141333 oe.treePanel.Return();
1315
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1316
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1317
- sliderPane.preferredHeight = 1;
1334
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1335
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1336
+ versionSliderPane.preferredHeight = 3;
13181337
13191338 // mainPanel.setDividerLocation(0.1); //1.0);
13201339 mainPanel.setResizeWeight(0.4);
....@@ -1504,6 +1523,7 @@
15041523
15051524 oe.SetupViews();
15061525
1526
+ if (Globals.DEBUG)
15071527 System.out.println("SetupViews");
15081528 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15091529 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2165,7 +2185,11 @@
21652185 shadow.material = new cMaterial(obj.material);
21662186 shadow.material.diffuse = 0.0001f;
21672187 shadow.material.specular = 0.0001f;
2168
- //shadow.projectedVertices[1].x = 300;
2188
+ shadow.material.opacity = 0.75f;
2189
+
2190
+ AllocProjectedVertices(shadow);
2191
+
2192
+ shadow.projectedVertices[1].x = 300;
21692193
21702194 makeSomething(shadow);
21712195 }
....@@ -3954,6 +3978,8 @@
39543978 if (source == closeButton)
39553979 {
39563980 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3981
+ Replace();
3982
+
39573983 cRadio ab;
39583984 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39593985 {
....@@ -4052,6 +4078,8 @@
40524078 } else
40534079 if(source instanceof cRadio)
40544080 {
4081
+ Replace();
4082
+
40554083 group.parent = keepparent;
40564084 group.attributes = 0;
40574085 //group.editWindow = null;
....@@ -4107,10 +4135,21 @@
41074135
41084136 if (copy.versionlist == null)
41094137 {
4110
- copy.versionlist = new Object3D[100];
41114138 copy.versionindex = -1;
41124139
4113
- 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);
41144153 }
41154154
41164155 SetVersionStates();
....@@ -4258,7 +4297,7 @@
42584297 TouchTransform(obj);
42594298 continue;
42604299 }
4261
- if ((mask&2) != 0) // Scale
4300
+ if ((mask&2) != 0) // Scale/rotation
42624301 {
42634302 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42644303 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4266,10 +4305,6 @@
42664305 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42674306 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42684307 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4269
- }
4270
- if ((mask&4) != 0) // Rotation
4271
- {
4272
- // ?
42734308 }
42744309 if ((mask&1) != 0) // Translation
42754310 {
....@@ -5355,7 +5390,8 @@
53555390 if (group.selection != null)
53565391 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53575392 {
5358
- if (!(e.nextElement() instanceof Composite))
5393
+ Object next = e.nextElement();
5394
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53595395 {
53605396 allComposites = false;
53615397 break;
....@@ -5367,6 +5403,7 @@
53675403
53685404 void refreshContents(boolean cp)
53695405 {
5406
+ if (Globals.ADVANCED)
53705407 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53715408 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53725409 {
....@@ -6346,7 +6383,7 @@
63466383 private MenuItem transformGeometryItem;
63476384 private MenuItem transformChildrenItem;
63486385 private MenuItem hideItem;
6349
- private MenuItem grabItem;
6386
+ private JMenuItem grabItem;
63506387 private MenuItem backItem;
63516388 private MenuItem frontItem;
63526389 private MenuItem cameraItem;